2008 Dec 08 5:42 AM
Hi guys,
I am developing an ABAP program where I have to fetch the invoice data from VBRK and VBRP based on the PO data or SO data in table LIPS. But I am not been able to link the two tables. Can anyone please suggest what are the PO and SO fields in VBRK or how to get the invoice data from VBRK and VBRP based on the Sales Order or Purchase Order number from LIPS. Thanks in advance.
Hi guys,
I am developing an ABAP program where I have to fetch the invoice data from VBRK and VBRP based on the PO data or SO data in table LIPS. But I am not been able to link the two tables. Can anyone please suggest what are the PO and SO fields in VBRK or how to get the invoice data from VBRK and VBRP based on the Sales Order or Purchase Order number from LIPS. Thanks in advance.
2008 Dec 08 5:54 AM
hi,
use this link between sales order and invoice.
VBRP-AUBEL = VBAK-VBELN
VBRP-AUPOS = VBAP-POSNR.
2008 Dec 08 5:58 AM
HI,
You can relate the PO or SO to invoice from the table VBFA.
Regards,
Anand.
2008 Dec 08 6:06 AM
example:-
VBRK & VBRP
select b~vbeln
b~posnr
a~fkdat
a~spart
a~kunag
a~vkorg
a~rfbsk
a~fkart
a~vtweg
a~bzirk
a~kurrf
a~waerk
a~knumv
b~fkimg
b~netwr
b~mwsbp
b~matnr
b~arktx
b~prodh
b~vkgrp
b~ktgrm
b~aubel
b~matnr
into corresponding fields of table itab
from vbrk as a inner join vbrp as b
on avbeln = bvbeln
where a~kunrg in p_cust and
a~fkdat in p_date and
a~spart in p_dev and
a~vkorg in p_vkorg and
a~vtweg in p_vtweg and
a~rfbsk in p_rfbsk and
a~regio in p_regio and
a~fkart in p_type and
b~werks in s_werks and
b~matnr in matnr.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |