SAP Function Modules

EHS_FIND_EXPOSURE_REL_PROT SAP Function module







EHS_FIND_EXPOSURE_REL_PROT is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name EHS_FIND_EXPOSURE_REL_PROT into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: EHS00PPROT
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM EHS_FIND_EXPOSURE_REL_PROT - EHS FIND EXPOSURE REL PROT





CALL FUNCTION 'EHS_FIND_EXPOSURE_REL_PROT' "
  EXPORTING
    im_pernr =                  " e1p0002-pernr  Personnel Number
*   im_begda = SY-DATUM         " begda
*   im_endda = SY-DATUM         " endda
*   im_flag_get_struc = 'X'     "
*   im_reason = 'X'             " c
  IMPORTING
    ex_protocols =              " ehspp_tbl_protocols
    ex_reasons =                " ehspp_tbl_reasons
  TABLES
*   result_tab =                " swhactor
*   result_objec =              " objec_t       Org. Management: Table of Object Entries
*   result_struc =              " struc_t       Org. Management: Table of Structure Entries
*   ex_agents_1403 =            " ehs00y_1403   EHS: Info Category 1403 Extended
*   ex_agents_1404 =            " ehs00y_1404   EHS: Info Category 1403 Extended
*   ex_exp_lta =                " ehs00y_explta  EHS: Agent (LTA)
*   ex_exp_ste =                " ehs00y_expste  EHS: Exposure (STE)
*   ex_exp_lta_nrd =            " ehs00y_explta  EHS: Agent (LTA)
*   ex_exp_ste_nrd =            " ehs00y_expste  EHS: Exposure (STE)
*   ex_exp_lta_res =            " ehs00y_explta  EHS: Agent (LTA)
*   ex_exp_ste_res =            " ehs00y_expste  EHS: Exposure (STE)
    ex_exp_persprot =           " ehs00persprot
  EXCEPTIONS
    PERNR_NOT_ALLOWED = 1       "
    PERNR_NOT_EXIST = 2         "
    NO_PLVAR_FOUND = 3          "
    ENDDA_BEFORE_BEGDA = 4      "
    .  "  EHS_FIND_EXPOSURE_REL_PROT

ABAP code example for Function Module EHS_FIND_EXPOSURE_REL_PROT





The ABAP code below is a full code listing to execute function module EHS_FIND_EXPOSURE_REL_PROT including all data declarations. The code uses 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 original method of declaring data variables up front. 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).

DATA:
ld_ex_protocols  TYPE EHSPP_TBL_PROTOCOLS ,
ld_ex_reasons  TYPE EHSPP_TBL_REASONS ,
it_result_tab  TYPE STANDARD TABLE OF SWHACTOR,"TABLES PARAM
wa_result_tab  LIKE LINE OF it_result_tab ,
it_result_objec  TYPE STANDARD TABLE OF OBJEC_T,"TABLES PARAM
wa_result_objec  LIKE LINE OF it_result_objec ,
it_result_struc  TYPE STANDARD TABLE OF STRUC_T,"TABLES PARAM
wa_result_struc  LIKE LINE OF it_result_struc ,
it_ex_agents_1403  TYPE STANDARD TABLE OF EHS00Y_1403,"TABLES PARAM
wa_ex_agents_1403  LIKE LINE OF it_ex_agents_1403 ,
it_ex_agents_1404  TYPE STANDARD TABLE OF EHS00Y_1404,"TABLES PARAM
wa_ex_agents_1404  LIKE LINE OF it_ex_agents_1404 ,
it_ex_exp_lta  TYPE STANDARD TABLE OF EHS00Y_EXPLTA,"TABLES PARAM
wa_ex_exp_lta  LIKE LINE OF it_ex_exp_lta ,
it_ex_exp_ste  TYPE STANDARD TABLE OF EHS00Y_EXPSTE,"TABLES PARAM
wa_ex_exp_ste  LIKE LINE OF it_ex_exp_ste ,
it_ex_exp_lta_nrd  TYPE STANDARD TABLE OF EHS00Y_EXPLTA,"TABLES PARAM
wa_ex_exp_lta_nrd  LIKE LINE OF it_ex_exp_lta_nrd ,
it_ex_exp_ste_nrd  TYPE STANDARD TABLE OF EHS00Y_EXPSTE,"TABLES PARAM
wa_ex_exp_ste_nrd  LIKE LINE OF it_ex_exp_ste_nrd ,
it_ex_exp_lta_res  TYPE STANDARD TABLE OF EHS00Y_EXPLTA,"TABLES PARAM
wa_ex_exp_lta_res  LIKE LINE OF it_ex_exp_lta_res ,
it_ex_exp_ste_res  TYPE STANDARD TABLE OF EHS00Y_EXPSTE,"TABLES PARAM
wa_ex_exp_ste_res  LIKE LINE OF it_ex_exp_ste_res ,
it_ex_exp_persprot  TYPE STANDARD TABLE OF EHS00PERSPROT,"TABLES PARAM
wa_ex_exp_persprot  LIKE LINE OF it_ex_exp_persprot .


DATA(ld_im_pernr) = Check type of data required
DATA(ld_im_begda) = 'Check type of data required'.
DATA(ld_im_endda) = 'Check type of data required'.
DATA(ld_im_flag_get_struc) = 'some text here'.
DATA(ld_im_reason) = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_result_tab to it_result_tab.

"populate fields of struture and append to itab
append wa_result_objec to it_result_objec.

"populate fields of struture and append to itab
append wa_result_struc to it_result_struc.

"populate fields of struture and append to itab
append wa_ex_agents_1403 to it_ex_agents_1403.

"populate fields of struture and append to itab
append wa_ex_agents_1404 to it_ex_agents_1404.

"populate fields of struture and append to itab
append wa_ex_exp_lta to it_ex_exp_lta.

"populate fields of struture and append to itab
append wa_ex_exp_ste to it_ex_exp_ste.

"populate fields of struture and append to itab
append wa_ex_exp_lta_nrd to it_ex_exp_lta_nrd.

"populate fields of struture and append to itab
append wa_ex_exp_ste_nrd to it_ex_exp_ste_nrd.

"populate fields of struture and append to itab
append wa_ex_exp_lta_res to it_ex_exp_lta_res.

"populate fields of struture and append to itab
append wa_ex_exp_ste_res to it_ex_exp_ste_res.

"populate fields of struture and append to itab
append wa_ex_exp_persprot to it_ex_exp_persprot. . CALL FUNCTION 'EHS_FIND_EXPOSURE_REL_PROT' EXPORTING im_pernr = ld_im_pernr * im_begda = ld_im_begda * im_endda = ld_im_endda * im_flag_get_struc = ld_im_flag_get_struc * im_reason = ld_im_reason IMPORTING ex_protocols = ld_ex_protocols ex_reasons = ld_ex_reasons TABLES * result_tab = it_result_tab * result_objec = it_result_objec * result_struc = it_result_struc * ex_agents_1403 = it_ex_agents_1403 * ex_agents_1404 = it_ex_agents_1404 * ex_exp_lta = it_ex_exp_lta * ex_exp_ste = it_ex_exp_ste * ex_exp_lta_nrd = it_ex_exp_lta_nrd * ex_exp_ste_nrd = it_ex_exp_ste_nrd * ex_exp_lta_res = it_ex_exp_lta_res * ex_exp_ste_res = it_ex_exp_ste_res ex_exp_persprot = it_ex_exp_persprot EXCEPTIONS PERNR_NOT_ALLOWED = 1 PERNR_NOT_EXIST = 2 NO_PLVAR_FOUND = 3 ENDDA_BEFORE_BEGDA = 4 . " EHS_FIND_EXPOSURE_REL_PROT
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_ex_protocols  TYPE EHSPP_TBL_PROTOCOLS ,
ld_im_pernr  TYPE E1P0002-PERNR ,
it_result_tab  TYPE STANDARD TABLE OF SWHACTOR ,
wa_result_tab  LIKE LINE OF it_result_tab,
ld_ex_reasons  TYPE EHSPP_TBL_REASONS ,
ld_im_begda  TYPE BEGDA ,
it_result_objec  TYPE STANDARD TABLE OF OBJEC_T ,
wa_result_objec  LIKE LINE OF it_result_objec,
ld_im_endda  TYPE ENDDA ,
it_result_struc  TYPE STANDARD TABLE OF STRUC_T ,
wa_result_struc  LIKE LINE OF it_result_struc,
ld_im_flag_get_struc  TYPE STRING ,
it_ex_agents_1403  TYPE STANDARD TABLE OF EHS00Y_1403 ,
wa_ex_agents_1403  LIKE LINE OF it_ex_agents_1403,
it_ex_agents_1404  TYPE STANDARD TABLE OF EHS00Y_1404 ,
wa_ex_agents_1404  LIKE LINE OF it_ex_agents_1404,
ld_im_reason  TYPE C ,
it_ex_exp_lta  TYPE STANDARD TABLE OF EHS00Y_EXPLTA ,
wa_ex_exp_lta  LIKE LINE OF it_ex_exp_lta,
it_ex_exp_ste  TYPE STANDARD TABLE OF EHS00Y_EXPSTE ,
wa_ex_exp_ste  LIKE LINE OF it_ex_exp_ste,
it_ex_exp_lta_nrd  TYPE STANDARD TABLE OF EHS00Y_EXPLTA ,
wa_ex_exp_lta_nrd  LIKE LINE OF it_ex_exp_lta_nrd,
it_ex_exp_ste_nrd  TYPE STANDARD TABLE OF EHS00Y_EXPSTE ,
wa_ex_exp_ste_nrd  LIKE LINE OF it_ex_exp_ste_nrd,
it_ex_exp_lta_res  TYPE STANDARD TABLE OF EHS00Y_EXPLTA ,
wa_ex_exp_lta_res  LIKE LINE OF it_ex_exp_lta_res,
it_ex_exp_ste_res  TYPE STANDARD TABLE OF EHS00Y_EXPSTE ,
wa_ex_exp_ste_res  LIKE LINE OF it_ex_exp_ste_res,
it_ex_exp_persprot  TYPE STANDARD TABLE OF EHS00PERSPROT ,
wa_ex_exp_persprot  LIKE LINE OF it_ex_exp_persprot.


ld_im_pernr = Check type of data required

"populate fields of struture and append to itab
append wa_result_tab to it_result_tab.
ld_im_begda = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_result_objec to it_result_objec.
ld_im_endda = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_result_struc to it_result_struc.
ld_im_flag_get_struc = 'some text here'.

"populate fields of struture and append to itab
append wa_ex_agents_1403 to it_ex_agents_1403.

"populate fields of struture and append to itab
append wa_ex_agents_1404 to it_ex_agents_1404.
ld_im_reason = 'Check type of data required'.

"populate fields of struture and append to itab
append wa_ex_exp_lta to it_ex_exp_lta.

"populate fields of struture and append to itab
append wa_ex_exp_ste to it_ex_exp_ste.

"populate fields of struture and append to itab
append wa_ex_exp_lta_nrd to it_ex_exp_lta_nrd.

"populate fields of struture and append to itab
append wa_ex_exp_ste_nrd to it_ex_exp_ste_nrd.

"populate fields of struture and append to itab
append wa_ex_exp_lta_res to it_ex_exp_lta_res.

"populate fields of struture and append to itab
append wa_ex_exp_ste_res to it_ex_exp_ste_res.

"populate fields of struture and append to itab
append wa_ex_exp_persprot to it_ex_exp_persprot.

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name EHS_FIND_EXPOSURE_REL_PROT or its description.