Application Development and Automation 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: 
Read only

loop through field symbos.

Former Member
0 Likes
772

i have below declarations

FIELD-SYMBOLS: <fs_table> TYPE STANDARD TABLE,

<fs_table1> TYPE STANDARD TABLE.

now i want to do below things.

loop at <fs_table>.

endloop.

it gives error "The internal table <fs_table> has no header line.

i also want to do below once above is error is solved.

loop at <fs_table>.

read table <fs_table1> with key ...........

endloop.

Pls help.

i have below declarations

FIELD-SYMBOLS: <fs_table> TYPE STANDARD TABLE,

<fs_table1> TYPE STANDARD TABLE.

now i want to do below things.

loop at <fs_table>.

endloop.

it gives error "The internal table <fs_table> has no header line.

i also want to do below once above is error is solved.

loop at <fs_table>.

read table <fs_table1> with key ...........

endloop.

Pls help.

6 REPLIES 6
Read only

Former Member
0 Likes
734

Press F1 on FIELD-SYMBOLS!

Read only

matt
Active Contributor
0 Likes
734

>

> Press F1 on FIELD-SYMBOLS!

And "LOOP AT".

Read only

0 Likes
734

>

>

> And "LOOP AT".

F13.

Read only

Former Member
0 Likes
734

declare a work area field symbol and do as:

<wa> type any.

loop at <fs> into <ws>.

endloop.

And <fs> is dynamic, how can u know the key fields of this dynamic table to use a read statement?

Are the fields for key unique?

Edited by: Veeranji Reddy on Jun 11, 2009 11:54 AM

Read only

Former Member
0 Likes
734

Hi santosh,

Try this...

FIELD-SYMBOLS: <DYN_TABLE> TYPE STANDARD TABLE,

<DYN_WA>,

<DYN_FIELD>,

<Y_FLD> TYPE ANY.

Regards,

Kittu

Read only

Former Member
0 Likes
734

Hi,

Create a Field symbol with TYPE ANY.

Then

LOOP AT <FS_TABLE> assigning/into <FS_WA>.

your logic.....

ENDLOOP.

you can use ASSIGN COMPONENT statement to move the value from <FS_WA> into another field symbol <FS_VAL> of TYPE ANY. nnow this <FS_VAL> will contain the value of the field you want to pick.

Thanks,

Prashanth