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

Work shedule rule code

Former Member
0 Likes
637

Can anyony help me with some sample code for extracting the work shedule rule from t550a,t551a and t508a tables.its please help me with you valuable suggestions.

3 REPLIES 3
Read only

Former Member
0 Likes
540

Hi,

Pls use the following function Module: HR_PERSON_READ_WORK_SCHEDULE.

Give the list of pernr's in gt_pernr_tab along with start date and enddate. You will get the DWS, PWS, shift start time, shift end time, in gt_psp table. And also any absences or attendances booked will be displayed in the table gt_day_psp table.

CALL FUNCTION 'HR_PERSON_READ_WORK_SCHEDULE'

EXPORTING

begin_date = pn-begda

end_date = pn-endda

TABLES

pernr_tab = gt_pernr_tab[]

psp = gt_psp

day_psp = gt_day_psp

EXCEPTIONS

error_in_build_psp = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

Hope this helps you.

Regards,

Deepak Raj

Read only

0 Likes
540

hi,

I thank you very much for your immediate responce,Let me tell you my actual requirement:

1.2.1 Functional Description

xxxx company currently uses SAP script to check the available of work schedule rules, this SAP script is not effective especially searching for rotating shift WSR. It was decided in the ASE that a new ABAP report will be created in order to fulfil the gaps and limitations of SAP Script

1.2.2 Technical Description

New ABAP program will be created in order to cover the gap by SAP script.

In the selection screen of the new ABAP program, the users will attach the file (Standard template for new request) and the ABAP program will look for the exact match. The field names of the exact match can be found in Technical Design section.

This ABAP report will take inputted data by the users and search for available WSR.

Selection Screen layout:

The layout of the selection screen is same as SAP query (Transaction ZXAUWSRG) but additionally the selection screen will also have provision to attach an excel file (.csv) format. The ABAP program reads the attach file data and look for the exact match of WSR across PS, Calendar ID and ES Grouping.

Tables Used

T550A

T551A

T508A

Selection Screen: Same selection screen of current SAP query (Transaction ZXAUWSRG) to be used and add an optional for file selection. This selection option is to check for the rotation shift available WSR.

ABAP Code: The ABAP code checks the data input from the selection screen and look for the exact match for WSR in the above mentioned tables (more table name can be added during development stage) and returns with output screen

The output layout of the ABAP program is as below

WSR Report Fields Data Item Format

Grouping Details ES Grouping Number

Grouping Details PS Grouping Number

Calendar Details Calendar ID Code

WS Details WSR Rule Code

WS Details DWS Code

WS Details Week details Code

WS Details Rule for Day types Code

WS Details Shift Premium Code

WS Details PWS Detail Code

Validity Start Date Date

Validity End Date Date

In case of Rotating shifts, for example a four week rotating shifts. The users should upload the excel file, using the above template with all the DWS weeks fields completed. The ABAP program will look for the exact match and will return with the following output layout

WSR Report Fields Data Item Format Additional Comments

Grouping Details ES Grouping Number

Grouping Details PS Grouping Number

Calendar Details Calendar ID Code

WS Details WSR Rule Code

WS Details DWS Code

WS Details Week details Code

WS Details Rule for Day types Code

WS Details Shift Premium Code

WS Details PWS Detail Code

Validity Start Date Date

Validity End Date Date

Exception: It will be possible to use the standard function modules for Exceptions. Additional exception and validation can be completed during the development stage.

Can you pls guide me in this aspect

Read only

Former Member
0 Likes
540

thanks alot i have solved by writing a code