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

Problem in fetching invoice data from VBRK table.

Former Member
0 Likes
639

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.

3 REPLIES 3
Read only

GauthamV
Active Contributor
0 Likes
544

hi,

use this link between sales order and invoice.

VBRP-AUBEL = VBAK-VBELN

VBRP-AUPOS = VBAP-POSNR.

Read only

Former Member
0 Likes
544

HI,

You can relate the PO or SO to invoice from the table VBFA.

Regards,

Anand.

Read only

Former Member
0 Likes
544

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.