cancel
Showing results for 
Search instead for 
Did you mean: 

Breakpoint Before Saving Billing Document

Former Member
0 Kudos

Hi,

I have a query as I have multiple delivery documents and I am going to create single billing document against delivery documents.

Here I want to check whether all delivery document have same Sold to Party (LIKP_ KUNAG) and Ship to Party (LIKP_ KUNNR) before Billing document is created.

Pls let me know if there is any standard user exist for the same.

Regards

Rajat

Accepted Solutions (1)

Accepted Solutions (1)

jignesh_mehta3
Active Contributor
0 Kudos

Hello,

USEREXIT_FILL_VBRK_VBRP (Module pool SAPLV60A, program RV60AFZC)

This User Exit is called when Billing Document is created.

In this exit you can add your ABAP code which will check Sold-to-Party & Ship-To-Party in all the Deliveries & only then proceed to create Invoice.

Hope this helps,

Thanks,

Jignesh Mehta

former_member182378
Active Contributor
0 Kudos

Jignesh,

could you explain what could happen by using this userexist (& code)?

e.g. after checking 100deliveries, then what?

thank you, in advance; for helping me in the learning process!

jignesh_mehta3
Active Contributor
0 Kudos

Refer the requirements.

The ABAP Code will check whether Sold-to-Party & Ship-to-Party are same in all the Deliveries. If yes only then it will allow to create Invoice. If they are not same, it can give a mesage & exit the VF01 Transaction.

Hope this helps,

Thanks,

Jignesh Mehta

PS: Typewriter, what is your real name?

Former Member
0 Kudos

Hi Jignesh,

Thanks for your help. This user exit is triggering. but which structure or table will store the deliveries for all the entries (Entered in VF01). So that I will be able to check sold to party for all deliveries entered one by one.

Regards,

Rajat

jignesh_mehta3
Active Contributor
0 Kudos

Hello,

Please take help of your ABAPer.

He can easily create Temporary tables & feilds to storre date from VF01 input screen & process the data (that is comparision of Sold to & Ship to Parties). Data can be easily fetched from LIKP, LIPS, VBAK & VBAP & necessary Partner Functions can be compared.

I will involve writing a ABAP code of many lines, which I or you cannot write. It is best done by a ABAPer.

Hope this helps,

Thanks,

Jignesh Mehta

former_member182378
Active Contributor
0 Kudos

Hi Rajat,

to clarify before creating an invoice you want system to check the deliveries and select those deliveries that have the same SP and SH and then create a single billing document for them. Is my understanding correct?

as I suggested, filtering on SP is standard functionality in VF04.

maybe i am not understanding some key point, pertaining to your business requirement.

please clarify, many thanks!

Answers (3)

Answers (3)

Jelena
Active Contributor
0 Kudos

As correctly pointed out before, it's not feasible to combine the deliveries with different Sold-to on one invoice. So no need to worry about checking that.

Standard functionality is to combine the multiple orders/deliveries into one billing document, unless header data is different or unless specified otherwise. Since it seems that the requirement is to have separate invoices by Ship-to then this may be achieved by using VOFM routine in Data Transfer. There is the routine #1 with an example of how to split the invoice. There are also many SDN posts already regarding the document split or combination.

I really don't see a point or doing this the other way around and placing some error message in a user exit. This would also affect negatively the batch invoicing capability in VF04.

Former Member
0 Kudos

Thanks Jelena Perfiljeva and Jignesh.

Regards

Rajat Bhargava

Former Member
0 Kudos

Thanks for an update.

Former Member
0 Kudos

Hi,

(Start by taking /) Take a look at SAP Note 177664 - Billing split due to VBPA-ADRNR or VBPA-ADRDA

Regards,

Jan Pel

former_member182378
Active Contributor
0 Kudos

What about using VF04 and giving for Sold To party, the billing duelist shall contain all the deliveries ready for billing from that SoldTo only.

Furthermore, if you want to create single billing document, it is NOT possible with deliveries from different SoldTo parties, as SP is a header partner function in the billing doc.