cancel
Showing results for 
Search instead for 
Did you mean: 

EHSM: Use Auth Check BAdI to hide Incident

Former Member
0 Kudos

Hi all,

I have enhanced the standard Auth Check BAdI BADI_EHHSS_INC_EXT_AUTH_CHECK for EHSM. Works like a charm.  But I just got another requirement and thought maybe someone else has done this before.

Right now, I have it set up so people with out the correct access can only view incidents.  Is there a way to use the BAdI to completely hide an incident when a user clicks on it?

Hope this makes sense.

Cheers,

Kevin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Hey all,

Our requirements ended up changing a bit but ended up putting authorization checks into class methods that control visibility for the sections of EHSM that we wanted to hide.  So, we got the result we were looking for.

Cheers,

Kevin

0 Kudos

Hi Kevin

Will you share the methods that control visibility for the sections of EHSM that

you were able to hide?

Cheers

Ricky

Former Member
0 Kudos

Hi Ricky,

Sorry for taking so long to get back.  So there were a couple places that I found for hiding certain things.

First thing, in the Recent tab, the Short Info column.  We wanted to hide the name of an injured person.  I did this in class CL_EHHSS_INC_Q_SEARCH_L, method CREATE_DESCRIPTION.  I created a PostExit routine.

Second thing, in the People tab withing an incident.  We wanted to hide the name of an injured person there as well.  This was done in class CL_EHHSS_INC_PINV_UI_LST, method MANAGE_CONFIDENTIAL.  I created a PostExit routine as well.

I enhanced the Extended Authorization Checks BAdI as well.  Here I created a routine for checking authorizations that I used in the two post exits listed above.

Hope this helps.

Cheers,

Kevin

0 Kudos

Hi Kevin

Thanks for your reply.  Will you supply example of your post-exit routine

to hide information.  I'm currently using BADI_EHHSS_INC_EXT_AUTH_CHECK

to check for additional access level. if access level is not granted we want to hide

confidentail information.  I would like to try your pos-exit routine CL_EHHSS_INC_PINV_UI_LST method confidential.  Not certain how to code this to hide information based upon access level granted or not.

Cheers,

Ricky

Former Member
0 Kudos

Hey Ricky,

Inside the BAdI Enhancement, I created an auth check method that was public so I could call it from wherever I wanted.  It returned either true or false.  For the client, it was based on the user logged in and their org id.

As for the post-exit, there was a bunch of code the client needed, but this is what you really need.


DATA: lo_ctrl TYPE REF TO cl_ehhss_inc_oif_cntrlr_new.

FIELD-SYMBOLS: <wa> TYPE ehhsss_inc_person_involved_eso,

                          <itab> TYPE table.

lo_ctrl ?= me->core_object->mo_controller.

*Call auth check routine*

*hide injured person in list

ASSIGN me->core_object->mt_data->* TO <itab>.

LOOP AT <itab> ASSIGNING <wa> CASTING.

     IF auth_routine = abap_true.

          <wa>-per_group_desc = abap_false.

          <wa>-roles_desc = abap_false.

          <wa>-roles_short_desc = abap_false.

          <wa>-full_name_disp = if_ehfnd_auth_check_c=>sc_confidential.

          <wa>-role_sort_code = abap_false.

     ENDIF.

ENDLOOP.

*hide injured person in the tab strip

IF auth_routine = abap_true.

     lo_ctrl->mo_ui_modifier->tab_set_tabstrip_visibility( iv_visible = abap_false

                                                                                         iv_requires_own_event = abap_true ).

     me->core_object->gv_disable_delete = abap_true.

     me->core_object->gv_disable_sendinc = abap_true.

ENDIF.

On the IF statements, you may want to add additional checks.  All depends on your requirements.

Hope this helps.

Cheers,

Kevin

Answers (1)

Answers (1)

former_member231368
Participant
0 Kudos

Hello Kevin,

I am new to SAP EHSM (SAP Version - 3.0)and I have the same requirement to hide some tabs or fields based on the custom access levels which has been added in domain - EHHSS_INC_ACCESS_LEVEL_CODE as suggested by SAP.

Could you please suggest or can you please share the steps which you have done it.

Enhanced the BADI - BADI_EHHSS_INC_EXT_AUTH_CHECK from SPRO.

From here I am unable to proceed further.

Thanks,

Yerukala Setty

Former Member
0 Kudos

Hi Yerukala,

I am no longer at the client that the solution was developed for.  The steps that I took to hide the information are listed above.  I created a class that checked an auth object and returned true or false.  The User either was able to see information or not.  As for the code that was in the BAdI, that is all dependent on the clients wishes. 

Sorry I can't be more help.

Cheers,

Kevin

former_member231368
Participant
0 Kudos

Hello Kevin,

Thank you for the updates.

Warm Regards,

Yerukala Setty