SAP RH_GENERATE_FROM_HEADCT_STEP Function Module for
RH_GENERATE_FROM_HEADCT_STEP is a standard rh generate from headct step SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, 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 generate from headct step FM, simply by entering the name RH_GENERATE_FROM_HEADCT_STEP into the relevant SAP transaction such as SE37 or SE38.
Function Group: RHMWAB
Program Name: SAPLRHMWAB
Main Program:
Appliation area: H
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:

Function RH_GENERATE_FROM_HEADCT_STEP 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_GENERATE_FROM_HEADCT_STEP'".
EXPORTING
* ACT_PLVAR = "
ACT_ORGUNIT = "
* ACT_ISTAT = '1' "
* ACT_PLAN_STATE = "
* ACT_CREATE_ONLY = ' ' "
* ACT_REDUCE_ONLY = ' ' "
* CALC_RED_GEN_ONLY = ' ' "
* DISTRIBUTE_REDUCTION = ' ' "
* USED_IN_GENERATION = "
IMPORTING
AMOUNT_OBSOLET = "
AMOUNT_GENERATE = "
NO_REDUCTION_DONE = "
TABLES
* POS_NOT_DELETED = "
EXCEPTIONS
NO_ACTIVE_PLVAR = 1 JOB_NOT_VALID = 10 ACT_OBS_NUMBER_IS_ZERO = 11 ORGUNIT_NOT_VALID = 2 PLAN_STATE_NOT_OK = 3 NO_HEAD_COUNT_PLAN_FOUND = 4 ORGUNIT_LOCKED = 5 REDUCTION_ERROR = 6 NO_POSITIONS_TO_SET_OBSOLET = 7 NO_POSITONS_TO_JOB_FOUND = 8 NO_POSITIONS_IN_ORGUNIT = 9
IMPORTING Parameters details for RH_GENERATE_FROM_HEADCT_STEP
ACT_PLVAR -
Data type: OBJEC-PLVAROptional: Yes
Call by Reference: No ( called with pass by value option)
ACT_ORGUNIT -
Data type: OBJEC-OBJIDOptional: No
Call by Reference: No ( called with pass by value option)
ACT_ISTAT -
Data type: OBJEC-ISTATDefault: '1'
Optional: Yes
Call by Reference: No ( called with pass by value option)
ACT_PLAN_STATE -
Data type: P1019-SUBTYOptional: Yes
Call by Reference: No ( called with pass by value option)
ACT_CREATE_ONLY -
Data type: FLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
ACT_REDUCE_ONLY -
Data type: FLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
CALC_RED_GEN_ONLY -
Data type: FLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
DISTRIBUTE_REDUCTION -
Data type: FLAGDefault: SPACE
Optional: Yes
Call by Reference: No ( called with pass by value option)
USED_IN_GENERATION -
Data type: FLAGOptional: Yes
Call by Reference: No ( called with pass by value option)
EXPORTING Parameters details for RH_GENERATE_FROM_HEADCT_STEP
AMOUNT_OBSOLET -
Data type: JOB_AMOUNT_FTEOptional: No
Call by Reference: No ( called with pass by value option)
AMOUNT_GENERATE -
Data type: JOB_AMOUNT_FTEOptional: No
Call by Reference: No ( called with pass by value option)
NO_REDUCTION_DONE -
Data type: FLAGOptional: No
Call by Reference: No ( called with pass by value option)
TABLES Parameters details for RH_GENERATE_FROM_HEADCT_STEP
POS_NOT_DELETED -
Data type: HROBJECTOptional: Yes
Call by Reference: Yes
EXCEPTIONS details
NO_ACTIVE_PLVAR -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
JOB_NOT_VALID -
Data type:Optional: No
Call by Reference: Yes
ACT_OBS_NUMBER_IS_ZERO -
Data type:Optional: No
Call by Reference: Yes
ORGUNIT_NOT_VALID -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
PLAN_STATE_NOT_OK -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
NO_HEAD_COUNT_PLAN_FOUND -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
ORGUNIT_LOCKED -
Data type:Optional: No
Call by Reference: No ( called with pass by value option)
REDUCTION_ERROR -
Data type:Optional: No
Call by Reference: Yes
NO_POSITIONS_TO_SET_OBSOLET -
Data type:Optional: No
Call by Reference: Yes
NO_POSITONS_TO_JOB_FOUND -
Data type:Optional: No
Call by Reference: Yes
NO_POSITIONS_IN_ORGUNIT -
Data type:Optional: No
Call by Reference: Yes
Copy and paste ABAP code example for RH_GENERATE_FROM_HEADCT_STEP 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_act_plvar | TYPE OBJEC-PLVAR, " | |||
| lv_amount_obsolet | TYPE JOB_AMOUNT_FTE, " | |||
| lv_no_active_plvar | TYPE JOB_AMOUNT_FTE, " | |||
| lt_pos_not_deleted | TYPE STANDARD TABLE OF HROBJECT, " | |||
| lv_job_not_valid | TYPE HROBJECT, " | |||
| lv_act_obs_number_is_zero | TYPE HROBJECT, " | |||
| lv_act_orgunit | TYPE OBJEC-OBJID, " | |||
| lv_amount_generate | TYPE JOB_AMOUNT_FTE, " | |||
| lv_orgunit_not_valid | TYPE JOB_AMOUNT_FTE, " | |||
| lv_act_istat | TYPE OBJEC-ISTAT, " '1' | |||
| lv_no_reduction_done | TYPE FLAG, " | |||
| lv_plan_state_not_ok | TYPE FLAG, " | |||
| lv_act_plan_state | TYPE P1019-SUBTY, " | |||
| lv_no_head_count_plan_found | TYPE P1019, " | |||
| lv_orgunit_locked | TYPE P1019, " | |||
| lv_act_create_only | TYPE FLAG, " SPACE | |||
| lv_act_reduce_only | TYPE FLAG, " SPACE | |||
| lv_reduction_error | TYPE FLAG, " | |||
| lv_calc_red_gen_only | TYPE FLAG, " SPACE | |||
| lv_no_positions_to_set_obsolet | TYPE FLAG, " | |||
| lv_distribute_reduction | TYPE FLAG, " SPACE | |||
| lv_no_positons_to_job_found | TYPE FLAG, " | |||
| lv_used_in_generation | TYPE FLAG, " | |||
| lv_no_positions_in_orgunit | TYPE FLAG. " |
|   CALL FUNCTION 'RH_GENERATE_FROM_HEADCT_STEP' " |
| EXPORTING | ||
| ACT_PLVAR | = lv_act_plvar | |
| ACT_ORGUNIT | = lv_act_orgunit | |
| ACT_ISTAT | = lv_act_istat | |
| ACT_PLAN_STATE | = lv_act_plan_state | |
| ACT_CREATE_ONLY | = lv_act_create_only | |
| ACT_REDUCE_ONLY | = lv_act_reduce_only | |
| CALC_RED_GEN_ONLY | = lv_calc_red_gen_only | |
| DISTRIBUTE_REDUCTION | = lv_distribute_reduction | |
| USED_IN_GENERATION | = lv_used_in_generation | |
| IMPORTING | ||
| AMOUNT_OBSOLET | = lv_amount_obsolet | |
| AMOUNT_GENERATE | = lv_amount_generate | |
| NO_REDUCTION_DONE | = lv_no_reduction_done | |
| TABLES | ||
| POS_NOT_DELETED | = lt_pos_not_deleted | |
| EXCEPTIONS | ||
| NO_ACTIVE_PLVAR = 1 | ||
| JOB_NOT_VALID = 10 | ||
| ACT_OBS_NUMBER_IS_ZERO = 11 | ||
| ORGUNIT_NOT_VALID = 2 | ||
| PLAN_STATE_NOT_OK = 3 | ||
| NO_HEAD_COUNT_PLAN_FOUND = 4 | ||
| ORGUNIT_LOCKED = 5 | ||
| REDUCTION_ERROR = 6 | ||
| NO_POSITIONS_TO_SET_OBSOLET = 7 | ||
| NO_POSITONS_TO_JOB_FOUND = 8 | ||
| NO_POSITIONS_IN_ORGUNIT = 9 | ||
| . " RH_GENERATE_FROM_HEADCT_STEP | ||
ABAP code using 7.40 inline data declarations to call FM RH_GENERATE_FROM_HEADCT_STEP
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 PLVAR FROM OBJEC INTO @DATA(ld_act_plvar). | ||||
| "SELECT single OBJID FROM OBJEC INTO @DATA(ld_act_orgunit). | ||||
| "SELECT single ISTAT FROM OBJEC INTO @DATA(ld_act_istat). | ||||
| DATA(ld_act_istat) | = '1'. | |||
| "SELECT single SUBTY FROM P1019 INTO @DATA(ld_act_plan_state). | ||||
| DATA(ld_act_create_only) | = ' '. | |||
| DATA(ld_act_reduce_only) | = ' '. | |||
| DATA(ld_calc_red_gen_only) | = ' '. | |||
| DATA(ld_distribute_reduction) | = ' '. | |||
Search for further information about these or an SAP related objects