Ansicht
Dokumentation

CBIH_LB14_UETEMPL_IATYPE_CHECK - EHS: User Exit to Check Type of Incident/Accident Log Entry

CBIH_LB14_UETEMPL_IATYPE_CHECK - EHS: User Exit to Check Type of Incident/Accident Log Entry

ROGBILLS - Synchronize billing plans   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This function module is used as a template for check functions that you can define for the incident/accident log entry type.

The function module is also available as a reference function module for defining the interface of the user exit category IAL_TYPCHK.

Example

In the following example, the consistency of the incident/accident log entry type is examined based on the number of persons affected. The values used in the example for the incident/accident log entry type are set as defaults in standard Customizing.

*"*"Local interface:
*" IMPORTING
*" VALUE(I_IATYPE) LIKE CCIHT_IAL-IATYPE
*" VALUE(I_IAL_RECN) LIKE CCIHT_IAL-RECN
*" VALUE(I_ADDINF) LIKE RCGADDINF STRUCTURE RCGADDINF
*" EXPORTING
*" VALUE(E_FLG_OK) TYPE ESP1_BOOLEAN
*" VALUE(E_ERROR_MESSAGE)
*" TABLES
*" I_INVPERS_TAB STRUCTURE CCIHS_IPIOT OPTIONAL
*" EXCEPTIONS
*" INTERNAL_ERROR
*"----------------------------------------------------------------------
* ----------------------------------------------------------------------
* Local data
* ----------------------------------------------------------------------
* working table
DATA: L_INVPERS_IOTAB LIKE CCIHS_IPIOT OCCURS 10 WITH HEADER LINE.
DATA: L_COUNT LIKE SY-TABIX VALUE 0.

* ----------------------------------------------------------------------
* Function body
* ----------------------------------------------------------------------
* init export parameters
E_FLG_OK = ESP1_TRUE.
CLEAR E_ERROR_MESSAGE.

* ----------------------------------------------------------
* STEP 1: prepare person involved table (recommended to be copied)
* ----------------------------------------------------------
REFRESH L_INVPERS_IOTAB.

IF ( I_INVPERS_TAB[] IS INITIAL ).

* read person involved data from buffer
CALL FUNCTION 'CBIH_LB14_IAL_SREAD'
EXPORTING
I_RECN = I_IAL_RECN
I_ACTYPE = IC_ACTYPE-SHOW
I_ADDINF = I_ADDINF
* I_FLG_AUTHORITY_CHECK = ESP1_FALSE
* I_FLG_WITH_LOCK = ESP1_FALSE
I_FLG_WITH_MESSAGE = TRUE
I_FLG_IP = ESP1_TRUE
TABLES
E_IP_IOTAB = L_INVPERS_IOTAB
EXCEPTIONS
PARAMETER_ERROR = 1
IAL_NOT_FOUND = 2
NO_AUTHORITY = 3
OTHERS = 4.

IF ( SY-SUBRC NE 0 ).
RAISE INTERNAL_ERROR.
ENDIF.

ELSE.
* use data of imported table
L_INVPERS_IOTAB[] = I_INVPERS_TAB[].

ENDIF. " i_invpers_tab[] is initial


* ----------------------------------
* STEP 2: check IAL type (example)
* ----------------------------------
* determine number of injured persons
L_COUNT = 0.
LOOP AT L_INVPERS_IOTAB WHERE ( IPTYPE = CIH04_IPTYPE-INJURED ).
L_COUNT = L_COUNT + 1.
ENDLOOP.

CASE I_IATYPE.

WHEN 'OPE'.
IF ( L_COUNT NE 1 ).
E_FLG_OK = FALSE.
ENDIF.

WHEN 'MPE'.
IF ( L_COUNT < 2 ).
E_FLG_OK = FALSE.
ENDIF.

WHEN 'NPE'.
IF ( L_COUNT > 0 ).
E_FLG_OK = FALSE.
ENDIF.

WHEN OTHERS.
E_FLG_OK = TRUE.

ENDCASE. " i_iatype

Notes

In Customizing for Industrial Hygiene and Safety, you can specify a user exit name for every incident/accident log entry type in the IMG activity Specify Incident/Accident Log Entry Types. You must have already created this user exit name in Customizing for Basic Data and Tools under Manage User Exits and assigned it to a function module.

If you write your own check function, its interface must match the interface of the reference function module.





Parameters

E_ERROR_MESSAGE
E_FLG_OK
I_ADDINF
I_IAL_RECN
I_IATYPE
I_INVPERS_TAB

Exceptions

INTERNAL_ERROR

Function Group

CBIH_LB14

BAL Application Log Documentation   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Length: 4882 Date: 20240523 Time: 112835     sap01-206 ( 48 ms )