Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Help in Select statement

Hi all,

I have the following select statement

SELECT akunnr aname1 AS name2 astras aort01

aregio apstlz astcd1 astceg

atelf1 atelfx bnamev bname1

btelf1 AS telf2 cstr_suppl1

cstr_suppl2 ccountry


FROM kna1 AS a

JOIN knb1 AS d

ON dkunnr = akunnr

JOIN knvk AS b

ON bkunnr = akunnr

JOIN adrc AS c

ON caddrnumber = aadrnr

WHERE ( aktokd = 'Z001' OR aktokd = 'Z002' )

AND d~bukrs = p_vkorg

AND a~kunnr IN r_location

AND a~loevm NE 'X'

AND d~loevm NE 'X'

AND b~abtnr eq 'ACCT'.

The above select is not getting the records when there is value in KNVK-ABTNR

other than ACCT.

What I need is I have to get customers which has value KNVK-ABTNR eq ACCT

and also at the same time if it has no value it should select as blank values in that table instead of not selecting the whole record.

Can we do that with out splitting select?

Any replies will be appreciated.

Hope its clear.



Former Member
Not what you were looking for? View more on this topic or Ask a question