‎2010 Dec 16 6:28 AM
Hi All
I have a requirement where i have the field names ( matnr, ekorg) etc., in an intenal table. eg., . using those names I need to read another internal table which carries values for the fields. I need to write a program to check if a particular field in table 1 has an initial value in table 2 or not.
for my logic, I am looping on tab1( since it will contan only few fields) and assigning it to field symbols. but since the values from tab1 are dynamic, i cant hard code to assign field name like Matnr. So I am unable to figure out who to read tab2 with the field names i find in tab1.
I used cl_abap_tabledescr=>describe_by_data (itab2) to columize the fields of itab2. but this method doesnt fetch me the field values? I was wondering if my approach was correct and if there is any way to use fields from itab1 to read values from itab2.
I am not an ABAP expert, so any help is appreciated
Regards
Ruel
‎2010 Dec 16 6:36 AM
Hi,
You can use this to get the field values.
ASSIGN COMPONENT <comp> OF STRUCTURE <s> TO <FS>.
[Here|http://help.sap.com/saphelp_470/helpdata/en/fc/eb3923358411d1829f0000e829fbfe/content.htm] is the link to documentation.
‎2010 Dec 16 6:36 AM
Hi,
You can use this to get the field values.
ASSIGN COMPONENT <comp> OF STRUCTURE <s> TO <FS>.
[Here|http://help.sap.com/saphelp_470/helpdata/en/fc/eb3923358411d1829f0000e829fbfe/content.htm] is the link to documentation.
‎2010 Dec 16 7:47 AM
Thank you nitwick for your quick help. i am able to read the value using fs.
assigned full points. thanks again