Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

FIELD-SYMBOLS and table ?

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

Tags:
Former Member
Former Member replied

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>.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question