We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!

CATP0001 - Determine target hours

CATP0001 - Determine target hours

ROGBILLS - Synchronize billing plans   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.
SAP E-Book

You can use this enhancement to fill target hours individually. You can use the data from the Time Type for Target Hours, Subtract HR Attendance or Absence Hours from Target Hours, and Add Overtime from HR to Target Hours fields in the data entry profile.

Examples

If according to the factory calendar a day is non-working, the target hours are set to 0 hours, otherwise to 8 hours.

tables: t001w.
data: is_0315 type cats_0315,
      is_target_hours type cats_hours_per_day.
data: plant like ps0315-werks,
     default_plant like ps0315-werks value '0001',
     workingday_indicator like scal-indicator,
     date like catsdb-workdate,
     working_hours like cats_hours_per_day-stdaz value 8.

* Read plant from infotype 0315
  CALL FUNCTION 'CATS_GET_INFOTYPE_0315'
       EXPORTING
            PERNR           = sap_pernr
            DATE            = sap_begda
       IMPORTING
            I0315           = is_0315
       EXCEPTIONS
            others          = 1.

  if is_0315-werks is initial.
    is_0315-werks = default_plant.
  endif.
 if t001w-werks <> is_0315-werks.
    select single * from t001w
      where werks = is_0315-werks.
  endif.

  date = sap_begda.
  while date <= sap_endda.
    clear is_target_hours.
    is_target_hours-date = date.

*   Check calendar for working days
    CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
         EXPORTING
              DATE                         = date
              FACTORY_CALENDAR_ID          = T001W-FABKL
         IMPORTING
              WORKINGDAY_INDICATOR         = workingday_indicator
         EXCEPTIONS
              others                       = 1.
    if sy-subrc &lt;&gt; 0.
      raise error_in_sap_enhancement.
    endif.
   if workingday_indicator is initial.
     is_target_hours-stdaz = working_hours.
    endif.
    append is_target_hours to sap_target_hours.
    date = date + 1.
  endwhile.






Fill RESBD Structure from EBP Component Structure   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 7058 Date: 20200919 Time: 023304     sap01-206 ( 35 ms )