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: 

requirements for BAPI_ACC_GL_POSTING_REV_POST

Former Member
0 Kudos

This is what I am passing to this BAPI

FORM F_POST_REV_GL_TRANSACTION .

DATA: gv_doc_header LIKE bapiache08,

refresh lt_reversal.

lt_reversal-COMP_CODE = gv_bukrs.

lt_reversal-AC_DOC_NO = gv_Posted-doc_num.

append lt_reversal.

CALL FUNCTION 'BAPI_ACC_GL_POSTING_REV_POST'

EXPORTING

REVERSAL = lt_reversal

IMPORTING

OBJ_TYPE = gv_doc_header-obj_type

OBJ_KEY = gv_doc_header-obj_key

OBJ_SYS = gv_doc_header-obj_sys

TABLES

RETURN = lt_return.

ENDFORM. " F_POST_REV_GL_TRANSACTION

I am getting this error on the return:

Required field OBJ_TYPE was not transferred in parameter REVERSAL

Required field OBJ_KEY_R was not transferred in parameter REVERSAL

Required field OBJ_SYS was not transferred in parameter REVERSAL

1 ACCEPTED SOLUTION

kanishakgupta1
Contributor
0 Kudos

Hi,

refer the below link......

hope it may help u.......

http://www.sapfans.com/forums/viewtopic.php?p=546963&sid=9a339f6928b96dbd46eda53286a0e11d

regards

kanishak

12 REPLIES 12

Former Member
0 Kudos

It's all available in BKPF when you retrieve the document data to be reversed.

Rob

0 Kudos

thanks for the info on bkpf... I am trying to find out what is all needed to make this BAPI work?

Right now I am only passing comp_code and the document number.

anyone know how this BAPI works?

kanishakgupta1
Contributor
0 Kudos

Hi,

refer the below link......

hope it may help u.......

http://www.sapfans.com/forums/viewtopic.php?p=546963&sid=9a339f6928b96dbd46eda53286a0e11d

regards

kanishak

0 Kudos

thanks K.

I am still looking for the answer for what are the 'required fields' to make this BAPI work?

also, do I need to populate the obj-sys, obj_type, obj_key for the reversal record? and would they just be taken from the docuemnt that I just posted in BAPI_ACC_GL_POSTING_POST.

0 Kudos

Hello Keith,

If you read the BAPI documentation, then you will find the following params are required to be passed :

OBJ_TYPE Sender ID

OBJ_KEY Reference number of the reversal document (source document)

OBJ_SYS Logical system

OBJ_KEY_R Reference number of the document to be reversed.

And i feel you are not passing these values when calling this BAPI.

BR,

Suhas

0 Kudos

Thanks Suhas,

here is what I am passing:

lt_reversal-obj_sys = lv_obj_sys.

lt_reversal-OBJ_KEY_R = gv_posted-doc_num.

lt_reversal-obj_type = lv_obj_type.

lt_reversal-obj_key = lv_obj_key.

  • lt_reversal-REASON_REV = '02'.

lt_reversal-FIS_PERIOD = '06'.

lt_reversal-COMP_CODE = gv_bukrs.

lt_reversal-AC_DOC_NO = gv_Posted-doc_num.

lt_reversal-PSTNG_DATE = gv_psting_dt.

append lt_reversal.

CALL FUNCTION 'BAPI_ACC_GL_POSTING_REV_POST'

EXPORTING

REVERSAL = lt_reversal

IMPORTING

OBJ_TYPE = gv_doc_header-obj_type

OBJ_KEY = gv_doc_header-obj_key

OBJ_SYS = gv_doc_header-obj_sys

TABLES

RETURN = lt_return.

I am getting the errors:

Reversal in component Financial Accounting not possible

Reversal not possible, accounting document for the ref. does not exist

0 Kudos

Hi All,

here is what I am trying to do:

1) BAPI BAPI_ACC_GL_POSTING_POST - create document

2) BAPI_TRANSACTION_COMMIT - commit document

3) if the file type is an accrual call BAPI_ACC_GL_POSTING_REV_POST - reverse document

does this sound correct?

0 Kudos

I found that to facilitate my requirements I would only need to populate the Reversal Reason (which is on part of the structure bapiache08 for the BAPI we are using already BAPI_ACC_GL_POSTING_POST) and Reversal Date

Reversal Date which is on Table BKPF field STODT, then everything else is taken care of the system.

Any ideas?

0 Kudos

anyone know if it would be possible to populate the tabel BKPF and fill in that field STODT after the document has been created?

0 Kudos

Hello Keith,

This field cannot be populated while creating an a/c'ing doc. While calling the BAPI may be you need to pass this value (for e.g., you can pass SY-DATUM or SY-DATUM + 5) and the BAPI will update this field in the DB.

Hope i am clear.

BR,

Suhas

0 Kudos

Suhas,

I tried upping (adding + 15 to sy-datum) the posting date to see if it would populate the Reversal date but, it did not.

Is that what you are suggesting?

thanks

Keith

0 Kudos

How to determine OBJ_TYPE? mine only works with OBJ_TYPE BKPFF, others will fail.