BAPI for Unplanned depreciation T-Code ABAA

There is a BAPI which can be used to post the unplanned depreciation in SAP   AMDP_BAPI_CALL_ON_TRANSACTION.

DATA :
lv_code   TYPE syucomm VALUE ‘SAVE’,
ls_raifp2 TYPE raifp2,
lt_raifp2 TYPE TABLE OF raifp2,
ls_raifp3 TYPE raifp3,
lt_raifp3 TYPE TABLE OF raifp3,
lt_return TYPE TABLE OF bapiret2,
ls_raifp4 TYPE raifp4,
ls_raifp1 TYPE raifp1.

ls_raifp1gsvor =
ls_raifp1vorgn ‘AFAP’.
ls_raifp1bwasl ‘650’.
ls_raifp1budat =
ls_raifp1bldat =
ls_raifp1bzdat ‘20181218’.
ls_raifp1waers ‘INR’.   “CURRENCY

ls_raifp2bukrs ‘1000’. “Company Code
ls_raifp2anln1  ‘1100000080’.
*ls_RAIFP2-ANLN2  =          0
ls_raifp2gjahr    ‘2018’.
ls_raifp2monat    ’12’.
ls_raifp2anbtr   ‘1’.
ls_raifp3rtext ‘TEST1’.
APPEND ls_raifp2 TO lt_raifp2.

ls_raifp3xbanl ‘X’.
ls_raifp3rtext ‘X’.
APPEND ls_raifp3 TO lt_raifp3.
BREAK-POINT.
CALL FUNCTION ‘AMDP_BAPI_CALL_ON_TRANSACTION’
*  IN BACKGROUND TASK AS SEPARATE UNIT
EXPORTING
i_raifp1       ls_raifp1
i_awtyp        ‘AMBU’
*   I_AWREF        =
*   I_VORGN        =
*   I_XPOST        = ‘ ‘
i_xdial        
*   I_XWAIT        = ‘ ‘
* IMPORTING
*   E_TXNOK        =
TABLES
t_raifp2       lt_raifp2
t_raifp3       lt_raifp3
*   T_RAIFP8       =
*   T_RAIFP8_LDT   =
*   T_ANEPI        =
t_return       lt_return
*   T_RAIFP5       =
*   T_AREAS_TO_BE_POSTED       =
CHANGING
c_fcode        lv_code
EXCEPTIONS
error_occurred 1
OTHERS         2.
IF sysubrc <> 0.
* Implement suitable error handling here
ENDIF.

BREAK-POINT.
CALL FUNCTION ‘BAPI_TRANSACTION_COMMIT’
* EXPORTING
*   WAIT          =
* IMPORTING
*   RETURN        =
.

 

Leave a Reply

Your email address will not be published. Required fields are marked *