10-08-2007 7:44 PM
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
10-08-2007 7:52 PM
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
10-08-2007 7:47 PM
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
10-08-2007 7:51 PM
Specify the corresponding Tables in the where clause.
Check the syntax for inner join hitting F1.
Sri
10-08-2007 7:52 PM
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