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

Sales Orders with diffrent partner functions

Former Member
0 Likes
527

Hi,

I wanted to find all the sales orders for which sold-to-party is diffrent than ship-to party.

can you help me.

Thanks in advance

jack

Hi,

I wanted to find all the sales orders for which sold-to-party is diffrent than ship-to party.

can you help me.

Thanks in advance

jack

2 REPLIES 2
Read only

former_member156446
Active Contributor
0 Likes
502
select vbeln posnr parvw kunnr
      from vbpa into it_vbpa
  where vbeln in so_vbeln.

loop at it_vbpa into wa_vbpa where parvw = 'AG'.
     read table it_vbpa into wa_buff with key vbeln = wa_vbpa-vbeln
                                                              posnr = wa_vbpa-posnr
                                                              parvw = 'WE'.
if sy-subrc eq 0.
if wa_vbpa-kunnr = wa_buff-kunnr.
delete it_vbpa index sy-tabix.
clear: wa_buff, wa_vbpa.
endif.
endif.
endloop.
"<<finally it_vbpa will contain all such entries which Sold to is not equal to ship to..

Edited by: Jay Sadaram on Jul 7, 2008 12:02 PM

Read only

Former Member
0 Likes
502

Hi,

Select data from vbpa as shown below:

data: i_vbpa type standard table of vbpa-vbeln.

select a~vbeln

from vbpa as a

inner join vbpa as b

on avbeln = bvbeln

and akunnr <> bkunnr << Not equal to sign not displaying by editor

into table i_vbpa

where a~PARVW = 'AG'

and b~PARVW = 'WE'.

check sy-subrc = 0.

Regards,

Joy.

Edited by: Joyjit Ghosh on Jul 7, 2008 9:17 PM