Skip to Content

calling a report and passing values!!

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jul 02, 2008 at 03:17 PM

    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 ?

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 02, 2008 at 03:25 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 02, 2008 at 03:34 PM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.