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: 

BAPI and validation

Former Member
0 Kudos

Hi all

I use BAPI_ACC_DOCUMENT_CHECK to checking data before post but it doesn't trigger FI validation.

How to execute it before accounting?

1 ACCEPTED SOLUTION

ThomasZloch
Active Contributor
0 Kudos

You could try calling BAPI_ACC_DOCUMENT_POST instead with a ROLLBACK WORK afterwards, and see if this does call the validation (it should, by all means). However make sure that there are no other DB changes lined up that you would roll back unwantedly.

I used above method successfully for the test mode of a posting program.

Thomas

3 REPLIES 3

ThomasZloch
Active Contributor
0 Kudos

You could try calling BAPI_ACC_DOCUMENT_POST instead with a ROLLBACK WORK afterwards, and see if this does call the validation (it should, by all means). However make sure that there are no other DB changes lined up that you would roll back unwantedly.

I used above method successfully for the test mode of a posting program.

Thomas

0 Kudos

It's very risk and get belnr. I must find another way.

0 Kudos

BELNR will be rolled back as well. After some more thoughts, my document type and number range here is exclusively used for that process, so I acknowedge there might be issues when the number range is used more widely.

You could also try calling FI_VALIDATION_HEADER, FI_VALIDATION_ITEM and FI_VALIDATION_DOC yourself, however you would have to map the data from your BAPI structures to the import structures of these function modules.

Thomas