12-24-2009 2:51 AM
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.
12-24-2009 4:07 AM
I think you need to change your function module to accept 2 records at a time instead of 1 ( to avoid loop)
a®
12-24-2009 4:09 AM
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