Skip to Content
avatar image
Former Member

regarding calls to multiple Submit statements

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Dec 24, 2014 at 05:55 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Dec 25, 2014 at 05:16 AM

    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

    Add comment
    10|10000 characters needed characters exceeded