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

Error in TYPES internal table

Former Member
0 Likes
484

I am trying to fetch data from table1 and based on the entries I get from first select qry, I am fetching the records from the another table2

Code :

TYPES: BEGIN of tag,

data_field type c,

END of tag.

DATA: my_tab type table of tag.

SELECT fild FROM table1 INTO TABLE my_tab .

SELECT xyz FROM table2 .............WHERE xyz IN my_tab

I am getting the error as "the tag structure of the table "my_tab" is incorrect. " in the last SELECT statement.

What is an error in above code ?

Can we specify "IN" with an internal table or do we need to have the subquery with "IN" ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
463

Hi,

In this case you need to use for all entries in.

If you want to use IN than the internal table is to have specific structure with sign option low and high.

Best regards,

Wojciech

2 REPLIES 2
Read only

Former Member
0 Likes
464

Hi,

In this case you need to use for all entries in.

If you want to use IN than the internal table is to have specific structure with sign option low and high.

Best regards,

Wojciech

Read only

Former Member
0 Likes
463

Hi,

Use the following statement:

select xyz from table2 into table it_tab for all the entries in my_tab where xyz = my_tab-fild.

This above statement will work only if field 'fild' of table 'my_tab' is same as that of 'xyz' of table2.

Please reward points if helpful.