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 using field symbols in Query...

Former Member
0 Kudos

Hi,

I am fetching the name of the table and field which I will be using in the query using field symbols. But it gives syntax error...

select single OBJECTTABLE OBJECTFIELD into help_numtab from Zobjectname

where OBJECTNAME = P_OBJECT.

field-symbols : <number> type any.

field-symbols : <module> type any.

ASSIGN help_numtab-OBjectfield to <number>.

ASSIGN help_numtab-OBjecttable to <module>.

/* Here <number> = MATNR and <module> = MARA.

select <NUMBER> into table help_item

from <MODULE>

where ERNAM = SY-UNAME.

This gives a syntax error which says <module> is not defined in ABAP DDIC.

1 ACCEPTED SOLUTION

suresh_datti
Active Contributor
0 Kudos

instead of field symbols, you ccan try this..


select (help_numtab-OBjectfield) into table help_item
from (help_numtab-OBjecttable)
where ERNAM = SY-UNAME.

~Suresh

1 REPLY 1

suresh_datti
Active Contributor
0 Kudos

instead of field symbols, you ccan try this..


select (help_numtab-OBjectfield) into table help_item
from (help_numtab-OBjecttable)
where ERNAM = SY-UNAME.

~Suresh