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: 

Replace Left Outer Join in Select Qeury

Former Member
0 Kudos

Hello Experts,

This is my select query :

SELECTvbap~vbeln vbap~posnr  vbep~etenr
vbap~matnr vbap~lgort vbap~lprio vbap~zzdelv
vbap~faksp vbap~netwr vbap~abgru vbap~werks

vbap~vstel  vbap~arktx vbap~prodh vbap~vrkme
vbap~route vbep~edatu  vbep~wadat vbep~bmeng

vbep~wmeng vbep~lifsp

                    INTO TABLE gt_vbapep  FROM vbap

              LEFT OUTER JOINvbep

                      ON vbep~vbeln = vbap~vbeln AND

                         vbep~posnr = vbap~posnr

              FOR ALL ENTRIES IN gt_vbakuk

                  WHERE vbap~vbeln = gt_vbakuk-vbeln.

Now I want to put a condition where vbep~bmeng NE 0. But since VBEP table is left outer joined, I cant put condition in this select query.

After select query I can delete the entries from internal table where BMENG <> 0 but what if I am not selecting BMENG?

So require your help in this please.

Can we replace it with inner join or can we put condition in this select query itself?

Thanks,

Onkar

2 REPLIES 2

diwaneamit
Participant
0 Kudos

This message was moderated.

raymond_giuseppi
Active Contributor
0 Kudos

Well if there are records in VBRP, you get same result with inner join. If there are none, BMENG will be initial so you will exclude those -> Convert to INNER JOIN or elaborate on exact requirement.

Regards,

Raymond