Application Development and Automation 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: 
Read only

SUBMIT

Former Member
0 Likes
484

can any one tell me how to use the SUBMIT and what are the syntax and advantages for using it

3 REPLIES 3
Read only

Former Member
0 Likes
421

Hello, Ayan!

SUBMIT is used to call a report directly, without using a transaction code, thus you can pass values to its parameters/select-options, which you cannot do directly when using transactions (only possible by mapping screens with SHDB).

SUBMIT report [VIA SELECTION-SCREEN]
          [USING SELECTION-SET var]
          [WITH sel criterion]
          [WITH FREE SELECTIONS freesel]
          [WITH SELECTION-TABLE rspar]
          [AND RETURN].

Report is a report name, without apostrophes (' '). The report name can be also a variable enclosed in parantheses, so, the report name can be dynamic.

VIA SELECTION-SCREEN: The selection screen of the called executable program appears.

USING SELECTION-SET <var>: This addition tells the system to start the called program with the variant <b>var</b>.

WITH sel criterion: Use this addition to fill individual elements sel of the selection screen (selection tables and parameters) with the help of the language elements <b>criterion</b>.

WITH FREE SELECTION freesel: User dialog for dynamic selections. To use this option, the called program must be connected to a logical database that supports dynamic selections.

WITH SELECTION-TABLE rspar: Dynamic transfer of different values. An internal table rspar with the Dictionary structure RSPARAMS is created. This table can be filled dynamically in the calling program with all the required values for the selection screen of the called program.

AND RETURN: The system stores the data of the calling executable program and returns to the calling after processing the called program.

More information can be found <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dba51a35c111d1829f0000e829fbfe/frameset.htm">here</a>.

Hope this helps!

Andre

Read only

Former Member
0 Likes
421

Hi Ayan

Submit statement basically tries to access an executable program from your calling program.There can be various sceanrios you can have to be able to use a SUBMIT statement. I would like to discuss 2 of such scenarios here:

A. Lets say i want to access an executable report Y from my calling program X.

The program Y has thr following selection-screen options:

1.s_werks for t001w-werks(Plant)

2.s_matnr for mara-matnr(Material Number)

Now from my calling program X , i want to execute report Y by passing values

of plant and material to this program. After that i want to return to my main

program X.

So the syntax for the same would be:

SUBMIT Y 
WITH s_werks IN s_werks
WITH s_matnr IN s_matnr 
AND RETURN.

s_matnr and s_werks should be there in program X as well.

B. The second scenario can be where you have an ALV in your report Y and you

want to get the list from this report back to your main program X. In this case

your syntax would be :

SUBMIT Y WITH s_werks IN s_werks
                         WITH s_matnr IN s_matnr 
                         EXPORTING LIST TO MEMORY 
                         AND RETURN. 

There can be many other instances where you can use SUMBIT statement.

For more information , please refer to the SAP help:

http://help.sap.com/saphelp_47x200/helpdata/en/9f/dba50d35c111d1829f0000e829fbfe/frameset.htm

Hope this helps

Cheers

shivika

Read only

Former Member
0 Likes
421

When you have requirement like passing the data between two abap programs,then we go for submit command.

We use mainly for ABAP memory like export and import commands.

Create one program first use export and use submit and again create second program .

see the simple example

REPORT ZTEST_AMEM1.

tables : lfa1.

data : begin of i_lfa1 occurs 0 ,

lifnr like lfa1-lifnr,

name1 like lfa1-name1,

land1 like lfa1-land1,

end of i_lfa1.

start-of-selection.

select lifnr

name1

land1 from lfa1

into table i_lfa1 up to 100 rows.

  • Export

export i_lfa1 to memory id 'SAP'.

submit ztest_amem2 and return.

write:/ 'hello'.

Create second program and use this code

&----


*& Report ZTEST_AMEM2

*&

&----


*&

*&

&----


REPORT ZTEST_AMEM2.

data : begin of j_lfa1 occurs 0,

lifnr like lfa1-lifnr,

name1 like lfa1-name1,

land1 like lfa1-land1,

end of j_lfa1.

start-of-selection.

import i_lfa1 to j_lfa1 from memory id 'SAP'.

loop at j_lfa1.

write:/ j_lfa1-lifnr,j_lfa1-name1,j_lfa1-land1.

endloop.

Reward Points if it is helpful

Thanks

Seshu