Dear all,
Recently I faced a lot of projects requesting Accounting Posting Automation not only requested by Finance Department but other departments in our company.
Facing this challenge to create new projects to automate the business accounting process we had the chance to review some old programs and we realize high number of SHDB programming logic.
So, this post will be designed to give the opportunity to use the BAPI_ACC_DOCUMENT_POST and raise the benefits instead of SHDB.
SAP Role and Access Management
The first issue that we faced using the SHDB for example to call FB01 transaction code and create an accounting posting is the Access Security and compliance. Because it will be necessary to release the access to transaction code FB01 to the user to avoid the authority check issue.
This first point we find out when we faced a project to create accounting posting that will be used by logistic users. There is not compliance to release access to FB01 for Logistic Users.
Field Status Group
During the system life cycle, many changes can occur and one of them is the management of field status group assigned in the posting keys and G/L account.
When you record an SHDB and is used by the ABAP as call transaction, error can be generated if the field has been suppressed in the field status group requesting more ABAP fix.
Error Management
The BAPI_ACC_DOCUMENT_POST returns the error messages for all line items with error and can be easly handle by the user to correct them. The call transaction (SHDB) fill out line item by line item, generating error by each posting tentative.
Check Functions
You can use the function module BAPI_ACC_DOCUMENT_CHECK to check if the document has any issue before perform the post or even simulate your posting.
Skip User Default Settings
The call transaction (SHDB) will use user parameters such as currency and date format which can be different for each user and the ABAP code should treat that.
Generally, the BAPI and SAP standard functions should be used if possible and if exists.
Note that BAPI_ACC_DOCUMENT_POST will not commit the transaction, you have to use BAPI_TRANSACTION_COMMIT after it.
I hope it helps you.
Best regards,
Gabriel Coleti