05-10-2011 8:09 AM
Hello Xperts,
we are having a bit of trouble with the following SELECT
FIELD-SYMBOLS:
<itab1> TYPE standard table.
ASSIGN ATTR_T_I->* TO <itab1>.
select
FIELD1
FIELD2
from DBTAB1
into CORRESPONDING FIELDS OF table <itab1>
FOR ALL ENTRIES IN <itab1>
where
FIELD3 = <itab1>-FIELD3 and
FIELD4 = <itab1>-FIELD4
.
ATTR_T_I is a static attibute of type table.
The syntax check throws the following message:
The specified type has no structure and therefore no component called FIELD3.
Any ideas out there how to solve this issue?
Thanx!
05-10-2011 9:24 AM
Hi Martin,
Change your code like this and try.
DATA: itab2 TYPE TABLE OF string.
FIELD-SYMBOLS:
<itab1> TYPE standard table.
ASSIGN ATTR_T_I->* TO <itab1>.
APPEND 'FIELD3 = <itab1>-FIELD3 and' TO itab2.
APPEND 'FIELD4 = <itab1>-FIELD4' TO itab2.
select
FIELD1
FIELD2
from DBTAB1
into CORRESPONDING FIELDS OF table <itab1>
FOR ALL ENTRIES IN <itab1>
where
(itab2)
.
Regards,
Rahul Muraleedharan.
05-10-2011 8:28 AM
You can use a solution like this:
FIELD-SYMBOLS: <lfv_valuefield3> TYPE ANY.
ASSIGN COMPONENT field3 OF STRUCTURE <itab1> TO <lfv_valuefield3>.
Then, do the select comparing FIELD3 = <lfv_valuefield3>
05-10-2011 8:41 AM
Hi Martin,
Please try with this. Declare your field symbol type any instead of standard table and then assign it accordingly.
This might help.
Thanks,
Guru.
05-10-2011 8:49 AM
Hello Martin,
You have to use a dynamic token in the WHERE clause. Check this question which i had posted:
Cheers,
Suhas
05-10-2011 9:24 AM
Hi Martin,
Change your code like this and try.
DATA: itab2 TYPE TABLE OF string.
FIELD-SYMBOLS:
<itab1> TYPE standard table.
ASSIGN ATTR_T_I->* TO <itab1>.
APPEND 'FIELD3 = <itab1>-FIELD3 and' TO itab2.
APPEND 'FIELD4 = <itab1>-FIELD4' TO itab2.
select
FIELD1
FIELD2
from DBTAB1
into CORRESPONDING FIELDS OF table <itab1>
FOR ALL ENTRIES IN <itab1>
where
(itab2)
.
Regards,
Rahul Muraleedharan.