SAP Function Modules

RH_CREATE_REQ_ASSIGNMENT SAP Function module







RH_CREATE_REQ_ASSIGNMENT is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name RH_CREATE_REQ_ASSIGNMENT into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: RHEI
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM RH_CREATE_REQ_ASSIGNMENT - RH CREATE REQ ASSIGNMENT





CALL FUNCTION 'RH_CREATE_REQ_ASSIGNMENT' "
  EXPORTING
    person_id =                 " objec-objid
*   req_objid =                 " objec-objid
    begin_date =                " sy-datum
    end_date =                  " sy-datum
*   begin_time =                " sy-uzeit
*   end_time =                  " sy-uzeit
*   no_dialog = SPACE           "
*   include_next_day =          " boole_d
  IMPORTING
    planned_begin =             " sy-datum
    planned_end =               " sy-datum
    planned_req_id =            " objec-objid
    person_get_req_time =       " c
    new_shift =                 " t77ed-dienste
    new_begin_time =            " sy-uzeit
    new_end_time =              " sy-uzeit
* TABLES
*   org_assignment =            "
*   assignments =               "
*   person_timetab =            "
*   changed_dates =             "
*   user_cust_tab =             " hrsp_user_cust
*   request_tab =               " hrsp_object
*   employee_tab =              " hrsp_object_date
  EXCEPTIONS
    NO_REQUIREMENT_FOUND = 1    "
    .  "  RH_CREATE_REQ_ASSIGNMENT

ABAP code example for Function Module RH_CREATE_REQ_ASSIGNMENT





The ABAP code below is a full code listing to execute function module RH_CREATE_REQ_ASSIGNMENT including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_planned_begin  TYPE SY-DATUM ,
ld_planned_end  TYPE SY-DATUM ,
ld_planned_req_id  TYPE OBJEC-OBJID ,
ld_person_get_req_time  TYPE C ,
ld_new_shift  TYPE T77ED-DIENSTE ,
ld_new_begin_time  TYPE SY-UZEIT ,
ld_new_end_time  TYPE SY-UZEIT ,
it_org_assignment  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_org_assignment  LIKE LINE OF it_org_assignment ,
it_assignments  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_assignments  LIKE LINE OF it_assignments ,
it_person_timetab  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_person_timetab  LIKE LINE OF it_person_timetab ,
it_changed_dates  TYPE STANDARD TABLE OF STRING,"TABLES PARAM
wa_changed_dates  LIKE LINE OF it_changed_dates ,
it_user_cust_tab  TYPE STANDARD TABLE OF HRSP_USER_CUST,"TABLES PARAM
wa_user_cust_tab  LIKE LINE OF it_user_cust_tab ,
it_request_tab  TYPE STANDARD TABLE OF HRSP_OBJECT,"TABLES PARAM
wa_request_tab  LIKE LINE OF it_request_tab ,
it_employee_tab  TYPE STANDARD TABLE OF HRSP_OBJECT_DATE,"TABLES PARAM
wa_employee_tab  LIKE LINE OF it_employee_tab .


DATA(ld_person_id) = Check type of data required

DATA(ld_req_objid) = Check type of data required
DATA(ld_begin_date) = '20210129'.
DATA(ld_end_date) = '20210129'.
DATA(ld_begin_time) = 'Check type of data required'.
DATA(ld_end_time) = 'Check type of data required'.
DATA(ld_no_dialog) = 'some text here'.
DATA(ld_include_next_day) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_org_assignment to it_org_assignment.

"populate fields of struture and append to itab
append wa_assignments to it_assignments.

"populate fields of struture and append to itab
append wa_person_timetab to it_person_timetab.

"populate fields of struture and append to itab
append wa_changed_dates to it_changed_dates.

"populate fields of struture and append to itab
append wa_user_cust_tab to it_user_cust_tab.

"populate fields of struture and append to itab
append wa_request_tab to it_request_tab.

"populate fields of struture and append to itab
append wa_employee_tab to it_employee_tab. . CALL FUNCTION 'RH_CREATE_REQ_ASSIGNMENT' EXPORTING person_id = ld_person_id * req_objid = ld_req_objid begin_date = ld_begin_date end_date = ld_end_date * begin_time = ld_begin_time * end_time = ld_end_time * no_dialog = ld_no_dialog * include_next_day = ld_include_next_day IMPORTING planned_begin = ld_planned_begin planned_end = ld_planned_end planned_req_id = ld_planned_req_id person_get_req_time = ld_person_get_req_time new_shift = ld_new_shift new_begin_time = ld_new_begin_time new_end_time = ld_new_end_time * TABLES * org_assignment = it_org_assignment * assignments = it_assignments * person_timetab = it_person_timetab * changed_dates = it_changed_dates * user_cust_tab = it_user_cust_tab * request_tab = it_request_tab * employee_tab = it_employee_tab EXCEPTIONS NO_REQUIREMENT_FOUND = 1 . " RH_CREATE_REQ_ASSIGNMENT
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_planned_begin  TYPE SY-DATUM ,
ld_person_id  TYPE OBJEC-OBJID ,
it_org_assignment  TYPE STANDARD TABLE OF STRING ,
wa_org_assignment  LIKE LINE OF it_org_assignment,
ld_planned_end  TYPE SY-DATUM ,
ld_req_objid  TYPE OBJEC-OBJID ,
it_assignments  TYPE STANDARD TABLE OF STRING ,
wa_assignments  LIKE LINE OF it_assignments,
ld_planned_req_id  TYPE OBJEC-OBJID ,
ld_begin_date  TYPE SY-DATUM ,
it_person_timetab  TYPE STANDARD TABLE OF STRING ,
wa_person_timetab  LIKE LINE OF it_person_timetab,
ld_person_get_req_time  TYPE C ,
it_changed_dates  TYPE STANDARD TABLE OF STRING ,
wa_changed_dates  LIKE LINE OF it_changed_dates,
ld_end_date  TYPE SY-DATUM ,
it_user_cust_tab  TYPE STANDARD TABLE OF HRSP_USER_CUST ,
wa_user_cust_tab  LIKE LINE OF it_user_cust_tab,
ld_begin_time  TYPE SY-UZEIT ,
ld_new_shift  TYPE T77ED-DIENSTE ,
ld_end_time  TYPE SY-UZEIT ,
ld_new_begin_time  TYPE SY-UZEIT ,
it_request_tab  TYPE STANDARD TABLE OF HRSP_OBJECT ,
wa_request_tab  LIKE LINE OF it_request_tab,
ld_no_dialog  TYPE STRING ,
ld_new_end_time  TYPE SY-UZEIT ,
it_employee_tab  TYPE STANDARD TABLE OF HRSP_OBJECT_DATE ,
wa_employee_tab  LIKE LINE OF it_employee_tab,
ld_include_next_day  TYPE BOOLE_D .


ld_person_id = Check type of data required

"populate fields of struture and append to itab
append wa_org_assignment to it_org_assignment.

ld_req_objid = Check type of data required

"populate fields of struture and append to itab
append wa_assignments to it_assignments.
ld_begin_date = '20210129'.

"populate fields of struture and append to itab
append wa_person_timetab to it_person_timetab.

"populate fields of struture and append to itab
append wa_changed_dates to it_changed_dates.
ld_end_date = '20210129'.

"populate fields of struture and append to itab
append wa_user_cust_tab to it_user_cust_tab.
ld_begin_time = 'Check type of data required'.
ld_end_time = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_request_tab to it_request_tab.
ld_no_dialog = 'some text here'.

"populate fields of struture and append to itab
append wa_employee_tab to it_employee_tab.
ld_include_next_day = 'Check type of data required'.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name RH_CREATE_REQ_ASSIGNMENT or its description.