09-11-2014 5:04 AM
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
09-11-2014 5:16 AM
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.
09-11-2014 6:22 AM
09-11-2014 7:38 AM
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.
09-11-2014 7:48 AM
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