‎2008 Jan 18 10:01 AM
Hi,
I need to map the fields from Internal table to Database table. I have the fieldnames as rows from excel sheet. Need to update the value in Database table. Example,
My internal table has following records.
fieldname1 value
fieldname2 value
fieldname3 value
....
....
fieldname50 value
Need to compare the field name with the Database field name and update the value from the field value.
Please advice me the best method.
‎2008 Jan 18 10:13 AM
Best method = using field symbols.
Example:
table KNA1, fields KUNNR and NAME1.
Internal table itab row 1 :
itab-fieldname KNA1-KUNNR
itab-value 123456
FIELD-SYMBOLS <f>
ASSIGN (itab-fieldname) TO <f>.
<f> = itab-value.
Result : KNA1-KUNNR will be filled with 123456
‎2008 Jan 18 10:13 AM
Best method = using field symbols.
Example:
table KNA1, fields KUNNR and NAME1.
Internal table itab row 1 :
itab-fieldname KNA1-KUNNR
itab-value 123456
FIELD-SYMBOLS <f>
ASSIGN (itab-fieldname) TO <f>.
<f> = itab-value.
Result : KNA1-KUNNR will be filled with 123456