SAP CD_INSERT Function Module for Insert New Payroll Records in the RGDIR
CD_INSERT is a standard cd 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 Insert New Payroll Records in the RGDIR 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 cd insert FM, simply by entering the name CD_INSERT into the relevant SAP transaction such as SE37 or SE38.
Function Group: RPHI
Program Name: SAPLRPHI
Main Program: SAPLRPHI
Appliation area: P
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function CD_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 'CD_INSERT'"Insert New Payroll Records in the RGDIR.
EXPORTING
* FORPER_PAY_SUBUNIT = ' ' "
* INPER_PAY_SUBUNIT = ' ' "
* INPER_MODIF = ' ' "
* INPER = ' ' "In-Period
* INPER_END_DATE = ' ' "In-Period End Date
* LEGAL_PERSON = ' ' "Legal person
* PAY_TYPE = ' ' "Payroll category
* PAY_IDENT = ' ' "Payroll identifier
* PAY_OCRSN = ' ' "
* PAY_OCCAT = ' ' "
* VOID_INDICATOR = ' ' "Validity indicator
* FORPER_MODIF = ' ' "
* BONUS_DATE = ' ' "Date of Bonus Payroll Run
* RUN_DATE = ' ' "Date of Regular Payroll Run
* RUN_TIME = ' ' "Time of Run
* PAY_DATE = 00000000 "
* DUMMY = ' ' "Indicate Dummy Result
* OUTOFSEQ = ' ' "
* OOSDATE = 00000000 "
* BRACKET = "
* IS_PARENT = "
* FORPER = ' ' "
* FORPER_BEG_DATE = ' ' "
* FORPER_END_DATE = ' ' "
* INPER_PAYTY = ' ' "
* INPER_PAYID = ' ' "
* INPER_OCRSN = ' ' "
* INPER_OCCAT = ' ' "
IMPORTING
SEQUENCE_NUMBER = "Sequential number
TABLES
RGDIR = "Cluster Directory
RGDIR_CA = "
EXCEPTIONS
DUPLICATE_RECORD = 1 DUPLICATE_SEQNR = 2
IMPORTING Parameters details for CD_INSERT
FORPER_PAY_SUBUNIT -
Data type: PC261-ABKRSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
INPER_PAY_SUBUNIT -
Data type: PC261-IABKRSDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
INPER_MODIF -
Data type: PC261-IPERMDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
INPER - In-Period
Data type: PC261-INPERDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
INPER_END_DATE - In-Period End Date
Data type: PC261-IPENDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
LEGAL_PERSON - Legal person
Data type: PC261-JUPERDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PAY_TYPE - Payroll category
Data type: PC261-PAYTYDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PAY_IDENT - Payroll identifier
Data type: PC261-PAYIDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PAY_OCRSN -
Data type: PC261-OCRSNDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PAY_OCCAT -
Data type: PC261-OCCATDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
VOID_INDICATOR - Validity indicator
Data type: PC261-VOIDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FORPER_MODIF -
Data type: PC261-PERMODefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
BONUS_DATE - Date of Bonus Payroll Run
Data type: PC261-BONDTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
RUN_DATE - Date of Regular Payroll Run
Data type: PC261-RUNDTDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
RUN_TIME - Time of Run
Data type: PC261-RUNTMDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
PAY_DATE -
Data type: PC261-PAYDTDefault: 00000000
Optional: Yes
Call by Reference: No ( called with pass by value option)
DUMMY - Indicate Dummy Result
Data type: PC261-DUMMYDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
OUTOFSEQ -
Data type: PC261-OUTOFSEQDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
OOSDATE -
Data type: PC261-OOSDATEDefault: 00000000
Optional: Yes
Call by Reference: No ( called with pass by value option)
BRACKET -
Data type: PC261-BRACKETOptional: Yes
Call by Reference: No ( called with pass by value option)
IS_PARENT -
Data type: RP_XFELDOptional: Yes
Call by Reference: No ( called with pass by value option)
FORPER -
Data type: PC261-FPPERDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FORPER_BEG_DATE -
Data type: PC261-FPBEGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
FORPER_END_DATE -
Data type: PC261-FPENDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
INPER_PAYTY -
Data type: PC261-PAYTYDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
INPER_PAYID -
Data type: PC261-PAYIDDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
INPER_OCRSN -
Data type: PC261-INOCRDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
INPER_OCCAT -
Data type: PC261-INOCCDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for CD_INSERT
SEQUENCE_NUMBER - Sequential number
Data type: PC261-SEQNROptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for CD_INSERT
RGDIR - Cluster Directory
Data type: PC261Optional: No
Call by Reference: No ( called with pass by value option)
RGDIR_CA -
Data type: PC261AOptional: No
Call by Reference: Yes
EXCEPTIONS details
DUPLICATE_RECORD -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
DUPLICATE_SEQNR -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for CD_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: | ||||
| lt_rgdir | TYPE STANDARD TABLE OF PC261, " | |||
| lv_sequence_number | TYPE PC261-SEQNR, " | |||
| lv_duplicate_record | TYPE PC261, " | |||
| lv_forper_pay_subunit | TYPE PC261-ABKRS, " SPACE | |||
| lv_inper_pay_subunit | TYPE PC261-IABKRS, " SPACE | |||
| lv_inper_modif | TYPE PC261-IPERM, " SPACE | |||
| lv_inper | TYPE PC261-INPER, " SPACE | |||
| lv_inper_end_date | TYPE PC261-IPEND, " SPACE | |||
| lv_legal_person | TYPE PC261-JUPER, " SPACE | |||
| lv_pay_type | TYPE PC261-PAYTY, " SPACE | |||
| lv_pay_ident | TYPE PC261-PAYID, " SPACE | |||
| lv_pay_ocrsn | TYPE PC261-OCRSN, " SPACE | |||
| lv_pay_occat | TYPE PC261-OCCAT, " SPACE | |||
| lv_void_indicator | TYPE PC261-VOID, " SPACE | |||
| lt_rgdir_ca | TYPE STANDARD TABLE OF PC261A, " | |||
| lv_forper_modif | TYPE PC261-PERMO, " SPACE | |||
| lv_duplicate_seqnr | TYPE PC261, " | |||
| lv_bonus_date | TYPE PC261-BONDT, " SPACE | |||
| lv_run_date | TYPE PC261-RUNDT, " SPACE | |||
| lv_run_time | TYPE PC261-RUNTM, " SPACE | |||
| lv_pay_date | TYPE PC261-PAYDT, " 00000000 | |||
| lv_dummy | TYPE PC261-DUMMY, " SPACE | |||
| lv_outofseq | TYPE PC261-OUTOFSEQ, " SPACE | |||
| lv_oosdate | TYPE PC261-OOSDATE, " 00000000 | |||
| lv_bracket | TYPE PC261-BRACKET, " | |||
| lv_is_parent | TYPE RP_XFELD, " | |||
| lv_forper | TYPE PC261-FPPER, " SPACE | |||
| lv_forper_beg_date | TYPE PC261-FPBEG, " SPACE | |||
| lv_forper_end_date | TYPE PC261-FPEND, " SPACE | |||
| lv_inper_payty | TYPE PC261-PAYTY, " SPACE | |||
| lv_inper_payid | TYPE PC261-PAYID, " SPACE | |||
| lv_inper_ocrsn | TYPE PC261-INOCR, " SPACE | |||
| lv_inper_occat | TYPE PC261-INOCC. " SPACE |
|   CALL FUNCTION 'CD_INSERT' "Insert New Payroll Records in the RGDIR |
| EXPORTING | ||
| FORPER_PAY_SUBUNIT | = lv_forper_pay_subunit | |
| INPER_PAY_SUBUNIT | = lv_inper_pay_subunit | |
| INPER_MODIF | = lv_inper_modif | |
| INPER | = lv_inper | |
| INPER_END_DATE | = lv_inper_end_date | |
| LEGAL_PERSON | = lv_legal_person | |
| PAY_TYPE | = lv_pay_type | |
| PAY_IDENT | = lv_pay_ident | |
| PAY_OCRSN | = lv_pay_ocrsn | |
| PAY_OCCAT | = lv_pay_occat | |
| VOID_INDICATOR | = lv_void_indicator | |
| FORPER_MODIF | = lv_forper_modif | |
| BONUS_DATE | = lv_bonus_date | |
| RUN_DATE | = lv_run_date | |
| RUN_TIME | = lv_run_time | |
| PAY_DATE | = lv_pay_date | |
| DUMMY | = lv_dummy | |
| OUTOFSEQ | = lv_outofseq | |
| OOSDATE | = lv_oosdate | |
| BRACKET | = lv_bracket | |
| IS_PARENT | = lv_is_parent | |
| FORPER | = lv_forper | |
| FORPER_BEG_DATE | = lv_forper_beg_date | |
| FORPER_END_DATE | = lv_forper_end_date | |
| INPER_PAYTY | = lv_inper_payty | |
| INPER_PAYID | = lv_inper_payid | |
| INPER_OCRSN | = lv_inper_ocrsn | |
| INPER_OCCAT | = lv_inper_occat | |
| IMPORTING | ||
| SEQUENCE_NUMBER | = lv_sequence_number | |
| TABLES | ||
| RGDIR | = lt_rgdir | |
| RGDIR_CA | = lt_rgdir_ca | |
| EXCEPTIONS | ||
| DUPLICATE_RECORD = 1 | ||
| DUPLICATE_SEQNR = 2 | ||
| . " CD_INSERT | ||
ABAP code using 7.40 inline data declarations to call FM CD_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.| "SELECT single SEQNR FROM PC261 INTO @DATA(ld_sequence_number). | ||||
| "SELECT single ABKRS FROM PC261 INTO @DATA(ld_forper_pay_subunit). | ||||
| DATA(ld_forper_pay_subunit) | = ' '. | |||
| "SELECT single IABKRS FROM PC261 INTO @DATA(ld_inper_pay_subunit). | ||||
| DATA(ld_inper_pay_subunit) | = ' '. | |||
| "SELECT single IPERM FROM PC261 INTO @DATA(ld_inper_modif). | ||||
| DATA(ld_inper_modif) | = ' '. | |||
| "SELECT single INPER FROM PC261 INTO @DATA(ld_inper). | ||||
| DATA(ld_inper) | = ' '. | |||
| "SELECT single IPEND FROM PC261 INTO @DATA(ld_inper_end_date). | ||||
| DATA(ld_inper_end_date) | = ' '. | |||
| "SELECT single JUPER FROM PC261 INTO @DATA(ld_legal_person). | ||||
| DATA(ld_legal_person) | = ' '. | |||
| "SELECT single PAYTY FROM PC261 INTO @DATA(ld_pay_type). | ||||
| DATA(ld_pay_type) | = ' '. | |||
| "SELECT single PAYID FROM PC261 INTO @DATA(ld_pay_ident). | ||||
| DATA(ld_pay_ident) | = ' '. | |||
| "SELECT single OCRSN FROM PC261 INTO @DATA(ld_pay_ocrsn). | ||||
| DATA(ld_pay_ocrsn) | = ' '. | |||
| "SELECT single OCCAT FROM PC261 INTO @DATA(ld_pay_occat). | ||||
| DATA(ld_pay_occat) | = ' '. | |||
| "SELECT single VOID FROM PC261 INTO @DATA(ld_void_indicator). | ||||
| DATA(ld_void_indicator) | = ' '. | |||
| "SELECT single PERMO FROM PC261 INTO @DATA(ld_forper_modif). | ||||
| DATA(ld_forper_modif) | = ' '. | |||
| "SELECT single BONDT FROM PC261 INTO @DATA(ld_bonus_date). | ||||
| DATA(ld_bonus_date) | = ' '. | |||
| "SELECT single RUNDT FROM PC261 INTO @DATA(ld_run_date). | ||||
| DATA(ld_run_date) | = ' '. | |||
| "SELECT single RUNTM FROM PC261 INTO @DATA(ld_run_time). | ||||
| DATA(ld_run_time) | = ' '. | |||
| "SELECT single PAYDT FROM PC261 INTO @DATA(ld_pay_date). | ||||
| DATA(ld_pay_date) | = 00000000. | |||
| "SELECT single DUMMY FROM PC261 INTO @DATA(ld_dummy). | ||||
| DATA(ld_dummy) | = ' '. | |||
| "SELECT single OUTOFSEQ FROM PC261 INTO @DATA(ld_outofseq). | ||||
| DATA(ld_outofseq) | = ' '. | |||
| "SELECT single OOSDATE FROM PC261 INTO @DATA(ld_oosdate). | ||||
| DATA(ld_oosdate) | = 00000000. | |||
| "SELECT single BRACKET FROM PC261 INTO @DATA(ld_bracket). | ||||
| "SELECT single FPPER FROM PC261 INTO @DATA(ld_forper). | ||||
| DATA(ld_forper) | = ' '. | |||
| "SELECT single FPBEG FROM PC261 INTO @DATA(ld_forper_beg_date). | ||||
| DATA(ld_forper_beg_date) | = ' '. | |||
| "SELECT single FPEND FROM PC261 INTO @DATA(ld_forper_end_date). | ||||
| DATA(ld_forper_end_date) | = ' '. | |||
| "SELECT single PAYTY FROM PC261 INTO @DATA(ld_inper_payty). | ||||
| DATA(ld_inper_payty) | = ' '. | |||
| "SELECT single PAYID FROM PC261 INTO @DATA(ld_inper_payid). | ||||
| DATA(ld_inper_payid) | = ' '. | |||
| "SELECT single INOCR FROM PC261 INTO @DATA(ld_inper_ocrsn). | ||||
| DATA(ld_inper_ocrsn) | = ' '. | |||
| "SELECT single INOCC FROM PC261 INTO @DATA(ld_inper_occat). | ||||
| DATA(ld_inper_occat) | = ' '. | |||
Search for further information about these or an SAP related objects