Application Development and Automation 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: 
Read only

issue with BAPI_ACC_DOCUMENT_POST

Former Member
0 Likes
5,375

Hi,

I am using BAPI BAPI_ACC_DOCUMENT_POST to post FI document. I am populating

obj_type = 'IDOC'

obj_key = 'TestBAPI'.

DOC_TYPE   =  'KR'

bus_act= 'RFBU'

This is vendor invoice and document is getting created properly.

However when we try to reverse this using FB08 it is giving error 'Not possible to reverse the document in financial accounting'

I checked and created document has Ref Transaction has value 'IDOC' where as manually posted document has value 'BKPF'.

When i try to post using obj_type = 'BKPF', it is giving below error

RW               628 Incorrect entry in field OBJ_TYPE: BKPF

How to post document with  obj_type = 'BKPF'

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,067

Basically SAP detected that this document was not originally posted in Financial Accounting, so it ask you to reverse the original document, same behvior than with SD or MM (*)

You could

  • Use BAPI_ACC_DOCUMENT_REV_POST to reverse document
  • Use another value for OBJ_TYPE, look at FM FI_REVERSE_POSTING_ALLOWED for your version to find a suitable type.

Regards,

Raymond

(*) Reference 1728685 - In FB08 or F.80 error message F5 763 appears: 'Not possible to reverse the document in fin...

5 REPLIES 5
Read only

Former Member
0 Likes
3,067

Hi

you need to pass the objtype as BKPFF.

Regards

Pallavi

Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,068

Basically SAP detected that this document was not originally posted in Financial Accounting, so it ask you to reverse the original document, same behvior than with SD or MM (*)

You could

  • Use BAPI_ACC_DOCUMENT_REV_POST to reverse document
  • Use another value for OBJ_TYPE, look at FM FI_REVERSE_POSTING_ALLOWED for your version to find a suitable type.

Regards,

Raymond

(*) Reference 1728685 - In FB08 or F.80 error message F5 763 appears: 'Not possible to reverse the document in fin...

Read only

0 Likes
3,067

Hi Raymond,

BKPF and BKPFF are marked as reversal allowed but 'BAPI_ACC_DOCUMENT_POST' is not allowing to post using this OBJ_TYPE.

What value should i pass in OBJ_KEY ?

Read only

0 Likes
3,067

BKPF is reserved for SAP in standard FI transactions, use BKPFF and leave the other fields initial so the generated FI document number will be the reference document number.

Reference: 561175 - BAPI posting in accounting with FI as reference

Regards,

Raymond

Read only

0 Likes
3,067

Thanks Raymond,

As per NOTE  938165 - Incorrect document number for OBJ_TYPE= 'BKPFF'

I left OBJ_TYPE, OBJ_KEY and OBJ_SYS empty and it is working fine now.