Ansicht
Dokumentation

CATS0006 - CATS: Validate entire time sheet

CATS0006 - CATS: Validate entire time sheet

Fill RESBD Structure from EBP Component Structure   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.
SAP E-Book

Definition

Enables any customer-specific checks of data from the Cross-Application Time Sheet (CATS).

Use

If you want to use this SAP enhancement, note the following points:

  • The data check covers the entire time sheet and its various user interfaces, and the use of the programming interface (the CATimeSheetManager business object. You can perform the data check manually on the user interfaces. The system also calls the data check automatically in particular situations, regardless of the user interface:
  • In CATS classic (transaction CAT2) when users save data or switch to another view

  • In CATS regular (Internet Application Component CATW) when users save data

  • The CHECK_TABLE table is used as the transfer structure for the data records. The table contains all account-assignment fields that are relevant.
  • The DATEFROM and DATETO variables represent time limits. The data records being processed and to be check are usually between these time limits. You should, however, take note of the following points, regardless of the user interface you use:
  • In CATS classic, DATEFROM and DATETO represent the time limits of the data entry period currently displayed. In CATS classic, you can change data records and switch to another data entry period without first saving your data. In this case, the data to be checked may extend outside the time limits DATEFROMand DATETO.

  • In CATS regular, DATEFROM represents the data of entry of the first record just processed and DATETO the data of entry of the last record just processed.

  • If you want to return messages to the standard program, you have to use the internal table I_MESSAGES.
  • In the example below, the error message 001 is output with message class ZZ, message type E, and parameter XYZ. Filling the I_MESSAGES table is equivalent here to the MESSAGE E001(ZZ) WITH XYZ command. However, to ensure that all the program flows can run, you must use the I_MESSAGES table rather than the command.

Example

You want to prevent a users from entering more than eight hours for each day:

DATA: OLD_WORKDATE LIKE CATSDB-WORKDATE.
DATA: CATSHOURS LIKE CATSDB-CATSHOURS.

REFRESH I_MESSAGES.
SORT CHECK_TABLE BY WORKDATE.
CLEAR OLD_WORKDATE.

LOOP AT CHECK_TABLE WHERE WORKDATE BETWEEN DATEFROM AND DATETO.
  IF OLD_WORKDATE NE CHECK_TABLE-WORKDATE.
    OLD_WORKDATE = CHECK_TABLE-WORKDATE.
    CLEAR CATSHOURS.
    CATSHOURS = CATSHOURS + CHECK_TABLE-CATSHOURS.
  ELSE.
    CATSHOURS = CATSHOURS + CHECK_TABLE-CATSHOURS.
  ENDIF.
  IF CATSHOURS GT 8.
    I_MESSAGES-MSGTY = 'E'.
    I_MESSAGES-MSGID = 'ZZ'.
    I_MESSAGES-MSGNO = '001'.
    I_MESSAGES-MSGV1 = 'XYZ'.
    APPEND I_MESSAGES.
  ENDIF.
ENDLOOP.









rdisp/max_wprun_time - Maximum work process run time   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 4400 Date: 20240425 Time: 140643     sap01-206 ( 61 ms )