Skip to Content

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

General

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

Tags:
Former Member
Former Member replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question