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

Problem using field symbols in Query...

Former Member
0 Likes
391

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
Read only

suresh_datti
Active Contributor
0 Likes
371

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
Read only

suresh_datti
Active Contributor
0 Likes
372

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