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

error

Former Member
0 Likes
805

Hi all,

Could you help me where the error?

DATA: BEGIN OF wa,

vbeln TYPE vbak-vbeln,

vgbel type lips-vgbel,

posnr type vbap-posnr,

vgpos type vbrp-vgpos,

vbeln1 type vbrk-vbeln,

END OF wa.

DATA itab LIKE SORTED TABLE OF wa

WITH UNIQUE KEY vbeln.

select avbeln cvgbel bposnr dvgpos e~vbeln

into CORRESPONDING FIELDS OF TABLE itab

from ( ( ( ( vbak as a

inner join vbap as b on avbeln = bvbeln )

inner join lips as c on cvgbel = bvbeln and cvgpos = bposnr )

inner join vbrp as d on dvgbel = cvbeln and dvgpos = cposnr )

inner join VBRK as e on evbeln = dvbeln ) .

loop at itab into wa.

write:/ wa-vbeln, wa-posnr, wa-vgbel,wa-vgpos,wa-vbeln1.

endloop.

Thanks

4 REPLIES 4
Read only

Former Member
0 Likes
705

HI,

in the select query u are selecting avbeln and evbeln and moving them into the table by using corresponding fields of table itab.

but itab contain only one field with name 'vbeln' and other with name 'vbeln1',

so u better to to use INTO TABLE ITAB in place of CORRESPONDING FIELDS OF TABLE

Read only

Former Member
0 Likes
705

Hi..

just change this..i am getting output with this..

DATA itab LIKE Standard TABLE OF wa

WITH non-UNIQUE KEY vbeln.

as you have taken sorted table...it won't allow duplicate records...

take standard table as above...

Message was edited by:

Rammohan Nagam

Read only

Former Member
0 Likes
705

Hi,

What are the fields you wants to fetch first>

Since there are VBELN's in all tables this is the problem.

DATA: BEGIN OF wa,

vbeln TYPE vbrk-vbeln, "billing Doc

posnr type vbrp-posnr, " billing item

vgbel type lips-vgbel, " delivery

vgpos type vbrp-vgpos, " delivery item

aubel type vbak-vbeln, " so No

aupos type vbap-posnr, " So item

END OF wa.

DATA itab LIKE SORTED TABLE OF wa

WITH UNIQUE KEY vbeln.

select dvbeln dvgbel dposnr dvgpos daubel daupos

into CORRESPONDING FIELDS OF TABLE itab

from ( ( ( ( vbak as a

inner join vbap as b on avbeln = bvbeln )

inner join lips as c on cvgbel = bvbeln and cvgpos = bposnr )

inner join vbrp as d on dvgbel = cvbeln and dvgpos = cposnr )

inner join VBRK as e on evbeln = dvbeln ) .

All the data from VBRP is alone sufficient here.

***No where condition mentioned Keep some condition.*****

loop at itab into wa.

write:/ wa-vbeln, wa-posnr, wa-vgbel,wa-vgpos,wa-vbeln1.

endloop.

reward if useful

regards,

Anji

Read only

Former Member
0 Likes
705

hay.. by the way what error u r getting can explain ..i dont think so there is error in this but there will be performance issue of the code ..cause no where condition given or u can have a dump error for that define ur table with non-unique key not unique

points pls if solved the problem or helped in solving

regards

farroque