Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with BAPI_ACC_ASS_TRANSFER_POST (when trying to execute as per ABT1N)

Former Member
0 Kudos

Hello experts,

I have developed a new ABAP program that is going to perform the mass transference of old assets to new assets, based on an input file.

I have applied the BAPI_ACC_ASS_TRANSFER_POST function module instead of using a call transaction in ABT1N transaction as per SAP recommendation. It works perfectly for most of the cases.

But there is a case that is not working for the following scenario:

- First of all, make a posting with no new acquisition (filling up the table TRANSRETIREMENTDATA with the field NEW_ACQ_IN = u2018u2019 - blank);

- and after with a new acquisition (filling up the table TRANSRETIREMENTDATA with the field NEW_ACQ_IN = u2018Xu2019).

Example:

u2022 First movement: Posting from asset 612/0, company code 5837, as a u201CPartial transferu201D u2013 Prior-year acquis. See ABT1N transaction for further details.

u2022 Second movement: Posting from asset 612/0, company code 5837, as a u201CPartial transferu201D u2013 From curr.-yr acquis. See ABT1N transaction for further details.

If you perform both situations in the same execution, with the normal transaction you will get the documents correctly. But if you perform the same cases with the BAPIs, you will get a strange line in the second movement (that can be seen at AW01N transaction - Asset Explorer). The second movement gets the line posted in the first and duplicate the amounts for the asset.

Has anyone seen something like this before?

Kind Regards,

Daniel.

1 REPLY 1

daniel_carvalho
Active Contributor
0 Kudos

Hi Experts,

The problem has been solved. The following function modules should be executed before calling up the mentioned BAPI function module:


    call function 'ACC5_TRANSFER_INDICATOR_SET'
      exporting
        if_transferac = space.

    call function 'AMSS_DATA_BUFFER_FILL_OR_READ'
      exporting
        i_xrefresh = 'X'.

    call function 'AMBU_GLOBAL_TABLES_REFRESH'.

    call function 'AMSP_GLOBAL_TABLES_REFRESH'
      exporting
        i_xallt = 'X'.

Regards,

Daniel