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: 

Using ASSIGN - Field Symbol

Former Member
0 Kudos

I have used

import <GT_POS_DATA> from memory id 'lines'.

and have the same{<GT_POS_DATA>} in my zreport. Now I have to sum

up one field and move it to a variable to be displayed in my report

output.

How shld I proceed.

Thanks in advance.

3 REPLIES 3

Former Member
0 Kudos

Hi

What's <GT_POS_DATA>? A table? A structure?

If it's a table:

FIELD-SYMBOLS: <WA> TYPE ANY,

<FIELD> TYPE ANY.

LOOP AT <GT_POS_DATA> ASSIGNI_:NG WA.

ASSIGN COMPONENT <FIELD NAME> OF STRUCTURE <WA> TO <FIELD>.

V_SUM = V_SUM + <FIELD>.

ENDLOOP.

max

Former Member
0 Kudos

hi,

refer to this sample code

data: temp1 type i.
assign temp1 to <GT_POS_DATA>.
<GT_POS_DATA> = <GT_POS_DATA> + 100.
reportvar = <GT_POS_DATA>.

Former Member
0 Kudos

Hi,

Am facing problem over here :

ASSIGN COMPONENT wkgbtr OF STRUCTURE <WA> TO <FIELD>.

This is the part of code I used :

FIELD-SYMBOLS: <gt_pos_data> TYPE table,

<WA> type any,

<field> type any.

LOOP AT <GT_POS_DATA> ASSIGNING <WA>.

ASSIGN COMPONENT <wa>-wkgbtr OF STRUCTURE <WA> TO <FIELD>.

lV_tot = lV_tot + <FIELD>.

ENDLOOP.