Dear Experts, Good Day!
I have 8 different programs for which I have to display ALV output. I just wanted to use SALV class for displaying ALV.
And these 8 programs are having 2 common includes like 1st for common global declarations and 2nd for common subroutines.
Now I want to build a common subroutine where all the ALV display part contains. And I want to just call CREATE_ALV by passing the output table from all 8 different programs.
So, I just want to prepare the output table and call the subroutine in common include to display ALV.
Note: I cannot create different structures in data dictionary, as then I will be in need to create many data elements for headings. I just want to send the output table structure from my calling program.
Please suggest/help me how to achieve this?
Thanks and Regards,
Vijay
Hi,
like this you can make use of subroutine of external program.
PERFORM <Subroutine> IN PROGRAM ( <program name> ) USING <actual parameters> IF FOUND.
or you can define a common subroutine by making use of DATA REFERENCE or field symbols something like this
like :
within subroutine..
FIELD-SYMBOLS : <ITAB> TYPE ANY TABLE / STANDARD TABLE.
if sy-repid = 'PROGRAM 1'.
ASSIGN '(PROGRAM 1)ITAB[]' TO <ITAB>.
elseif sy-repid = 'PROGRAM 2'.
ASSIGN '(PROGRAM 2)ITAB[]' TO <ITAB>.
endif.
thank you!!
Hi Vijay,
In common include you can write like this...
perform XXXXXX in program (sy-repid) if found using XXXXX.
after that call this subroutine in programs
form XXXXXX using XXXXX.
endform.
Regards
Raj
Add a comment