03-08-2007 5:21 AM
Hi,
I have an order with one item ( VBAP)
2 schedule lines in VBEP for the same item.
3 deliveries in LIPS for that item.
i want to display order with items, item schedule lines, deliveries if any.
How do i ralate these 3 tables ? or is there other solution?
Thanks,
M B
03-08-2007 5:43 AM
Simple, order and delivery are related at the item level, this is because order items from one sales order can goto multiple deliveries, so the delivery items refer the sales order items.
In particular, this is your answer
Method 1.
Join VBAP, VBEP via fields VBELN, POSNR
Join VBEP, LIPS via LIPS-VGBEL = VBEP-VBELN and LIPS-VGPOS = VBEP-POSNR.
Method 2.
You can use document history table VBFA
Join VBAP, VBEP via fields VBELN, POSNR
Join VBEP, VBFA via VBFA-VBELV = VBEP-VBELN and VBFA-POSNV = VBEP-POSNR
Join LIPS, VBFA via LIPS-VBELN = VBFA-VBELN and LIPS-POSNR = VBFA-POSNN
You can also specify VBFA-VBTYP_N = 'J', if they are normal outbound deliveries
03-08-2007 5:29 AM
v have vbeln as key for vbap - get the item data
use vbeln and posnr to get schedule lines from vbep
use the vbeln and posnr to get the deliveries....
store all these in an internal table and display....
hope this helps
> Hi,
>
> I have an order with one item ( VBAP)
> 2 schedule lines in VBEP for the same item.
> 3 deliveries in LIPS for that item.
> i want to display order with items, item schedule
> lines, deliveries if any.
> How do i ralate these 3 tables ? or is there other
> solution?
>
> Thanks,
> M B
hi
u can relate these tables with the key vbeln...and fetch the details
03-08-2007 5:33 AM
Hi M B,
Those 3 tables (VBAP, VBEP and LIPS) have 2 common key fields: VBELN and POSNR. These key fields may help you to relate the tables.
Hope it helps!
03-08-2007 5:33 AM
Hi M.B,
Please try this:
VBAP=Sales Document: Item Data
VBEP=Sales Document: Schedule Line Data
LIPS= SD document: Delivery: Item data
U can relate the tables like this,
VBAP-VBELN = VBEP-VBELN
VBAP-MATNR = LIPS-MATNR
Regards,
Ramganesan K
03-08-2007 5:36 AM
Hi ,
Use Function module
RV_ORDER_FLOW_INFORMATION enter order number and item number you will ger everything .
Please reward if useful.
03-08-2007 5:38 AM
hi,
refer to this
select vbeln posnr
from vbap
into corresponding fields of table i_vbap.
select vbeln posnr
from vbep
into corresponding fields of table i_vbep
for all entries in i_vbap
where vbeln eq i_vbap-vbeln
and posnr eq i_vbap-posnr.
select vbelnr posnr
from lips
into corresponding fields of table i_lips
for all entries in i_vbep
where vgbel eq i_vbep-vbeln
and vgpos eq i_vbep-posnr.
03-08-2007 5:40 AM
MB
-
SELECT VBAPPOSNR VBAPVBELN VBEPPOSNR VBEPVBELN LIPS~POSNR
LIPS~VBELN
INTO (VBAP-POSNR , VBAP-VBELN , VBEP-POSNR , VBEP-VBELN , LIPS-POSNR
, LIPS-VBELN )
FROM ( VBAP
INNER JOIN VBEP
ON VBEPPOSNR = VBAPPOSNR
AND VBEPVBELN = VBAPVBELN
INNER JOIN LIPS
ON LIPSPOSNR = VBEPPOSNR
AND LIPSVBELN = VBEPVBELN ).
ENDSELECT.
Pls. rewardx if useful
03-08-2007 5:40 AM
Hi
Just see the table of VBFA table and pass your Order number to VBELV and get the preseding document number VBELN for the order and also check the flag for delivery.
Hope It Helps you.
Regards,
Hiren Patel
03-08-2007 5:43 AM
Simple, order and delivery are related at the item level, this is because order items from one sales order can goto multiple deliveries, so the delivery items refer the sales order items.
In particular, this is your answer
Method 1.
Join VBAP, VBEP via fields VBELN, POSNR
Join VBEP, LIPS via LIPS-VGBEL = VBEP-VBELN and LIPS-VGPOS = VBEP-POSNR.
Method 2.
You can use document history table VBFA
Join VBAP, VBEP via fields VBELN, POSNR
Join VBEP, VBFA via VBFA-VBELV = VBEP-VBELN and VBFA-POSNV = VBEP-POSNR
Join LIPS, VBFA via LIPS-VBELN = VBFA-VBELN and LIPS-POSNR = VBFA-POSNN
You can also specify VBFA-VBTYP_N = 'J', if they are normal outbound deliveries
03-08-2007 5:47 AM
Hi MB,
You can find all these details in <b>VBFA</b> table,
to find schedule lines u can use VBAP s entries as preceeding doc details, and can get succeeding doc.(VBEP) details.
then preceeding doc detials as VBEP entries and can get succeeding doc. details as LIPS.
in all the cases give the document category as an important entry.
Regards,
Sujatha.