cancel
Showing results for 
Search instead for 
Did you mean: 

Sql queries from internal tables based on context node

Former Member
0 Kudos

Hi experts,

I want to select from my inetrnal table which is based on the context node, the rows which do not appear in another internal table based on the context node.

I have this data:

data lt_item_level type table of wd_this->element_item_level INITIAL SIZE 0.

data lt_item_level_cp type table of wd_this->element_item_level INITIAL SIZE 0.

data lt_po_items TYPE table of wd_this->element_po_items INITIAL SIZE 0.

I want to do this:

select * into CORRESPONDING FIELDS OF TABLE lt_item_level_cp from lt_item_level WHERE lt_po_items-po_number NE lt_item_level-item_number.

But i get an error:

"LT_ITEM_LEVEL" is not defined in the ABAP Dictionary as a table,

Is there a way to do it with select or should i loop over my internal tables?

thank u very much!!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi,

You cannot use Select queries on internal table. do like this :

loop at itab into wa where wa-F1 NE wa-F2.

append wa to itab1.

endloop.

Here itab1 will have all the records as per your requiement.

I hope it is clear.

Edited by: Saurav Mago on Oct 26, 2009 5:37 PM

Former Member
0 Kudos

Thanks.

I did it with the loop and if clause.

It would have been very handy if it was possible to use select with internal tables too.

Answers (0)