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

report

Former Member
0 Likes
827

hi,

i am using two report programs r1 and r2.

i want to execute the report program r1 inside r2..how can i call that report program...so that when i execute the report r2 i should be able to give the inputs for r1..can anyone solve this plz..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
796

Hi,

See the code below for ur requirement:

suppose u want to call R1 inside r2 .

inside r2:

  • Call to r1 AND Pass the below mentioned

  • values

SUBMIT r1 WITH einlesen EQ lc_x

WITH headfile EQ lv_source

WITH bankid EQ lc_bacs

WITH mregel EQ lc_session

WITH pa_mode EQ lc_post_method

WITH valut_on EQ lc_x

WITH pa_xcall EQ lc_x

WITH batch EQ lc_x

WITH spool EQ lc_x

WITH p_koausz EQ lc_x

WITH p_tape_t EQ lc_x

WITH e_option EQ lc_x

WITH m_match EQ lc_x

WITH p_bupro EQ lc_x

WITH p_statik EQ lc_x

TO SAP-SPOOL WITHOUT SPOOL DYNPRO

KEEP IN SPOOL 'X'

AND RETURN.

rgds,

latheesh

Message was edited by: Latheesh Kaduthara

8 REPLIES 8
Read only

Manohar2u
Active Contributor
0 Likes
796

you need to write <b>submit with parameters</b> statement in R2 to call R1.

Regds

Manohar

Read only

Former Member
0 Likes
796

Satheesh,

You can use SUBMIT. See synaxt below.

SUBMIT REPORT01 
       VIA SELECTION-SCREEN 
       USING SELECTION-SET 'VARIANT1' 
       USING SELECTION-SETS OF PROGRAM 'REPORT00' 
       AND RETURN. 

you can refer ABAPDOC tcode for futher doc.

Rgds

TM

Read only

0 Likes
796

I think this is the version of submit you want, as long as report1 and 2 have identical selection screens:

submit report2 WITH SELECTION-TABLE seltab

Effect

seltab is an internal table with the structure RSPARAMS.

This variant allows you to set the names and contents of the parameters and selection options dynamically at runtime.

You can use the function module RS_REFRESH_FROM_SELECTOPTIONS to read the contents of the parameters and selection options of the current program into an internal table seltab with the structure RSPARAMS. By using SUBMIT ... WITH SELECTION-TABLE seltab, you can then pass these values on directly.

Read only

Former Member
0 Likes
796

Submit r1 inside the report r2.

SUBMIT Report(r1) VIA SELECTION-SCREEN

AND RETURN

Read only

Former Member
0 Likes
797

Hi,

See the code below for ur requirement:

suppose u want to call R1 inside r2 .

inside r2:

  • Call to r1 AND Pass the below mentioned

  • values

SUBMIT r1 WITH einlesen EQ lc_x

WITH headfile EQ lv_source

WITH bankid EQ lc_bacs

WITH mregel EQ lc_session

WITH pa_mode EQ lc_post_method

WITH valut_on EQ lc_x

WITH pa_xcall EQ lc_x

WITH batch EQ lc_x

WITH spool EQ lc_x

WITH p_koausz EQ lc_x

WITH p_tape_t EQ lc_x

WITH e_option EQ lc_x

WITH m_match EQ lc_x

WITH p_bupro EQ lc_x

WITH p_statik EQ lc_x

TO SAP-SPOOL WITHOUT SPOOL DYNPRO

KEEP IN SPOOL 'X'

AND RETURN.

rgds,

latheesh

Message was edited by: Latheesh Kaduthara

Read only

Former Member
0 Likes
796

Hi Satheesh,

You can execute a program within another program using the statement SUBMIT.

Suppose you want to provide values for fields in program r1 , you can use the submit statement like this within R2.

SUBMIT R1 WITH FIELD1 = 'VALUE1'

WITH FIELD2 = 'VALUE2'

AND RETURN.

This will provide the values to the fields in R1 and execute the program after that.

If you want to just provide values to the fields in R1 program, you can use VIA SELECTION-SCREEN addition after specifying the R1 program.

SUBMIT R1 VIA SELECTION SCREEN WITH FIELD1 = 'VALUE1'

WITH FIELD2 = 'VALUE2'

AND RETURN.

Regards,

SP.

Read only

Former Member
0 Likes
796

Hi,

You can do this by using the

Submit r1 via selection screen.

in your r2 program.

Pls reward useful answers.

Regards,

Ram Mohan

Read only

Former Member
0 Likes
796

Hi sateesh,

suppose if there is selection screen for r2 and u want to pass some values to that parameters u can try this

SUBMIT r1

VIA SELECTION-SCREEN

USING SELECTION-SET 'VARIANT1'

USING SELECTION-SETS OF PROGRAM 'REPORT00'

AND RETURN.

and if there is no selection screen for report r1 even though u want to pass values to particular varibles ussing EXPORT.. ID and u caIMPORT in r1.

and if there is no need to pass pass any values into R1 just simply SUBMIT r1 AND RETURN.

Regards,

Ramesh.