‎2007 Apr 03 3:33 PM
Hi All,
I am writing one program to post two FI documents simultaneously.Either post all or nothing.Fo rthat i have created Z one function module in update task and calling the function module two time in update task. After that i am writing the commit work.If second one contains error then it is posting first document but giveing updation termination for the second one. But i dont want to post any of the document if anyone contains error. Please suggest me .
How can i proceed further.
Thanks a lot
Lincon
‎2007 Apr 03 3:42 PM
Hi Lincon,
How are you posting the FI documents? Using a BAPI or ?!? In case you are using a BAPI, then please check in the import parameters for an option like NO_COMMIT, if it exists, please pass 'X' to it. What it will ensure is the DB update wont happen until you call BAPI_TRANSACTION_COMMIT, on second thoughts, if you are using a BAPI, it wont write to DB until you call the above FM. Hence do let me know whether u are using BAPI's and if not try finding a suitable BAPI from transaction BAPI.
Regards,
Aditya
‎2007 Apr 03 3:42 PM
Hi Lincon,
How are you posting the FI documents? Using a BAPI or ?!? In case you are using a BAPI, then please check in the import parameters for an option like NO_COMMIT, if it exists, please pass 'X' to it. What it will ensure is the DB update wont happen until you call BAPI_TRANSACTION_COMMIT, on second thoughts, if you are using a BAPI, it wont write to DB until you call the above FM. Hence do let me know whether u are using BAPI's and if not try finding a suitable BAPI from transaction BAPI.
Regards,
Aditya
‎2007 Apr 03 3:49 PM
Hi Aditya,
No i am using the function module AC_DOCUMENT_DIRCT_INPUT for posting the FI document. Actually i am calling this function module in the Z function module in update task.I am calling the function module in the Z report two times and after that i am doing the commit work.So if error is there in second one it is posting first one and Termination for second one. So can i rollback the work after the commit ar any way to do it.
Please suggest.
Thanks
Lincon
‎2007 Apr 03 4:40 PM
Hi Lincon,
What you can do is call both FMs in TESTRUN (I_TESTRUN = 'X') mode and only if both are successful then call them in actual mode. Hence in this way you can prevent a false update.
-Adi
‎2007 Apr 03 5:00 PM
Hi Aditya,
I have cotrolled by checking the test run flag. I solved my problem.
Thank you very much.
Lincon