Properties SourceCde
txt
1
*---------------------------------------------------------------------*
2
*       FORM VIM_CHECK_ALE_EDIT_LOCK                                  *
3
*---------------------------------------------------------------------*
4
*       ........                                                      *
5
*---------------------------------------------------------------------*
6
FORM VIM_CHECK_ALE_EDIT_LOCK USING VALUE(VCAEL_OBJECT) LIKE E071-OBJECT
7
                                   VCAEL_LOCK TYPE C.
8
  DATA: OBJ_TYPE LIKE OBJH-OBJECTTYPE, OBJ_NAME LIKE OBJH-OBJECTNAME.
9
 
10
* OBJ_NAME = VIEW_NAME.
11
  OBJ_NAME = MASTER_NAME.
12
  CASE VCAEL_OBJECT.
13
    WHEN VIM_VIEW_TYPE.                "-> view
14
      OBJ_TYPE = VIM_VIEW.
15
    WHEN TRANSP_OBJECT.                "-> tables
16
      OBJ_TYPE = VIM_TABL.
17
    WHEN VIM_CLUS_TYPE.                "-> viewcluster
18
      OBJ_TYPE = VIM_CLST.
19
    WHEN VIM_TRAN_TYPE.                "-> individual transaction
20
      OBJ_TYPE = VIM_TRAN.
21
    WHEN OTHERS.                       "-> may be LOGO object ?
22
      OBJ_TYPE = VIM_LOGO. OBJ_NAME = VCAEL_OBJECT.
23
*     SELECT SINGLE * FROM OBJH WHERE OBJECTNAME EQ OBJ_NAME "required ?
24
*                                 AND OBJECTTYPE EQ OBJ_TYPE.
25
*     IF SY-SUBRC NE 0. CLEARVCAEL_LOCK. EXIT. ENDIF. "no logo-object
26
  ENDCASE.
27
  CALL FUNCTION 'ALE_EDIT_CHECK'
28
       EXPORTING
29
            OBJECTTYPE      = OBJ_TYPE
30
            OBJECTNAME      = OBJ_NAME
31
       IMPORTING
32
            SOMEKEYS_NOEDIT = VIM_ALE_KEYSPEC_CHECK
33
       EXCEPTIONS
34
            NO_CALL         = 1
35
            NO_EDIT         = 2.
36
  IF SY-SUBRC GT 1.
37
    VCAEL_LOCK = 'X'.
38
    VIM_ALE_MSGID = SY-MSGID. VIM_ALE_MSGNO = SY-MSGNO.
39
    VIM_ALE_MSGV1 = SY-MSGV1. VIM_ALE_MSGV2 = SY-MSGV2.
40
    VIM_ALE_MSGV3 = SY-MSGV3. VIM_ALE_MSGV4 = SY-MSGV4.
41
  ELSE.
42
    CLEAR VCAEL_LOCK.
43
    IF VIM_ALE_KEYSPEC_CHECK NE SPACE AND OBJ_TYPE NE VIM_LOGO.
44
      VIM_ALE_KEYSPEC_OBJTAB-ONAME = OBJ_NAME.
45
      VIM_ALE_KEYSPEC_OBJTAB-OTYPE = OBJ_TYPE.
46
      APPEND VIM_ALE_KEYSPEC_OBJTAB.
47
    ENDIF.
48
  ENDIF.
49
ENDFORM.                               "vim_check_ale_edit_lock