Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Need Help in Field Symbol for Dynamically passing table field value

Former Member
0 Kudos

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

7 REPLIES 7

Former Member
0 Kudos

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

former_member209217
Active Contributor
0 Kudos

Hi Sri,

Chk this link once.

or try using this FM MCS_CSTRUCTURE_GET_FIELDS

Regards,

Lakshman.

Former Member
0 Kudos

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

asik_shameem
Active Contributor
0 Kudos

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> .

peter_ruiz2
Active Contributor
0 Kudos

hi,

use this.


ASSIGN COMPONENT <field name or variable containing field name> OF STRUCTURE <structure name> TO <TS>.

ALL_VAL-VALUE = <TS>.

regards,

Peter

0 Kudos

Hi All,

Thanks for the help. Solved .

sharma

0 Kudos

Issue solved. Thanks for the suggestions.

Thanks,

San