SAP BORROW_INSERT Function Module for IS-H: Entleihe/Entleihanforderung für ein oder mehrere Dokumente anlegen
BORROW_INSERT is a standard borrow insert SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for IS-H: Entleihe/Entleihanforderung für ein oder mehrere Dokumente anlegen 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 borrow insert FM, simply by entering the name BORROW_INSERT into the relevant SAP transaction such as SE37 or SE38.
Function Group: N031
Program Name: SAPLN031
Main Program: SAPLN031
Appliation area: N
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function BORROW_INSERT 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 'BORROW_INSERT'"IS-H: Entleihe/Entleihanforderung für ein oder mehrere Dokumente anlegen.
EXPORTING
* SS_DIALOG = 'X' "Entleihe/Entleihanforderung mit Dialog ON/OFF
* SS_FORMULAR_FALNR = ' ' "Diese Fall-Id soll für das Formularwesen bereitgestellt werden
* SS_FORMULAR_LFDBW = '00000' "Daten dieser Bewegung sollen für das Formularwesen bereitgestellt werden
SS_ENTLEIHER = "Entleiher-ID
SS_ENTLEIHERTYP = "Entleihertyp lt. TND03
SS_ENTLEIHZWECK = "Entleihzweck lt. TND01
* SS_MOD = '1' "Modus für Anlegen von Entleihsätzen ->F2
SS_ORGKR = "Organisationskreis ->F2
* SS_SAVE_IMMEDIATLY = '1' "TRUE => FUB stößt d. Verbuchung an
* SS_FULLSCREEN = ' ' "Entleihdialogbild als Vollbild bringen
* SS_TCODE = SY-TCODE "Transactionscode vom aufrufendem Programm
IMPORTING
SS_ERRORS_EXIST = "Es sind Fehler aufgetreten TRUE/FALSE->Protokoll
SS_UPDATE_NDAE = "Entleihsatz wurde angelegt TRUE/FALSE
SS_PRINT_FORM = "ON/OFF Formulardruck wurde angestoßen
TABLES
SS_DOCUMENT_TAB = "Tabelle mit zu entleihenden Dokumenten ->F2
EXCEPTIONS
BORROW_SET_IS_WRONG = 1 DOKAR_IS_DIFFERENT = 2 NO_DOCUMENTS = 3 NO_ORGKR = 4 NO_TYPE_OF_BORROWER = 5
IMPORTING Parameters details for BORROW_INSERT
SS_DIALOG - Entleihe/Entleihanforderung mit Dialog ON/OFF
Data type:Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SS_FORMULAR_FALNR - Diese Fall-Id soll für das Formularwesen bereitgestellt werden
Data type: NFAL-FALNRDefault: SPACE
Optional: Yes
Call by Reference: Yes
SS_FORMULAR_LFDBW - Daten dieser Bewegung sollen für das Formularwesen bereitgestellt werden
Data type: NBEW-LFDNRDefault: '00000'
Optional: Yes
Call by Reference: Yes
SS_ENTLEIHER - Entleiher-ID
Data type: NDAE-ENTLEIHEROptional: No
Call by Reference: No ( called with pass by value option)
SS_ENTLEIHERTYP - Entleihertyp lt. TND03
Data type: NDAE-ENTLTYPOptional: No
Call by Reference: No ( called with pass by value option)
SS_ENTLEIHZWECK - Entleihzweck lt. TND01
Data type: NDAE-ENTZWOptional: No
Call by Reference: No ( called with pass by value option)
SS_MOD - Modus für Anlegen von Entleihsätzen ->F2
Data type:Default: '1'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SS_ORGKR - Organisationskreis ->F2
Data type: NDAE-ORGKROptional: No
Call by Reference: No ( called with pass by value option)
SS_SAVE_IMMEDIATLY - TRUE => FUB stößt d. Verbuchung an
Data type:Default: '1'
Optional: Yes
Call by Reference: No ( called with pass by value option)
SS_FULLSCREEN - Entleihdialogbild als Vollbild bringen
Data type:Default: ' '
Optional: Yes
Call by Reference: No ( called with pass by value option)
SS_TCODE - Transactionscode vom aufrufendem Programm
Data type: SY-TCODEDefault: SY-TCODE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for BORROW_INSERT
SS_ERRORS_EXIST - Es sind Fehler aufgetreten TRUE/FALSE->Protokoll
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SS_UPDATE_NDAE - Entleihsatz wurde angelegt TRUE/FALSE
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
SS_PRINT_FORM - ON/OFF Formulardruck wurde angestoßen
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for BORROW_INSERT
SS_DOCUMENT_TAB - Tabelle mit zu entleihenden Dokumenten ->F2
Data type: NDAEOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
BORROW_SET_IS_WRONG - Entleihsatz ist fehlerhaft; nur b. SS_DIALOG=OFF
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DOKAR_IS_DIFFERENT - Dokumente haben nicht gleiche Dokumentenart
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_DOCUMENTS - Es liegen keine Dokumente vor
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_ORGKR - Es wurde kein Organisationskreis übergeben
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_TYPE_OF_BORROWER - Es wurde kein Entleihertyp übergeben
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for BORROW_INSERT 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_ss_dialog | TYPE STRING, " 'X' | |||
| lt_ss_document_tab | TYPE STANDARD TABLE OF NDAE, " | |||
| lv_ss_errors_exist | TYPE NDAE, " | |||
| lv_borrow_set_is_wrong | TYPE NDAE, " | |||
| lv_ss_formular_falnr | TYPE NFAL-FALNR, " SPACE | |||
| lv_ss_formular_lfdbw | TYPE NBEW-LFDNR, " '00000' | |||
| lv_ss_entleiher | TYPE NDAE-ENTLEIHER, " | |||
| lv_ss_update_ndae | TYPE NDAE, " | |||
| lv_dokar_is_different | TYPE NDAE, " | |||
| lv_no_documents | TYPE NDAE, " | |||
| lv_ss_print_form | TYPE NDAE, " | |||
| lv_ss_entleihertyp | TYPE NDAE-ENTLTYP, " | |||
| lv_no_orgkr | TYPE NDAE, " | |||
| lv_ss_entleihzweck | TYPE NDAE-ENTZW, " | |||
| lv_ss_mod | TYPE NDAE, " '1' | |||
| lv_no_type_of_borrower | TYPE NDAE, " | |||
| lv_ss_orgkr | TYPE NDAE-ORGKR, " | |||
| lv_ss_save_immediatly | TYPE NDAE, " '1' | |||
| lv_ss_fullscreen | TYPE NDAE, " ' ' | |||
| lv_ss_tcode | TYPE SY-TCODE. " SY-TCODE |
|   CALL FUNCTION 'BORROW_INSERT' "IS-H: Entleihe/Entleihanforderung für ein oder mehrere Dokumente anlegen |
| EXPORTING | ||
| SS_DIALOG | = lv_ss_dialog | |
| SS_FORMULAR_FALNR | = lv_ss_formular_falnr | |
| SS_FORMULAR_LFDBW | = lv_ss_formular_lfdbw | |
| SS_ENTLEIHER | = lv_ss_entleiher | |
| SS_ENTLEIHERTYP | = lv_ss_entleihertyp | |
| SS_ENTLEIHZWECK | = lv_ss_entleihzweck | |
| SS_MOD | = lv_ss_mod | |
| SS_ORGKR | = lv_ss_orgkr | |
| SS_SAVE_IMMEDIATLY | = lv_ss_save_immediatly | |
| SS_FULLSCREEN | = lv_ss_fullscreen | |
| SS_TCODE | = lv_ss_tcode | |
| IMPORTING | ||
| SS_ERRORS_EXIST | = lv_ss_errors_exist | |
| SS_UPDATE_NDAE | = lv_ss_update_ndae | |
| SS_PRINT_FORM | = lv_ss_print_form | |
| TABLES | ||
| SS_DOCUMENT_TAB | = lt_ss_document_tab | |
| EXCEPTIONS | ||
| BORROW_SET_IS_WRONG = 1 | ||
| DOKAR_IS_DIFFERENT = 2 | ||
| NO_DOCUMENTS = 3 | ||
| NO_ORGKR = 4 | ||
| NO_TYPE_OF_BORROWER = 5 | ||
| . " BORROW_INSERT | ||
ABAP code using 7.40 inline data declarations to call FM BORROW_INSERT
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.| DATA(ld_ss_dialog) | = 'X'. | |||
| "SELECT single FALNR FROM NFAL INTO @DATA(ld_ss_formular_falnr). | ||||
| DATA(ld_ss_formular_falnr) | = ' '. | |||
| "SELECT single LFDNR FROM NBEW INTO @DATA(ld_ss_formular_lfdbw). | ||||
| DATA(ld_ss_formular_lfdbw) | = '00000'. | |||
| "SELECT single ENTLEIHER FROM NDAE INTO @DATA(ld_ss_entleiher). | ||||
| "SELECT single ENTLTYP FROM NDAE INTO @DATA(ld_ss_entleihertyp). | ||||
| "SELECT single ENTZW FROM NDAE INTO @DATA(ld_ss_entleihzweck). | ||||
| DATA(ld_ss_mod) | = '1'. | |||
| "SELECT single ORGKR FROM NDAE INTO @DATA(ld_ss_orgkr). | ||||
| DATA(ld_ss_save_immediatly) | = '1'. | |||
| DATA(ld_ss_fullscreen) | = ' '. | |||
| "SELECT single TCODE FROM SY INTO @DATA(ld_ss_tcode). | ||||
| DATA(ld_ss_tcode) | = SY-TCODE. | |||
Search for further information about these or an SAP related objects