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

BAPI_ACC_DOCUMENT_POST extension for Reversal date

Former Member
0 Likes
1,283

Hello

This is my first post here so please be patient.

I have developed Excel macro which calls function BAPI_ACC_DOCUMENT_POST populates required structures and tables with excel data, commits transaction and gets booking number from SAP. Everything is working fine except for accrual Journals where Reversal date needs to populated. I know it is not in the header structure and EXTENSION1 needs to be used. I spent hours reading through internet how to do it and I am still with no idea.

Do I need to implement some ABAP code first in SAP?

I do no not have ABAP key. I cannot make any changes in SAP as developer, I only have user access. I can call BAPIs from Excel.

Is there a way to enter reversal date through EXTENSION1 table? What should I pass to entension1 from excel?

I tried: (example of code from excel macro)

Set BAPIfnct = SAPfns.Add("BAPI_ACC_DOCUMENT_POST")

.......................

.........'populate header and lines

......................

BAPIfnct.tables.Item("EXTENSION1").Rows.Add
BAPIfnct.tables.Item("EXTENSION1").Value(BAPIfnct.tables.Item(1, "FIELD1") = "BKPF-STODT='20150505'"

but obviously this is not enough

do I need to pass some ABAP code there? I never did any ABAP programming.

Any push in the right direction will be greatly appreciated.

Regards

Marcin

Hello

This is my first post here so please be patient.

I have developed Excel macro which calls function BAPI_ACC_DOCUMENT_POST populates required structures and tables with excel data, commits transaction and gets booking number from SAP. Everything is working fine except for accrual Journals where Reversal date needs to populated. I know it is not in the header structure and EXTENSION1 needs to be used. I spent hours reading through internet how to do it and I am still with no idea.

Do I need to implement some ABAP code first in SAP?

I do no not have ABAP key. I cannot make any changes in SAP as developer, I only have user access. I can call BAPIs from Excel.

Is there a way to enter reversal date through EXTENSION1 table? What should I pass to entension1 from excel?

I tried: (example of code from excel macro)

Set BAPIfnct = SAPfns.Add("BAPI_ACC_DOCUMENT_POST")

.......................

.........'populate header and lines

......................

BAPIfnct.tables.Item("EXTENSION1").Rows.Add
BAPIfnct.tables.Item("EXTENSION1").Value(BAPIfnct.tables.Item(1, "FIELD1") = "BKPF-STODT='20150505'"

but obviously this is not enough

do I need to pass some ABAP code there? I never did any ABAP programming.

Any push in the right direction will be greatly appreciated.

Regards

Marcin

1 REPLY 1
Read only

Former Member
0 Likes
566

Hello Marcin,

Not only fill Extension table but you should also write some code on ABAP side. This process has two difference side. First you should fill data to Extension and secondly in abap side, you should catch the extension values and MODIFY some internal tables while the posting document is creating.

Shortly, it is not only enough to set some values in Extensions.

Here is the document about BAPI_ACC_DOCUMENT_POST Extension usage;

Business Transaction Event - RWBAPI01 - For Accounting Document Interface - ABAP Development - SCN W...

It is quietly clear to understand. However, if you do not develop something on SAP ABAP. It will also be hard to work for you.