SAP RH_INSERT_INFTY Function Module for Insert Infotype Records
RH_INSERT_INFTY is a standard rh insert infty SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Insert Infotype Records 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 rh insert infty FM, simply by entering the name RH_INSERT_INFTY into the relevant SAP transaction such as SE37 or SE38.
Function Group: RHAP
Program Name: SAPLRHAP
Main Program: SAPLRHAP
Appliation area: H
Release date: 08-Apr-1998
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RH_INSERT_INFTY 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 'RH_INSERT_INFTY'"Insert Infotype Records.
EXPORTING
* FCODE = 'INSE' "Function Code
* KEEP_LUPD = "Retain Last Changed By/On
* WORKF_ACTV = 'X' "Workflow Switch Active
VTASK = "Update (B=Buffer,D=Online,V=Update,S=Sync)
* ORDER_FLG = 'X' "Switch: Take Record Sequence Into Account
* COMMIT_FLG = 'X' "Switch with COMMIT
* AUTHY = 'X' "Authorization Check Switch
* PPPAR_IMP = "Import Structure PPPAR
* OLD_TABNR = ' ' "Flag: Take Old Pointer Value (TABNR)
* REPID = ' ' "Report Name for Transferring Table Infotypes
* FORM = ' ' "FORM Name for Transferring Table Infotypes
TABLES
INNNN = "Table of Infotype Records
* ILFCODE = "Table of Logical Function Codes
EXCEPTIONS
NO_AUTHORIZATION = 1 ERROR_DURING_INSERT = 2 REPID_FORM_INITIAL = 3 CORR_EXIT = 4 BEGDA_GREATER_ENDDA = 5
IMPORTING Parameters details for RH_INSERT_INFTY
FCODE - Function Code
Data type: HRRHAP-FCODEDefault: 'INSE'
Optional: Yes
Call by Reference: No ( called with pass by value option)
KEEP_LUPD - Retain Last Changed By/On
Data type: HRRHAP-KEEP_LUPDOptional: Yes
Call by Reference: No ( called with pass by value option)
WORKF_ACTV - Workflow Switch Active
Data type: HRRHAP-WORKF_ACTVDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
VTASK - Update (B=Buffer,D=Online,V=Update,S=Sync)
Data type: HRRHAP-VTASKOptional: No
Call by Reference: No ( called with pass by value option)
ORDER_FLG - Switch: Take Record Sequence Into Account
Data type: HRRHAP-ORDER_FLGDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
COMMIT_FLG - Switch with COMMIT
Data type: HRRHAP-COMMIT_FLGDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
AUTHY - Authorization Check Switch
Data type: HRRHAP-AUTHYDefault: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)
PPPAR_IMP - Import Structure PPPAR
Data type: PPPAROptional: Yes
Call by Reference: No ( called with pass by value option)
OLD_TABNR - Flag: Take Old Pointer Value (TABNR)
Data type: HRRHAP-OLD_TABNRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
REPID - Report Name for Transferring Table Infotypes
Data type: SY-REPIDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FORM - FORM Name for Transferring Table Infotypes
Data type:Default: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for RH_INSERT_INFTY
INNNN - Table of Infotype Records
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ILFCODE - Table of Logical Function Codes
Data type: ILFCODOptional: Yes
Call by Reference: No ( called with pass by value option)
EXCEPTIONS details
NO_AUTHORIZATION - Error while Creating Record
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ERROR_DURING_INSERT - No Authorization
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
REPID_FORM_INITIAL - Report/FORM Name for Table Infotype is Empty
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
CORR_EXIT - Error/Termination While Assigning Correction Number
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
BEGDA_GREATER_ENDDA - Start Date is After End Date
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
Copy and paste ABAP code example for RH_INSERT_INFTY 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_fcode | TYPE HRRHAP-FCODE, " 'INSE' | |||
| lt_innnn | TYPE STANDARD TABLE OF HRRHAP, " | |||
| lv_no_authorization | TYPE HRRHAP, " | |||
| lv_keep_lupd | TYPE HRRHAP-KEEP_LUPD, " | |||
| lv_workf_actv | TYPE HRRHAP-WORKF_ACTV, " 'X' | |||
| lv_vtask | TYPE HRRHAP-VTASK, " | |||
| lt_ilfcode | TYPE STANDARD TABLE OF ILFCOD, " | |||
| lv_error_during_insert | TYPE ILFCOD, " | |||
| lv_order_flg | TYPE HRRHAP-ORDER_FLG, " 'X' | |||
| lv_repid_form_initial | TYPE HRRHAP, " | |||
| lv_corr_exit | TYPE HRRHAP, " | |||
| lv_commit_flg | TYPE HRRHAP-COMMIT_FLG, " 'X' | |||
| lv_authy | TYPE HRRHAP-AUTHY, " 'X' | |||
| lv_begda_greater_endda | TYPE HRRHAP, " | |||
| lv_pppar_imp | TYPE PPPAR, " | |||
| lv_old_tabnr | TYPE HRRHAP-OLD_TABNR, " SPACE | |||
| lv_repid | TYPE SY-REPID, " SPACE | |||
| lv_form | TYPE SY. " SPACE |
|   CALL FUNCTION 'RH_INSERT_INFTY' "Insert Infotype Records |
| EXPORTING | ||
| FCODE | = lv_fcode | |
| KEEP_LUPD | = lv_keep_lupd | |
| WORKF_ACTV | = lv_workf_actv | |
| VTASK | = lv_vtask | |
| ORDER_FLG | = lv_order_flg | |
| COMMIT_FLG | = lv_commit_flg | |
| AUTHY | = lv_authy | |
| PPPAR_IMP | = lv_pppar_imp | |
| OLD_TABNR | = lv_old_tabnr | |
| REPID | = lv_repid | |
| FORM | = lv_form | |
| TABLES | ||
| INNNN | = lt_innnn | |
| ILFCODE | = lt_ilfcode | |
| EXCEPTIONS | ||
| NO_AUTHORIZATION = 1 | ||
| ERROR_DURING_INSERT = 2 | ||
| REPID_FORM_INITIAL = 3 | ||
| CORR_EXIT = 4 | ||
| BEGDA_GREATER_ENDDA = 5 | ||
| . " RH_INSERT_INFTY | ||
ABAP code using 7.40 inline data declarations to call FM RH_INSERT_INFTY
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 FCODE FROM HRRHAP INTO @DATA(ld_fcode). | ||||
| DATA(ld_fcode) | = 'INSE'. | |||
| "SELECT single KEEP_LUPD FROM HRRHAP INTO @DATA(ld_keep_lupd). | ||||
| "SELECT single WORKF_ACTV FROM HRRHAP INTO @DATA(ld_workf_actv). | ||||
| DATA(ld_workf_actv) | = 'X'. | |||
| "SELECT single VTASK FROM HRRHAP INTO @DATA(ld_vtask). | ||||
| "SELECT single ORDER_FLG FROM HRRHAP INTO @DATA(ld_order_flg). | ||||
| DATA(ld_order_flg) | = 'X'. | |||
| "SELECT single COMMIT_FLG FROM HRRHAP INTO @DATA(ld_commit_flg). | ||||
| DATA(ld_commit_flg) | = 'X'. | |||
| "SELECT single AUTHY FROM HRRHAP INTO @DATA(ld_authy). | ||||
| DATA(ld_authy) | = 'X'. | |||
| "SELECT single OLD_TABNR FROM HRRHAP INTO @DATA(ld_old_tabnr). | ||||
| DATA(ld_old_tabnr) | = ' '. | |||
| "SELECT single REPID FROM SY INTO @DATA(ld_repid). | ||||
| DATA(ld_repid) | = ' '. | |||
| DATA(ld_form) | = ' '. | |||
Search for further information about these or an SAP related objects