SAP BAPI_ACC_DOCUMENT_POST Function Module for Accounting: Posting









BAPI_ACC_DOCUMENT_POST is a standard bapi acc document post SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Accounting: Posting processing and below is the pattern details for this FM, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for bapi acc document post FM, simply by entering the name BAPI_ACC_DOCUMENT_POST into the relevant SAP transaction such as SE37 or SE38.

Function Group: ACC9
Program Name: SAPLACC9
Main Program: SAPLACC9
Appliation area:
Release date: 29-Mar-2001
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function BAPI_ACC_DOCUMENT_POST pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'"Accounting: Posting
EXPORTING
DOCUMENTHEADER = "Header
* CUSTOMERCPD = "One-time customer
* CONTRACTHEADER = "Additional Contract Accounts Recievable and Payable Header Line

IMPORTING
OBJ_TYPE = "Reference procedure
OBJ_KEY = "Reference key
OBJ_SYS = "Logical system of source document

TABLES
* ACCOUNTGL = "G/L account item
* PAYMENTCARD = "Payment Card Information
* CONTRACTITEM = "Additional Contract Accounts Recieviable and Payable Document Line Item
* EXTENSION2 = "Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT
* REALESTATE = "Real Estate Account Assignment Data
* ACCOUNTWT = "Withholding tax information for FI Interface
* ACCOUNTRECEIVABLE = "Customer Item
* ACCOUNTPAYABLE = "Vendor Item
* ACCOUNTTAX = "Tax item
CURRENCYAMOUNT = "Currency Items
* CRITERIA = "CO-PA Account Assignment Characteristics
* VALUEFIELD = "CO-PA Account Assignment Value Fields
* EXTENSION1 = "Container for 'Customer Exit' Parameter
RETURN = "Return parameter
.



IMPORTING Parameters details for BAPI_ACC_DOCUMENT_POST

DOCUMENTHEADER - Header

Data type: BAPIACHE09
Optional: No
Call by Reference: No ( called with pass by value option)

CUSTOMERCPD - One-time customer

Data type: BAPIACPA09
Optional: Yes
Call by Reference: No ( called with pass by value option)

CONTRACTHEADER - Additional Contract Accounts Recievable and Payable Header Line

Data type: BAPIACCAHD
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for BAPI_ACC_DOCUMENT_POST

OBJ_TYPE - Reference procedure

Data type: BAPIACHE09-OBJ_TYPE
Optional: No
Call by Reference: No ( called with pass by value option)

OBJ_KEY - Reference key

Data type: BAPIACHE09-OBJ_KEY
Optional: No
Call by Reference: No ( called with pass by value option)

OBJ_SYS - Logical system of source document

Data type: BAPIACHE09-OBJ_SYS
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for BAPI_ACC_DOCUMENT_POST

ACCOUNTGL - G/L account item

Data type: BAPIACGL09
Optional: Yes
Call by Reference: No ( called with pass by value option)

PAYMENTCARD - Payment Card Information

Data type: BAPIACPC09
Optional: Yes
Call by Reference: No ( called with pass by value option)

CONTRACTITEM - Additional Contract Accounts Recieviable and Payable Document Line Item

Data type: BAPIACCAIT
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXTENSION2 - Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT

Data type: BAPIPAREX
Optional: Yes
Call by Reference: Yes

REALESTATE - Real Estate Account Assignment Data

Data type: BAPIACRE09
Optional: Yes
Call by Reference: Yes

ACCOUNTWT - Withholding tax information for FI Interface

Data type: BAPIACWT09
Optional: Yes
Call by Reference: Yes

ACCOUNTRECEIVABLE - Customer Item

Data type: BAPIACAR09
Optional: Yes
Call by Reference: No ( called with pass by value option)

ACCOUNTPAYABLE - Vendor Item

Data type: BAPIACAP09
Optional: Yes
Call by Reference: No ( called with pass by value option)

ACCOUNTTAX - Tax item

Data type: BAPIACTX09
Optional: Yes
Call by Reference: No ( called with pass by value option)

CURRENCYAMOUNT - Currency Items

Data type: BAPIACCR09
Optional: No
Call by Reference: Yes

CRITERIA - CO-PA Account Assignment Characteristics

Data type: BAPIACKEC9
Optional: Yes
Call by Reference: Yes

VALUEFIELD - CO-PA Account Assignment Value Fields

Data type: BAPIACKEV9
Optional: Yes
Call by Reference: Yes

EXTENSION1 - Container for 'Customer Exit' Parameter

Data type: BAPIACEXTC
Optional: Yes
Call by Reference: Yes

RETURN - Return parameter

Data type: BAPIRET2
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for BAPI_ACC_DOCUMENT_POST Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_obj_type  TYPE BAPIACHE09-OBJ_TYPE, "   
lt_accountgl  TYPE STANDARD TABLE OF BAPIACGL09, "   
lv_documentheader  TYPE BAPIACHE09, "   
lt_paymentcard  TYPE STANDARD TABLE OF BAPIACPC09, "   
lt_contractitem  TYPE STANDARD TABLE OF BAPIACCAIT, "   
lt_extension2  TYPE STANDARD TABLE OF BAPIPAREX, "   
lt_realestate  TYPE STANDARD TABLE OF BAPIACRE09, "   
lt_accountwt  TYPE STANDARD TABLE OF BAPIACWT09, "   
lv_obj_key  TYPE BAPIACHE09-OBJ_KEY, "   
lv_customercpd  TYPE BAPIACPA09, "   
lt_accountreceivable  TYPE STANDARD TABLE OF BAPIACAR09, "   
lv_obj_sys  TYPE BAPIACHE09-OBJ_SYS, "   
lt_accountpayable  TYPE STANDARD TABLE OF BAPIACAP09, "   
lv_contractheader  TYPE BAPIACCAHD, "   
lt_accounttax  TYPE STANDARD TABLE OF BAPIACTX09, "   
lt_currencyamount  TYPE STANDARD TABLE OF BAPIACCR09, "   
lt_criteria  TYPE STANDARD TABLE OF BAPIACKEC9, "   
lt_valuefield  TYPE STANDARD TABLE OF BAPIACKEV9, "   
lt_extension1  TYPE STANDARD TABLE OF BAPIACEXTC, "   
lt_return  TYPE STANDARD TABLE OF BAPIRET2. "   

  CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'  "Accounting: Posting
    EXPORTING
         DOCUMENTHEADER = lv_documentheader
         CUSTOMERCPD = lv_customercpd
         CONTRACTHEADER = lv_contractheader
    IMPORTING
         OBJ_TYPE = lv_obj_type
         OBJ_KEY = lv_obj_key
         OBJ_SYS = lv_obj_sys
    TABLES
         ACCOUNTGL = lt_accountgl
         PAYMENTCARD = lt_paymentcard
         CONTRACTITEM = lt_contractitem
         EXTENSION2 = lt_extension2
         REALESTATE = lt_realestate
         ACCOUNTWT = lt_accountwt
         ACCOUNTRECEIVABLE = lt_accountreceivable
         ACCOUNTPAYABLE = lt_accountpayable
         ACCOUNTTAX = lt_accounttax
         CURRENCYAMOUNT = lt_currencyamount
         CRITERIA = lt_criteria
         VALUEFIELD = lt_valuefield
         EXTENSION1 = lt_extension1
         RETURN = lt_return
. " BAPI_ACC_DOCUMENT_POST




ABAP code using 7.40 inline data declarations to call FM BAPI_ACC_DOCUMENT_POST

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single OBJ_TYPE FROM BAPIACHE09 INTO @DATA(ld_obj_type).
 
 
 
 
 
 
 
 
"SELECT single OBJ_KEY FROM BAPIACHE09 INTO @DATA(ld_obj_key).
 
 
 
"SELECT single OBJ_SYS FROM BAPIACHE09 INTO @DATA(ld_obj_sys).
 
 
 
 
 
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!