2007 Aug 04 11:12 AM
in this peace of code i got error message like:
The column name "VBELN" has two meanings..
Please let me know how to resolve this <b>select-options:</b> problem
tables:vbap,lips,likp.
data: begin of first occurs 0,
vbeln1 like vbap-vbeln,
matnr2 like vbap-matnr,
werks3 like lips-werks,
route4 like likp-route,
end of first.
select-options: enter for vbap-vbeln.
select
a~vbeln
a~matnr
b~werks
c~route
into table first
from vbap as a
inner join lips as b
on avbeln = bvbeln
inner join likp as c
on bvbeln = cvbeln
<b> where vbeln in enter.</b>
loop at first.
write:/2 sy-vline, first-vbeln1,
sy-vline,first-matnr2,
sy-vline,first-werks3,
sy-vline,first-route4.
endloop.
Thanks In advance
~~SANDY~~~
2007 Aug 04 11:15 AM
Hi,
Give like this,
tables:vbap,lips,likp.
data: begin of first occurs 0,
vbeln1 like vbap-vbeln,
matnr2 like vbap-matnr,
werks3 like lips-werks,
route4 like likp-route,
end of first.
select-options: enter for vbap-vbeln.
select
a~vbeln
a~matnr
b~werks
c~route
into table first
from vbap as a
inner join lips as b
on avbeln = bvbeln
inner join likp as c
on bvbeln = cvbeln
where<b> a~vbeln</b> in enter.
loop at first.
write:/2 sy-vline, first-vbeln1,
sy-vline,first-matnr2,
sy-vline,first-werks3,
sy-vline,first-route4.
endloop.
Regards,
Padmam.
in this peace of code i got error message like:
The column name "VBELN" has two meanings..
Please let me know how to resolve this <b>select-options:</b> problem
tables:vbap,lips,likp.
data: begin of first occurs 0,
vbeln1 like vbap-vbeln,
matnr2 like vbap-matnr,
werks3 like lips-werks,
route4 like likp-route,
end of first.
select-options: enter for vbap-vbeln.
select
a~vbeln
a~matnr
b~werks
c~route
into table first
from vbap as a
inner join lips as b
on avbeln = bvbeln
inner join likp as c
on bvbeln = cvbeln
<b> where vbeln in enter.</b>
loop at first.
write:/2 sy-vline, first-vbeln1,
sy-vline,first-matnr2,
sy-vline,first-werks3,
sy-vline,first-route4.
endloop.
Thanks In advance
~~SANDY~~~
2007 Aug 04 11:15 AM
Hi,
Give like this,
tables:vbap,lips,likp.
data: begin of first occurs 0,
vbeln1 like vbap-vbeln,
matnr2 like vbap-matnr,
werks3 like lips-werks,
route4 like likp-route,
end of first.
select-options: enter for vbap-vbeln.
select
a~vbeln
a~matnr
b~werks
c~route
into table first
from vbap as a
inner join lips as b
on avbeln = bvbeln
inner join likp as c
on bvbeln = cvbeln
where<b> a~vbeln</b> in enter.
loop at first.
write:/2 sy-vline, first-vbeln1,
sy-vline,first-matnr2,
sy-vline,first-werks3,
sy-vline,first-route4.
endloop.
Regards,
Padmam.
2007 Aug 04 11:23 AM
ya
Padmam
but also it not showing out put Please hepl me in this regard.
2007 Aug 04 11:16 AM
Hi Sandy,
The error has occurred due to ambiguity of vbeln from which table it needs to be consider. Speicy vbeln as a~vbeln to resolve the issue.
Change code as in BOLD.
select-options: enter for vbap-vbeln.
select
a~vbeln
a~matnr
b~werks
c~route
into table first
from vbap as a
inner join lips as b
on avbeln = bvbeln
inner join likp as c
on bvbeln = cvbeln
<b>where a~vbeln in enter.</b>
Don't use INNER JOINS for more than 2 levels as it will have great impact on performance and use FOR ALL ENTRIES instead of INNER JOINS.
Thanks,
Vinay
Message was edited by:
Vinaykumar G
2007 Aug 04 11:17 AM
Hiii
Change the condition in where clause
Where a~VBELN IN ENTER
Regards
hitesh
2007 Aug 04 11:43 AM
hi,
after using <b>a~</b> also out put is not coming
When i debugged it it is not fetching any data
what to do?????????
Thanks in advance
~~~sandy~~~
2007 Aug 04 11:48 AM
Hi Sandy,
As you didn't have any relationship statements among the LIPS and VBAP.
Try as follows.
select-options: enter for vbap-vbeln.
select
a~vbeln
a~matnr
b~werks
c~route
into table first
from vbap as a
inner join lips as b
<b>on avbeln = bvgbel and aposnr = bvgpos
where a~vbeln in enter
</b>inner join likp as c
on bvbeln = cvbeln.
Thanks,
Vinay
2007 Aug 04 1:24 PM
Hi,
Try this one,it is working fine,
tables:vbap,lips,likp.
data: begin of first occurs 0,
vbeln like vbap-vbeln,
matnr like vbap-matnr,
werks like lips-werks,
route like likp-route,
end of first.
select-options: enter for vbap-vbeln.
<b>select avbeln amatnr bwerks croute into corresponding fields of table first
from vbap as a inner join lips as b on avbeln = bvgbel
inner join likp as c on bvbeln = cvbeln
where a~vbeln in enter.</b>
loop at first.
write:/2 sy-vline, first-vbeln,
sy-vline,first-matnr,
sy-vline,first-werks,
sy-vline,first-route.
endloop.
Regards,
Padmam.
2007 Aug 04 11:25 AM
hi,
check the tables you are using for the vbeln,because it is having two different meanings in the data base tables because vbeln is used for the sales order as well as delivery number depending upon the database table.
please check this once.
please donot forget to reward points if it helps you.
all the best
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |