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

Use commit when calling RFC in enhancement

bin-general
Discoverer
0 Likes
2,484

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?

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
Read only

Sandra_Rossi
Active Contributor
0 Likes
2,319

Did you try it?

Read only

bin-general
Discoverer
0 Likes
2,319

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.

Read only

Sandra_Rossi
Active Contributor
2,319

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.

Read only

bin-general
Discoverer
0 Likes
2,319

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

Read only

matt
Active Contributor
0 Likes
2,319

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.
Read only

Sandra_Rossi
Active Contributor
2,319

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.

Read only

chaouki_akir
Contributor
0 Likes
2,319

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

Read only

bin-general
Discoverer
0 Likes
2,319

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