05-05-2010 6:11 PM
Hi SDN,
In mode test (without commit work): Is it necessary to perform BAPI_TRANSACTION_ROLLBACK, after calling the BAPI?
In this case BAPI_ASSET_RETIREMENT_POST
in what circumstances?
Even without commit, the number range FI_DOCUMNT was used.
Best regards,
Maria João Rocha
05-05-2010 6:28 PM
The BAPI transaction model must afford the user explicit transaction control. Therefore, if several BAPIs are called together, the caller can decide him/herself when to execute a COMMIT WORK (or, as the case may be, a ROLLBACK WORK). This means that BAPIs themselves cannot (generally) execute a COMMIT WORK command.
Source: help.sap
Hope this link helps you to get answer to your question:
Edited by: Mishra.Manas on May 5, 2010 7:31 PM
05-05-2010 6:28 PM
The BAPI transaction model must afford the user explicit transaction control. Therefore, if several BAPIs are called together, the caller can decide him/herself when to execute a COMMIT WORK (or, as the case may be, a ROLLBACK WORK). This means that BAPIs themselves cannot (generally) execute a COMMIT WORK command.
Source: help.sap
Hope this link helps you to get answer to your question:
Edited by: Mishra.Manas on May 5, 2010 7:31 PM
05-05-2010 6:37 PM
Hi,
In this case I have a program that calls BAPI_ASSET_RETIREMENT_POST, for each record in a file (excel).
The question is; as the BAPI_ASSET_RETIREMENT_POST has not the commit work inside, must be the program that class the bapi to execute the commit. So i put an option on the selection screen "test mode" and the program in this case calls the bapi BAPI_ASSET_RETIREMENT but doesn't commit, just whe the option "test mode" is not checked.
The problem is that several numbers int the number range FI_DOCUMNT are lost.
Must I execute BAPI_TRANSACTION_ROLLBACK, on this test mode?
Regards,
Maria João Rocha
05-05-2010 7:07 PM
> The problem is that several numbers int the number range FI_DOCUMNT are lost.
> Must I execute BAPI_TRANSACTION_ROLLBACK, on this test mode?
Have you tried it ? Is this not working ?
I think this should answer your queries:
DATA v_num TYPE anln1.
CALL FUNCTION 'NUMBER_GET_NEXT'
EXPORTING
nr_range_nr = `01`
object = `ANLAGENNR`
subobject = `0001`
IMPORTING
number = v_num
EXCEPTIONS
interval_not_found = 1
number_range_not_intern = 2
object_not_found = 3
quantity_is_0 = 4
quantity_is_not_1 = 5
interval_overflow = 6
buffer_overflow = 7
OTHERS = 8.
IF sy-subrc = 0.
WRITE / v_num.
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ENDIF.
Edited by: Suhas Saha on May 5, 2010 11:53 PM
05-05-2010 7:07 PM
Hi,
Even if you use ROLL BACK, i think your number range wont be reverted. But can you give a try and see what happens?
Thanks,
Vinod.
05-06-2010 9:51 AM
Hi,
Thanks for your replies.
I delivered the program for testing to our KUser on AM module.
I hope that BAPI_TRANSACTION_ROLLBACK results, because FI number range can not be lost; the numbering must be sequential.
At the worst, I will cancel the test mod option.
Best Regards,
Maria João Rocha
05-06-2010 2:38 PM
Hi,
It worked with BAPI_TRANSACTION_ROLLBACK - the number range is not used.
In this case when "test mode" is used the number of the FI document is always the same. I think, problably when the bpi retuns warning this also prevent the namber usage.
The bapi documentation should refer this point, wich is very important on FI number range.
Thanks.
Maria João Rocha