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

Inner join issue

Former Member
0 Likes
405

Hi Gurus,

iam using an inner joiN ON vbak,vabp,vbkd.

the selection screen is

select-options: s_erdat for vbak-erdat, "SO CREATION DATE

s_vbeln for g_vbeln, " SALES ORDER

s_bstkd for vbkd-bstkd_e. " CLIENT PURCHASE ORDER NO

THE sample records:

SO soline PO poline

86333 1 - -

87000 1 49000 1

my inner join:

select vbakvbeln vbapposnr vbaproute vbkdbstkd_e vbkd~posex_e

into table t_vbap

from vbak

inner join vbap

on vbakvbeln = vbapvbeln

inner join vbkd

on vbapvbeln = vbkdvbeln

and vbapposnr = vbkdposnr

where vbak~erdat in s_erdat

and vbap~vbeln in s_vbeln

and vbkd~bstkd_e in s_bstkd.

problem:

selection screen:

DATE: - TO -

SO : 86333 TO -

PO : - TO -

INPUT IS ONLY sales order no.

and in V BKD NO po - blank .

In VBKD table if the PO is blank am not getting any record.

mean the first one should be retrived but not happening.

at least it should show me like this below.

86333 1 - -

pls clera me asap.

2 REPLIES 2
Read only

Former Member
0 Likes
385

Hi,

use left outer join for VBKD

select vbakvbeln vbapposnr vbaproute vbkdbstkd_e vbkd~posex_e

into table t_vbap

from vbak

inner join vbap

on vbakvbeln = vbapvbeln

LEFT OUTER join vbkd

on vbapvbeln = vbkdvbeln

and vbapposnr = vbkdposnr

where vbak~erdat in s_erdat

and vbap~vbeln in s_vbeln

and vbkd~bstkd_e in s_bstkd.

Eg.

SELECT scarrid scarrname p~connid

INTO CORRESPONDING FIELDS OF TABLE itab

FROM scarr AS s

LEFT OUTER JOIN spfli AS p ON scarrid = pcarrid

AND p~cityfrom = p_cityfr.

Regards

Rajiv singh.

Read only

0 Likes
385

Rajjiv ,

i changed according ly but its giving the below error.

NO-FILEDS FROM TEH RIGHT-HAND SIDE OF TABLE OF left -outer join may appear in WHERE condition : " vbkd~bstkd_e.

it seems in where conditon its not allowing this.