Skip to Content
-3

Rollback work is not working after calling function in user exit

Jan 13, 2017 at 12:43 PM

155

avatar image

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.

10 |10000 characters needed characters left characters exceeded

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

1

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

0

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.

0

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.

0

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.

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Richard Harper Jan 13, 2017 at 12:54 PM
0

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.

Show 4 Share
10 |10000 characters needed characters left characters exceeded

That's how it is and can be found here

0

Thanks Horst

1

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.

0

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

0
shivshanker agrawal Jan 27, 2017 at 05:56 AM
0

@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 .

Share
10 |10000 characters needed characters left characters exceeded