11-22-2010 8:39 AM
Hi ,
I have to use an internal table in a form which can have differnet structures at diffrenet points of time.
As the internal table is dynamic , I have declared a field symbol for this.I need to use th efields in this internal table for processing inside a loop.But because i have to use an untyped field symbol , I am getting an error that the field QUANT is not there in <fs_order_tab>.
Please let me know what to do in such a situation.Thanks in advance.
FIELD-SYMBOLS :<fs_order_tab> TYPE STANDARD TABLE,
<fs_order_wa> TYPE ANY.
ASSIGN i_so TO <fs_order_tab>.
ASSIGN wa_so TO <fs_order_wa>.
LOOP AT<fs_order_tab> into <fs_order_wa>..
........
l_quant = <fs_order_wa>-QUANT.
.......
ENDLOOP.
11-22-2010 8:55 AM
Hi Rashmi,
Kindly follow the steps given below.
After assigning the internal table to the field symbol,
create 1 more field symbols of the following type
<fs_quant> TYPE vbep-bmeng,
Create 2 constants :
CONSTANTS: lc_quant TYPE c LENGTH 5 VALUE 'QUANT',
and then assign the field quantity and WERKS to these field symbols
ASSIGN COMPONENT lc_quant OF STRUCTURE <fs_order_wa> TO <fs_quant>.
Inside the loop write the following statement
l_quant = <fs_quant>
Hope this helps in solving your query.
11-22-2010 8:47 AM
Use the ASSIGN COMPONENT 'QUANT' OF STRUCTURE statement.
BTW: Did you already search on SDN before posting this question? sounds like a basis question to me.
11-22-2010 8:55 AM
Hi Rashmi,
Kindly follow the steps given below.
After assigning the internal table to the field symbol,
create 1 more field symbols of the following type
<fs_quant> TYPE vbep-bmeng,
Create 2 constants :
CONSTANTS: lc_quant TYPE c LENGTH 5 VALUE 'QUANT',
and then assign the field quantity and WERKS to these field symbols
ASSIGN COMPONENT lc_quant OF STRUCTURE <fs_order_wa> TO <fs_quant>.
Inside the loop write the following statement
l_quant = <fs_quant>
Hope this helps in solving your query.
11-22-2010 8:56 AM
Hi Rashmi,
Kindly follow the steps given below.
After assigning the internal table to the field symbol,
create 1 more field symbols of the following type
<fs_quant> TYPE vbep-bmeng,
Create 1 constant.
CONSTANTS: lc_quant TYPE c LENGTH 5 VALUE 'QUANT'.
and then assign the field quantity to the field symbol
ASSIGN COMPONENT lc_quant OF STRUCTURE <fs_order_wa> TO <fs_quant>.
Inside the loop write the following statement
l_quant = <fs_quant>
Hope this helps in solving your query.
Edited by: Kadian.Arjun on Nov 22, 2010 9:56 AM