04-14-2009 9:21 PM
Hi SDN,
I am writing ABAP for a BI project.
I have a data package (A) to process which contains Planned Orders as the key. Another table (B) contains Planned Orders but with a PreFix 'PA'.
So A->PLUM = 'PA' + B->PLUM.
How do I code the Where clause to extract from table B into an itab.
Thanks.
SM
04-14-2009 9:28 PM
Try this way
data : v_like(24) type c.
concatenate '_____%' a-plum into v_like.
condense v_like no-gaps.
select * from B into table i_tab
where plum like v_like.
a®
04-14-2009 9:55 PM
Thanks but I was looking for something like:
Select z y x
from A
for all entries in dp
where PLNUM = 'PA' + A-PLNUM.
Please advise.
It looks like your logic will work if I use it in a loop around the DP.
Thanks.
SM
04-14-2009 10:00 PM
Then it may be
data : begin of itab_t occurs.
data : plnum like b-plnum.
end of itab_t.
loop at a.
concatenate 'PA' a-plnum into itab-t-plnum.
condense itab_t-plnum no-gaps.
append itab_t-plnum.
endloop.
select * from b
for all entries in itab_t
where plnum eq itab_t-plnum.
a®