2024 Mar 14 7:39 PM
Hi experts,
How do I "reset" the BAPI_FIXEDASSET_CREATE1 function module between executions?
I am creating a number of assets via BAPI_FIXEDASSET_CREATE1 FM via a loop successfully, until I turn on asset synchronisation.
To test the error handling, I have created one bad equipment category configuration (linked to an asset class) which must fail. The issue is that all subsequent BAPI_FIXEDASSET_CREATE1 executions after that first failure fail with the same error code even though the data for subsequent executions is different.
Asset Class | Result | Error |
1 | Success | |
1 | Success | |
2 | Failure | A - ITOP error |
1 | Failure | A - ITOP error |
1 | Failure | A - ITOP error |
I am clearing AND refreshing all input structures at the end of the FM execution in the loop. I am using both a BAPI_TRANSACTION_COMMIT and a COMMIT work.
How do I loop through multiple executions of BAPI_FIXEDASSET_CREATE1 (with equipment sync) and resetting the FM between executions?
Thanks
2024 Mar 15 9:51 AM
Did you look for OSS notes relevant for your versions (notes such as 2999629 - Japan: CSMD - Time-dependent Fields Are Incorrect When You Execute BAPI_FIXEDASSET_CREATE1... )
if you don't find any suitable notes, you could try to execute the BAPI in another session
* Execute in a separate session
CALL FUNCTION 'BAPI_FIXEDASSET_CREATE1'
DESTINATION 'NONE'
" (...)
TABLES
return = lt_return.
* Commit the changes within this session
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
DESTINATION 'NONE'
EXPORTING wait = 'X'.
* Close the session.
CALL FUNCTION 'RFC_CONNECTION_CLOSE'
EXPORTING destination = 'NONE'
EXCEPTIONS OTHERS = 0.
So no data will be shared between successive calls due to explicit close.
2024 Mar 15 10:58 AM
Thanks @raymond_giuseppi . I did a scan of notes, but didnt look at that one.
RFC disconnect. Interesting. Let me try that.