SAP CUSTOMER_OLDEST_OPEN_ITEM Function Module for
CUSTOMER_OLDEST_OPEN_ITEM is a standard customer oldest open item SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 customer oldest open item FM, simply by entering the name CUSTOMER_OLDEST_OPEN_ITEM into the relevant SAP transaction such as SE37 or SE38.
Function Group: F035
Program Name: SAPLF035
Main Program: SAPLF035
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:

Function CUSTOMER_OLDEST_OPEN_ITEM 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 'CUSTOMER_OLDEST_OPEN_ITEM'".
EXPORTING
I_KKBER = "Credit control area
I_KUNNR = "Customer
* I_REGUL = 'X' "Only read payer data?
* I_ERLTA = '01' "Permitted ageing in days
* I_ERLST = '00' "Permitted Ageing in Hours
* I_XCRCV = ' ' "
IMPORTING
E_BELNR = "Document number
E_XODAT = "
E_XNDAT = "
E_VERTA = "
E_VERST = "
E_XDATAAKT = "
E_BUKRS = "Company code
E_FAEDT = "Due date for net payment
E_GJAHR = "Fiscal year
E_INFAE = "Inverted due date for net payment
E_KUNNR = "Customer
E_VERZN = "Days in arrears net
E_WAERS = "Document currency
E_WRBTR = "Amount in document currency
EXCEPTIONS
INVALID_CALL = 1 NO_BUKRS = 2 NO_ITEMS = 3
IMPORTING Parameters details for CUSTOMER_OLDEST_OPEN_ITEM
I_KKBER - Credit control area
Data type: T014-KKBEROptional: No
Call by Reference: No ( called with pass by value option)
I_KUNNR - Customer
Data type: KNKK-KUNNROptional: No
Call by Reference: No ( called with pass by value option)
I_REGUL - Only read payer data?
Data type: T691F-REGULDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_ERLTA - Permitted ageing in days
Data type: RF035-ERLTADefault: '01'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_ERLST - Permitted Ageing in Hours
Data type: RF035-ERLSTDefault: '00'
Optional: Yes
Call by Reference: No ( called with pass by value option)
I_XCRCV -
Data type: BOOLE-BOOLEDefault: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CUSTOMER_OLDEST_OPEN_ITEM
E_BELNR - Document number
Data type: BSID-BELNROptional: No
Call by Reference: No ( called with pass by value option)
E_XODAT -
Data type: RF035-XODATOptional: No
Call by Reference: No ( called with pass by value option)
E_XNDAT -
Data type: RF035-XNDATOptional: No
Call by Reference: No ( called with pass by value option)
E_VERTA -
Data type: RF035-ERLTAOptional: No
Call by Reference: No ( called with pass by value option)
E_VERST -
Data type: RF035-ERLSTOptional: No
Call by Reference: No ( called with pass by value option)
E_XDATAAKT -
Data type: BOOLE-BOOLEOptional: No
Call by Reference: No ( called with pass by value option)
E_BUKRS - Company code
Data type: BSID-BUKRSOptional: No
Call by Reference: No ( called with pass by value option)
E_FAEDT - Due date for net payment
Data type: RFPOS-FAEDTOptional: No
Call by Reference: No ( called with pass by value option)
E_GJAHR - Fiscal year
Data type: BSID-GJAHROptional: No
Call by Reference: No ( called with pass by value option)
E_INFAE - Inverted due date for net payment
Data type: BSID-INFAEOptional: No
Call by Reference: No ( called with pass by value option)
E_KUNNR - Customer
Data type: BSID-KUNNROptional: No
Call by Reference: No ( called with pass by value option)
E_VERZN - Days in arrears net
Data type: RFPOS-VERZNOptional: No
Call by Reference: No ( called with pass by value option)
E_WAERS - Document currency
Data type: BSID-WAERSOptional: No
Call by Reference: No ( called with pass by value option)
E_WRBTR - Amount in document currency
Data type: BSID-WRBTROptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
INVALID_CALL - Invalid Call
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_BUKRS - Customer created in no company code
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_ITEMS - No open items were found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for CUSTOMER_OLDEST_OPEN_ITEM 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_e_belnr | TYPE BSID-BELNR, " | |||
| lv_i_kkber | TYPE T014-KKBER, " | |||
| lv_invalid_call | TYPE T014, " | |||
| lv_e_xodat | TYPE RF035-XODAT, " | |||
| lv_e_xndat | TYPE RF035-XNDAT, " | |||
| lv_e_verta | TYPE RF035-ERLTA, " | |||
| lv_e_verst | TYPE RF035-ERLST, " | |||
| lv_e_xdataakt | TYPE BOOLE-BOOLE, " | |||
| lv_e_bukrs | TYPE BSID-BUKRS, " | |||
| lv_i_kunnr | TYPE KNKK-KUNNR, " | |||
| lv_no_bukrs | TYPE KNKK, " | |||
| lv_e_faedt | TYPE RFPOS-FAEDT, " | |||
| lv_i_regul | TYPE T691F-REGUL, " 'X' | |||
| lv_no_items | TYPE T691F, " | |||
| lv_e_gjahr | TYPE BSID-GJAHR, " | |||
| lv_i_erlta | TYPE RF035-ERLTA, " '01' | |||
| lv_e_infae | TYPE BSID-INFAE, " | |||
| lv_i_erlst | TYPE RF035-ERLST, " '00' | |||
| lv_e_kunnr | TYPE BSID-KUNNR, " | |||
| lv_i_xcrcv | TYPE BOOLE-BOOLE, " ' ' | |||
| lv_e_verzn | TYPE RFPOS-VERZN, " | |||
| lv_e_waers | TYPE BSID-WAERS, " | |||
| lv_e_wrbtr | TYPE BSID-WRBTR. " |
|   CALL FUNCTION 'CUSTOMER_OLDEST_OPEN_ITEM' " |
| EXPORTING | ||
| I_KKBER | = lv_i_kkber | |
| I_KUNNR | = lv_i_kunnr | |
| I_REGUL | = lv_i_regul | |
| I_ERLTA | = lv_i_erlta | |
| I_ERLST | = lv_i_erlst | |
| I_XCRCV | = lv_i_xcrcv | |
| IMPORTING | ||
| E_BELNR | = lv_e_belnr | |
| E_XODAT | = lv_e_xodat | |
| E_XNDAT | = lv_e_xndat | |
| E_VERTA | = lv_e_verta | |
| E_VERST | = lv_e_verst | |
| E_XDATAAKT | = lv_e_xdataakt | |
| E_BUKRS | = lv_e_bukrs | |
| E_FAEDT | = lv_e_faedt | |
| E_GJAHR | = lv_e_gjahr | |
| E_INFAE | = lv_e_infae | |
| E_KUNNR | = lv_e_kunnr | |
| E_VERZN | = lv_e_verzn | |
| E_WAERS | = lv_e_waers | |
| E_WRBTR | = lv_e_wrbtr | |
| EXCEPTIONS | ||
| INVALID_CALL = 1 | ||
| NO_BUKRS = 2 | ||
| NO_ITEMS = 3 | ||
| . " CUSTOMER_OLDEST_OPEN_ITEM | ||
ABAP code using 7.40 inline data declarations to call FM CUSTOMER_OLDEST_OPEN_ITEM
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 BELNR FROM BSID INTO @DATA(ld_e_belnr). | ||||
| "SELECT single KKBER FROM T014 INTO @DATA(ld_i_kkber). | ||||
| "SELECT single XODAT FROM RF035 INTO @DATA(ld_e_xodat). | ||||
| "SELECT single XNDAT FROM RF035 INTO @DATA(ld_e_xndat). | ||||
| "SELECT single ERLTA FROM RF035 INTO @DATA(ld_e_verta). | ||||
| "SELECT single ERLST FROM RF035 INTO @DATA(ld_e_verst). | ||||
| "SELECT single BOOLE FROM BOOLE INTO @DATA(ld_e_xdataakt). | ||||
| "SELECT single BUKRS FROM BSID INTO @DATA(ld_e_bukrs). | ||||
| "SELECT single KUNNR FROM KNKK INTO @DATA(ld_i_kunnr). | ||||
| "SELECT single FAEDT FROM RFPOS INTO @DATA(ld_e_faedt). | ||||
| "SELECT single REGUL FROM T691F INTO @DATA(ld_i_regul). | ||||
| DATA(ld_i_regul) | = 'X'. | |||
| "SELECT single GJAHR FROM BSID INTO @DATA(ld_e_gjahr). | ||||
| "SELECT single ERLTA FROM RF035 INTO @DATA(ld_i_erlta). | ||||
| DATA(ld_i_erlta) | = '01'. | |||
| "SELECT single INFAE FROM BSID INTO @DATA(ld_e_infae). | ||||
| "SELECT single ERLST FROM RF035 INTO @DATA(ld_i_erlst). | ||||
| DATA(ld_i_erlst) | = '00'. | |||
| "SELECT single KUNNR FROM BSID INTO @DATA(ld_e_kunnr). | ||||
| "SELECT single BOOLE FROM BOOLE INTO @DATA(ld_i_xcrcv). | ||||
| DATA(ld_i_xcrcv) | = ' '. | |||
| "SELECT single VERZN FROM RFPOS INTO @DATA(ld_e_verzn). | ||||
| "SELECT single WAERS FROM BSID INTO @DATA(ld_e_waers). | ||||
| "SELECT single WRBTR FROM BSID INTO @DATA(ld_e_wrbtr). | ||||
Search for further information about these or an SAP related objects