Skip to Content
author's profile photo Former Member
Former Member

Need Help in Field Symbol for Dynamically passing table field value

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 20, 2009 at 04:54 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 20, 2009 at 04:55 AM

    Hi Sri,

    Chk this link once.

    accessing-dynamic-internal-table's-fields

    or try using this FM MCS_CSTRUCTURE_GET_FIELDS

    Regards,

    Lakshman.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 20, 2009 at 05: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 20, 2009 at 05: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> .

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 20, 2009 at 05: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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.