Skip to Content
avatar image
Former Member

nested submit program

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • May 04, 2017 at 12: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.
    Add comment
    10|10000 characters needed characters exceeded

  • May 04, 2017 at 06: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.

    Add comment
    10|10000 characters needed characters exceeded

  • May 04, 2017 at 07:02 AM

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

    Rich

    Add comment
    10|10000 characters needed characters exceeded