Skip to Content

Check original language of repository objects when creating

In our company, repo objects must be created with original language EN. Is there a way to check the logon language in case of creating a new object in the ABAP repository?

Desired behaviour: SE80 - create program/class/data element/table/....

--> user exit/badi checks the logon language. When it is not 'EN', the creation will be refused.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Apr 10 at 05:52 AM

    Although your requirement is fully justified, a user exit probably doesn't exist, so you'll be the first one to do a modification of the standard (enhancement framework). Almost every ABAP Workbench action is initiated through the CL_WB_REQUEST class, so you could do something around it. But you must be very careful with any modification in the ABAP workbench, you could put down the whole system if your code has a syntax error one day (installation of support package or upgrade, SAP note, etc.), so if you do anything at all, I advise you to take all possible precautions : dynamic linking of your modification to the code (call method ('CLASS')=>('NAME'))+ restriction of your modification to only the developers + assigning the modification to the + option to switch it off at any time (switch framework, reversible business function).

    Add comment
    10|10000 characters needed characters exceeded

    • Good suggestions. I now stripped it down to

        data zz_lv_oper_failed type abap_bool.
        try.
            call method ('ZCL_DV07_WB_REQUEST_ENH')=>('OPERATION_NOT_VALID')
              exporting iv_operation = 'CREATE'
              receiving rv_failed = zz_lv_oper_failed.
            if zz_lv_oper_failed = abap_true.
              return.
            endif.
          catch CX_SY_DYN_CALL_ERROR.
            " do nothing.
        endtry.<br>

      The rest is done in the called method:

        method operation_not_valid.
            if so_dp is not bound.<br>        " create a static data provider that contains all SEU operations
              " with additional checks (stored in a customizing table)
              so_dp = new #( ).  " see data provider class
            endif.
            try.
                " get the action from the data provider
                data(ls_action) = so_dp->mt_settings[ id = iv_operation ].
              catch cx_sy_itab_line_not_found.
                " no checks for this action set - leave
                return.
            endtry.
            if ls_action-langu_check = abap_true.  " logon language check active
              if sy-langu <> 'E'.  " English is mandatory
                message i001(zm_dv07) display like 'E'. " show a message
                rv_failed = abap_true. " return the failed-flag
              endif.
            endif.
        endmethod.
      
      *--------- the data provider class ------------------<br>class lcl_dp_settings definition final.
        public section.
          types gty_t_settings type standard table of zdb_dv07_001 with default key.
          data mt_settings type gty_t_settings.
          methods constructor.
      endclass.
      
      class lcl_dp_settings implementation.
        method constructor.
          select * from zdb_dv07_001
            into table @mt_settings.
        endmethod.
      endclass.
      
      *------------ the customizing table ZDB_DV07_001
      |ID         |LANGU_CHECK |
      +-----------+------------+
      |CREANOEDIT |X           |
      |CREATE     |X           |
      |CREATE_CPT |X           |
      |CREATE_DMD |X           |
      |CREATE_OBJ |X           |
      |CREATE_OP  |X           |
      |CREATE_PRP |X           |
      |CREATE_REF |X           |
      |CREATE_REL |X           |
      |CREATE_SOB |X           |
      |EDIT       |X           |
      
      
      
      
      

  • Apr 09 at 09:50 AM

    I don't think there is. You could however put a check at transport release time in an implementation of BADI CTS_REQUEST_CHECK.


    Add comment
    10|10000 characters needed characters exceeded

    • At transport release would be too late for the objects are already created with the wrong language. But I already put a check at the creation of work bench requests. But one colleague has created placeholder requests with english logon and uses them instead of creating new ones....