SAP EHS_FIND_EXPOSURE Function Module for









EHS_FIND_EXPOSURE is a standard ehs find exposure SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for ehs find exposure FM, simply by entering the name EHS_FIND_EXPOSURE into the relevant SAP transaction such as SE37 or SE38.

Function Group: EHS00PPROT
Program Name: SAPLEHS00PPROT
Main Program: SAPLEHS00PPROT
Appliation area: P
Release date: N/A
Mode(Normal, Remote etc): Normal Function Module
Update:



Function EHS_FIND_EXPOSURE pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'EHS_FIND_EXPOSURE'"
EXPORTING
IM_PERNR = "Personnel Number
* IM_BEGDA = SY-DATUM "
* IM_ENDDA = SY-DATUM "
* IM_FLAG_GET_STRUC = 'X' "

TABLES
* RESULT_TAB = "
* EX_EXP_LTA_RES = "EHS: Agent (LTA)
* EX_EXP_STE_RES = "EHS: Exposure (STE)
* RESULT_OBJEC = "
* RESULT_STRUC = "
* EX_AGENTS_1403 = "EHS: Info Category 1403 Extended
* EX_AGENTS_1404 = "EHS: Info Category 1404 Extended
* EX_EXP_LTA = "EHS: Agent (LTA)
* EX_EXP_STE = "EHS: Exposure (STE)
* EX_EXP_LTA_NRD = "EHS: Agent (LTA)
* EX_EXP_STE_NRD = "EHS: Exposure (STE)

EXCEPTIONS
PERNR_NOT_ALLOWED = 1 PERNR_NOT_EXIST = 2 NO_PLVAR_FOUND = 3 ENDDA_BEFORE_BEGDA = 4
.



IMPORTING Parameters details for EHS_FIND_EXPOSURE

IM_PERNR - Personnel Number

Data type: E1P0002-PERNR
Optional: No
Call by Reference: No ( called with pass by value option)

IM_BEGDA -

Data type: BEGDA
Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

IM_ENDDA -

Data type: ENDDA
Default: SY-DATUM
Optional: Yes
Call by Reference: No ( called with pass by value option)

IM_FLAG_GET_STRUC -

Data type:
Default: 'X'
Optional: Yes
Call by Reference: No ( called with pass by value option)

TABLES Parameters details for EHS_FIND_EXPOSURE

RESULT_TAB -

Data type: SWHACTOR
Optional: Yes
Call by Reference: No ( called with pass by value option)

EX_EXP_LTA_RES - EHS: Agent (LTA)

Data type: EHS00Y_EXPLTA
Optional: Yes
Call by Reference: Yes

EX_EXP_STE_RES - EHS: Exposure (STE)

Data type: EHS00Y_EXPSTE
Optional: Yes
Call by Reference: Yes

RESULT_OBJEC -

Data type: OBJEC
Optional: Yes
Call by Reference: No ( called with pass by value option)

RESULT_STRUC -

Data type: STRUC
Optional: Yes
Call by Reference: No ( called with pass by value option)

EX_AGENTS_1403 - EHS: Info Category 1403 Extended

Data type: EHS00Y_1403
Optional: Yes
Call by Reference: Yes

EX_AGENTS_1404 - EHS: Info Category 1404 Extended

Data type: EHS00Y_1404
Optional: Yes
Call by Reference: Yes

EX_EXP_LTA - EHS: Agent (LTA)

Data type: EHS00Y_EXPLTA
Optional: Yes
Call by Reference: Yes

EX_EXP_STE - EHS: Exposure (STE)

Data type: EHS00Y_EXPSTE
Optional: Yes
Call by Reference: Yes

EX_EXP_LTA_NRD - EHS: Agent (LTA)

Data type: EHS00Y_EXPLTA
Optional: Yes
Call by Reference: Yes

EX_EXP_STE_NRD - EHS: Exposure (STE)

Data type: EHS00Y_EXPSTE
Optional: Yes
Call by Reference: Yes

EXCEPTIONS details

PERNR_NOT_ALLOWED -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

PERNR_NOT_EXIST -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

NO_PLVAR_FOUND -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

ENDDA_BEFORE_BEGDA -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

Copy and paste ABAP code example for EHS_FIND_EXPOSURE Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_im_pernr  TYPE E1P0002-PERNR, "   
lt_result_tab  TYPE STANDARD TABLE OF SWHACTOR, "   
lv_pernr_not_allowed  TYPE SWHACTOR, "   
lt_ex_exp_lta_res  TYPE STANDARD TABLE OF EHS00Y_EXPLTA, "   
lt_ex_exp_ste_res  TYPE STANDARD TABLE OF EHS00Y_EXPSTE, "   
lv_im_begda  TYPE BEGDA, "   SY-DATUM
lt_result_objec  TYPE STANDARD TABLE OF OBJEC, "   
lv_pernr_not_exist  TYPE OBJEC, "   
lv_im_endda  TYPE ENDDA, "   SY-DATUM
lt_result_struc  TYPE STANDARD TABLE OF STRUC, "   
lv_no_plvar_found  TYPE STRUC, "   
lt_ex_agents_1403  TYPE STANDARD TABLE OF EHS00Y_1403, "   
lv_im_flag_get_struc  TYPE EHS00Y_1403, "   'X'
lv_endda_before_begda  TYPE EHS00Y_1403, "   
lt_ex_agents_1404  TYPE STANDARD TABLE OF EHS00Y_1404, "   
lt_ex_exp_lta  TYPE STANDARD TABLE OF EHS00Y_EXPLTA, "   
lt_ex_exp_ste  TYPE STANDARD TABLE OF EHS00Y_EXPSTE, "   
lt_ex_exp_lta_nrd  TYPE STANDARD TABLE OF EHS00Y_EXPLTA, "   
lt_ex_exp_ste_nrd  TYPE STANDARD TABLE OF EHS00Y_EXPSTE. "   

  CALL FUNCTION 'EHS_FIND_EXPOSURE'  "
    EXPORTING
         IM_PERNR = lv_im_pernr
         IM_BEGDA = lv_im_begda
         IM_ENDDA = lv_im_endda
         IM_FLAG_GET_STRUC = lv_im_flag_get_struc
    TABLES
         RESULT_TAB = lt_result_tab
         EX_EXP_LTA_RES = lt_ex_exp_lta_res
         EX_EXP_STE_RES = lt_ex_exp_ste_res
         RESULT_OBJEC = lt_result_objec
         RESULT_STRUC = lt_result_struc
         EX_AGENTS_1403 = lt_ex_agents_1403
         EX_AGENTS_1404 = lt_ex_agents_1404
         EX_EXP_LTA = lt_ex_exp_lta
         EX_EXP_STE = lt_ex_exp_ste
         EX_EXP_LTA_NRD = lt_ex_exp_lta_nrd
         EX_EXP_STE_NRD = lt_ex_exp_ste_nrd
    EXCEPTIONS
        PERNR_NOT_ALLOWED = 1
        PERNR_NOT_EXIST = 2
        NO_PLVAR_FOUND = 3
        ENDDA_BEFORE_BEGDA = 4
. " EHS_FIND_EXPOSURE




ABAP code using 7.40 inline data declarations to call FM EHS_FIND_EXPOSURE

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single PERNR FROM E1P0002 INTO @DATA(ld_im_pernr).
 
 
 
 
 
DATA(ld_im_begda) = SY-DATUM.
 
 
 
DATA(ld_im_endda) = SY-DATUM.
 
 
 
 
DATA(ld_im_flag_get_struc) = 'X'.
 
 
 
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!