Application Development 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: 

How to restrict posting of an invoice against PO if invoicing is already done

sakshi_sawhney
Participant
0 Kudos

Hi,

The scenario is The invoice creation is and parking is being handled via Interface where vendor details , PO Number and invoice amount (Header) is passed.

I am using bapi_incominginvoice_park to park the invoice.

For the invoice line items amount and quantity , the calculation is being handled through PO history table : EKBE.

The Issue is , if the same PO is passed through Interface twice , the Invoice takes into account the amount and quantity again.

How can i restrict taking into account the quantity and amount already invoiced?

As i have a workflow attached which is linked with Invoice Park Event : (BUS2081 - Parked) So as soon as an invoice is parked a workflow is triggered and if the balance is within tolerance the invoice gets posted automatically through post bapi..

Issue is : Multiple invoice can be posted for the same PO which may lead to paying vendor for same PO more than one.

Would be grateful if someone could guide on how can this situation be avoided.

5 REPLIES 5

freek_cavens2
Participant
0 Kudos

Hi Sakshi,

I think there are multiple options you can try :

  • You can try BADI INVOICE_UPDATE.  This has different methods, where you can perform additional checks.  You could write some logic here to prevent the invoice from parking/posting.
  • You can change the workflow.  Create a ZBUS2081 object (be certain to use delegation) and add an additional method where you perform your checks.  Then call this method in your workflow before you post the invoice and add the desired action (some kind of alert/deletion of the parked invoice).

For more information about copying a business object, this is quite a good explanation :

http://scn.sap.com/thread/427024

Regards,

Freek

Former Member
0 Kudos

HI,

check the PO and PO line item number from table RSEG. if value exist then show error message.

Regards,

Ravi Pratap Singh

sakshi_sawhney
Participant
0 Kudos

Hi ,

But how can i add check , like on which basis.

@ Ravi - Entry in rseg can also be for a PO invoice which is currently on hold and also if invoicing done ealrier is partial for a PO , and then again invoice is requested how can this be handled.

0 Kudos

Hi,

For PO based invoice verification, system generates one invoice item in the item list for each PO item.The system propose the qty to settle as the differance between the total delivered qty and the total invoice qty.This means that partial deliveries for a PO item are not flagged as individual invoice items.It makes no differrance wheather you make the allocation using a PO or a delivery note.If you make the allocation with a delivery note system determine the relevant po items with their total quantities to settle --in the same way as if there was a reference to the PO.The system does not only propose the qty from the allocated delivery note.

If there are several goods receipts and invoices for a  po item , the PO history does not tell you which invoice cam e from which vendor.

Q: also if invoicing done ealrier is partial for a PO , and then again invoice is requested how can this be handled

Ans: If invoicing  done partially then when you are doing invoice again this will bring you the remaining quantity pending for Invoicing automatically.

Ex: if PO of 15 quantity and you first invoiced 10 qty and then if you aging go for invoice for the same po and same material ... it will show you only remaining qty 5.

0 Kudos

Hi,

Using BAPI BAPI_PO_GETDETAIL1 you can get the totals of the PO item history (in tables parameter POHISTORY_TOTALS).  This contains the total invoiced and delivered quantity and value for a po and for each item.  This way you can see if 100% has already been invoiced or not.

You can also calculate the values yourself, using table EKBE.

Regards,

Freek