SAP BAPI_AP_ACC_GETKEYDATEBALANCE Function Module for Vendor Account Balance at Key Date
BAPI_AP_ACC_GETKEYDATEBALANCE is a standard bapi ap acc getkeydatebalance SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Vendor Account Balance at Key Date 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 ap acc getkeydatebalance FM, simply by entering the name BAPI_AP_ACC_GETKEYDATEBALANCE into the relevant SAP transaction such as SE37 or SE38.
Function Group: 3008
Program Name: SAPL3008
Main Program: SAPL3008
Appliation area: F
Release date: 15-Jul-1997
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BAPI_AP_ACC_GETKEYDATEBALANCE 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_AP_ACC_GETKEYDATEBALANCE'"Vendor Account Balance at Key Date.
EXPORTING
COMPANYCODE = "Company code
VENDOR = "Vendor
KEYDATE = "Key date
* BALANCESPGLI = ' ' "Balance per special G/L indicator
* NOTEDITEMS = ' ' "Noted items requested
IMPORTING
RETURN = "Return Code
TABLES
KEYBALANCE = "Balance at key date
IMPORTING Parameters details for BAPI_AP_ACC_GETKEYDATEBALANCE
COMPANYCODE - Company code
Data type: BAPI3008_1-COMP_CODEOptional: No
Call by Reference: No ( called with pass by value option)
VENDOR - Vendor
Data type: BAPI3008_1-VENDOROptional: No
Call by Reference: No ( called with pass by value option)
KEYDATE - Key date
Data type: BAPI3008-KEY_DATEOptional: No
Call by Reference: No ( called with pass by value option)
BALANCESPGLI - Balance per special G/L indicator
Data type: BAPI3008-BAL_SGLINDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NOTEDITEMS - Noted items requested
Data type: BAPI3008-NTDITMS_RQDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_AP_ACC_GETKEYDATEBALANCE
RETURN - Return Code
Data type: BAPIRETURNOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_AP_ACC_GETKEYDATEBALANCE
KEYBALANCE - Balance at key date
Data type: BAPI3008_3Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BAPI_AP_ACC_GETKEYDATEBALANCE 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_return | TYPE BAPIRETURN, " | |||
| lt_keybalance | TYPE STANDARD TABLE OF BAPI3008_3, " | |||
| lv_companycode | TYPE BAPI3008_1-COMP_CODE, " | |||
| lv_vendor | TYPE BAPI3008_1-VENDOR, " | |||
| lv_keydate | TYPE BAPI3008-KEY_DATE, " | |||
| lv_balancespgli | TYPE BAPI3008-BAL_SGLIND, " SPACE | |||
| lv_noteditems | TYPE BAPI3008-NTDITMS_RQ. " SPACE |
|   CALL FUNCTION 'BAPI_AP_ACC_GETKEYDATEBALANCE' "Vendor Account Balance at Key Date |
| EXPORTING | ||
| COMPANYCODE | = lv_companycode | |
| VENDOR | = lv_vendor | |
| KEYDATE | = lv_keydate | |
| BALANCESPGLI | = lv_balancespgli | |
| NOTEDITEMS | = lv_noteditems | |
| IMPORTING | ||
| RETURN | = lv_return | |
| TABLES | ||
| KEYBALANCE | = lt_keybalance | |
| . " BAPI_AP_ACC_GETKEYDATEBALANCE | ||
ABAP code using 7.40 inline data declarations to call FM BAPI_AP_ACC_GETKEYDATEBALANCE
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 COMP_CODE FROM BAPI3008_1 INTO @DATA(ld_companycode). | ||||
| "SELECT single VENDOR FROM BAPI3008_1 INTO @DATA(ld_vendor). | ||||
| "SELECT single KEY_DATE FROM BAPI3008 INTO @DATA(ld_keydate). | ||||
| "SELECT single BAL_SGLIND FROM BAPI3008 INTO @DATA(ld_balancespgli). | ||||
| DATA(ld_balancespgli) | = ' '. | |||
| "SELECT single NTDITMS_RQ FROM BAPI3008 INTO @DATA(ld_noteditems). | ||||
| DATA(ld_noteditems) | = ' '. | |||
Search for further information about these or an SAP related objects