05-04-2017 6:56 AM
if i call program B from program A and then call program C from program B using submit program statement i.e.
A->submit program B->B->submit program C-> C
then how can i get execution sequence number for each program? i.e 1 for A, 2 for B etc
i didn't find any system field.
Please suggest.
05-04-2017 1:29 PM
I solved this by adding a hidden parameter in the selection screen:
PARAMETERS: pa_mode TYPE char1 NO-DISPLAY.
Then you can get back your selection screen data and set the parameter for the next submit.
DATA: lt_sel TYPE TABLE OF rsparams.
FIELD-SYMBOLS: <rsparam> LIKE LINE OF lt_sel.
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = sy-cprog
* IMPORTING
* SP =
TABLES
selection_table = lt_sel
* SELECTION_TABLE_255 =
EXCEPTIONS
not_found = 1
no_report = 2
OTHERS = 3
.
LOOP AT lt_sel ASSIGNING <rsparam> WHERE selname = 'PA_MODE'.
<rsparam>-low = 'X'.
ENDLOOP.
SUBMIT zreport WITH SELECTION-TABLE lt_sel AND RETURN.
05-04-2017 7:46 AM
Hi,
I don't know whether there is such parameter exists to count the sequence. But you can calculate it in each program you are calling.
Eg.
In Prog A define count as 1 and export to memory.In the calling program B import the parameter from memory and add 1 to it. same procedure follows for the second calling prog as well. I am not sure whether this is an effective idea or not, but sharing my thought on this.
Regards,
Priyanka.
05-04-2017 8:02 AM
There isn't one, but you can look at the system call stack using function module SYSTEM_CALLSTACK.
Rich
05-04-2017 6:31 PM
05-04-2017 1:29 PM
I solved this by adding a hidden parameter in the selection screen:
PARAMETERS: pa_mode TYPE char1 NO-DISPLAY.
Then you can get back your selection screen data and set the parameter for the next submit.
DATA: lt_sel TYPE TABLE OF rsparams.
FIELD-SYMBOLS: <rsparam> LIKE LINE OF lt_sel.
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = sy-cprog
* IMPORTING
* SP =
TABLES
selection_table = lt_sel
* SELECTION_TABLE_255 =
EXCEPTIONS
not_found = 1
no_report = 2
OTHERS = 3
.
LOOP AT lt_sel ASSIGNING <rsparam> WHERE selname = 'PA_MODE'.
<rsparam>-low = 'X'.
ENDLOOP.
SUBMIT zreport WITH SELECTION-TABLE lt_sel AND RETURN.
05-04-2017 2:24 PM
If you properly design your programs and move the data getting logic into a separate class or function module from the display logic, you don't need to use SUBMIT at all.
05-04-2017 2:43 PM
You are corrrect . In this case I needed a new logical session though.
05-05-2017 6:30 AM
CALL FUNCTION 'XXXX' DESTINATION 'NONE will give a new session, without the mixing of view and model coding.