06-21-2007 7:55 AM
Hi friends,
i have a question regarding the following bit of code i have:
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE <dyn_wa> TO <dyn_field>.
IF sy-subrc <> 0.
...
ELSE.
...
ENDIF.
ENDDO.
I get the content of the field assigned to <dyn_field> but how do i get the name of the component ( in this case the fieldname ) ?.
Regards, i will give points immediately and generously for sure!
Clemens
06-21-2007 7:59 AM
Hi,
By this code you may get some idea....
i_finaltab ---is internal table.
Include ole2incl.
data : det type ref to CL_ABAP_structDESCR.
det ?= cl_abap_typedescr=>describe_by_DATA( i_finaltab ).
loop at det->components into wa.
call method of sheet 'Cells' = cells
exporting
#1 = index.
set property of cells 'Value' = wa-name.
index = index + 1.
endloop.
Don't forget to reward if useful
06-21-2007 7:59 AM
Hi,
By this code you may get some idea....
i_finaltab ---is internal table.
Include ole2incl.
data : det type ref to CL_ABAP_structDESCR.
det ?= cl_abap_typedescr=>describe_by_DATA( i_finaltab ).
loop at det->components into wa.
call method of sheet 'Cells' = cells
exporting
#1 = index.
set property of cells 'Value' = wa-name.
index = index + 1.
endloop.
Don't forget to reward if useful