SAP RH_WORKTIME_GET Function Module for Read work schedule









RH_WORKTIME_GET is a standard rh worktime get SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used for Read work schedule 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 worktime get FM, simply by entering the name RH_WORKTIME_GET into the relevant SAP transaction such as SE37 or SE38.

Function Group: RHOM
Program Name: SAPLRHOM
Main Program:
Appliation area: H
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function RH_WORKTIME_GET 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_WORKTIME_GET'"Read work schedule
EXPORTING
GW_PLVAR = "
GW_OTYPE = "
GW_OBJID = "
* GW_ISTAT = '1' "
* GW_BEGDA = SY-DATUM "
* GW_ENDDA = SY-DATUM "
* GET_WORKTIME_OF_PREV_OBJECT = "
* READ_OBJECT_TEXT = "
* BUFFER_MODE = "

IMPORTING
RET_OTYPE = "
RET_OBJID = "
RET_OTEXT = "
RET_OTYPETEXT = "

TABLES
GW_TABLE = "
* WORKTIME_FAC = "

EXCEPTIONS
T77S0_ENTRY_NOT_FOUND = 1 INVALID_TIME_PERIOD = 2 OTYPE_NOT_VALID = 3 NO_ENTRY_FOUND = 4
.



IMPORTING Parameters details for RH_WORKTIME_GET

GW_PLVAR -

Data type: P1011-PLVAR
Optional: No
Call by Reference: No ( called with pass by value option)

GW_OTYPE -

Data type: P1011-OTYPE
Optional: No
Call by Reference: No ( called with pass by value option)

GW_OBJID -

Data type: P1011-OBJID
Optional: No
Call by Reference: No ( called with pass by value option)

GW_ISTAT -

Data type: P1011-ISTAT
Default: '1'
Optional: Yes
Call by Reference: No ( called with pass by value option)

GW_BEGDA -

Data type: P1011-BEGDA
Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

GW_ENDDA -

Data type: P1011-ENDDA
Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

GET_WORKTIME_OF_PREV_OBJECT -

Data type: P1011-HISTO
Optional: Yes
Call by Reference: No ( called with pass by value option)

READ_OBJECT_TEXT -

Data type: P1011-HISTO
Optional: Yes
Call by Reference: No ( called with pass by value option)

BUFFER_MODE -

Data type: FLAG
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for RH_WORKTIME_GET

RET_OTYPE -

Data type: P1011-OTYPE
Optional: No
Call by Reference: No ( called with pass by value option)

RET_OBJID -

Data type: P1011-OBJID
Optional: No
Call by Reference: No ( called with pass by value option)

RET_OTEXT -

Data type: OBJEC-STEXT
Optional: No
Call by Reference: No ( called with pass by value option)

RET_OTYPETEXT -

Data type: T777O-OTEXT
Optional: No
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for RH_WORKTIME_GET

GW_TABLE -

Data type: P1011
Optional: No
Call by Reference: No ( called with pass by value option)

WORKTIME_FAC -

Data type: P1011_FAC
Optional: Yes
Call by Reference: Yes

EXCEPTIONS details

T77S0_ENTRY_NOT_FOUND -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

INVALID_TIME_PERIOD -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

OTYPE_NOT_VALID -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_ENTRY_FOUND -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for RH_WORKTIME_GET 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_gw_plvar  TYPE P1011-PLVAR, "   
lt_gw_table  TYPE STANDARD TABLE OF P1011, "   
lv_ret_otype  TYPE P1011-OTYPE, "   
lv_t77s0_entry_not_found  TYPE P1011, "   
lv_gw_otype  TYPE P1011-OTYPE, "   
lv_ret_objid  TYPE P1011-OBJID, "   
lt_worktime_fac  TYPE STANDARD TABLE OF P1011_FAC, "   
lv_invalid_time_period  TYPE P1011_FAC, "   
lv_gw_objid  TYPE P1011-OBJID, "   
lv_ret_otext  TYPE OBJEC-STEXT, "   
lv_otype_not_valid  TYPE OBJEC, "   
lv_gw_istat  TYPE P1011-ISTAT, "   '1'
lv_ret_otypetext  TYPE T777O-OTEXT, "   
lv_no_entry_found  TYPE T777O, "   
lv_gw_begda  TYPE P1011-BEGDA, "   SY-DATUM
lv_gw_endda  TYPE P1011-ENDDA, "   SY-DATUM
lv_get_worktime_of_prev_object  TYPE P1011-HISTO, "   
lv_read_object_text  TYPE P1011-HISTO, "   
lv_buffer_mode  TYPE FLAG. "   

  CALL FUNCTION 'RH_WORKTIME_GET'  "Read work schedule
    EXPORTING
         GW_PLVAR = lv_gw_plvar
         GW_OTYPE = lv_gw_otype
         GW_OBJID = lv_gw_objid
         GW_ISTAT = lv_gw_istat
         GW_BEGDA = lv_gw_begda
         GW_ENDDA = lv_gw_endda
         GET_WORKTIME_OF_PREV_OBJECT = lv_get_worktime_of_prev_object
         READ_OBJECT_TEXT = lv_read_object_text
         BUFFER_MODE = lv_buffer_mode
    IMPORTING
         RET_OTYPE = lv_ret_otype
         RET_OBJID = lv_ret_objid
         RET_OTEXT = lv_ret_otext
         RET_OTYPETEXT = lv_ret_otypetext
    TABLES
         GW_TABLE = lt_gw_table
         WORKTIME_FAC = lt_worktime_fac
    EXCEPTIONS
        T77S0_ENTRY_NOT_FOUND = 1
        INVALID_TIME_PERIOD = 2
        OTYPE_NOT_VALID = 3
        NO_ENTRY_FOUND = 4
. " RH_WORKTIME_GET




ABAP code using 7.40 inline data declarations to call FM RH_WORKTIME_GET

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 P1011 INTO @DATA(ld_gw_plvar).
 
 
"SELECT single OTYPE FROM P1011 INTO @DATA(ld_ret_otype).
 
 
"SELECT single OTYPE FROM P1011 INTO @DATA(ld_gw_otype).
 
"SELECT single OBJID FROM P1011 INTO @DATA(ld_ret_objid).
 
 
 
"SELECT single OBJID FROM P1011 INTO @DATA(ld_gw_objid).
 
"SELECT single STEXT FROM OBJEC INTO @DATA(ld_ret_otext).
 
 
"SELECT single ISTAT FROM P1011 INTO @DATA(ld_gw_istat).
DATA(ld_gw_istat) = '1'.
 
"SELECT single OTEXT FROM T777O INTO @DATA(ld_ret_otypetext).
 
 
"SELECT single BEGDA FROM P1011 INTO @DATA(ld_gw_begda).
DATA(ld_gw_begda) = SY-DATUM.
 
"SELECT single ENDDA FROM P1011 INTO @DATA(ld_gw_endda).
DATA(ld_gw_endda) = SY-DATUM.
 
"SELECT single HISTO FROM P1011 INTO @DATA(ld_get_worktime_of_prev_object).
 
"SELECT single HISTO FROM P1011 INTO @DATA(ld_read_object_text).
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!