Read planned work schedule

 

 

This form shows how to read the planned come/go time for a person.

 

Planned time can be seen in transaction PA20 infotypes 0007 Planned Working Time and infotype 2003 Substitutions.

 

The planned time can be based either on a Daily working schedule or Individuel working time

 

 

*&---------------------------------------------------------------------*

*&      Form  read_planned_time

*&---------------------------------------------------------------------*

*

*  Read planned begin/end time from work schedules or indivdual working time

*

*----------------------------------------------------------------------*

*      -->P_PERNR             Personnel Number

*      -->P_LDATE             Logical Date - Date of work

*      <--P_L_PLANNED_BEGIN   Planned begin of work time

*      <--P_L_PLANNED_END     Planned begin end work time

*----------------------------------------------------------------------*

 

FORM read_planned_time  USING    p_pernr TYPE pernr_d

                                 p_ldate TYPE ldate

                        CHANGING p_planned_begin LIKE cc1_timeevent-ltime

                                 p_planned_end LIKE cc1_timeevent-ltime.

                                

 

  DATA:

     lt_psp     TYPE STANDARD TABLE OF ptpsp,

     lt_dayint  TYPE STANDARD TABLE OF pwsdayint,

     lt_daygen  TYPE STANDARD TABLE OF pwsdaygen,

     wa_psp     TYPE ptpsp,

     wa_dayint  TYPE pwsdayint.

 

 

 

  CALL FUNCTION 'HR_PERSONAL_WORK_SCHEDULE'

    EXPORTING

      pernr                   = p_pernr

      begda                   = p_ldate

      endda                   = p_ldate

* IMPORTING

*   WARNING_OCCURED         =

    TABLES

      perws                   = lt_psp

  EXCEPTIONS

    error_occured           = 1

    abort_occured           = 2

    OTHERS                  = 3.  .

 

  IF sy-subrc <> 0.

 

  ENDIF.

 

  CALL FUNCTION 'HR_WORK_SCHEDULE_TIMES'

    EXPORTING

      pernr                         = p_pernr

      begda                         = p_ldate

      endda                         = p_ldate

*    IMPORTING

*      WARNING_OCCURED               =

    TABLES

      perws                         = lt_psp    ”From FM HR_PERSONAL_WORK_SCHEDULE

      daygen                        = lt_daygen

      dayint                        = lt_dayint

    EXCEPTIONS

      error_occured                 = 1

      perws_error                   = 2

      OTHERS                        = 3

            .

  IF sy-subrc <> 0 or lt_dayint[] is initial.

  ENDIF.

 

ENDFORM

 

Converted from CHM to HTML with chm2web Standard 2.7 (unicode)