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: 

Report Writer "CALL TRANSACTION tcode..."

former_member699400
Active Participant
0 Kudos
993

Hello All,

I would appreciate help on the following subject:

I need to get some info from standard transaction, calling it from whitin my Z* report.

The transaction calls report writer program, that is why probably not a solution to use ABAP statement "SUBMIT program ...".

A problem is that I do not know how to get info (internal table) from transaction if to use the following statement:

CALL TRANSACTION tcode USING gt_bdc.

Here tcode is a transaction which calls report writer program.

Any ideas?
Thank you.
Regards, Alex.

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos
422

Does the called report use an ALV grid, if yes use cl_salv_bs_runtime_info  to disable ALV display and get internal table (and other informations on layout) back.

If not, you have to either generate a spool and convert it back to internal table or use an implicit enhancement or available BAdI to export the table to memory as already written.

Also to call such a report, use the report-to-report interface, look for sample using keywords like RSTI_APPL_STACK_PO, RSTI_APPL_STACK_INITIALIZE, RSTI_SELECTION_EXPORT and RSTI_COMMUNICATION_HANDLER.

Regards,

Raymond

10 REPLIES 10

Former Member
0 Kudos
422

hi Alex

first, enhance the standard Tcode, export the itab to abap memory.

then, in your Zprogram import the abap memory.

hope can help you

regards,

Archer

Former Member
0 Kudos
422

Hi,

Why don't you get the information from the tables after calling the transaction! I am not getting the exact situation of your problem! Can you elaborate in details please!

Former Member
0 Kudos
422

Hi,

First of all you have to do implicit enhancement to pass the values from standard transaction to your custom report.

Sample Code:

In Standard Transaction

EXPORT <FIELD1> TO MEMORY ID <ID>.


In Custom Program


IMPORT <FIELD1>  FROM MEMORY ID <ID>


Thanks & Regards,

Rajkumar Parthipan.

0 Kudos
422

Hi Rajkumar,

please correct me if I am wrong, but EXPORT / IMPORT uses a database table, this means transaction must save data in the table before IMPORT can be used.

BR.

Former Member
0 Kudos
422

Hi,

If you are interested the in output of standard transaction then you can use the submit statement with

exporting list to memory or to SPOOL. This will be useful only standard transaction output is list. 

Example in SAP Documentation

DATA list_tab TYPE TABLE OF abaplist.

SUBMIT report EXPORTING LIST TO MEMORY
              AND RETURN.

CALL FUNCTION 'LIST_FROM_MEMORY'
  TABLES
    listobject = list_tab
  EXCEPTIONS
    not_found  = 1
    OTHERS           = 2.

IF sy-subrc = 0.
  CALL FUNCTION 'WRITE_LIST'
    TABLES
      listobject = list_tab.
ENDIF.


Thanks & Regards,

Arun

0 Kudos
422

Hi Aruna,

thanks, but the report behind the standard transaction I call is written by Report Writer, that is why I think "SUBMIT report" statement is not an option, because of 2 reasons:

1. report name will change each time it is generated
2. SUBMIT statement is not executed till the end if to use addition "...EXPORTING LIST TO MEMORY AND RETURN."

Regards...

0 Kudos
422

Hi,

Still you can use submit statement for dynamic program using variable which holding program name .

As you mentioned earlier you are trying with CALL transaction , But is transaction dynamically creating ?

Thanks & Regards,

Arun

Former Member
0 Kudos
422

Hi,

You can directly IMPORT and Export  internal table . The syntax as below.

    EXPORT i_itab TO DATABASE indx(WQ)

    FROM wa_indx CLIENT sy-mandt ID Sales_order_number

IMPORT i_itab = i_itab1 FROM DATABASE indx(WQ)

  CLIENT sy-mandt ID Sales_order_number.

former_member206395
Participant
0 Kudos
422

HI Mindaugas,

Could you be a bit more specific. Do you mean that the standard transaction already calls your Z* report  using a SUBMIT program.. statement? and hence you are not interested in using the SUBMIT program statement to fetch data from your report!

If that is correct then if you want only some of the info then the only way would be to find a standard FM to suit your functionality or else will result in infinite recursive calls.

But if you mean that your SAP transaction runs a report writer report in background then a SUBMIT program.. TO MEMORY(mentioned by Aruna Kumara) would be a good option.

raymond_giuseppi
Active Contributor
0 Kudos
423

Does the called report use an ALV grid, if yes use cl_salv_bs_runtime_info  to disable ALV display and get internal table (and other informations on layout) back.

If not, you have to either generate a spool and convert it back to internal table or use an implicit enhancement or available BAdI to export the table to memory as already written.

Also to call such a report, use the report-to-report interface, look for sample using keywords like RSTI_APPL_STACK_PO, RSTI_APPL_STACK_INITIALIZE, RSTI_SELECTION_EXPORT and RSTI_COMMUNICATION_HANDLER.

Regards,

Raymond