Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to fetch the output of Transaction VA45 in ALV program

0 Kudos
816

Hello Guys,

I am in a situation where i need to fetch the the output of a Transaction VA45 into my ALV report,

and i need to use that data in my ALV report.

anyone is aware how to achieve this please help me out in this.

2 REPLIES 2

0 Kudos
565

Hi Naresh,

In S/4 system, Program for TCode VA45 is Report (TYPE 1) program. So in this case, you can use SUBMIT statement as below:

SUBMIT SD_SALES_DOCUMENT_VA45 WITH ... EXPORTING LIST TO MEMORY AND RETURN.

If you are using ECC system, then you program type is M (Module Pool). In this case, you have to use CALL TRANSACTION. Follow the below steps for this:

1. Since we use Select Options using SET statement and we have select options in VA45 screen, we need to create the recording for VA45 using SHDB and then use CALL TRANSACTION using BDCDATA.

You can take reference of one of my recording which I had used for my custom transaction requirement:

2. In the main program of VA45, find an implicit enhancement after ALV display to EXPORT the final internal table into memory.

EXPORT itab TO MEMORY ID 'TEST_CONTRACT_MEM'.

3. Now, IMPORT the final table from this memory ID in your custom program after your call transaction statement:

IMPORT itab FROM MEMORY ID 'TEST_CONTRACT_MEM'.

Hope this will resolve your issue.

Regards,

Gauri Rathi

Sandra_Rossi
Active Contributor
565

ALV data can be intercepted instead of being displayed by using the class CL_SALV_BS_RUNTIME_INFO. There are many discussions about it in the forum.

For instance:

  1. Tell ALV engine to store the data instead of displaying it
  2. SUBMIT ALV report AND RETURN
  3. Retrieve ALV data

Example:

  cl_salv_bs_runtime_info=>set(
    EXPORTING display  = abap_false
              metadata = abap_false
              data     = abap_true ).
  SUBMIT ... AND RETURN.
  cl_salv_bs_runtime_info=>get_data_ref(
        IMPORTING r_data = DATA(r_data) ).