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: 

standard report data need to display from a custom report

0 Kudos
957

Hi all,

Using SUBMIT I have extracted standard report output, which has 52 field from which I need to display only 2 fields at the report output, how this can be done. Currently I have data in field symbol, what steps I need to follow to display the data at the output.

Following is the code which I done so far,

field-symbols <lt_pay_data> type TABLE.
data lr_pay_data type ref to data.
DATA itab TYPE REF TO DATA.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE text-001.
SELECT-OPTIONS so_werks FOR t001w-werks.
SELECT-OPTIONS so_bukrs FOR t001-bukrs.
SELECT-OPTIONS so_budat FOR bsim-budat NO-EXTENSION OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.

cl_salv_bs_runtime_info=>set( exporting display = abap_false
metadata = abap_false
data = abap_true ).
submit J_3RMOBVEDH
USING SELECTION-SCREEN '1000'
WITH so_bukrs IN so_bukrs
WITH so_budat IN so_budat
WITH so_werks IN so_werks
and return.
try.
cl_salv_bs_runtime_info=>get_data_ref( importing r_data = lr_pay_data ).
assign lr_pay_data->* to <lt_pay_data>.
catch cx_salv_bs_sc_runtime_info.
message `Unable to retrieve ALV data` type 'E'.
endtry.

cl_salv_bs_runtime_info=>clear_all( ).

Now standard report output is available in <lt_pay_data> which has 52 columns, now in my custom report output I want to display only two selected columns,

Please suggest me the next steps.

3 REPLIES 3

FredericGirod
Active Contributor
834

If you know the structure of LT_PAY_DATA you could crete an internal table with the correct structure and put the content in this internal table

If not, you will have to play with field catalog and make an assign to the fields requested

Sandra_Rossi
Active Contributor
0 Kudos
834

Please edit your question, select your code and press the button [CODE], which makes the code appear colored/indented, it will be easier for people to look at it. Thank you!

Sandra_Rossi
Active Contributor
0 Kudos
834

To complete Frederic comment:

LOOP AT <lt_pay_data> ASSIGNING FIELD-SYMBOL(<line>).
  ASSIGN COMPONENT 'COMPNAME' OF STRUCTURE <line> TO FIELD-SYMBOL(<comp>).
  your_alv_line-compname = <comp>.
  APPEND your_alv_line TO your_alv_table.
ENDLOOP.

You may also use CORRESPONDING.