Skip to Content
0
Former Member
Jul 06, 2012 at 04:14 AM

BAPI_ACC_GL_POSTING_REV_POST is reversing document based on obj_key

60 Views

Hello all,

I am using BAPI_ACC_GL_POSTING_REV_POST bapi for doing reversal of docs.

I am passing all the data like this

ls_reversal-obj_type = tb_docs-awtyp.

ls_reversal-obj_key = tb_docs-awkey.

CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'

IMPORTING

OWN_LOGICAL_SYSTEM = ls_reversal-obj_sys

EXCEPTIONS

OWN_LOGICAL_SYSTEM_NOT_DEFINED = 1

OTHERS = 2.

ls_reversal-obj_key_r = tb_docs-awkey.

ls_reversal-pstng_date = pa_budat.

ls_reversal-fis_period = pa_monat.

ls_reversal-comp_code = pa_bukrs.

ls_reversal-reason_rev = pa_rever.

ls_reversal-ac_doc_no = tb_docs-belnr.

* Calling BAPI for docs reversal

CALL FUNCTION 'BAPI_ACC_GL_POSTING_REV_POST'

EXPORTING

reversal = ls_reversal

IMPORTING

OBJ_TYPE = ls_reversal-obj_type

OBJ_KEY = ls_reversal-obj_key

OBJ_SYS = ls_reversal-obj_sys

TABLES

return = tb_return.

Issue is FM is reversing all the docs based on objkey though i explicitly mentioned docnumber and company code.

Need to check if am missing something while calling FM?

Thanks in advance.