01-13-2017 12:43 PM
Hello Team,
I am doing changes in sales order user exit. Here interesting point is that I call one FM to get some data.
If i don't call FM, then roll back works and delivery is not created.But when I call FM then Rollback does not happen.
I have tried using Rollback work and bapi_transcation_rollback.
Please suggest some hints.
Regards,
Shiv.
01-13-2017 12:54 PM
I seem to remember @Horst_Keller mentioning the fact that there is an implied commit work when a work area is rolled out. I've tried finding this again but no luck. Perhaps Horst can dig it up for you.
01-13-2017 4:16 PM
01-16-2017 12:02 PM
01-17-2017 5:44 AM
Thanks Richard and Horst.
Thanks for sharing link. Reason to use this in userexit_save_document that delivery number is generated which we need to pass to web service.
in userexit_save_document_prepare ,Delivery number is not generated. So please suggest is there any possiblity further.
01-17-2017 11:34 AM
Off the top of my head I would suggest peeking (ie reading but not updating) at the next number in the relevant number range, calling your third party service and if that is not ok abandon the delivery. All of this can be done in save_document_prepare.
Rich
01-13-2017 1:12 PM
If i don't call FM, then roll back works and delivery is not created.But when I call FM then Rollback does not happen.
Without "relevant" code snippet it is not possible to analyse if any implicit commit is triggered. If you want concrete answers, then post the code snippet.
BR
Suhas
01-13-2017 4:01 PM
Code logic follows as
I am in Userexit_save_document where I am doing coding inside one FM. Here Reason to do coding that Delivery number is determined here which we need to send to third party and get the response from there.
So I am calling Webservice FM here and checking if there is error message returns then I need to rollback which means no delivery creation.
Call FM 'ABC'
export = im_request
import = ex_response.
If Ex_response-error is not initial.
rollback work.
endif.
If I comment CALL fm and just do rollback work then delivery is not created. But with FM, delivery is created with rollback work also.
Please suggest.
With regards,
Shiv
I
01-13-2017 7:34 PM
Hello,
User-Exit "userexit_save_document" is part of what program : SAPMV45A ?
Is it called during transaction VA02 ?
Can you show us a ScreenShot of your code (that is in the user exit) ?
BR.
01-16-2017 12:06 PM
You should not be doing a rollback work inside a user exit. Use Save_Document_Prepare Instead and then (I think) issue an 'E' message.
01-16-2017 1:50 PM
Shiva,
What is the input and what is the output from the FM through which you calling a webservice ? What else is checked within that FM to determine whether it is a Success or Failure.Based on that, may be you can get more appropriate suggestions relevant to your requirement.
K.Kiran.
01-27-2017 5:56 AM
@Richard,
Thanks for your response. We can not do coding in save_document_Prepare as delivery number is not determined yet which we need to send it to third party.
@All, Please suggest if problem of this solution is feasible .