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: 

calling a report and passing values!!

rnb86
Participant
0 Kudos

Hi Experts,

i have a requirement. I have a report [zrep1] with billing doc field and shipment field on the selection screen.

The logic for billing document is written. Im writing logic for shipment numbers. I am finding the billing documents of delivaries for each shipment.

I want to pass those billing documents as input to the same report program [zrep1] for the existing billing document code to get the output.

How to call the same report and pass the values from internal table as input to it.

Please suggest the way to proceed. i knw it is possible.

Thanks in advance.

Edited by: Craig Cmehil on Jul 3, 2008 3:30 PM

3 REPLIES 3

franois_henrotte
Active Contributor
0 Kudos

even if it is possible, it is not a good idea to call itself

why don't you separate logic of billing into a routine and call the routine ?

Former Member
0 Kudos

Hello,

Try this:

The program report1 has a stand-alone selection screen with the screen number 1100. In the program report2, an internal table with row type RSPARAMS and a ranges table are filled for this selection screen. These are transferred at SUBMIT together with a single condition.

Program accessed

REPORT report1.

DATA text TYPE c LENGTH 10.

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 TYPE c LENGTH 10,

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.

vinod_vemuru2
Active Contributor
0 Kudos

Hi,

First append the selection screen values of ZREP1 to an internal table of structure RSPARAMS

Next use below statement to submit that report.

SUBMIT zrep1 WITH SELECTION-TABLE i_rsparams AND RETURN.

eg: If ur billing doc selection screen field is select option so_vbeln.

Then

wa_rsparams-selname = 'SO_VBELN'.

wa_rsparams-kind = 'S'.

wa_rsparams-sign = 'I'.

wa_rsparams-option = 'BT'.

wa_rsparams-low = ur low value.

wa_rsparams-high = ur high value.

APPEND wa_rsparams TO i_rsparams.

U have append like this for both selection screen elements.

If u have multiple values then u have to append those also.

Hope it is clear.

Thanks,

Vinod.