‎2006 Nov 02 1:02 PM
Hello !
I´m using
MF BAPI_REQUISITION_RELEASE
. my question is: it is necessary to executeBAPI_TRANSACTION_COMMIT
if the execution was ok, or executeBAPI_TRANSACTION_ROLLBACK
if the execution wasn´t ok?in synthesis, this good to do this?
CALL FUNCTION 'BAPI_REQUISITION_RELEASE' + Parameters.
if sy-subrc = 0.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' + Parameters.
else.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK' + Parameters.
endif.
‎2006 Nov 02 1:03 PM
hi,
With BAPI_TRANSACTION_COMMIT ..the external systems have a way of deciding on whether to
Commit or to Roll back Changes.
But with Commit Work u have to code it inside ure BAPI and the outside systems then have no chance or have
any hold over the commit...
so i guess the diff lies more in the way how u want to call commit ,either from outside or from within ure BAPI.
u can use both...
SAP though recommends using BAPI_Transaction_Commit and not using Commit_work in the BAPI...
but its upto u and ure middleware guy to decide how u want to do it..
ys u r dong correct.
rgds
anver
Message was edited by: Anversha s
‎2006 Nov 02 1:06 PM
Hi,
It not necessary to execute BAPI_TRANSACTION_COMMIT if the execution was ok, or execute BAPI_TRANSACTION_ROLLBACK if the execution wasn´t ok?
before compelting the execution of FM 'BAPI_REQUISITION_RELEASE' the commit work will be performed.
Regards,
Satya.
If the FM 'BAPI_REQUISITION_RELEASE' execution is unsccessful the as per the requirement you have to give some popup and report display.
Message was edited by: Satyanarayana Sayana
‎2006 Nov 02 1:07 PM
Hello Fernando:
yes you are rigth...
but do it better this way:
LOOP AT tbl_msg WHERE type CA 'EAX'. EXIT. ENDLOOP.
IF sy-subrc NE 0.
LOOP AT tbl_msg WHERE type CA 'ISW'. EXIT. ENDLOOP.
ENDIF.
IF tbl_msg-type CA 'ISW '.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
ENDIF.
The bapi will not work until you commit, so you wont have to roolback.
Dont forget to reward!!
Gabriel
‎2006 Nov 23 7:54 AM
hi,Gabriel :
according you answer, the BAPI will not change the DB after the program does complete when we do not commit. Yes?
‎2006 Nov 24 6:48 AM
Helllo Edgar,
Sorry for the delay,
Yes, the db will be only changed when you call the commit, if you dont do it, wont change it.
Greettings,
Gabriel P-
‎2007 Feb 06 4:02 PM