Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with field symbols

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

3 REPLIES 3

Sm1tje
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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