Application Development 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: 

Concatenation in Where Clause!

Former Member
0 Kudos

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

3 REPLIES 3

former_member194669
Active Contributor
0 Kudos

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.

0 Kudos

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

0 Kudos

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.