SAP GET_LOAN_FOR_POSTING Function Module for Loans Dunning: Determine the Contract for Posting
GET_LOAN_FOR_POSTING is a standard get loan for posting SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Loans Dunning: Determine the Contract for Posting 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 get loan for posting FM, simply by entering the name GET_LOAN_FOR_POSTING into the relevant SAP transaction such as SE37 or SE38.
Function Group: FVCW_HELP
Program Name: SAPLFVCW_HELP
Main Program:
Appliation area: F
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function GET_LOAN_FOR_POSTING 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 'GET_LOAN_FOR_POSTING'"Loans Dunning: Determine the Contract for Posting.
EXPORTING
I_SDUNPOST = "Posting Variant
I_SDUNNCMP = "Summarization Level
I_BUKRS = "Company Code
I_SARCHIV = "Archv.
I_RANL = "Contract Number
* I_RKLAMMER = "Finanzprojektnummer ( I_SUNNCMP = 'FP')
* I_RDARNEHM = "Hauptdarlehensnehmer ( I_SUNNCMP = 'BO')
IMPORTING
E_RANL = "Vertrag, der die Gebührenbuchung trägt
E_VDARL = "
EXCEPTIONS
RANL_NOT_FOUND = 1 NO_POSTING = 2 NO_I_RKLAMMER = 3 NO_I_RDARNEHM = 4
IMPORTING Parameters details for GET_LOAN_FOR_POSTING
I_SDUNPOST - Posting Variant
Data type: TZPAB-SDUNPOSTOptional: No
Call by Reference: No ( called with pass by value option)
I_SDUNNCMP - Summarization Level
Data type: VDARL-SDUNNCMPOptional: No
Call by Reference: No ( called with pass by value option)
I_BUKRS - Company Code
Data type: VDARL-BUKRSOptional: No
Call by Reference: No ( called with pass by value option)
I_SARCHIV - Archv.
Data type: VDARL-SARCHIVOptional: No
Call by Reference: No ( called with pass by value option)
I_RANL - Contract Number
Data type: VDARL-RANLOptional: No
Call by Reference: No ( called with pass by value option)
I_RKLAMMER - Finanzprojektnummer ( I_SUNNCMP = 'FP')
Data type: VDARL-RKLAMMEROptional: Yes
Call by Reference: No ( called with pass by value option)
I_RDARNEHM - Hauptdarlehensnehmer ( I_SUNNCMP = 'BO')
Data type: VDARL-RDARNEHMOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for GET_LOAN_FOR_POSTING
E_RANL - Vertrag, der die Gebührenbuchung trägt
Data type: VDARL-RANLOptional: No
Call by Reference: No ( called with pass by value option)
E_VDARL -
Data type: VDARLOptional: No
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
RANL_NOT_FOUND - Kein Vertrag für Gebührenbuchung gefunden
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_POSTING - Buchungsvariante sieht keine Buchung vor
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_I_RKLAMMER - Verdichtungsebene FP: Finanzprojekt benötigt
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_I_RDARNEHM - Verdichtungsebene BO: Darlehensnehmer benötigt
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for GET_LOAN_FOR_POSTING 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_ranl | TYPE VDARL-RANL, " | |||
| lv_i_sdunpost | TYPE TZPAB-SDUNPOST, " | |||
| lv_ranl_not_found | TYPE TZPAB, " | |||
| lv_e_vdarl | TYPE VDARL, " | |||
| lv_i_sdunncmp | TYPE VDARL-SDUNNCMP, " | |||
| lv_no_posting | TYPE VDARL, " | |||
| lv_i_bukrs | TYPE VDARL-BUKRS, " | |||
| lv_no_i_rklammer | TYPE VDARL, " | |||
| lv_i_sarchiv | TYPE VDARL-SARCHIV, " | |||
| lv_no_i_rdarnehm | TYPE VDARL, " | |||
| lv_i_ranl | TYPE VDARL-RANL, " | |||
| lv_i_rklammer | TYPE VDARL-RKLAMMER, " | |||
| lv_i_rdarnehm | TYPE VDARL-RDARNEHM. " |
|   CALL FUNCTION 'GET_LOAN_FOR_POSTING' "Loans Dunning: Determine the Contract for Posting |
| EXPORTING | ||
| I_SDUNPOST | = lv_i_sdunpost | |
| I_SDUNNCMP | = lv_i_sdunncmp | |
| I_BUKRS | = lv_i_bukrs | |
| I_SARCHIV | = lv_i_sarchiv | |
| I_RANL | = lv_i_ranl | |
| I_RKLAMMER | = lv_i_rklammer | |
| I_RDARNEHM | = lv_i_rdarnehm | |
| IMPORTING | ||
| E_RANL | = lv_e_ranl | |
| E_VDARL | = lv_e_vdarl | |
| EXCEPTIONS | ||
| RANL_NOT_FOUND = 1 | ||
| NO_POSTING = 2 | ||
| NO_I_RKLAMMER = 3 | ||
| NO_I_RDARNEHM = 4 | ||
| . " GET_LOAN_FOR_POSTING | ||
ABAP code using 7.40 inline data declarations to call FM GET_LOAN_FOR_POSTING
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 RANL FROM VDARL INTO @DATA(ld_e_ranl). | ||||
| "SELECT single SDUNPOST FROM TZPAB INTO @DATA(ld_i_sdunpost). | ||||
| "SELECT single SDUNNCMP FROM VDARL INTO @DATA(ld_i_sdunncmp). | ||||
| "SELECT single BUKRS FROM VDARL INTO @DATA(ld_i_bukrs). | ||||
| "SELECT single SARCHIV FROM VDARL INTO @DATA(ld_i_sarchiv). | ||||
| "SELECT single RANL FROM VDARL INTO @DATA(ld_i_ranl). | ||||
| "SELECT single RKLAMMER FROM VDARL INTO @DATA(ld_i_rklammer). | ||||
| "SELECT single RDARNEHM FROM VDARL INTO @DATA(ld_i_rdarnehm). | ||||
Search for further information about these or an SAP related objects