2020 Jul 24 2:11 PM
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.
2020 Jul 24 5:40 PM
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
2020 Jul 24 9:28 PM
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:
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) ).