Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

regarding calls to multiple Submit statements

Former Member
0 Kudos

hi Friends,

From a Report program, i'm calling up multiple Submit statements for Extraction programs on condition basis as below:

  IF lt_account[] IS NOT INITIAL.
    SUBMIT zcustomer_extract WITH so_kunnr IN lt_account
                                       WITH pa_xml = 'X'
                                       AND RETURN.
    REFRESH: lt_account.
  ENDIF.

  IF lt_contract[] IS NOT INITIAL.
*    maintain another field, Sales org
    SUBMIT zcontract_extract WITH so_vbeln IN lt_contract
                                       WITH pa_xml = 'X'
                                       AND RETURN.
    REFRESH: lt_contract.
  ENDIF.

/*here, actually if Extract programs were test independently, they'll give output of no. of records retrieved

/*My program has to give output of both the SUBMIT programs if condition satisfies...here after cursor going to first SUBMIT statement, it'll shows the output of first report, HERE IF WE PRESS BACK, then RETURNS and calls to second SUBMIT program and shows it's output, where the user interaction is required..and i want it to be no-User interaction.

Please suggest me to proceed further, thanks in advance.

Regards,

Suseel

2 REPLIES 2

VenkatRamesh_V
Active Contributor
0 Kudos

Hi Suseel,

Try.

IF lt_account[] IS NOT INITIAL.
    SUBMIT zcustomer_extract WITH so_kunnr IN lt_account
                                       WITH pa_xml = 'X'
                                       AND RETURN.
    REFRESH: lt_account.

    STOP.
  ENDIF.

  IF lt_contract[] IS NOT INITIAL.
*    maintain another field, Sales org
    SUBMIT zcontract_extract WITH so_vbeln IN lt_contract
                                       WITH pa_xml = 'X'
                                       AND RETURN.
    REFRESH: lt_contract.

      STOP.
  ENDIF.

                                              OR

                             



IF lt_account[] IS NOT INITIAL.
    SUBMIT zcustomer_extract WITH so_kunnr IN lt_account
                                       WITH pa_xml = 'X'
                                       AND RETURN.
    REFRESH: lt_account, lt_contract.

  ENDIF.

  IF lt_contract[] IS NOT INITIAL.
*    maintain another field, Sales org
    SUBMIT zcontract_extract WITH so_vbeln IN lt_contract
                                       WITH pa_xml = 'X'
                                       AND RETURN.
REFRESH: lt_account, lt_contract.

  ENDIF.


Regards,

Venkat.

Former Member
0 Kudos

Hi Suseel,

In your second extract program, you can call a FM(SAPGUI_SET_FUNCTIONCODE) to automatically process function code(which is your interaction function code).

Maybe you need a judge flag, if it`s running independently, then do not call this FM.

regards,

Archer