SAP SERNR_DEL_FROM_DOCUMENT Function Module for NOTRANSL: Loeschen von Serialnummer(n) aus einem Beleg (dunkel)
SERNR_DEL_FROM_DOCUMENT is a standard sernr del from document SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for NOTRANSL: Loeschen von Serialnummer(n) aus einem Beleg (dunkel) 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 sernr del from document FM, simply by entering the name SERNR_DEL_FROM_DOCUMENT into the relevant SAP transaction such as SE37 or SE38.
Function Group: IPW1
Program Name: SAPLIPW1
Main Program: SAPLIPW1
Appliation area: I
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function SERNR_DEL_FROM_DOCUMENT 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 'SERNR_DEL_FROM_DOCUMENT'"NOTRANSL: Loeschen von Serialnummer(n) aus einem Beleg (dunkel).
EXPORTING
OBJKOPF = "Type of Object List
* BUDAT = "Posting Date in the Document
* BAPI = ' ' "Call from BAPI
* EXT = "Interface Extensions for SERNR_DEL_FROM_DOCUMENT
SERXX = "
OPERATION = "Serialization procedure
* MATERIAL = "Material Number
J_VORGANG = "
* BSTCH = "
* BSTUP = "
* DEL_COMPLETE = ' ' "
* PROFILE = "
IMPORTING
ANZSN = "
SERIAL_COMMIT = "Change Indicator
STATUS_NOT_ALLOWED = "
ZEILEN_ID = "
CHANGING
* T_SMESG = "Message table message collector
TABLES
* SERNR = "
* R_SERNR = "
EXCEPTIONS
OBJECTLIST_NOT_FOUND = 1 PARAMETER_ERROR = 2
Customer Function user exits
Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.EXIT_SAPLIPW1_001 Automatic Serial Number Assignment
EXIT_SAPLIPW1_002 Check on Copying Object List
EXIT_SAPLIPW1_003 Serial Numbers, User Exit for Additional Fields
EXIT_SAPLIPW1_004 Serial Numbers, User Exit After Exiting the Serial Screen
EXIT_SAPLIPW1_008 Check of Serial Number - Character String
IMPORTING Parameters details for SERNR_DEL_FROM_DOCUMENT
OBJKOPF - Type of Object List
Data type: T377X-OBJKOPFOptional: No
Call by Reference: No ( called with pass by value option)
BUDAT - Posting Date in the Document
Data type: MKPF-BUDATOptional: Yes
Call by Reference: Yes
BAPI - Call from BAPI
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXT - Interface Extensions for SERNR_DEL_FROM_DOCUMENT
Data type: EXT_SERNR_DEL_FROM_DOCUMENTOptional: Yes
Call by Reference: Yes
SERXX -
Data type: RSERXXOptional: No
Call by Reference: No ( called with pass by value option)
OPERATION - Serialization procedure
Data type: T377X-BELEGOptional: No
Call by Reference: No ( called with pass by value option)
MATERIAL - Material Number
Data type: RISA0-MATNROptional: Yes
Call by Reference: No ( called with pass by value option)
J_VORGANG -
Data type: TJ01-VRGNGOptional: No
Call by Reference: No ( called with pass by value option)
BSTCH -
Data type: BSINFOptional: Yes
Call by Reference: No ( called with pass by value option)
BSTUP -
Data type: BSINFOptional: Yes
Call by Reference: No ( called with pass by value option)
DEL_COMPLETE -
Data type: CDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PROFILE -
Data type: T377P-SERAILOptional: Yes
Call by Reference: Yes
EXPORTING Parameters details for SERNR_DEL_FROM_DOCUMENT
ANZSN -
Data type: LIPS-ANZSNOptional: No
Call by Reference: No ( called with pass by value option)
SERIAL_COMMIT - Change Indicator
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
STATUS_NOT_ALLOWED -
Data type: COptional: No
Call by Reference: No ( called with pass by value option)
ZEILEN_ID -
Data type: MESG-ZEILEOptional: No
Call by Reference: Yes
CHANGING Parameters details for SERNR_DEL_FROM_DOCUMENT
T_SMESG - Message table message collector
Data type: TSMESGOptional: Yes
Call by Reference: Yes
TABLES Parameters details for SERNR_DEL_FROM_DOCUMENT
SERNR -
Data type: E1RMSNOOptional: Yes
Call by Reference: No ( called with pass by value option)
R_SERNR -
Data type: ERSERNROptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
OBJECTLIST_NOT_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
PARAMETER_ERROR -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for SERNR_DEL_FROM_DOCUMENT 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_anzsn | TYPE LIPS-ANZSN, " | |||
| lt_sernr | TYPE STANDARD TABLE OF E1RMSNO, " | |||
| lv_objkopf | TYPE T377X-OBJKOPF, " | |||
| lv_t_smesg | TYPE TSMESG, " | |||
| lv_objectlist_not_found | TYPE TSMESG, " | |||
| lv_budat | TYPE MKPF-BUDAT, " | |||
| lv_bapi | TYPE C, " SPACE | |||
| lv_ext | TYPE EXT_SERNR_DEL_FROM_DOCUMENT, " | |||
| lv_serxx | TYPE RSERXX, " | |||
| lt_r_sernr | TYPE STANDARD TABLE OF ERSERNR, " | |||
| lv_serial_commit | TYPE C, " | |||
| lv_parameter_error | TYPE C, " | |||
| lv_operation | TYPE T377X-BELEG, " | |||
| lv_status_not_allowed | TYPE C, " | |||
| lv_material | TYPE RISA0-MATNR, " | |||
| lv_zeilen_id | TYPE MESG-ZEILE, " | |||
| lv_j_vorgang | TYPE TJ01-VRGNG, " | |||
| lv_bstch | TYPE BSINF, " | |||
| lv_bstup | TYPE BSINF, " | |||
| lv_del_complete | TYPE C, " SPACE | |||
| lv_profile | TYPE T377P-SERAIL. " |
|   CALL FUNCTION 'SERNR_DEL_FROM_DOCUMENT' "NOTRANSL: Loeschen von Serialnummer(n) aus einem Beleg (dunkel) |
| EXPORTING | ||
| OBJKOPF | = lv_objkopf | |
| BUDAT | = lv_budat | |
| BAPI | = lv_bapi | |
| EXT | = lv_ext | |
| SERXX | = lv_serxx | |
| OPERATION | = lv_operation | |
| MATERIAL | = lv_material | |
| J_VORGANG | = lv_j_vorgang | |
| BSTCH | = lv_bstch | |
| BSTUP | = lv_bstup | |
| DEL_COMPLETE | = lv_del_complete | |
| PROFILE | = lv_profile | |
| IMPORTING | ||
| ANZSN | = lv_anzsn | |
| SERIAL_COMMIT | = lv_serial_commit | |
| STATUS_NOT_ALLOWED | = lv_status_not_allowed | |
| ZEILEN_ID | = lv_zeilen_id | |
| CHANGING | ||
| T_SMESG | = lv_t_smesg | |
| TABLES | ||
| SERNR | = lt_sernr | |
| R_SERNR | = lt_r_sernr | |
| EXCEPTIONS | ||
| OBJECTLIST_NOT_FOUND = 1 | ||
| PARAMETER_ERROR = 2 | ||
| . " SERNR_DEL_FROM_DOCUMENT | ||
ABAP code using 7.40 inline data declarations to call FM SERNR_DEL_FROM_DOCUMENT
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 ANZSN FROM LIPS INTO @DATA(ld_anzsn). | ||||
| "SELECT single OBJKOPF FROM T377X INTO @DATA(ld_objkopf). | ||||
| "SELECT single BUDAT FROM MKPF INTO @DATA(ld_budat). | ||||
| DATA(ld_bapi) | = ' '. | |||
| "SELECT single BELEG FROM T377X INTO @DATA(ld_operation). | ||||
| "SELECT single MATNR FROM RISA0 INTO @DATA(ld_material). | ||||
| "SELECT single ZEILE FROM MESG INTO @DATA(ld_zeilen_id). | ||||
| "SELECT single VRGNG FROM TJ01 INTO @DATA(ld_j_vorgang). | ||||
| DATA(ld_del_complete) | = ' '. | |||
| "SELECT single SERAIL FROM T377P INTO @DATA(ld_profile). | ||||
Search for further information about these or an SAP related objects