Skip to Content
1
Former Member
Jul 12, 2007 at 02:36 PM

fieldsymbols

15 Views

Hi experts,

I am working with fieldsymbols and very new to the concept.

Can anybody tell me whether there is something wrong with the code. Its giving dump. Where am I wrong here?

form gather_cond_data using p_wa_pr_cond type type_pr_cond

value(p_1524)

p_prp_prod_i_ref_guid

changing p_wa_cond_data.

data: v_field1(40) type c,

v_field2(40) type c,

v_field3(40) type c,

v_field4(40) type c,

v_field5(40) type c.

data: v_konwa(10) type c,

v_kmein_670(10) type c,

v_kpein_670(10) type c.

data: v_kpein(10) type c,

v_kmein(10) type c.

data: ev_output_qty type CMST_QUANTITY_UNIT.

field-symbols:<fs1> type any,

<fs2> type any,

<fs3> type any,

<fs4> type any,

<fs5> type any.

concatenate 'KBETR' p_1524 into v_field1.

assign component v_field1 of structure p_wa_pr_cond to <fs1>.

concatenate 'KPEIN' p_1524 into v_field2.

assign component v_field2 of structure p_wa_pr_cond to <fs2>.

concatenate 'KMEIN' p_1524 into v_field3.

assign component v_field3 of structure p_wa_pr_cond to <fs3>.

concatenate 'KONWA' p_1524 into v_field4.

assign component v_field4 of structure p_wa_pr_cond to <fs4>.

concatenate 'KRECH' p_1524 into v_field5.

assign component v_field5 of structure p_wa_pr_cond to <fs5>.

*Comparison at record level

if p_1524 CS 'YMP0'.

clear: v_konwa, v_kpein, v_kmein.

v_konwa = <fs4>. " Giving dump here

v_kmein_670 = <fs3>.

v_kpein_670 = <fs2>.

elseif p_1524 NS 'YMP0'.

clear v_field4.

concatenate 'KONWA' p_1524 into v_field4.

assign component v_field4 of structure p_wa_pr_cond to <fs4>.

My objective is to take the values from one of the field in the structure and put it in a field symbol.

How to go about it?

How is assignment done in field-symbol?

Thanks in advance,

Sangeeta.