Application Development 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: 

How to pass variable while using SUBMIT

Former Member
0 Kudos

Hi,

Can anyone tell me how to pass the parameter variables to other report program while using the 'submit' keyword?

I've modified some variables & want to pass them to the report I'm calling with 'submit' keyword.

Thanx in advance,

Hemant.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

use the following code...

Say u have program p1 with parameters which needs to be passed to program p2.

SUBMIT p2

AND return

with p2-<parameter1> = p1-<parameter1>

with p2-<parameter2> = p1-<parameter1>.

This will solve ur problem.

Pl. award appropriate points.

8 REPLIES 8

andreas_mann3
Active Contributor
0 Kudos

hi,

sample:

  SUBMIT ZFBPET00 WITH BR_BUKRS IN BR_BUKRS
                  WITH BLART    IN BLART
                  WITH BR_GJAHR in s_gjahr
                  WITH EXTRAKT EQ 'X'
                  WITH DS_NAME EQ DS_NAME
                  WITH CPUDATUM IN DATUM
                  EXPORTING LIST TO MEMORY
                  AND RETURN.

Andreas

former_member181962
Active Contributor
0 Kudos

1) using ranges addition

2) using export and Import statements.

YOu have to declare ranges in the current program and populate the data in them and pass them with the submit statement using the <b>With</b> addition.

YOu have to declare the select-option which receive the values from the calling program with no-display addition.

Regards,

Ravi

Former Member
0 Kudos

Hemant

U can use EXPORT/IMPORT ing of Data ie using ABAP Memory.

EXPORT the variable in the Current program and IMPORT it inside the SUBMIT program.

Thanks

Kam

Former Member
0 Kudos

use the following code...

Say u have program p1 with parameters which needs to be passed to program p2.

SUBMIT p2

AND return

with p2-<parameter1> = p1-<parameter1>

with p2-<parameter2> = p1-<parameter1>.

This will solve ur problem.

Pl. award appropriate points.

former_member181962
Active Contributor
0 Kudos

One more sample.

Program accessed

REPORT report1.

DATA text(10) TYPE c.

SELECTION-SCREEN BEGIN OF SCREEN 1100.

SELECT-OPTIONS: selcrit1 FOR text,

selcrit2 FOR text.

SELECTION-SCREEN END OF SCREEN 1100.

...

Calling program

REPORT report2.

DATA: text(10) TYPE c,

rspar_tab TYPE TABLE OF rsparams,

rspar_line LIKE LINE OF rspar_tab,

range_tab LIKE RANGE OF text,

range_line LIKE LINE OF range_tab.

...

rspar_line-selname = 'SELCRIT1'.

rspar_line-kind = 'S'.

rspar_line-sign = 'I'.

rspar_line-option = 'EQ'.

rspar_line-low = 'ABAP'.

APPEND rspar_line TO rspar_tab.

range_line-sign = 'E'.

range_line-option = 'EQ'.

range_line-low = 'H'.

APPEND range_line TO range_tab.

range_line-sign = 'E'.

range_line-option = 'EQ'.

range_line-low = 'K'.

APPEND range_line TO range_tab.

SUBMIT report1 USING SELECTION-SCREEN '1100'

WITH SELECTION-TABLE rspar_tab

WITH selcrit2 BETWEEN 'H' AND 'K'

WITH selcrit2 IN range_tab

AND RETURN.

Regards,

Ravi

Former Member
0 Kudos

Hi,

If there is any variant avilable for the report, you can use the following statement to submit the report,

For ex,

SUBMIT report(report_name)

USING SELECTION-SET 'variant_name'

wiTH s_werks = p_werks "Plant value

AND RETURN.

Hope this helps,

Rgds,

Former Member
0 Kudos

hi,

First of all,make sure the report program that you are calling contain the passing variable, for example:

FORM test TABLES itab

USING variable1

variable2.

Then you may called you program using:

PERFORM <i>FORMNAME</i> IN PROGRAM <i>PROGRAMNAME</i>

TABLES itab

USING variable1

variable2.

Hopes it helps you.

Former Member
0 Kudos

Hi,

Sorry, i oversee that you want to use 'SUBMIT'.

Try to use this:

SUBMIT ZFIXXXXR00_CUSTLINE

WITH dd_kunnr IN s_kunnr

WITH dd_kunnr = p_bukrs

WITH pa_stida = s_datum-low

WITH x_opsel = 'X'

  • WITH x_aisel = 'X'

WITH x_shbv = v_indicator

AND RETURN.

First of all, the dd_kunnr, dd_kunnr, pa_stida, x_opsel, x_shbv are coming from the select option or the parameters from the program you are calling from.

After that, you may use import statement in your program to retrieve the values from the program you are calling too.Do remember to use export statement inside the program you are calling from.

Thanks.