Skip to Content
0
Former Member
Mar 26, 2009 at 02:04 PM

How to Assign value to dynamic field of struc, field not specified directly

4430 Views

Hi Friends,

I have value,fieldname and also the structure name.

problem is to pass the value to that field of that structure without specifying the fieldname directly.

Ex: variable w_val has value '0001'.

fs_str is my structure which has around 10 fields

i am finding the fieldname dynamically to which the value should be passed,

and assigned it to a variable.

w_fieldname = 'Field1'.

normally to pas the value, we do

fs_str-field1 = w_val

but i should not specify the fieldname directly here

tried doing like below,

fs_str-(w_fieldname) = w_val

but getting an error.

Please help me on this.

Regards,

Sowjanya