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
1,287

Hi All,

I am using <b>submit</b> statement to move the control from <b>1st</b> program(<b>calling program</b>) to <b>2nd</b> program (<b>called program</b>) . I want to pass two values from the calling program to the called program. How to do it? and how to <b>capture these</b> two variable values in the called program.

Regards,

Nikhil.

10 REPLIES 10
Read only

Former Member
0 Likes
1,130

Hi,

Use set parameter ID statement and set the valuesyou need.

The parameter ID u can find out from the technical settings of field.

<b><REMOVED BY MODERATOR></b>

Message was edited by:

Alvaro Tejada Galindo

Read only

Former Member
0 Likes
1,130

hi,

please give the submit in mentioning with index...

thanks ,

<b><REMOVED BY MODERATOR></b>

Message was edited by:

Alvaro Tejada Galindo

Read only

Former Member
0 Likes
1,130

Hi,

SET PARAMETER ID pid FIELD dobj.

This statement sets the content of the parameter specified in pid to the content of the data object dobj.

you can retrieve using

GET PARAMETER ID pid FIELD dobj.

This statement sets the content of the data object dobj to the content of the parameter specified in pid.

Thanks,

<b><REMOVED BY MODERATOR></b>

Message was edited by:

Alvaro Tejada Galindo

Read only

0 Likes
1,130

Hi Viji,

I have a standard program of which i have made a Z copy, now in this form there are three <b>'open_form'</b> which i think are sheduled in <b>background</b> as the processing does not stop when i put a breakpoint .

I am using a <b>submit</b> statement to call my <b>driver program</b> which will in turn call my sapscript which i have developed.

Now for this driver program to execute i want to pass <b>two parameters</b> viz <b>'Run Date'</b> and <b>'Identification Number'</b> from the Z copy (standard program).

I tried using <b>'Set-Get'</b> as well as <b>'Export-Import'</b> for passing these two parameters, but the parameters are not passed as the script does <b>not come in spool</b>. Can you guide me on this as to how should i pass these two parameters to my driver program? Is there any other way of passing these parameters?

Regards,

Nikhil.

Read only

Former Member
0 Likes
1,130

use export and import

ex:

Calling program

EXPORT TEXT3 FROM MEMORY ID 'text'

SUBMIT <prog> .

Called Program

IMPORT TEXT3

FROM

TO MEMORY ID 'text'.

PRESS F1 ON IMPORT OR EXPORT AND FIND ALL THE REQUIRED INFORMATION HOW TO DO FOR UR REQUIREMENT.

regards,

Prabhu

<b><REMOVED BY MODERATOR></b>

Message was edited by:

Alvaro Tejada Galindo

Read only

hymavathi_oruganti
Active Contributor
0 Likes
1,130

hi,

for submit statement u should only use export/import parameters.

first u write

<b>export var</b> in the current report

and write <b>import var</b> in the report called by submit.

thats it.

Read only

Former Member
0 Likes
1,130

Hi,

You can acheive the requirement using IMPORT and EXPORT statement.

In program 1 you can pass the values to memory using the following code before the submit statement.

EXPORT w_val1 w_val2 to memory id 'A01'.

SUBMIT program2 via selection0-screen.

In program2 you can export the same values using the following code.

IMPORT w_val1 w_val2 from memory id 'A01'.

Here the fields w_val1 and w_val2 should have same declaration in program 1 & 2.

To know more about import and export, do f1 help on these keywords.....

Hope this helps..

Regards,

Dilli

Message was edited by:

Dilli Babu

Read only

Former Member
0 Likes
1,130

Hi,

Define the selection screen in ur first program. Then use submit statement to move control to second program.

Use Export and Import statement.

Message was edited by:

Sathyaa

Read only

Former Member
0 Likes
1,130

Hi Nikhil,

In order to call one program from another you have to use Submit statement along with the selection tabel which you will have to populate in your first program and pass on to another one.

There is a special type of declaration whcih you need to use in order to use Sub mit.

Please refer to the below sample code for reference:

REPORT zs_alr MESSAGE-ID zs_alr .

type-pools : truxs.

TABLES : ska1, skb1,bkpf.

DATA : rspar TYPE TABLE OF rsparams,

rspar_wa LIKE LINE OF rspar.

DATA : var1(15) TYPE c,

var2(15) TYPE c ,

temp(15) TYPE c.

DATA : listobject1 LIKE abaplist OCCURS 0.

IF bilaver1 IS NOT INITIAL.

rspar_wa-selname = 'BILAVERS'.

rspar_wa-kind = 'P'.

rspar_wa-sign = 'I'.

rspar_wa-option = 'EQ'.

rspar_wa-low = bilaver1.

APPEND rspar_wa TO rspar.

CLEAR rspar_wa.

ENDIF.

IF bilaspr1 IS NOT INITIAL.

rspar_wa-selname = 'BILASPRA'.

rspar_wa-kind = 'P'.

rspar_wa-sign = 'I'.

rspar_wa-option = 'EQ'.

rspar_wa-low = bilaspr1.

APPEND rspar_wa TO rspar.

CLEAR rspar_wa.

ENDIF.

IF bilbjah1 IS NOT INITIAL.

rspar_wa-selname = 'BILBJAHR'.

rspar_wa-kind = 'P'.

rspar_wa-sign = 'I'.

rspar_wa-option = 'EQ'.

rspar_wa-low = bilbjah1.

APPEND rspar_wa TO rspar.

CLEAR rspar_wa.

ENDIF.

IF bmonat1 IS NOT INITIAL.

rspar_wa-selname = 'B-MONATE'.

rspar_wa-kind = 'P'.

rspar_wa-sign = 'I'.

rspar_wa-option = 'EQ'.

rspar_wa-low = bmonat1.

APPEND rspar_wa TO rspar.

CLEAR rspar_wa.

ENDIF.

IF bilvjah1 IS NOT INITIAL.

rspar_wa-selname = 'BILVJAHR'.

rspar_wa-kind = 'P'.

rspar_wa-sign = 'I'.

rspar_wa-option = 'EQ'.

rspar_wa-low = bilvjah1.

APPEND rspar_wa TO rspar.

CLEAR rspar_wa.

ENDIF.

IF vmonat1 IS NOT INITIAL.

rspar_wa-selname = 'V-MONATE'.

rspar_wa-kind = 'P'.

rspar_wa-sign = 'I'.

rspar_wa-option = 'EQ'.

rspar_wa-low = vmonat1.

APPEND rspar_wa TO rspar.

CLEAR rspar_wa.

ENDIF.

*IF BILAGRI1 IS NOT INITIAL.

*RSPAR_WA-SELNAME = 'BILAGRID'.

*RSPAR_WA-KIND = 'P'.

*RSPAR_WA-SIGN = 'I'.

*RSPAR_WA-OPTION = 'EQ'.

*RSPAR_WA-LOW = BILAGRI1.

*APPEND RSPAR_WA TO RSPAR.

*CLEAR RSPAR_WA.

*ENDIF.

*

*

*IF BILALIS1 IS NOT INITIAL.

*RSPAR_WA-SELNAME = 'BILALIST'.

*RSPAR_WA-KIND = 'P'.

*RSPAR_WA-SIGN = 'I'.

*RSPAR_WA-OPTION = 'EQ'.

*RSPAR_WA-LOW = BILALIS1.

*APPEND RSPAR_WA TO RSPAR.

*CLEAR RSPAR_WA.

*ENDIF.

*

IF ktopl1 IS NOT INITIAL.

rspar_wa-selname = 'SD_KTOPL'.

rspar_wa-kind = 'P'.

rspar_wa-sign = 'I'.

rspar_wa-option = 'EQ'.

rspar_wa-low = ktopl1-low.

rspar_wa-high = ktopl1-high.

APPEND rspar_wa TO rspar.

CLEAR rspar_wa.

ENDIF.

IF currtype IS NOT INITIAL.

rspar_wa-selname = 'SD_CURTP'.

rspar_wa-kind = 'P'.

rspar_wa-sign = 'I'.

rspar_wa-option = 'EQ'.

rspar_wa-low = currtype.

APPEND rspar_wa TO rspar.

CLEAR rspar_wa.

ENDIF.

var1 = bukrs1-low.

var2 = bukrs1-high.

move filename to filenam1.

IF bukrs1-low IS NOT INITIAL AND bukrs1-high IS INITIAL.

SUBMIT rfbila00

WITH SELECTION-TABLE rspar

WITH sd_bukrs EQ var1

AND RETURN.

I hope this sample code clears it.

In case you have any further clarifications,do let me know.

Regards,

Puneet Jhari.

Read only

Former Member
0 Likes
1,130

Hi,

Calling Program :-

EXPORT P_TEXT TO MEMORY ID V_ID.

SUBMIT <Program Name> USING SELECTION-SCREEN 1000

WITH SELECTION-TABLE T_RSPARTAB

AND RETURN.

Called Program :-

IMPORT P_TEXT TO V_TEXT

FROM MEMORY ID C_ID.

Reward if useful.