SAP Function Modules

BAPI_AR_ACC_GETKEYDATEBALANCE SAP Function module - Customer account balance at a key date







BAPI_AR_ACC_GETKEYDATEBALANCE is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name BAPI_AR_ACC_GETKEYDATEBALANCE into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: 3007
Released Date: 15.07.1997
Processing type: Remote-Enabled
remote enabled module settings


Pattern for FM BAPI_AR_ACC_GETKEYDATEBALANCE - BAPI AR ACC GETKEYDATEBALANCE





CALL FUNCTION 'BAPI_AR_ACC_GETKEYDATEBALANCE' "Customer account balance at a key date
  EXPORTING
    companycode =               " bapi3007_1-comp_code  Company code
    customer =                  " bapi3007_1-customer  Customer
    keydate =                   " bapi3007-key_date  Key date
*   balancespgli = SPACE        " bapi3007-bal_sglind  Balance per special G/L indicator
*   noteditems = SPACE          " bapi3007-ntditms_rq  Noted items requested
  IMPORTING
    return =                    " bapireturn    Return Code
  TABLES
    keybalance =                " bapi3007_3    Balance at key date
    .  "  BAPI_AR_ACC_GETKEYDATEBALANCE

ABAP code example for Function Module BAPI_AR_ACC_GETKEYDATEBALANCE





The ABAP code below is a full code listing to execute function module BAPI_AR_ACC_GETKEYDATEBALANCE including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_return  TYPE BAPIRETURN ,
it_keybalance  TYPE STANDARD TABLE OF BAPI3007_3,"TABLES PARAM
wa_keybalance  LIKE LINE OF it_keybalance .


DATA(ld_companycode) = some text here

DATA(ld_customer) = some text here

DATA(ld_keydate) = 20210129

DATA(ld_balancespgli) = some text here

DATA(ld_noteditems) = some text here

"populate fields of struture and append to itab
append wa_keybalance to it_keybalance. . CALL FUNCTION 'BAPI_AR_ACC_GETKEYDATEBALANCE' EXPORTING companycode = ld_companycode customer = ld_customer keydate = ld_keydate * balancespgli = ld_balancespgli * noteditems = ld_noteditems IMPORTING return = ld_return TABLES keybalance = it_keybalance . " BAPI_AR_ACC_GETKEYDATEBALANCE
IF SY-SUBRC EQ 0. "All OK ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_return  TYPE BAPIRETURN ,
ld_companycode  TYPE BAPI3007_1-COMP_CODE ,
it_keybalance  TYPE STANDARD TABLE OF BAPI3007_3 ,
wa_keybalance  LIKE LINE OF it_keybalance,
ld_customer  TYPE BAPI3007_1-CUSTOMER ,
ld_keydate  TYPE BAPI3007-KEY_DATE ,
ld_balancespgli  TYPE BAPI3007-BAL_SGLIND ,
ld_noteditems  TYPE BAPI3007-NTDITMS_RQ .


ld_companycode = some text here

"populate fields of struture and append to itab
append wa_keybalance to it_keybalance.

ld_customer = some text here

ld_keydate = 20210129

ld_balancespgli = some text here

ld_noteditems = some text here

SAP Documentation for FM BAPI_AR_ACC_GETKEYDATEBALANCE


This method supplies a customer's total balance at a given key date. The total balance includes both standard and special general ledger ...See here for full SAP fm documentation




Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name BAPI_AR_ACC_GETKEYDATEBALANCE or its description.