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: 

RFC question

Former Member
0 Kudos

hi,all:

i have a question about RFC calling,please check my coding below:

loop(2 times)

CALL FUNCTION 'ZREM_RECORD_PRE_ENTER'

DESTINATION 'CMS DOC CONNECTION'

end loop.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' DESTINATION 'CMS DOC CONNECTION' or

CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK' DESTINATION 'CMS DOC CONNECTION'.

the result is:only the last one i did created successfully,and i tried change the coding the blow:

loop(2 times)

CALL FUNCTION 'ZREM_RECORD_PRE_ENTER'

DESTINATION 'CMS DOC CONNECTION'

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' DESTINATION 'CMS DOC CONNECTION'

EXPORTING

wait = 'X'.

end loop.

but when the question is how can i rollback the rollback the session(RFC),any one can give me some sugguestion,thxs in advance.

2 REPLIES 2

former_member194669
Active Contributor
0 Kudos

I think you need to change your function module to accept 2 records at a time instead of 1 ( to avoid loop)

Former Member
0 Kudos

Hi ,

Check below code :

loop(2 times)

CALL FUNCTION 'ZREM_RECORD_PRE_ENTER'

DESTINATION 'CMS DOC CONNECTION'

check sy-subrc eq 0

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' DESTINATION 'CMS DOC CONNECTION'

EXPORTING

wait = 'X'.

CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK' DESTINATION 'CMS DOC CONNECTION'.

end loop.

May be is its correct i think . other wise explain.

Regards ,

Shankar GJ