03-18-2008 7:52 AM
Hi All,
I need logic for getting master sales order number from available Delivery number.
Note: There can be many SO's in diffrent levels.
Finally i need to pick up master sales order no.
Thanks in advance.
Thanks,
Deep.
03-18-2008 9:31 AM
Hello
The document flow can be read using function module RV_ORDER_FLOW_INFORMATION. Set:
COMWA-VBELN = <delivery number>
Use all default values except NACHFOLGER = ' ' because you want to read the "upstream" document flow, i.e. the sales order.
Regards
Uwe
03-18-2008 8:14 AM
Hi,
U can get the sales order number from the VBFA table .
In the VBFA u give
vbfa-VbelV = delviery no.
vbfa-posnv = delivery item no.
vbfa-vbtyp_N = 'C'.
then u will get the order no. in the vbfa-vbeln field.
---Patil
03-18-2008 9:09 AM
Hi,
If there are multiple sales orders how can we go about it, which one will be final/master sales order no!
Also is there any function module which will find master sales order number based on given delivery no!
Thanks,
Deep.
03-18-2008 9:18 AM
Hi,
I dont think one delivery will have multiple sales order. but one sales order will have multiple deliveries. check it!!!!
You can try the following FM
SD_VBFA_READ_WITH_VBELV
SHP_VBFA_GET_SINGLE_SD_ORDER
WB2_READ_VBFA_BACK_TO_START
SHP_VBFA_GET_GNERIC_SD_ORDER
03-18-2008 9:38 AM
Hi,
I have a outbound delivery[VL03N] 'X' in my system .
Then for getting sales order no i am writing below code:
SELECT single vbelv vbeln
from vbfa
INTO (vbelv, vbeln)
where vbeln EQ p_vbeln AND
vbtyp_n EQ 'J'.
Then vbelv i need to pick up master sales order no.
SELECT vbelv vbeln
from vbfa
INTO TABLE i_so
where vbeln EQ l_vbelv AND
vbtyp_n EQ 'C'.
If i write code as above it is giving four sales orders which one of them is master sales order no!
Thanks,
Deep.
03-18-2008 9:31 AM
Hello
The document flow can be read using function module RV_ORDER_FLOW_INFORMATION. Set:
COMWA-VBELN = <delivery number>
Use all default values except NACHFOLGER = ' ' because you want to read the "upstream" document flow, i.e. the sales order.
Regards
Uwe
03-18-2008 9:51 AM
Hi Schieferstein,
I have used above F.M with delivery no.
I have got all sales orders. Now i need to find master sales order how to find!
Thanks,
Deep.
03-18-2008 9:53 AM
Hi,
I got the answer.
We have to pick up record(VBELN) where VBELV is initial.
Thanks a lot Schieferstein.
Thanks,
Deep.
03-20-2008 10:01 AM
Hi All,
From Above F.M RV_ORDER_FLOW_INFORMATION if we get multiple sales orders whose VBELV value is initial.
Then how can we know which one is Master Sales Order/Base Sales Order!
Can anybody have the solution for the same!
Is ther any other way/F.M!
Thanks in advance.
Thanks,
Deep.