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: 

General

Former Member
0 Kudos

Hi Folks,

I am getting an error at my inner join saying column name SPART has 2 meanings , same with ERDAT too .. donno whatz the problem . could anyone rectify .

here is my code ..

select A~VBELN

A~ERDAT

A~ERNAM

A~AUART

A~VKORG

A~VTWEG

A~SPART

A~VSBED

A~KUNNR

B~VBELN

B~POSNR

B~MATNR

B~PSTYV

B~KWMENG

C~VBELN

C~POSNR

C~WMENG

C~BMENG

D~VBELN

D~POSNR

D~LFSTA

D~FKSAA

E~VBELV

E~POSNV

E~VBELN

E~POSNN

E~VBTYP_N

into corresponding fields of table GT_VBAK

from VBAK as A inner join VBAP as B on AVBELN = BVBELN

inner join VBEP as C on BVBELN = CVBELN and BPOSNR = CPOSNR

inner join VBUP as D on CVBELN = DVBELN and CPOSNR = DPOSNR

inner join VBFA as E on DVBELN = EVBELV and DPOSNR = EPOSNN

where VKORG in S_VKORG

and VTWEG in S_VTWEG

and SPART in S_SPART

and AUART in S_AUART

and PSTYV in S_PSTYV

and ERDAT in S_ERDAT

and BSARK in S_BSARK

and VBTYP_N = GC_M.

Thanks in advance.

regards

rock

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

do like this

select A~VBELN

A~ERDAT

A~ERNAM

A~AUART

A~VKORG

A~VTWEG

A~SPART

A~VSBED

A~KUNNR

B~VBELN

B~POSNR

B~MATNR

B~PSTYV

B~KWMENG

C~VBELN

C~POSNR

C~WMENG

C~BMENG

D~VBELN

D~POSNR

D~LFSTA

D~FKSAA

E~VBELV

E~POSNV

E~VBELN

E~POSNN

E~VBTYP_N

into corresponding fields of table GT_VBAK

from VBAK as A inner join VBAP as B on AVBELN = BVBELN

inner join VBEP as C on BVBELN = CVBELN and BPOSNR = CPOSNR

inner join VBUP as D on CVBELN = DVBELN and CPOSNR = DPOSNR

inner join VBFA as E on DVBELN = EVBELV and DPOSNR = EPOSNN

where A~VKORG in S_VKORG

and A~VTWEG in S_VTWEG

and A~SPART in S_SPART

and A~AUART in S_AUART

and B~PSTYV in S_PSTYV

and A~ERDAT in S_ERDAT

and A~BSARK in S_BSARK

and E~VBTYP_N = GC_M.

Regards

Anji

3 REPLIES 3

Former Member
0 Kudos

There is an error in WHERE condition.

VKORG in S_VKORG

and VTWEG in S_VTWEG

and SPART in S_SPART

and AUART in S_AUART

and PSTYV in S_PSTYV

and ERDAT in S_ERDAT

and BSARK in S_BSARK

and VBTYP_N = GC_M.

You need to give table name with fields for eg VBAKVKORG in S_VKORG and VBAKVTWEG in S_VTWEG.

Please make this correction and check again.

ashish

Former Member
0 Kudos

Specify the corresponding Tables in the where clause.

Check the syntax for inner join hitting F1.

Sri

Former Member
0 Kudos

Hi

do like this

select A~VBELN

A~ERDAT

A~ERNAM

A~AUART

A~VKORG

A~VTWEG

A~SPART

A~VSBED

A~KUNNR

B~VBELN

B~POSNR

B~MATNR

B~PSTYV

B~KWMENG

C~VBELN

C~POSNR

C~WMENG

C~BMENG

D~VBELN

D~POSNR

D~LFSTA

D~FKSAA

E~VBELV

E~POSNV

E~VBELN

E~POSNN

E~VBTYP_N

into corresponding fields of table GT_VBAK

from VBAK as A inner join VBAP as B on AVBELN = BVBELN

inner join VBEP as C on BVBELN = CVBELN and BPOSNR = CPOSNR

inner join VBUP as D on CVBELN = DVBELN and CPOSNR = DPOSNR

inner join VBFA as E on DVBELN = EVBELV and DPOSNR = EPOSNN

where A~VKORG in S_VKORG

and A~VTWEG in S_VTWEG

and A~SPART in S_SPART

and A~AUART in S_AUART

and B~PSTYV in S_PSTYV

and A~ERDAT in S_ERDAT

and A~BSARK in S_BSARK

and E~VBTYP_N = GC_M.

Regards

Anji