Skip to Content
0
Former Member
Aug 24, 2005 at 02:21 PM

Storing values in internal table into workarea dynamically

19 Views

The following piece of code is used to assign the value of a field in an internal table to a field in a workarea.

lwa_subscr - workarea

li_subscrbe - Internal table

1. loop at li_subscrbe.

2. lwa_subscr-mailerid = li_subscrbe-mailerid.

3. lwa_subscr-cust_no = li_subscrbe-cust_no.

*this assigns the field name dynamically to a string variable 'event_field'

4. concatenate 'lwa_subscr-' li_subscrbe-eventid into event_field.

5. assign table field event_field to <fs_event>.

6. move li_subscrbe-subscr_value to <fs_event>.

7. endloop.

i want to assign the value of a field 'subscr_value' in internal table 'li_subscrbe', into a field of workarea.

The 'move' statement assigns the value to field symbol and not to the field stored in the field symbol.

example:

Before line 5, the value of field symbol <fs_event> has value 'lwa_subscr-volume' where 'volume' is one of the columns of the work area.

But in line 6, i want the integer value in 'li_subscrbe-subscr_value' to be assigned to 'lwa_subscr-volume', but the interger value gets assisgned to the field symbol itself.

how else can i implement this.