Application Development 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: 

Use commit when calling RFC in enhancement

bin-general
Discoverer
0 Kudos
580

HI!

When I use MIGO~MB_DOCUMENT_BADI~MB_DOCUMENT_BEFORE_UPDATE,

CALL RFC:

CALL FUNCTION 'ZSD_MIGO' STARTING NEW TASK 'NONE' DESTINATION lv_system
   TABLES
      t_item = lt_item.

AND I Need to store log tables in RFC: ZSD_MIGO. When not using COMMIT WORK, there is no guarantee that data will be saved to the log table every time. Can I use COMMIT WORK in RFC when enhancing it?

8 REPLIES 8

Sandra_Rossi
Active Contributor
0 Kudos
415

Did you try it?

bin-general
Discoverer
0 Kudos
415

Hi Sandra,
Yes, I have tried and there were no mistakes. But I'm not sure if doing so will affect the use of the tcode MIGO.

Sandra_Rossi
Active Contributor
415

Thanks. So it works as you wish, but you're asking for general recommendations about asynchronous and MIGO.

This kind of solution may not be good because of the LUW concept. You should commit all data which are interdependent at the same time (save all or none). Data committed in RFC and data committed in MIGO are not linked, so you'll get save partially instead of save all or none.

But maybe you don't mind having data saved by RFC (in ZSD_MIGO) while data is not saved by MIGO (RBKP, etc.) and vice versa.

bin-general
Discoverer
0 Kudos
415

Thank you. I see your point,thank you for your answer

matt
Active Contributor
0 Kudos
415

For logging, rather than use an RFC you could a service connection

INSERT demo_update CONNECTION R/3*service_conn
  FROM @( VALUE #( id = 'X'  col1 = 1 col2 = 2 col3 = 3 col4 = 4 ) ).
COMMIT CONNECTION R/3*service_conn.

Sandra_Rossi
Active Contributor
415

NB: updating via a secondary database connection is exactly the same question, they are both completely independent: the primary commit won't commit the secondary database updates and vice versa.

chaouki_akir
Contributor
0 Kudos
415

What do you have in lv_system ? Is it really an other SAP system ?

bin-general
Discoverer
0 Kudos
415

HI!The lv_system is not an other SAP system,Is the current system.The use of lv_system is to avoid permission verification