简体   繁体   中英

ALV List Viewer for single entry in IW29/39 transaction

I'm calling SAP transaction from VBA to automate report. When I'm using transaction like IW39 my output display is a list shown with SAP ALV List Viewer. It's very useful to export to VBA where I have a function to do it automatically.

ALV显示

But sometimes I have an issue in some particular case: when my hit list consists of only one line. SAP replaces ALV with something not very useful to export with VBA.

不显示 ALV

My question is: is there a way to change the display mode to "ALV-always" when there is single line in a hit list?

A clue: when I start IW39 tcode and when I have a single line, the result is displayed as an IW33 tcode. So when I come back to transaction I stay in IW33 query.

As your screenshots show, you speak about IW 29 (Display Notifications), not IW39, however, their logic is quite similar.
The switch, which defines how to display results - via ALV or directly via IW23/IW33 - is hard coded in IW29 logic (which is RIQMEL20 report) and cannot be changed that easy.

However, while learning the code, I found out that the results are listed correctly, in ALV, even for single entry if tcode is executed in background mode , The corresponding program check exists in source code.

So these are possible solutions as I see them :

  • Create dummy transaction (eg ZIW29) and execute target report in batch like this

    SUBMIT RIQMEL20 AND RETURN.
  • Create dummy transaction and run target report exporting results to memory

    SUBMIT RIQMEL20 EXPORTING LIST TO MEMORY.
  • Directly call target transaction (IW29/39) in batch and export results to memory

    DATA: lt_bdcdata TYPE TABLE OF bdcdata, ls_options TYPE ctu_params. ls_options-dismode = 'N'. " This is to set the batch input mode CALL TRANSACTION 'IW29' USING lt_bdcdata OPTIONS FROM ls_options. IMPORT data_tab TO it_out FROM MEMORY ID 'XYZ'.
  • Any combinations of the above.

  • Playing with AS ABAP operation modes (dialog/background) thus forcing server to set sy-binpt variable to X .

  • Revoke authorization to start IW*9 transactions in foreground and start them only via SA38 .

By and large, one can conclude that it is unachievable to achieve this by means of VBA (ie without ABAP or BASIS intervention).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM