SAP BAPI_AR_ACC_GETKEYDATEBALANCE Function Module for Customer account balance at a key date
BAPI_AR_ACC_GETKEYDATEBALANCE is a standard bapi ar 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 Customer account balance at a 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 ar acc getkeydatebalance FM, simply by entering the name BAPI_AR_ACC_GETKEYDATEBALANCE into the relevant SAP transaction such as SE37 or SE38.
Function Group: 3007
Program Name: SAPL3007
Main Program: SAPL3007
Appliation area: F
Release date: 15-Jul-1997
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function BAPI_AR_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_AR_ACC_GETKEYDATEBALANCE'"Customer account balance at a key date.
EXPORTING
COMPANYCODE = "Company code
CUSTOMER = "Customer
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_AR_ACC_GETKEYDATEBALANCE
COMPANYCODE - Company code
Data type: BAPI3007_1-COMP_CODEOptional: No
Call by Reference: No ( called with pass by value option)
CUSTOMER - Customer
Data type: BAPI3007_1-CUSTOMEROptional: No
Call by Reference: No ( called with pass by value option)
KEYDATE - Key date
Data type: BAPI3007-KEY_DATEOptional: No
Call by Reference: No ( called with pass by value option)
BALANCESPGLI - Balance per special G/L indicator
Data type: BAPI3007-BAL_SGLINDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
NOTEDITEMS - Noted items requested
Data type: BAPI3007-NTDITMS_RQDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BAPI_AR_ACC_GETKEYDATEBALANCE
RETURN - Return Code
Data type: BAPIRETURNOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BAPI_AR_ACC_GETKEYDATEBALANCE
KEYBALANCE - Balance at key date
Data type: BAPI3007_3Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BAPI_AR_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 BAPI3007_3, " | |||
| lv_companycode | TYPE BAPI3007_1-COMP_CODE, " | |||
| lv_customer | TYPE BAPI3007_1-CUSTOMER, " | |||
| lv_keydate | TYPE BAPI3007-KEY_DATE, " | |||
| lv_balancespgli | TYPE BAPI3007-BAL_SGLIND, " SPACE | |||
| lv_noteditems | TYPE BAPI3007-NTDITMS_RQ. " SPACE |
|   CALL FUNCTION 'BAPI_AR_ACC_GETKEYDATEBALANCE' "Customer account balance at a key date |
| EXPORTING | ||
| COMPANYCODE | = lv_companycode | |
| CUSTOMER | = lv_customer | |
| KEYDATE | = lv_keydate | |
| BALANCESPGLI | = lv_balancespgli | |
| NOTEDITEMS | = lv_noteditems | |
| IMPORTING | ||
| RETURN | = lv_return | |
| TABLES | ||
| KEYBALANCE | = lt_keybalance | |
| . " BAPI_AR_ACC_GETKEYDATEBALANCE | ||
ABAP code using 7.40 inline data declarations to call FM BAPI_AR_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 BAPI3007_1 INTO @DATA(ld_companycode). | ||||
| "SELECT single CUSTOMER FROM BAPI3007_1 INTO @DATA(ld_customer). | ||||
| "SELECT single KEY_DATE FROM BAPI3007 INTO @DATA(ld_keydate). | ||||
| "SELECT single BAL_SGLIND FROM BAPI3007 INTO @DATA(ld_balancespgli). | ||||
| DATA(ld_balancespgli) | = ' '. | |||
| "SELECT single NTDITMS_RQ FROM BAPI3007 INTO @DATA(ld_noteditems). | ||||
| DATA(ld_noteditems) | = ' '. | |||
Search for further information about these or an SAP related objects