Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Commiting two things simultaneously

0 Likes
745

Hi,

I do have a proxy call and table update(using RFC function module) in my program. I want  make it both commit at one time and if any issues happen in either table updation or proxy call both should be rolled back.

My FM is RFC one returning some flag value, I can't make it update FM i believe.

Suggest me some ways

3 REPLIES 3
Read only

Former Member
0 Likes
708

Hi Sujit,

Not sure about the entire scenario, but what i would do is, bring them into one SAP LUW, meaning i will create a new FM/Proxy, and call the current proxy and FM sequentially, and on successful execution of both proxy and FM, i will perform a commit, otherwise i will run a rollback command.


Hope this helps.


Reg

Pras

Read only

0 Likes
708

Hi ,

To elaborate  in program looks like below

call proxy method

if sy-subrc eq 0.

   Call  the FM that updates the DB table,

  if sy-subrc eq 0

       commit work.

  endif.

endif.

(I can't write table modifcation logic inside my program, as there are many other programs doing same this)

I think when the FM call  returns back to my program SAP does a commit itself,I can't rollBack DB entry.so problem happens modification happens first then the proxy is commited.

     

I need both the things to be dependent on each other.

Read only

0 Likes
708

Hi Sujit,

Try to write a new single wrapper FM in the target system, which will have the logic to call the proxy and FM and have a single commit work based on the requirement. Later, you can use the new FM to call from another system using RFC.

There by you achieve dependency and also the rollback on failure.

Regards,

Prasanna