Skip to Content
avatar image
Former Member

How to assign ranges ( select-option)to field symbol

Hi ,

I have following scenario

ranges : r_test1 for agr_1251,

r_test2 for agr_1251.

In runtime i am getting which range i have to populate in a field v_rname.for now let it me v_rname = 'r_test2'

i want to assign (v_rname ) to <field -symbol> ie is range to field symbol.

and i want to update the <field -symbol>-sign ='I'

<field -symbol>-LOW ='some value'

append <field -symbol>.

This is the logic i want to follow, for this how should i have to declare the field symbol ? I couldn't assign a range to field symbol . Please help me.

thanks

Murali

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    May 11, 2007 at 11:24 AM

    Try this

    FIELD-SYMBOLS : <field_symbol> TYPE ANY TABLE.

    ASSIGN (v_rname) to <field_symbol>.

    <field -symbol>-sign ='I'

    <field -symbol>-LOW ='some value'

    append <field -symbol>.

    This should work because your range is a table.

    Hope this helps you.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 11, 2007 at 11:20 AM
    something like this
    
    
    REPORT ABC MESSAGE-ID ZZ.
    
    RANGES : IT_RANGES FOR MARA-MATNR,
             IT_TEMP FOR MARA-MATNR.
    
    DATA : V_CHAR(10) VALUE 'IT_RANGES'.
    
    FIELD-SYMBOLS : <FS> LIKE IT_RANGES.
    
    ASSIGN (V_CHAR) TO <FS>.
    
    <FS>-SIGN = 'I'.
    <FS>-OPTION = 'BT'.
    <FS>-LOW = '100000'.
    APPEND <FS> TO IT_TEMP.
    
    LOOP AT IT_TEMP.
      WRITE : IT_TEMP-LOW.
    ENDLOOP.
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Chandru,

      The problem is instead of Appending ( APPEND <FS> TO IT_TEMP)

      it into different range. i want it to be in the same range which you have assigned it to field symbol . in your example into IT_RANGES . Do you have any solution on this ? If we try Append <FS>, it will say it is not an internal table..