SUBMIT is a keyword in SAP ABAP where you can use to execute an ABAP program within an another ABAP Program. There are multiple variations how you can use SUBMIT statement in SAP ABAP. For example, with different variations of SUBMIT statement syntax, you can define how to set Selection Screen parameters of the calling program, define if you want to execute the ABAP program in background mode, or if you want to save the list results to ABAP Memory.
SAP Versions used in the illustration:
SAP S4 HANA Fashion 1709
We need to identify there are two programs when we discuss SUBMIT function.
Calling Program: ABAP program which calls or executes the external ABAP program. This is the ABAP program we will implement the SUBMIT statement code.
Executed (Called) Program: The Executable program we will execute from the Calling Program.
Types of ABAP Programs You Can SUBMIT.
Executable ABAP programs are the only programs we can execute using SUBMIT statement. Before coding your calling program you need to first check the type of the program you intend to execute.
Find the Type of the ABAP Program via Transaction se38.
You identify the type of the ABAP program from attributes of the program in transaction se38. Go to transaction se38 and enter the name of the ABAP program and select ‘Attributes’ and choose Display.
Find the Type of the ABAP Program using Transaction Code.
Maybe you are only aware of the Transaction code, not the ABAP program name. To find the the program name, go to transaction to se93 (Maintain Transaction) and find the the program name in the next screen. Finally, go to Transaction se38 to identify the program type.
Syntax of ABAP SUBMIT Statement.
Syntax of the SUBMIT statement is as follows.
<Executed (called) program name>
<Selection Screen options>
<Output list options>
<Background job options>
Executed (called) Program Name.
This option defines the name of the Executed (called) program. This program should be of type “Executable” as discussed previously. You define the name of the Executed program as a variable or hard-code the program name. Use an variable to define the program name if the program name should be derived dynamically at run-time.
Selection Screen Options
Executed (called) program might have a Selection Screen. If you require to set the Selection Screen parameters of the Executed program, use this syntax option. Here you can supply the values to the Selection Screen fields of the Executed program from the Calling Program.
Output List Options
Using Output list options, we can define how to handle the output of the program. Using addition, EXPORTING LIST TO MEMORYyou can save the list in ABAP memory. Addition TO SAP-SPOOL creates a new Spool request with the Executed output list.
Background Job Options
Addition VIA JOB syntax allow us to execute the program in background mode.
If you specify AND RETURN, Executed program is started in a new internal session. After the Executed program has run has been completed, Calling Program continue after the SUBMIT statement. We use this addition if we need to sequence the execution of the Calling program and Executed program at run-time.
Sample ABAP Programs with SUBMIT Statement.
Let’s call transaction FBL5N (program rfitemar) which is used to check customer open items. I will call this report for company code 3000 and key date as at today.
In this example Calling program name is ‘zcalling_program‘ and the Executed program name is ‘rfitemar‘.
Company code parameter name is ‘DD_BUKARS’ and Key date selection screen parameter name is ‘PA_STIDA’.
SAP Version Sample ABAP Code was Implemented.
SAP ABAP PLATFORM 1809
SAP S/4HANA 1809
SAP S/4HANA FOUNDATION 1809
SUBMIT with WITH SELECTION-TABLE.
ABAP SUBMIT with SELECTION-TABLE
*Setting values for selection screen field Company Code
lwa_selection-selname='DD_BUKARS'."Company Code selection field name
lwa_selection-low='3000'."Company Code value
*Setting values for selection screen field Open Items at Key Date
lwa_selection-selname='PA_STIDA'."Open Items at Key Date screen field name
lwa_selection-low=sy-datum."Open Items at Key Date value as system date
Operators EQ|NE|CP|NP|GT|GE|LT|LE passes single values while BETWEEN passes ranges to the selection parameters. IN can be used to pass a range of values. To pass a range, create a internal table with RANGE OF addition.
SUBMIT with a Variant.
Use the following syntax to call the program with a Variant ‘TEST_VARIANT_1’. Assign the Company Code and Key date values in the variant.
ABAP SUBMIT USING SELECTION-SET
Call Report and Export the List to Memory.
In this variation of SUBMIT, we call the program and export the output list to memory. Next we read the list from memory and write to screen.
Go to transaction sm37 to monitor the status of the background job created from the calling program.
If not specified, default behavior is Batch Job created under the login User and Logon language. You can change the Batch Job user name and language with additions USER and LANGUAGE to the SUBMIT statement.
Practical Issues with SUBMIT Statement.
Suppress Pop-up Windows.
Unfortunately, pop-up windows of Executed program cannot be suppressed in SUBMIT. This is an issue specially if the Executed program is a standard program. If you are calling a custom Z program, you can change the code or copy the program to a new program and change to code to accommodate SUBMIT function.
Have you come across other variations of SUBMIT statement that came in handy? If you have any questions on how to use SUBMIT statement in SAP ABAP, please leave a comment below.
Hi, I am Isuru Fernando, Senior SAP Integration Consultant with 10 years of SAP full-cycle implementation and support project experience.From the early days, I had a passion for coding, software development, and everything tech-related. I started my carrier as an ABAP developer and soon found my love for system integration when I learned SAP XI 3.0 in 2008. Playing a variety of roles from an offshore technical consultant (ABAP, PI/PO, BW, BOBJ) at the beginning of my career to a technical lead managing a team of consultants in different countries, I have gained immense experience in SAP project implementation life cycle.Having the opportunity to work on SAP implementation projects in USA, EU, and Asia, I learned valuable ins and outs of global business processors in Sales and Distribution (SD), Material Management, Retail, Customer Relationship Management (CRM), and Finance and Controlling (FICO).Through this blog, I want to share my expertise in SAP technical areas such as SAP ABAP, PI/PO, AIF, and Basis. I also want to provide a platform for others with similar ambitions who would like to share their SAP technical expertise with the world!