Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 11577

How to get the components of table deep structure

$
0
0

Hi experts,

 

Am not able to get the all components of mara table , why bcoz in mara table they included another structure.

Am able to disply only 2 fields only.

 

plz have a look below code :

 

 

data: text type string,
       it_table type table of mara,
       wa_table like line of it_table,
       lt_comp type ABAP_COMPONENT_TAB,
       ls_comp like line of lt_comp.
data: lo_ref type ref to CL_ABAP_STRUCTDESCR,
       lo_cast type ref to CX_SY_MOVE_CAST_ERROR.

try.
   lo_ref ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_DATA( wa_table ).
   catch CX_SY_MOVE_CAST_ERROR into lo_cast.
   text = lo_cast->get_text( ).
endtry.
  lt_comp = lo_ref->get_components( ).
loop at lt_comp into ls_comp.
   write:/ ls_comp-name.
   clear: ls_comp.
endloop.


Viewing all articles
Browse latest Browse all 11577

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>