Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

call function ' HR_PERSONAL_WORK_SCHEDULE'

Former Member
0 Likes
3,821

Dear experts,

can i use the FM 'HR_PERSONAL_WORK_SCHEDULE' TO UPDATE infotype p0007. what about the field 'schkz'. i was using FM 'HR_INFOTYPE_OPERATION'

but its not able to update the data correctly.. also the significance of 'operation' ' tclas ' and 'dialogue_mode'.

regards ,

aeroshil nameirakpam

3 REPLIES 3
Read only

Former Member
0 Likes
1,908

hi,

chk this code it might help u

The below code shows how HR_PERSONAL_WORK_SCHEDULE is used. Export to the FM a personnel

number, period and it will retrieve the employees work schedule for that period.

data: it_ptpsp type standard table of t_ptpsp initial size 0,

wa_ptpsp type t_ptpsp.

CALL FUNCTION 'HR_PERSONAL_WORK_SCHEDULE'

EXPORTING

pernr = pernr-pernr

begda = pn-begda

endda = pn-endda

  • KUG =

  • REFRESH = 'X'

  • WORKING_HOURS = 'X'

  • SWITCH_ACTIV =

  • MODIFY_ENTRIES = 'X'

  • I0001_I0007_ERROR = '0'

  • READ_CLUSTER =

IMPORTING

warning_occured = gd_warning

TABLES

  • I0000 =

  • I0001 =

  • I0002 =

  • I0007 =

  • I0049 =

  • I2001 =

  • I2002 =

  • I2003 =

perws = it_ptpsp "Stores employees work schedule

  • I0003 =

EXCEPTIONS

error_occured = 1

abort_occured = 2

OTHERS = 3.

PLZ reward if helpful.

Read only

Former Member
0 Likes
1,908

Hello Aeroshil,

In my experience and observation of the use of the HR_PERSONAL_WORK_SCHEDULE function module, it is used primarily for reading and expanding the PWS belonging to an employee from the 0007 infotype which could be used for further processing.

Updates should always be performed via the given function modules/methods e.g. HR_INFOTYPE_OPERATION. You might want to check the NOCOMMIT flag being passed to the function module, it should be ' ' i.e. default value, else if you want to COMMIT the LUW @ a later stage, then ensure you have coded an explicity COMMIT WORK at a later and more appropriate stage of your program.

Regarding HR_INFOTYPE_OPERATION, for the fields u have asked you would get a good explanation from the possible values by checking the domains of the respetive fields:

For example:

OPERATION can have the following values with the explanations

COP Copy

DEL Delete

DIS Display

EDQ Lock/unlock

INS Create

LIS9 Delimit

MOD Change

INSS Create for Actions is not converted to Change

TCLAS has the following values, and basically indicates for which genre of personnel the operation is being carried out:

A Master Data and Time Data (PA**** table updates)

B Applicant Data (PB**** table updates)

T Shift Schedule

Finally DIALOG_MODE can have the values 0,1 and 2. As you might be aware the function module updates the infotype(s) via a BDC dialog run, and this field basically describes the mode of operation, e.g. 0 is for No Display MODE 'N' BDC run.

I hope this helps with your work.

Regards,

Aditya

Read only

Former Member
0 Likes
1,908

yes u can use tht..in the import parameters make field 'MODIFY_ENTRIES' as 'X'.

SCHKZ field is for work schedule name in IT0007.

Tclass is A here in HR_infotype_operation'.