Skip to Content
0

nested submit program

May 04, 2017 at 05:56 AM

155

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Werner Gerbert May 04, 2017 at 12:29 PM
3

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.
Show 3 Share
10 |10000 characters needed characters left characters exceeded

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.

0

You are corrrect . In this case I needed a new logical session though.

0

CALL FUNCTION 'XXXX' DESTINATION 'NONE will give a new session, without the mixing of view and model coding.

0
satyapriyanka vana May 04, 2017 at 06:46 AM
1

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.

Share
10 |10000 characters needed characters left characters exceeded
Richard Harper May 04, 2017 at 07:02 AM
0

There isn't one, but you can look at the system call stack using function module SYSTEM_CALLSTACK.

Rich

Show 1 Share
10 |10000 characters needed characters left characters exceeded
It works only for the current internal session (only the stack of all CALL and PERFORM in the current program). SUBMIT starts a new internal session.
1