Skip to Content
0
Former Member
Jul 03, 2009 at 01:03 PM

updating field-symbol dynamically

77 Views

Hi,

I have a field-symbol(dynamic table kind) with some set of fields.And I have one more internal table which has records which can be fit into the field-symbol fields.

But in my internal table I have the structure is as follows:

FLD_POS FLD_VALUE.

Now whenever the FLD_POS will change the values to be moved to each field of the field-symbol.I do not not the exact field names of the field symbol though this is getting updated dynamically each time whenever I upload a file.I need to write the code to pass the values of FLD_POS to the field-symbol in dynamic way.

I have done the coding as follows:

LOOP AT gt_field INTO gs_temp.

l_counter = l_counter + 1.

CASE gs_temp-fld_pos.

when l_counter.

MOVE gs_temp-fld_value to <dyn_wa>.

APPEND <dyn_wa> TO <dyn_table>.

ENDCASE.

ENDLOOP.

But I do not know the field-name of <dyn_wa>.I mean gs_temp-fld_value will move to which field each time.Please help on this.

The values to be passed as follows:

when gs_temp-fld_pos = 1.

<dyn_wa>.-field1 = gs_temp-fld_value .

when gs_temp-fld_pos = 2.

<dyn_wa>.-field2 = gs_temp-fld_value .

when gs_temp-fld_pos = 3.

<dyn_wa>.-field3 = gs_temp-fld_value .

.

.

.

And so on...........

Edited by: Jjammy on Jul 3, 2009 3:04 PM