2011 Sep 16 2:26 PM
Hi All,
SELECT doknr objky from drad INTO TABLE lt_drad FOR ALL ENTRIES IN it_mchb
WHERE objky LIKE it_mchb-CHARG.
Error :
The addition "FOR ALL ENTRIES IN itab" cannot be used in the WHERE
condition BETWEEN, LIKE, and IN.
Error is ok.
but i want to know how to use this query without loop... i don't want to use select query within loop..
so please suggest me . how to do...
2011 Sep 16 2:31 PM
Hi Mehta,
SELECT doknr objky from drad INTO TABLE lt_drad FOR ALL ENTRIES IN it_mchb
WHERE objky = it_mchb-CHARG
If the OBJKY is different type than CHARG.
you can define a different structure same as your
it_mchb
but the OBJKY as CHARG type.
loop at your internal table and append the values to your new structure internal table and after that you can use select query on your for all entries on new structure internal table .
try this way.
when your refering a for all entries internal table it should be EQ sign.
Edited by: Naresh Nelapatla on Sep 16, 2011 3:32 PM
2011 Sep 16 2:31 PM
Hi Mehta,
SELECT doknr objky from drad INTO TABLE lt_drad FOR ALL ENTRIES IN it_mchb
WHERE objky = it_mchb-CHARG
If the OBJKY is different type than CHARG.
you can define a different structure same as your
it_mchb
but the OBJKY as CHARG type.
loop at your internal table and append the values to your new structure internal table and after that you can use select query on your for all entries on new structure internal table .
try this way.
when your refering a for all entries internal table it should be EQ sign.
Edited by: Naresh Nelapatla on Sep 16, 2011 3:32 PM
2011 Sep 17 3:05 AM
Hi Kumar,
It is very clear for all entries nothing but .In your first internal table you got some data it is header table.Now depending on this header we are getting entries from item table.That header may containd number of items at item level.The key words equal to will make a relation between the two tables and get all the records which have the same value in the both the tables.
Once you get your data into your final internal table then declare one more structure and append it
Regards,
Madhu.
Edited by: madhurao123 on Sep 17, 2011 7:38 AM
2011 Sep 20 9:35 AM
Hi,
Understand the concept of working with FOR ALL ENTRIES, what madhu had given.
in your case there is no linkage between tables DRAD and MCHB.
Regards,
Kiran