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: 

display the data in classical report

Former Member
0 Kudos

Hi experts,

Generally in classical reports if we want to display the data then we will write following logic like

WRITE: / <itab>-<f1>,

                <itab>-<f2>,.....

But my doubt is that is there any possible without giving any filed name i want to see the total internal table data on output.

Please tell me.

thanks in advance

laxman

4 REPLIES 4

KiranJ
Active Participant
0 Kudos

Hi Laxman,     it is not possible ,with out giveing any field name in WRITE statement to display the output, if you want output you need to write the field names with WRITE statement.

former_member202818
Active Contributor
0 Kudos

ALV is preferable

nikolayevstigneev
Contributor
0 Kudos

Hi, Laxman!

In case I got you right you can try something like that

(supposing that wa_itab is your table line):

DATA: lo_descr_ref TYPE REF TO cl_abap_structdescr.

FIELD-SYMBOLS: <descr_wa> TYPE abap_compdescr.
FIELD-SYMBOLS: <fs_field> TYPE any.


lo_descr_ref ?= cl_abap_typedescr=>describe_by_data( wa_itab ).

LOOP AT lo_descr_ref->components ASSIGNING <descr_wa>.
     AT FIRST.

      WRITE / .

    ENDAT.


     ASSIGN COMPONENT <descr_wa>-name OF STRUCTURE wa_itab TO <fs_field>.
     IF sy-subrc <> 0.
       RAISE processing_error.
       EXIT.
     ENDIF.

    WRITE <fs_field>.

ENDLOOP.

0 Kudos

Hi laxman,

in your internal tabla all fields are in same data type then we can use directly like

loop at itab into wa.

write : / wa.

end loop.

otherwise we have to specify field names