cancel
Showing results for 
Search instead for 
Did you mean: 

How to avoid create a SD billing document?

Former Member
0 Kudos

Hi experts:

I need a customizing tip or user exit or routine to avoid create a billing document in SD if can´t create the accounting documents.

We used the BADI SD_CIN_LV60AU02, but it was implemented incorrectly. I´m finding another solution.

Please if anyone know or have a tip I will be very thankful.

My mail is ginoplis@hotmail.com

Thanks.

Best Regards,

Gina Marí

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

There is no standard way to control that Billing & Accounting happens together. It may be tried using a user exit & still not sure that requirement can be met.

Regards,

Rajesh Banka

former_member217082
Active Contributor
0 Kudos

Hi Gina

Can u tell the scenario first and can i know why you want to avoid the sd billing document?

plz let me knw gina

Thanks and Regards

Srinath

Former Member
0 Kudos

Hi:

Thanks for your quickly response.

I need to avoid the creation of billing document for example when I have an error in accounting interface because the account determination is incorrect or because the period was closed or is not open yet. I know you can change the Account assignment group for the material in order to force it, but in this case the problem is caused by sales area. The materials are created in all sales areas but only determinate account with one or two, The client blocked some materials but they have a lot.

Then they create a lot of billing documents because they use IS-U. SD is integrated with FI-AR and FICA and make many mistakes with the period. I don´t know why but this error is very common.

I hope you know some solution for this.

Thanks

Best Regards

Gina

Former Member
0 Kudos

HI Gina,

So if I understand correctly from your second statemnet, you need to stop creation of billing documents if the account determination is incorrect.

So the recommended solution would be to do the check on account determination and other criteria like acounting period open and other checks in the current BADI you are already using. This BADI(or if required and user exit) should be called before you start creating the billing document. So this means you are checking for "correct accounting information" before you even start creating the billing document.

SO what will happen that if you account determination is giving an error or accounting periods are not open then you billing log will give you an error. The function module needed would be standard and would be easily picked.

Hope this helps.

Abhishek

Former Member
0 Kudos

Thanks. If I understand, I need to put all the situations for can´t created the billing document in the BADI.

Now the logical only read table VBRK and if the field RFBRK have the value different to "C" will show the message e001(zsd020) correctly, but then show the message "Document 90538875 has been saved" and if you see the table VBRK the document 90538875 doesn´t exist and show a dump SAPSQL_ARRAY_INSERT_DUPREC

Because this, I asked for another solution, but for your answers I think is the only one.

30 METHOD if_ex_sd_cin_lv60au02~excise_invoice_create.

31 DATA: w_xvbrk TYPE vbrkvb.

32 * Sólo ejecutar BADi para transacción ZVF01 Y VF01.

33 IF sy-tcode = 'ZVF01' OR sy-tcode = 'VF01' .

34 READ TABLE xvbrk INDEX 1 INTO w_xvbrk .

35 IF w_xvbrk-rfbsk NE 'C'.

36 MESSAGE e001(zsd020) .

37 ENDIF.

38 ENDIF .

39 ENDMETHOD.

Thanks

Best Regards

Gina

Former Member
0 Kudos

HI Gina,

I think you have misunderstood.

The code you have showed is when you have created and saved the invoice.

But mine is one step earlier, before going into Function module of creating the invoice, you will have to do another Function module where in you check wether the account determination is not giving error, time period is open or not.

So its a sort of check you do before enter the Function module of invoice creation.

So in my logic you dont read the VBRK table, you just use the existing function module of account determination on the data stored in internal tables, use it to see, wether account determination gives error. If it gives error you dont create the invoice.

If it doesnot give the error go ahead check for open period and so on.

This way you will know if invoice will generate the error even before the invoice is created.

Hope this helps,

Abhishek