cancel
Showing results for 
Search instead for 
Did you mean: 

Capturing Sales invoice no from PO number

Former Member
0 Kudos

Dear Gurus,

I'm writing a report to capture the invoice details (invoice no, sales order no etc...) when the PO no is entered as an input parameter.

pl help...

Tks

Amilachins

Edited by: amilachins on Jul 23, 2009 12:07 PM

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member184555
Active Contributor
0 Kudos

Hi

Use the table VBAK to get the sales order number (VBAK-VBELN) using the Customer PO value (VBAK-BSTNK). Pass the VBAK-VBELN values to VBFA table and get all the details of the subsequent or preceeding documents.

Thanks,

Ravi

Former Member
0 Kudos

Table VBFA is the table linking preceeding and subsequent document. The PO number will be available at Sales Order level to link PO and Sales Order and through Sales Order, you will have to link Invoice number, where Sales Order number will be the common link point.

Regards,

Rajesh Banka

Former Member
0 Kudos

Hi There,

I have few doubts regarding your requirement....

1. As PO number in sales order is text field, so how you can input this and get subsequent doc?

2. If its STO or intercompany

In the later case

You have to use these tables...

1. EKKO - Purchase document Header

2. EKPO- Purchase document Item

3. LIKP - Delivery Header

4. LIPS - delievry Item

5. VBRK - Billing HEader

6. VBRP - Billing Item

Let us know if your requirement is different than this.....

Thanks,

Raja

Former Member
0 Kudos

hi Raja,

well, we have an external system integrated to SAP. A unique no will be generated from the system and it is saved in the PO feild.

Further, sales order, delivery and invoice no will be generated. So, my requirement is to capture the invoice details when user enters the external system no ( which is in the PO Field) in a report.

Tks

Amilachins

Former Member
0 Kudos

HI

Pass your PO number as VBKD-BSTKD. table VBKD field BSTKD and fetch VBELN.

Pass this VBKD-VBELN to VBFA table as VBFA-VBELV and fetch VBFA-VBELN where VBTYP_N = 'M'.

Former Member
0 Kudos

Hi,

Which PO number you are referring to.... is the Stock Transfer PO, or Individual PO scenario or just the PO number on the Sales order..Kindly clarify.

Thanks,

MG

Former Member
0 Kudos

hi .

it is just the PO no in the sales order

Former Member
0 Kudos

Hi,

If it is the field in the sales order, then you cant get the PO number from the VBFA table.

Got VBFA table and give the sales order number and you can execute it, then you willl get the Billing document numbers with the Document category M.

Hope it is clear.

regards,

santosh

Former Member
0 Kudos

Hi

Use VBELN and VBELV fields of VBFA table.

Edited by: Yadav on Jul 23, 2009 12:11 PM