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

Need help on select statement in ABAP

Former Member
0 Likes
397

Hi,

I have 2 table. in that I need to do join. But 2 fields of table A that I need to join with the 2 fields in table B.

But problem is that both the fields of table A can be NULL(either of them).

i.c.

Table A Table B

-


-


KONDA KUNNR PRICESHEET KONDA KUNNR

-


-


KA NULL A KA 1000

KA NULL B KA 1001

DZ NULL C DZ 1002

NULL 1000 D DZ 1003

NULL 1001 E DZ 1004

NULL 1002 F

NULL 1003 F

NULL 1004 G

After Joining I need for KONDA = 'KA'

-


KONDA KUNNR PRICESHEET

-


KA NULL A

KA NULL B

NULL 1000 D

NULL 1001 E

Could you plz help me...Plz reply soon. Thanks in advance

Regards

Anutosh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
379

select a~konda a~kunnr a~pricesheet  from table_a as a
join table_b as b on ( a~konda = b~konda or a~konda eq space ) and (a~kunnr = b~kunnr or a~kunnr eq space )
where b~konda = 'KA'.

Try that

Edited by: Ramiro Escamilla on Apr 3, 2008 11:48 PM

1 REPLY 1
Read only

Former Member
0 Likes
380

select a~konda a~kunnr a~pricesheet  from table_a as a
join table_b as b on ( a~konda = b~konda or a~konda eq space ) and (a~kunnr = b~kunnr or a~kunnr eq space )
where b~konda = 'KA'.

Try that

Edited by: Ramiro Escamilla on Apr 3, 2008 11:48 PM