SAP HR_PERSONAL_WORK_SCHEDULE Function Module for









HR_PERSONAL_WORK_SCHEDULE is a standard hr personal work schedule 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 hr personal work schedule FM, simply by entering the name HR_PERSONAL_WORK_SCHEDULE into the relevant SAP transaction such as SE37 or SE38.

Function Group: PTWS
Program Name: SAPLPTWS
Main Program: SAPLPTWS
Appliation area: P
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function HR_PERSONAL_WORK_SCHEDULE 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 'HR_PERSONAL_WORK_SCHEDULE'"
EXPORTING
PERNR = "
* READ_CLUSTER = "
BEGDA = "
ENDDA = "
* KUG = "
* REFRESH = 'X' "
* WORKING_HOURS = 'X' "
* SWITCH_ACTIV = "
* MODIFY_ENTRIES = 'X' "
* I0001_I0007_ERROR = '0' "

IMPORTING
WARNING_OCCURED = "

TABLES
* I0000 = "
* I0003 = "
* I0001 = "
* I0002 = "
* I0007 = "
* I0049 = "
* I2001 = "
* I2002 = "
* I2003 = "
PERWS = "

EXCEPTIONS
ERROR_OCCURED = 1 ABORT_OCCURED = 2
.




Customer Function user exits

Below is a list of CUSTOMER FUNCTION exit user exits that are available within this program and maybe relevant for this FM.
EXIT_SAPLPTWS_001 User Exit for Generating Monthly Work Schedule

IMPORTING Parameters details for HR_PERSONAL_WORK_SCHEDULE

PERNR -

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

READ_CLUSTER -

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

BEGDA -

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

ENDDA -

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

KUG -

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

REFRESH -

Data type: C
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

WORKING_HOURS -

Data type: C
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

SWITCH_ACTIV -

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

MODIFY_ENTRIES -

Data type: C
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

I0001_I0007_ERROR -

Data type: C
Default: '0'
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for HR_PERSONAL_WORK_SCHEDULE

WARNING_OCCURED -

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

TABLES Parameters details for HR_PERSONAL_WORK_SCHEDULE

I0000 -

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

I0003 -

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

I0001 -

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

I0002 -

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

I0007 -

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

I0049 -

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

I2001 -

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

I2002 -

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

I2003 -

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

PERWS -

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

EXCEPTIONS details

ERROR_OCCURED -

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

ABORT_OCCURED -

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

Copy and paste ABAP code example for HR_PERSONAL_WORK_SCHEDULE 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_i0000  TYPE STANDARD TABLE OF P0000, "   
lv_pernr  TYPE PSPAR-PERNR, "   
lv_error_occured  TYPE PSPAR, "   
lv_warning_occured  TYPE SY-SUBRC, "   
lt_i0003  TYPE STANDARD TABLE OF P0003, "   
lv_read_cluster  TYPE C, "   
lv_begda  TYPE SY-DATUM, "   
lt_i0001  TYPE STANDARD TABLE OF P0001, "   
lv_abort_occured  TYPE P0001, "   
lv_endda  TYPE SY-DATUM, "   
lt_i0002  TYPE STANDARD TABLE OF P0002, "   
lv_kug  TYPE C, "   
lt_i0007  TYPE STANDARD TABLE OF P0007, "   
lt_i0049  TYPE STANDARD TABLE OF P0049, "   
lv_refresh  TYPE C, "   'X'
lt_i2001  TYPE STANDARD TABLE OF P2001, "   
lv_working_hours  TYPE C, "   'X'
lt_i2002  TYPE STANDARD TABLE OF P2002, "   
lv_switch_activ  TYPE P2002, "   
lt_i2003  TYPE STANDARD TABLE OF P2003, "   
lv_modify_entries  TYPE C, "   'X'
lt_perws  TYPE STANDARD TABLE OF PTPSP, "   
lv_i0001_i0007_error  TYPE C. "   '0'

  CALL FUNCTION 'HR_PERSONAL_WORK_SCHEDULE'  "
    EXPORTING
         PERNR = lv_pernr
         READ_CLUSTER = lv_read_cluster
         BEGDA = lv_begda
         ENDDA = lv_endda
         KUG = lv_kug
         REFRESH = lv_refresh
         WORKING_HOURS = lv_working_hours
         SWITCH_ACTIV = lv_switch_activ
         MODIFY_ENTRIES = lv_modify_entries
         I0001_I0007_ERROR = lv_i0001_i0007_error
    IMPORTING
         WARNING_OCCURED = lv_warning_occured
    TABLES
         I0000 = lt_i0000
         I0003 = lt_i0003
         I0001 = lt_i0001
         I0002 = lt_i0002
         I0007 = lt_i0007
         I0049 = lt_i0049
         I2001 = lt_i2001
         I2002 = lt_i2002
         I2003 = lt_i2003
         PERWS = lt_perws
    EXCEPTIONS
        ERROR_OCCURED = 1
        ABORT_OCCURED = 2
. " HR_PERSONAL_WORK_SCHEDULE




ABAP code using 7.40 inline data declarations to call FM HR_PERSONAL_WORK_SCHEDULE

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 PERNR FROM PSPAR INTO @DATA(ld_pernr).
 
 
"SELECT single SUBRC FROM SY INTO @DATA(ld_warning_occured).
 
 
 
"SELECT single DATUM FROM SY INTO @DATA(ld_begda).
 
 
 
"SELECT single DATUM FROM SY INTO @DATA(ld_endda).
 
 
 
 
 
DATA(ld_refresh) = 'X'.
 
 
DATA(ld_working_hours) = 'X'.
 
 
 
 
DATA(ld_modify_entries) = 'X'.
 
 
DATA(ld_i0001_i0007_error) = '0'.
 


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!