Sunday, December 19, 2010
The SUBMIT statement accesses an executable program <report>.

We have lot of options fill the Inputs of the called programs.
  • With Selection-screen appearance.
    SUBMIT DEMO_PROGRAM_SUBMIT_REP1 VIA SELECTION-SCREEN
      WITH PARAMET EQ 'Selection 1'
      WITH SELECTO IN SELTAB
      WITH SELECTO NE 3
       AND RETURN.
  • The selection screen of the called executable program (report) appears. If you transfer values to the program using one or more of the other options, the corresponding input fields in the selections screen are filled. The user can change these values.
  • Without Selection-screen appearance.
    SUBMIT demo_program_submit_rep1
      WITH paramet eq 'Selection 1'
      WITH selecto IN seltab
      WITH selecto ne 3
       AND RETURN.
  • With selection screen appearance
    DATA:
          RSPAR    TYPE TABLE OF RSPARAMS,
          WA_RSPAR LIKE LINE OF RSPAR.
    *passing all selection-screen values through rspar table .check the structure *RSPARAMS.
    SUBMIT DEMO_PROGRAM_SUBMIT_REP1 VIA SELECTION-SCREEN
      WITH SELECTION-TABLE RSPAR
       AND RETURN.
  • Without selection screen appearance
    DATA: 
        rspar TYPE TABLE OF rsparams,
        wa_rspar LIKE LINE OF rspar.
    " Passing all selection-screen values through rspar table .
    " check the structure RSPARAMS.
    SUBMIT demo_program_submit_rep1
      WITH SELECTION-TABLE rspar
       AND RETURN.
  • Using Variant created for the called program.
    "With Selection screen
    SUBMIT DEMO_PROGRAM_SUBMIT_REP1 VIA SELECTION-SCREEN
    USING SELECTION-SET 'VAR1'
    AND RETURN.
    "Without selection screen 
    SUBMIT DEMO_PROGRAM_SUBMIT_REP1
    USING SELECTION-SET 'VAR1'
    AND RETURN.
  • After executing using SUBMIT statement, to pass data between these programs. Check the sample programs.
    REPORT REP1 NO STANDARD PAGE HEADING.
    
    DATA:
          ITAB TYPE I OCCURS 10,
          NUM  TYPE I.
    
    SUBMIT REP2 AND RETURN.
    IMPORT ITAB FROM MEMORY ID 'HK'.
    
    LOOP AT ITAB INTO NUM.
      WRITE / NUM.
    ENDLOOP.
    
    TOP-OF-PAGE.
      WRITE 'Report 1'.
      ULINE.

    Report REP2.
    REPORT REP2 NO STANDARD PAGE HEADING.
    
    DATA: 
          NUMBER TYPE I,
          ITAB   TYPE I OCCURS 10.
    
    SET PF-STATUS 'MYBACK'.
    
    DO 5 TIMES.
      NUMBER = SY-INDEX.
      APPEND NUMBER TO ITAB.
      WRITE / NUMBER.
    ENDDO.
    
    TOP-OF-PAGE.
      WRITE 'Report 2'.
      ULINE.
    
    AT USER-COMMAND.
      CASE SY-UCOMM.
        WHEN 'MBCK'.
          EXPORT ITAB TO MEMORY ID 'HK'.
          LEAVE.
      ENDCASE.

0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.