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

FI Posting Simulation

Former Member
0 Likes
2,796

Hi All,

I have a problem related to FI document posting.

I am getting a file from my presentation server and this file has 4 different types of document in it. Now I need to process my file such that either all the documents are posted successfully or none is posted.

I am using Bapi "BAPI_ACC_DOCUMENT_POST" for the same. I have done ceratin validations before passing data to this BAPI and actually posting the document.

Now my requirement is that I want to SIMULATE all types of postings before I actually do any posting in the system. Is there any Function module by which I can just do the simulation of an FI posting before actually posting the document.

Any help is highly appreciated and would be Moderator message: read the Terms of Engagement again

Thanks a Lot!!

Regards,

Lalit Kabra

1 ACCEPTED SOLUTION
Read only

JozsefSzikszai
Active Contributor
0 Likes
1,616

for simulation purposes use FM BAPI_ACC_DOCUMENT_CHECK, this won't post the document, but will check everything else. It will return with error messages (if there is any), or with nothing, just as the "POST" BAPI.

The idea of Manoj should be avoided! The problem is that if you don't do COMMIT after the BAPI call, nothing will be posted (that is right), but the document number will be reversed, so finally there will be a hole in the number range! Financial people and tax authorities are not really happy about that

5 REPLIES 5
Read only

Former Member
0 Likes
1,616

Check the RETURN table of the BAPI after execution for any errors.

For the cases where you only want to simulate, do not call BAPI_TRANSACTION_COMMIT. Instead call BAPI_TRANSACTION_ROLLBACK to undo your changes.

Read only

0 Likes
1,616

Hi,

Thanks for the quick response.

So that means document is not posted till we specifically call BAPI_TRANSACTION_COMMIT.

So in case there is some error we can stop there and will not proceed further. Only problem with this way would be that a document number is generated which would not be used.

Any way that even document number is not generated. Only simulation is done?

Regards,

Lalit Kabra

Read only

0 Likes
1,616

Yes. Until COMMIT WORK is called, the changes are not written to the database.

Regarding generation of document number, you may need to use a different BAPI for that purpose since BAPI_ACC_DOCUMENT_POST will generate a document number every time it is called.

Read only

0 Likes
1,616

Hi,

Thanks a Lot for the quick response.

Regards,

Lalit

Read only

JozsefSzikszai
Active Contributor
0 Likes
1,617

for simulation purposes use FM BAPI_ACC_DOCUMENT_CHECK, this won't post the document, but will check everything else. It will return with error messages (if there is any), or with nothing, just as the "POST" BAPI.

The idea of Manoj should be avoided! The problem is that if you don't do COMMIT after the BAPI call, nothing will be posted (that is right), but the document number will be reversed, so finally there will be a hole in the number range! Financial people and tax authorities are not really happy about that