03-20-2009 4:50 AM
Hi All,
In my internal table I am having data.
I am dynamically forming table field name and substitute for the another table field name to pass DATA.
but I am getting the Variable name insted of Value ie Data.
I am using Field Symbol for this.
data:
Field-symbols <TS> type any.
field1 type string.
LOOP AT TABLEFIELDS INTO WA_TABLEFIELDS.
READ TABLE TEST WITH KEY NAME = WA_TABLEFIELDS-FIELDNAME.
IF SY-SUBRC = 0.
CONCATENATE 'WA_' WA_TABLEFIELDS-TABNAME '-' WA_TABLEFIELDS-FIELDNAME INTO Field1.
Assign Field1 to <TS>.
ALL_VAL-VALUE = <TS>
"After substituting the <TS> into ALL_VAL-VALUE field I need a DATA to be passed but the variable name is appending"*
APPEND ALL_VAL.
ENDIF.
ENDLOOP.
kindly how to pass the value into the table.
Thanks in advance.
San
03-20-2009 4:54 AM
Hi;
have a look
[Link for Field Symbol|http://www.sapdevelopment.co.uk/tips/tips_fsymbol.htm]
[2nd link|http://www.sapdb.info/abap-programs-inserting-lines-at-a-specified-position/]
Regards
Shashi
03-20-2009 4:55 AM
03-20-2009 5:07 AM
Hi,
pls assign a break point in
CONCATENATE 'WA_' WA_TABLEFIELDS-TABNAME '-' WA_TABLEFIELDS-FIELDNAME INTO Field1.
Assign Field1 to <TS>.
ALL_VAL-VALUE = <TS>
" Put a break point here and check for the value in <TS>.
if <TS> contains value then create a work area for ALL_VAL AND PASS the Field-Symbol to that and then append thw wa into the table...
Hope this works out!!
thanks
03-20-2009 5:08 AM
Hi
Replace Assign Field1 to <TS>., with Assign (Field1) to <TS>.
CONCATENATE 'WA_' WA_TABLEFIELDS-TABNAME '-' WA_TABLEFIELDS-FIELDNAME INTO Field1.
ASSIGN (field1) TO <TS>. " Change
ALL_VAL-VALUE = <TS> .
03-20-2009 5:38 AM
hi,
use this.
ASSIGN COMPONENT <field name or variable containing field name> OF STRUCTURE <structure name> TO <TS>.
ALL_VAL-VALUE = <TS>.
regards,
Peter
03-20-2009 10:37 AM
03-20-2009 10:45 AM