SAP LOT_CHECK Function Module for
LOT_CHECK is a standard lot check 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 lot check FM, simply by entering the name LOT_CHECK into the relevant SAP transaction such as SE37 or SE38.
Function Group: FCHKCORE
Program Name: SAPLFCHKCORE
Main Program: SAPLFCHKCORE
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function LOT_CHECK 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 'LOT_CHECK'".
EXPORTING
I_HBKID = "
I_HKTID = "
I_STAPL = "
I_ZBUKR = "
IMPORTING
E_STAPI = "
E_STAPL = "
E_ZWELS = "
EXCEPTIONS
NOT_FOUND_LOT = 1 NOT_FOUND_NEXT_LOT = 2 NO_NEXT_LOT = 3 LOT_NOT_SEQUENTIAL = 4
IMPORTING Parameters details for LOT_CHECK
I_HBKID -
Data type: PCEC-HBKIDOptional: No
Call by Reference: No ( called with pass by value option)
I_HKTID -
Data type: PCEC-HKTIDOptional: No
Call by Reference: No ( called with pass by value option)
I_STAPL -
Data type: PCEC-STAPLOptional: No
Call by Reference: No ( called with pass by value option)
I_ZBUKR -
Data type: PCEC-ZBUKROptional: No
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for LOT_CHECK
E_STAPI -
Data type: PCEC-STAPIOptional: No
Call by Reference: No ( called with pass by value option)
E_STAPL -
Data type: PCEC-STAPLOptional: No
Call by Reference: No ( called with pass by value option)
E_ZWELS -
Data type: PCEC-ZWELSOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NOT_FOUND_LOT - Check lot not found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NOT_FOUND_NEXT_LOT - Next lot not found
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_NEXT_LOT - Check lot has no next lot
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
LOT_NOT_SEQUENTIAL -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for LOT_CHECK 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_stapi | TYPE PCEC-STAPI, " | |||
| lv_i_hbkid | TYPE PCEC-HBKID, " | |||
| lv_not_found_lot | TYPE PCEC, " | |||
| lv_e_stapl | TYPE PCEC-STAPL, " | |||
| lv_i_hktid | TYPE PCEC-HKTID, " | |||
| lv_not_found_next_lot | TYPE PCEC, " | |||
| lv_e_zwels | TYPE PCEC-ZWELS, " | |||
| lv_i_stapl | TYPE PCEC-STAPL, " | |||
| lv_no_next_lot | TYPE PCEC, " | |||
| lv_i_zbukr | TYPE PCEC-ZBUKR, " | |||
| lv_lot_not_sequential | TYPE PCEC. " |
|   CALL FUNCTION 'LOT_CHECK' " |
| EXPORTING | ||
| I_HBKID | = lv_i_hbkid | |
| I_HKTID | = lv_i_hktid | |
| I_STAPL | = lv_i_stapl | |
| I_ZBUKR | = lv_i_zbukr | |
| IMPORTING | ||
| E_STAPI | = lv_e_stapi | |
| E_STAPL | = lv_e_stapl | |
| E_ZWELS | = lv_e_zwels | |
| EXCEPTIONS | ||
| NOT_FOUND_LOT = 1 | ||
| NOT_FOUND_NEXT_LOT = 2 | ||
| NO_NEXT_LOT = 3 | ||
| LOT_NOT_SEQUENTIAL = 4 | ||
| . " LOT_CHECK | ||
ABAP code using 7.40 inline data declarations to call FM LOT_CHECK
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 STAPI FROM PCEC INTO @DATA(ld_e_stapi). | ||||
| "SELECT single HBKID FROM PCEC INTO @DATA(ld_i_hbkid). | ||||
| "SELECT single STAPL FROM PCEC INTO @DATA(ld_e_stapl). | ||||
| "SELECT single HKTID FROM PCEC INTO @DATA(ld_i_hktid). | ||||
| "SELECT single ZWELS FROM PCEC INTO @DATA(ld_e_zwels). | ||||
| "SELECT single STAPL FROM PCEC INTO @DATA(ld_i_stapl). | ||||
| "SELECT single ZBUKR FROM PCEC INTO @DATA(ld_i_zbukr). | ||||
Search for further information about these or an SAP related objects