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: 

FIELD-SYMBOLS and table ?

Former Member
0 Kudos

Hi all,

in my programm i must check in differents tables some values. Tables are parameters of my program.

So i thought that i could use field-symbols for access to the table but it's not work for me.

Just a example, i've 2 tables to check : HRP1002 and HRP1003.

I can't do that :

FIELD-SYMBOLS <fs> STANDARD TABLE.

ASSIGN 'HRP1002' TO <fs>.

ASSIGN line is in error because no compatible type.

How can i do this ?

Regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Try this code...

tables: rsrd1.

DATA: LineType TYPE string,

ItabRef TYPE REF TO DATA,

lineRef TYPE REF TO DATA.

FIELD-SYMBOLS: <fs> TYPE STANDARD TABLE,

<fs1> type any.

parameter tbl like RSRD1-TBMA_VAL.

linetype = tbl.

CREATE DATA ItabRef TYPE STANDARD TABLE OF (LineType).

ASSIGN ItabRef->* to <fs> .

create data lineref like line of <fs>.

assign lineref->* to <fs1>.

SELECT * FROM (tbl) INTO <fs1>.

write <fs1>.

endselect.

SELECT * FROM (tbl) INTO table <fs>.

4 REPLIES 4

Former Member
0 Kudos

Try this code...

tables: rsrd1.

DATA: LineType TYPE string,

ItabRef TYPE REF TO DATA,

lineRef TYPE REF TO DATA.

FIELD-SYMBOLS: <fs> TYPE STANDARD TABLE,

<fs1> type any.

parameter tbl like RSRD1-TBMA_VAL.

linetype = tbl.

CREATE DATA ItabRef TYPE STANDARD TABLE OF (LineType).

ASSIGN ItabRef->* to <fs> .

create data lineref like line of <fs>.

assign lineref->* to <fs1>.

SELECT * FROM (tbl) INTO <fs1>.

write <fs1>.

endselect.

SELECT * FROM (tbl) INTO table <fs>.

Former Member
0 Kudos

Try this..

FIELD-SYMBOLS <fs> .

ASSIGN 'HRP1002' TO <fs>.

This assigns the value HRP1002 to <fs>..

But if you want to assign the internal table values to <fs>, create an internal table and then assign it to <fs>

Former Member
0 Kudos

hi tafkap,

if u need any materail related to filed symbols let me know

Regards,

Naveen

0 Kudos

Thanks to all,

it's ok now

Regards