Skip to Content

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

Issue regarding Select Query

Hello experts,

I want a join on table ekpo & mbew(for valuation class).

But its not working.

if valclass is initial.

select aebeln aebelp atxz01 amatnr abukrs awerks a~menge

a~mtart

b~bklas

from ekpo as a inner join mbew as b on bmatnr eq amatnr

into corresponding fields of table ekpo_mbew

where ( a~matnr eq mat_num ) and

( a~bukrs eq compcode ) and

( a~werks eq plant ) and

( a~mtart eq mat_type ) and

b~bklas in ('3001','3045' ,'3006','3055','3065') and

( amatnr eq bmatnr ).

else.

select aebeln aebelp atxz01 amatnr abukrs awerks a~menge

a~mtart

b~bklas

from ekpo as a inner join mbew as b on bmatnr eq amatnr

into corresponding fields of table ekpo_mbew

where ( a~matnr eq mat_num ) and

( a~bukrs eq compcode ) and

( a~werks eq plant ) and

( a~mtart eq mat_type ) and

( b~bklas in valclass ) and

( amatnr eq bmatnr ).

endif.

Plz tell where I m wrng.

Ravi.

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