SAP Function Modules

RH_GET_VACANCY SAP Function module







RH_GET_VACANCY 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_GET_VACANCY into the relevant SAP transaction such as SE37 or SE80.

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


Pattern for FM RH_GET_VACANCY - RH GET VACANCY





CALL FUNCTION 'RH_GET_VACANCY' "
  EXPORTING
    vac_begda =                 " plog-begda    Starting date of selection period
    vac_endda =                 " plog-endda    Final date of selection period
    vac_istat =                 " plog-istat    Status of position
*   vac_objec_begda =           " plog-begda
*   vac_objec_endda =           " plog-endda
    vac_objid =                 " plog-objid    Object ID of position
    vac_otype =                 " plog-otype    Object type of position
    vac_plvar =                 " plog-plvar    Plan version of position
*   vac_switch = 'X'            " flag          Switch for parameter HOLDER_ENDDA
  IMPORTING
    free_begda =                " plog-begda    Starting date, position unoccupied
    holder_endda =              " plog-endda    Date, up to which the position is
    vacancy_begda =             " plog-begda    Starting date of vacancy
    vacancy_endda =             " plog-endda
    vac_subrc =                 " sy-subrc      Return code
    vac_status =                " p1007-status
    .  "  RH_GET_VACANCY

ABAP code example for Function Module RH_GET_VACANCY





The ABAP code below is a full code listing to execute function module RH_GET_VACANCY 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_free_begda  TYPE PLOG-BEGDA ,
ld_holder_endda  TYPE PLOG-ENDDA ,
ld_vacancy_begda  TYPE PLOG-BEGDA ,
ld_vacancy_endda  TYPE PLOG-ENDDA ,
ld_vac_subrc  TYPE SY-SUBRC ,
ld_vac_status  TYPE P1007-STATUS .


SELECT single BEGDA
FROM PLOG
INTO @DATA(ld_vac_begda).


SELECT single ENDDA
FROM PLOG
INTO @DATA(ld_vac_endda).


SELECT single ISTAT
FROM PLOG
INTO @DATA(ld_vac_istat).


SELECT single BEGDA
FROM PLOG
INTO @DATA(ld_vac_objec_begda).


SELECT single ENDDA
FROM PLOG
INTO @DATA(ld_vac_objec_endda).


SELECT single OBJID
FROM PLOG
INTO @DATA(ld_vac_objid).


SELECT single OTYPE
FROM PLOG
INTO @DATA(ld_vac_otype).


SELECT single PLVAR
FROM PLOG
INTO @DATA(ld_vac_plvar).

DATA(ld_vac_switch) = 'Check type of data required'. . CALL FUNCTION 'RH_GET_VACANCY' EXPORTING vac_begda = ld_vac_begda vac_endda = ld_vac_endda vac_istat = ld_vac_istat * vac_objec_begda = ld_vac_objec_begda * vac_objec_endda = ld_vac_objec_endda vac_objid = ld_vac_objid vac_otype = ld_vac_otype vac_plvar = ld_vac_plvar * vac_switch = ld_vac_switch IMPORTING free_begda = ld_free_begda holder_endda = ld_holder_endda vacancy_begda = ld_vacancy_begda vacancy_endda = ld_vacancy_endda vac_subrc = ld_vac_subrc vac_status = ld_vac_status . " RH_GET_VACANCY
IF SY-SUBRC EQ 0. "All OK 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_free_begda  TYPE PLOG-BEGDA ,
ld_vac_begda  TYPE PLOG-BEGDA ,
ld_holder_endda  TYPE PLOG-ENDDA ,
ld_vac_endda  TYPE PLOG-ENDDA ,
ld_vacancy_begda  TYPE PLOG-BEGDA ,
ld_vac_istat  TYPE PLOG-ISTAT ,
ld_vacancy_endda  TYPE PLOG-ENDDA ,
ld_vac_objec_begda  TYPE PLOG-BEGDA ,
ld_vac_subrc  TYPE SY-SUBRC ,
ld_vac_objec_endda  TYPE PLOG-ENDDA ,
ld_vac_status  TYPE P1007-STATUS ,
ld_vac_objid  TYPE PLOG-OBJID ,
ld_vac_otype  TYPE PLOG-OTYPE ,
ld_vac_plvar  TYPE PLOG-PLVAR ,
ld_vac_switch  TYPE FLAG .


SELECT single BEGDA
FROM PLOG
INTO ld_vac_begda.


SELECT single ENDDA
FROM PLOG
INTO ld_vac_endda.


SELECT single ISTAT
FROM PLOG
INTO ld_vac_istat.


SELECT single BEGDA
FROM PLOG
INTO ld_vac_objec_begda.


SELECT single ENDDA
FROM PLOG
INTO ld_vac_objec_endda.


SELECT single OBJID
FROM PLOG
INTO ld_vac_objid.


SELECT single OTYPE
FROM PLOG
INTO ld_vac_otype.


SELECT single PLVAR
FROM PLOG
INTO ld_vac_plvar.

ld_vac_switch = '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_GET_VACANCY or its description.