cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How do I make the Security Policy field a mandatory field in transaction SU01?

thomas_wolf_1234
Discoverer
1,315

Dear all,

we want all users created in transaction SU01 to have a security policy entered.
Therefore, this should be made a mandatory field.
Unfortunately I couldn't find anything about it on the Internet.

Does anyone know how to do this?

Many thanks in advance
Thomas 

 

Accepted Solutions (0)

Answers (1)

Answers (1)

RaymondGiuseppi
Active Contributor

Did you already try to code it within BADI_IDENTITY_CHECK ?

Could look like (written quickly, so adjust the code)

if not ( is_badi_identity_check-modus eq cl_identity_persistence=>co_ta_modus_create or
is_badi_identity_check-modus eq cl_identity_persistence=>co_ta_modus_modify ).
  return.
endif.

data: ls_logondata type suid_st_node_logondata,
      ls_msg       type symsg.

  try.

      call method is_badi_identity_check-idref->get_logondata
        importing
          es_logondata = ls_logondata.

      if ls_logondata-SECURITY_POLICY is not initial.
        return.
      else.
        clear: ls_msg.
        ls_msg-msgty = 'E'.
        ls_msg-msgid = 'ZXXXX'. " your class
        ls_msg-msgno = '999'. " your number
        call method io_badi_msg_buffer->add_object_message_symsg
          exporting
            iv_bname     = is_badi_identity_check-bname
            iv_nodename  = if_identity_definition=>gc_node_logondata
            iv_field     = if_identity_definition=>GC_FIELD_LOGONDATA_SEC_POLICY
            is_msg       = ls_msg
            iv_lifetime  = if_suid_msg_buffer=>co_lifetime_permanent.
      endif.
    catch cx_root.
  endtry.

 

Peter
Participant
RaymondGiuseppi
Active Contributor
0 Likes
Basically, the note states that there is no solution through Customizing, hence my suggestion to use a BAdI.