cancel
Showing results for 
Search instead for 
Did you mean: 

how to write error log while creating invoice and avoid implicite commit

Former Member
0 Kudos

Hi,

I've have written code in exit RV60AFZZ in which I check for some possible errors while invoicing via VF01/VF04. If conditions are met then we create error message and display it to the user. As result we had a lot of missing SD invoices in FI when we did batch/mass invoicing. I've opened OSS note and SAP support team wrote that using statement MESSAGE is forbidden in UE. It can lead to implicite commits.

Do you have some example how to write error log for invoincing in VF01/VF04 transactions?

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Brunot
Explorer
0 Kudos

Hi Viktor, i have the exact same problem. How did u solve it?

I am facing a lot of trouble.

Thanks for helping

Former Member
0 Kudos

This message was moderated.

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

Try to do it with VOFM copy requirement in copy rules (tcodes VTFL and VTFA). If you don't have the right VOFM available, create your own VOFM in your range number as a customer taking others as a template.

I hope this helps you

Regards

Eduardo

Former Member
0 Kudos

Thanks but that is not enough in my case. Some data does not exist while copying data from delivery/order to invoice.

For example I'm searching for errors in tax calculation (roudning) which happens just before invoice posting.

Also I've tried to use same logic to post error like in copy requirements (VOFM) and it doesn't work.

former_member217082
Active Contributor
0 Kudos

Hi

Go to VOFM and include the logic in the copying routine which has been maintained in the copy controls.Also try to include the same logic in the billing program of VF01, VF02 and VF03

Regards

Srinath

Former Member
0 Kudos

@ sri nath. Please read post before answering. I wouldn't be posting trivial questions. As I wrote before it doesn't work. Also SAP support would not answer to the question in my OSS.

In VOFM, SAP is using routine VBFS_HINZUFUEGEN_ALLG to write to error log.

Mine is something like this in ue:

PERFORM ZVBFS_HINZUFUEGEN_ALLG

USING VBAP-VBELN VBAP-POSNR 'ZSD' 'E '600'

SPACE SPACE SPACE SPACE.

(we have custom message class)

As result XVBFS and VBSK are filled with error, but posting is also done. Error log is filled but invoice is created and posted in FI.

That is not OK.

thanks

former_member217082
Active Contributor
0 Kudos

Hi

I have not gone through your message because i have replied to your issue before you replied.But when i was giving solution , i forgot to post into the forum.So by the time i posted my solution you have already replied also.

As you have custom message class, so please check with ABAP team and then with SAP support team wheather it will work or not.

Regards

Srinath

Former Member
0 Kudos

Hi,

I've also tried with standard message class. Same result. Message is written to log table and posted to FI. Not good.