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: 

Catching output of a standard report in Z-Program

Former Member
0 Kudos

Dear All,

I have to make a Z-report where I have to use the output of two different Standard reports.

Is there any function module where I can catch the output of the std. report in some internal table........basically any method where I just specify the selection parameters and get the output for use in my Z-report, without getting into the code of the std. report.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

submit <standar reort prog name> and return

This will help.

regards,

11 REPLIES 11

Former Member
0 Kudos

Hi,

U can submit the standard report in ur Z-Program.

See the variant of SUBMIT statement in which u can also pass the selection parameters to the report as per ur need.

Use : SUBMIT Program and RETURN.

Once u get the output, u can get it using Function Module : LIST_FROM_MEMORY and then LIST_TO_ASCI.

Regards,

Himanshu

Message was edited by:

Himanshu Aggarwal

Former Member
0 Kudos

submit <standar reort prog name> and return

This will help.

regards,

Former Member
0 Kudos

U can code like following in your standard program:

field-symbols: <fs> type table.
  data: wa type string.
  data: pointer_tab(20) type c.
 
<b>  pointer_tab = '(standard_program_name)ITAB[]'.
  assign (pointer_tab) to <fs>.</b>
 
  loop at <fs> into wa.
    write:/ wa.
  endloop.

0 Kudos

Hello Abhishek,

Can you please explain your approach a bit further? Because it looks promising to what my requirement needs.

My requirement is like this...

I have to capture an internal table called AUS_S000 which is being populated in standard program RMCB0200 (standard program behind tx MC.5) in my custom(Z) program.

After searching SDN I found your reply in this thread. Based on it I did the following coding... But I am unable to get AUS_000 table assigned to the field symbol <fs> which I declared.

REPORT zb_test.

DATA: BEGIN OF aus_s000 OCCURS 100.

INCLUDE STRUCTURE austab_global.

DATA: xhwaer LIKE s031-hwaer.

DATA: xbasme LIKE s031-basme.

INCLUDE STRUCTURE kennzahl_felder.

DATA: plan_counter LIKE sy-tabix,

markierung(1) TYPE c.

DATA: END OF aus_s000.

FIELD-SYMBOLS: <fs> TYPE table.

DATA: wa TYPE string.

DATA: pointer_tab(20) TYPE c.

SUBMIT rmcb0200

WITH SELECTION-TABLE selpr

AND RETURN

EXPORTING LIST TO MEMORY.

pointer_tab = '(RMCB0200)AUS_S000[]'.

ASSIGN (pointer_tab) TO <fs>.

LOOP AT <fs> INTO wa.

WRITE:/ wa.

ENDLOOP.

I might have used LIST_FROM_MEMORY, LIST_TO_ASCI function modules. But based on some input fields the output of the RMCB0200 is changing and the required fields are not being displayed in the output all the time.

Any help will be appreciated. Thanks in advance for you help.

Regards,

Bharat.

0 Kudos

Hi Bharath,

Were you able to overcome this problem and did you get the contents of the internal table from the standard program to your custom program?

Even i have come across this problem. Could you please help me out in this.

Thanks!

Umair

0 Kudos

By the way, if anyone else knows answer for this, please advise me on this.

Thanks!

Umair

0 Kudos

by the way if anyone else knows the solution for this, please do advise me on this.,

0 Kudos

Hello Umair,

I activated user exit EXIT_SAPLMCS2_001 of enhancement MCR00002 and used the following code which exports AUS_S000 table to memory.

*---It is better to have this statement as the last statement in this include(function module exit).

*TABLES: indx.

DATA: lv_indxkey TYPE indx_srtfd VALUE 'AUS'.

  • Before the export, fille the data

  • fields before CLUSTR.

*indx-aedat = sy-datum.

*indx-usera = sy-uname.

  • Export data.

EXPORT t_aus_s000 TO

DATABASE indx(st) ID lv_indxkey.

clear: lv_indxkey .

And in my custom program I used the following code to retrieve AUS_S000 table from memory.

*---Submit main program behind transaction MC.5. Component EXIT_SAPLMCS2_001 of customer-exit MCR0002

*---will export its output table AUS_s000 to memory id 'AUS'. Importing it will give help you to get the

*---value of total stock in storate location 2300 of plant 1100.

SUBMIT rmcb0200

WITH SELECTION-TABLE lit_selpr

AND RETURN

EXPORTING LIST TO MEMORY.

IF sy-subrc = 0.

IMPORT t_aus_s000 TO lit_aus_s000 FROM DATABASE indx(st) ID 'AUS'. "CLIENT sy-mandt

ENDIF.

Let me know if you need more details.

Thanks.

Bharat.

0 Kudos

Hi Bharat,

I have to also get the output of a standard program into my Z-program but the problem is the output ALV table in the standard program is a field symbol of type table and am not able to capture the output into my z-program there is no specified type for the internal table in which the field symbol value can be obtained.

Thanks,

Neha

0 Kudos

Hello Neha,

If there is no table type defined in the standard program you can always declare a table with string as a row type. Once you import this table you can access the data based on the field lengths(offset).

As downloading standard program output is not common to all the programs let me know the standard program/transaction name that you are trying to capture the output of so that I can see if there is any table defined or any way to download its output.

Regards,

Bharat.

0 Kudos

Hi Bharat,

Transaction is COOIS and the standard program is PPIO_ENTRY.

Thanks,

Neha