Properties SourceCde
txt
1
*---------------------------------------------------------------------*
2
*       FORM CHECK_LOCKABLE_OBJECT                                    *
3
*---------------------------------------------------------------------*
4
*  check lockable transport objects                                   *
5
*---------------------------------------------------------------------*
6
* <---> CLO_E071 ......
7
* <---- return code: 0 - ok, 4 - display only, 8 - cancel edit        *
8
*---------------------------------------------------------------------*
9
FORM CHECK_LOCKABLE_OBJECT USING CLO_E071 STRUCTURE E071
10
                                 CLO_RETURN TYPE I.
11
  DATA: CLO_TADIR LIKE TADIR, CLO_DDERR LIKE DDERR,
12
        CLO_LOCKED(1) TYPE C, CLO_LOCKABLE(1) TYPE C,
13
        CLO_EDITABLE(1) TYPE C, CLO_LOCK_TASK LIKE E071-TRKORR,
14
        CLO_LOCK_USER LIKE SY-UNAME, CLO_LOCK_ORDER LIKE E071-TRKORR,
15
        CLO_TRANSPORTABLE(1) TYPE C, CLO_ICORR LIKE E070-TRKORR,
16
        CLO_TE071 LIKE KO200 OCCURS 0, CLO_TTADIR LIKE TADIR OCCURS 0,
17
        CLO_TE071K LIKE E071K OCCURS 0.
18
 
19
  APPEND CLO_E071 TO CLO_TE071.
20
  CALL FUNCTION 'TR_EDIT_CHECK_OBJECTS_KEYS'
21
       EXPORTING
22
            WI_ORDER                       = CLO_E071-TRKORR
23
            WI_WITH_DIALOG                 = 'R'
24
*           WI_OBJ_CATEGOGY_MIX            = 'X'
25
            WI_SEND_MESSAGE                = ' '
26
       IMPORTING
27
*           WE_ORDER                       =
28
            WE_TASK                        = CLO_E071-TRKORR
29
*           WE_OBJECTS_APPENDABLE          =
30
*           EV_ERRNUM                      =
31
*           EV_OBJECT_UNLOCKED             =
32
       TABLES
33
            WT_E071                        = CLO_TE071
34
            WT_E071K                       = CLO_TE071K
35
            WT_TADIR                       = CLO_TTADIR
36
       EXCEPTIONS
37
            CANCEL_EDIT_APPEND_ERROR_KEYS  = 1
38
            CANCEL_EDIT_APPEND_ERROR_OBJCT = 2
39
            CANCEL_EDIT_APPEND_ERROR_ORDER = 3
40
            CANCEL_EDIT_BUT_SE01           = 4
41
            CANCEL_EDIT_NO_HEADER_OBJECT   = 5
42
            CANCEL_EDIT_NO_ORDER_SELECTED  = 6
43
            CANCEL_EDIT_REPAIRED_OBJECT    = 7
44
            CANCEL_EDIT_SYSTEM_ERROR       = 8
45
            CANCEL_EDIT_TADIR_MISSING      = 9
46
            CANCEL_EDIT_TADIR_UPDATE_ERROR = 10
47
            CANCEL_EDIT_UNKNOWN_DEVCLASS   = 11
48
            CANCEL_EDIT_UNKNOWN_OBJECTTYPE = 12
49
            CANCEL_EDIT_NO_CHECK_CALL      = 13
50
            CANCEL_EDIT_CATEGORY_MIXTURE   = 14
51
            CANCEL_EDIT_USER_AFTER_ERROR   = 15
52
            CANCEL_EDIT_CUSTOM_OBJ_AT_SAP  = 16
53
            CANCEL_EDIT_ACCESS_DENIED      = 17
54
            SHOW_ONLY_CLOSED_SYSTEM        = 18
55
            SHOW_ONLY_CONSOLIDATION_LEVEL  = 19
56
            SHOW_ONLY_DDIC_IN_CUSTOMER_SYS = 20
57
            SHOW_ONLY_DELIVERY_SYSTEM      = 21
58
            SHOW_ONLY_DIFFERENT_ORDERTYPES = 22
59
            SHOW_ONLY_DIFFERENT_TASKTYPES  = 23
60
            SHOW_ONLY_ENQUEUE_FAILED       = 24
61
            SHOW_ONLY_GENERATED_OBJECT     = 25
62
            SHOW_ONLY_ILL_LOCK             = 26
63
            SHOW_ONLY_LOCK_ENQUEUE_FAILED  = 27
64
            SHOW_ONLY_MIXED_ORDERS         = 28
65
            SHOW_ONLY_MIX_LOCAL_TRANSP_OBJ = 29
66
            SHOW_ONLY_NO_SHARED_REPAIR     = 30
67
            SHOW_ONLY_OBJECT_LOCKED        = 31
68
            SHOW_ONLY_REPAIRED_OBJECT      = 32
69
            SHOW_ONLY_SHOW_CLIENT          = 33
70
            SHOW_ONLY_TADIR_MISSING        = 34
71
            SHOW_ONLY_UNKNOWN_DEVCLASS     = 35
72
            SHOW_ONLY_CLOSED_CLIENT        = 36
73
            SHOW_ONLY_CLOSED_ALE_OBJECT    = 37
74
            SHOW_ONLY_UNALLOWED_SUPERUSER  = 38
75
            SHOW_ONLY_NO_REPAIR_SYSTEM     = 39
76
            SHOW_ONLY_NO_LICENSE           = 40
77
            SHOW_ONLY_CENTRAL_BASIS        = 41
78
            SHOW_ONLY_USER_AFTER_ERROR     = 42
79
            SHOW_ONLY_OBJECT_NOT_PATCHABLE = 43.
80
  IF SY-SUBRC NE 0.
81
    MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
82
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
83
    IF SY-SUBRC LE 17.
84
      CLO_RETURN = 8. EXIT.
85
    ELSE.
86
      CLO_RETURN = 4. <STATUS>-CORR_NBR = VIM_LOCKED_IN_CORR. EXIT.
87
    ENDIF.
88
  ELSE.
89
    READ TABLE CLO_TE071 INTO CLO_E071 INDEX 1.
90
    READ TABLE CLO_TTADIR INTO CLO_TADIR INDEX 1.
91
    IF CLO_TADIR-DEVCLASS IS INITIAL.
92
      CALL FUNCTION 'TR_EDIT_CHECK_OBJECTS_KEYS'
93
           EXPORTING
94
                WI_ORDER                       = CLO_E071-TRKORR
95
                WI_WITH_DIALOG                 = 'X'
96
*           WI_OBJ_CATEGOGY_MIX            = 'X'
97
                WI_SEND_MESSAGE                = ' '
98
           IMPORTING
99
*           WE_ORDER                       =
100
                WE_TASK                        = CLO_E071-TRKORR
101
*           WE_OBJECTS_APPENDABLE          =
102
*           EV_ERRNUM                      =
103
*           EV_OBJECT_UNLOCKED             =
104
           TABLES
105
                WT_E071                        = CLO_TE071
106
                WT_E071K                       = CLO_TE071K
107
                WT_TADIR                       = CLO_TTADIR
108
           EXCEPTIONS
109
                CANCEL_EDIT_APPEND_ERROR_KEYS  = 1
110
                CANCEL_EDIT_APPEND_ERROR_OBJCT = 2
111
                CANCEL_EDIT_APPEND_ERROR_ORDER = 3
112
                CANCEL_EDIT_BUT_SE01           = 4
113
                CANCEL_EDIT_NO_HEADER_OBJECT   = 5
114
                CANCEL_EDIT_NO_ORDER_SELECTED  = 6
115
                CANCEL_EDIT_REPAIRED_OBJECT    = 7
116
                CANCEL_EDIT_SYSTEM_ERROR       = 8
117
                CANCEL_EDIT_TADIR_MISSING      = 9
118
                CANCEL_EDIT_TADIR_UPDATE_ERROR = 10
119
                CANCEL_EDIT_UNKNOWN_DEVCLASS   = 11
120
                CANCEL_EDIT_UNKNOWN_OBJECTTYPE = 12
121
                CANCEL_EDIT_NO_CHECK_CALL      = 13
122
                CANCEL_EDIT_CATEGORY_MIXTURE   = 14
123
                CANCEL_EDIT_USER_AFTER_ERROR   = 15
124
                CANCEL_EDIT_CUSTOM_OBJ_AT_SAP  = 16
125
                CANCEL_EDIT_ACCESS_DENIED      = 17
126
                SHOW_ONLY_CLOSED_SYSTEM        = 18
127
                SHOW_ONLY_CONSOLIDATION_LEVEL  = 19
128
                SHOW_ONLY_DDIC_IN_CUSTOMER_SYS = 20
129
                SHOW_ONLY_DELIVERY_SYSTEM      = 21
130
                SHOW_ONLY_DIFFERENT_ORDERTYPES = 22
131
                SHOW_ONLY_DIFFERENT_TASKTYPES  = 23
132
                SHOW_ONLY_ENQUEUE_FAILED       = 24
133
                SHOW_ONLY_GENERATED_OBJECT     = 25
134
                SHOW_ONLY_ILL_LOCK             = 26
135
                SHOW_ONLY_LOCK_ENQUEUE_FAILED  = 27
136
                SHOW_ONLY_MIXED_ORDERS         = 28
137
                SHOW_ONLY_MIX_LOCAL_TRANSP_OBJ = 29
138
                SHOW_ONLY_NO_SHARED_REPAIR     = 30
139
                SHOW_ONLY_OBJECT_LOCKED        = 31
140
                SHOW_ONLY_REPAIRED_OBJECT      = 32
141
                SHOW_ONLY_SHOW_CLIENT          = 33
142
                SHOW_ONLY_TADIR_MISSING        = 34
143
                SHOW_ONLY_UNKNOWN_DEVCLASS     = 35
144
                SHOW_ONLY_CLOSED_CLIENT        = 36
145
                SHOW_ONLY_CLOSED_ALE_OBJECT    = 37
146
                SHOW_ONLY_UNALLOWED_SUPERUSER  = 38
147
                SHOW_ONLY_NO_REPAIR_SYSTEM     = 39
148
                SHOW_ONLY_NO_LICENSE           = 40
149
                SHOW_ONLY_CENTRAL_BASIS        = 41
150
                SHOW_ONLY_USER_AFTER_ERROR     = 42
151
                SHOW_ONLY_OBJECT_NOT_PATCHABLE = 43.
152
      IF SY-SUBRC NE 0.
153
        MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
154
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
155
        IF SY-SUBRC LE 17.
156
          CLO_RETURN = 8. EXIT.
157
        ELSE.
158
          CLO_RETURN = 4. <STATUS>-CORR_NBR = VIM_LOCKED_IN_CORR. EXIT.
159
        ENDIF.
160
      ELSE.
161
        READ TABLE CLO_TE071 INTO CLO_E071 INDEX 1.
162
        READ TABLE CLO_TTADIR INTO CLO_TADIR INDEX 1.
163
      ENDIF.
164
    ENDIF.
165
  ENDIF.
166
* PERFORM MCOMMEDITCHECK(RDDINSYS)
167
*                        CHANGING CLO_E071 CLO_TADIR CLO_DDERR.
168
* IF CLO_DDERR-SEVERITY EQ 'F'.
169
*   IF CLO_DDERR-ERRNUM EQ '16'.       "repair requested
170
*     PERFORM FCOMMEDITCHECK(RDDINSYS)
171
*                            CHANGING CLO_E071 CLO_TADIR CLO_DDERR.
172
*     IF CLO_DDERR-SEVERITY EQ 'F'.
173
*       CASE CLO_DDERR-ERRNUM.
174
*         WHEN 4.                      "display
175
**          MAINT_MODE = STATUS-ACTION = ANZEIGEN.
176
**          EXIT.
177
*           CLO_RETURN = 4. <STATUS>-CORR_NBR = VIM_LOCKED_IN_CORR.
178
*           EXIT.
179
*         WHEN 12.                     "cancel edit
180
**          RAISE MISSING_CORR_NUMBER.
181
*           CLO_RETURN = 8. EXIT.
182
*       ENDCASE.
183
*     ENDIF.
184
*   ELSEIF CLO_DDERR-ERRNUM EQ '17' OR "no TADIR or
185
*          CLO_DDERR-ERRNUM EQ '18'.   "missing devclass
186
*     IF CLO_DDERR-ERRNUM EQ '17'.
187
*       MESSAGE S133(SV). "Bitte Transporteigenschaften eingeben
188
*     ELSE.
189
*       MESSAGE S486(TK) WITH CLO_TADIR-DEVCLASS.
190
*     ENDIF.
191
*     CLO_TADIR-PGMID    = CLO_E071-PGMID.
192
*     CLO_TADIR-OBJECT   = CLO_E071-OBJECT.
193
*     CLO_TADIR-OBJ_NAME = CLO_E071-OBJ_NAME.
194
*     CALL FUNCTION 'TADIR_PFLEGE'
195
*          EXPORTING
196
*               ADIR      = CLO_TADIR
197
*               E71TEMP   = CLO_E071
198
*               START_ROW = 2
199
*          IMPORTING
200
*               NEWADIR   = CLO_TADIR
201
*               PDDERR    = CLO_DDERR
202
*          EXCEPTIONS
203
*               ILL_TYPE  = 01.
204
*     IF SY-SUBRC NE 0.
205
*       MESSAGE I095(SV) WITH E071-TRKORR. "Systemfehler
206
**      RAISE MISSING_CORR_NUMBER.
207
*       CLO_RETURN = 8. EXIT.
208
*     ENDIF.
209
*     IF CLO_DDERR-SEVERITY EQ 'F'.
210
*       CASE CLO_DDERR-ERRNUM.
211
*         WHEN 4.                      "display
212
**          MAINT_MODE = STATUS-ACTION = ANZEIGEN.
213
**          EXIT.
214
*           CLO_RETURN = 4. <STATUS>-CORR_NBR = VIM_LOCKED_IN_CORR.
215
*           EXIT.
216
*         WHEN 12.                     "cancel edit
217
**          RAISE MISSING_CORR_NUMBER.
218
*           CLO_RETURN = 8. EXIT.
219
*       ENDCASE.
220
*     ELSE.
221
*       CALL FUNCTION 'TRINT_CHANGE_TADIR_MASTERLANG'
222
*            EXPORTING
223
*                 WI_TADIR_PGMID               = CLO_TADIR-PGMID
224
*                 WI_TADIR_OBJECT              = CLO_TADIR-OBJECT
225
*                 WI_TADIR_OBJ_NAME            = CLO_TADIR-OBJ_NAME
226
*                 WI_TADIR_MASTERLANG          = SY-LANGU
227
*            EXCEPTIONS
228
*                 MASTERLANG_NOT_ALLOWED       = 1.
229
*       IF SY-SUBRC NE 0. "language not allowed
230
*         MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
231
*           WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
232
*       ENDIF.
233
*     ENDIF.
234
*   ELSE.  "other problems in MCOMM....
235
*     MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
236
*             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
237
**    MESSAGE I733(TK).
238
*     IF CLO_DDERR-ERRNUM EQ '4'.   "display
239
*       CLO_RETURN = 4. <STATUS>-CORR_NBR = VIM_LOCKED_IN_CORR.
240
*       EXIT.
241
*     ELSE.                         "cancel
242
*       CLO_RETURN = 8. EXIT.
243
*     ENDIF.
244
**    MESSAGE I095(SV) WITH E071-TRKORR. "Systemfehler
245
**    RAISE MISSING_CORR_NUMBER.
246
*   ENDIF.                             " clo_dderr-errnum in ( 17, 18 )
247
* ENDIF.                               "clo_dderr-severity eq 'F'
248
* first check if devclass is ok
249
* SELECT SINGLE * FROM TADIR INTO CLO_TADIR "already done in MCOMMEDITCH
250
*                            WHERE PGMID    = CLO_E071-PGMID
251
*                              AND OBJECT   = CLO_E071-OBJECT
252
*                              AND OBJ_NAME = CLO_E071-OBJ_NAME.
253
* IF TADIR-DEVCLASS(1) EQ '$'. "local object -> no transport
254
  IF CLO_TADIR IS INITIAL.             "may be no lockable object?
255
    CALL FUNCTION 'TR_CHECK_OBJECT_LOCK'
256
         EXPORTING
257
              WI_OBJECT                  = CLO_E071-OBJECT
258
              WI_OBJNAME                 = CLO_E071-OBJ_NAME
259
              WI_PGMID                   = CLO_E071-PGMID
260
         IMPORTING
261
              WE_LOCKABLE_OBJECT         = CLO_LOCKABLE
262
              WE_LOCKED                  = CLO_LOCKED
263
              WE_LOCK_TASK               = CLO_LOCK_TASK
264
              WE_LOCK_TASK_USER          = CLO_LOCK_USER
265
              WE_LOCK_ORDER              = CLO_LOCK_ORDER
266
              WE_OBJECT_EDITABLE         = CLO_EDITABLE
267
* 4.0 Namesp. WE_POSSIBLE_USER_EDIT_TASK = CLO_TADIR-KORRNUM
268
              WE_POSSIBLE_USER_EDIT_TASK = CLO_ICORR
269
         EXCEPTIONS
270
              EMPTY_KEY                  = 01
271
              NO_SYSTEMNAME              = 02
272
              NO_SYSTEMTYPE              = 03
273
              UNALLOWED_LOCK_ORDER       = 04.
274
    IF SY-SUBRC NE 0.
275
      MESSAGE I095(SV) WITH E071-TRKORR. "Systemfehler
276
*     RAISE MISSING_CORR_NUMBER.
277
      CLO_RETURN = 8. EXIT.
278
    ENDIF.
279
    IF CLO_LOCKABLE EQ SPACE.          "yes no lockable object
280
      VIM_CORR_OBJTAB-LOCKABLE = SPACE.
281
      MODIFY VIM_CORR_OBJTAB.
282
      EXIT.
283
    ELSE.                              "inconsistent object.
284
      MESSAGE I095(SV) WITH E071-TRKORR. "Systemfehler
285
      CLO_RETURN = 8. EXIT.
286
    ENDIF.
287
  ENDIF.                               "clo_tadir is initial
288
  CALL FUNCTION 'VIEW_GET_DEVCLASS_STATE'
289
       EXPORTING
290
            DEV_CLASS          = CLO_TADIR-DEVCLASS
291
       IMPORTING
292
            TRANSPORT_POSSIBLE = CLO_TRANSPORTABLE
293
       EXCEPTIONS
294
            NOT_FOUND          = 01.
295
  IF CLO_TRANSPORTABLE EQ SPACE.       "local object -> no transport
296
    X_HEADER-FLAG = VIM_TRANSPORT_DENIED.
297
    MODIFY X_HEADER INDEX 1.
298
  ELSE.
299
* second check if all objects have valid source systems
300
    IF VIM_LAST_SOURCE_SYSTEM EQ SPACE.
301
      VIM_LAST_SOURCE_SYSTEM = CLO_TADIR-SRCSYSTEM.
302
    ELSE.
303
      IF CLO_TADIR-SRCSYSTEM EQ SY-SYSID.    "if one object has sy-sysid
304
        IF VIM_LAST_SOURCE_SYSTEM NE SY-SYSID."all objs must have sy-sys
305
          MESSAGE I134(SV). "Inkonsistenz in Objektdefinition, nur Anzei
306
*       MAINT_MODE = STATUS-ACTION = ANZEIGEN.
307
*       EXIT.
308
          CLO_RETURN = 4. <STATUS>-CORR_NBR = VIM_LOCKED_IN_CORR. EXIT.
309
        ENDIF.
310
      ELSE. "if one object has another source system, all objects must
311
        IF VIM_LAST_SOURCE_SYSTEM EQ SY-SYSID. "another source system
312
          MESSAGE I134(SV). "Inkonsistenz in Objektdefinition, nur Anzei
313
*       MAINT_MODE = STATUS-ACTION = ANZEIGEN.
314
*       EXIT.
315
          CLO_RETURN = 4. <STATUS>-CORR_NBR = VIM_LOCKED_IN_CORR. EXIT.
316
        ENDIF.
317
      ENDIF.
318
    ENDIF.
319
    CALL FUNCTION 'TR_CHECK_OBJECT_LOCK'
320
         EXPORTING
321
              WI_OBJECT                  = CLO_E071-OBJECT
322
              WI_OBJNAME                 = CLO_E071-OBJ_NAME
323
              WI_PGMID                   = CLO_E071-PGMID
324
         IMPORTING
325
              WE_LOCKABLE_OBJECT         = CLO_LOCKABLE
326
              WE_LOCKED                  = CLO_LOCKED
327
              WE_LOCK_TASK               = CLO_LOCK_TASK
328
              WE_LOCK_TASK_USER          = CLO_LOCK_USER
329
              WE_LOCK_ORDER              = CLO_LOCK_ORDER
330
              WE_OBJECT_EDITABLE         = CLO_EDITABLE
331
* 4.0 Namesp. WE_POSSIBLE_USER_EDIT_TASK = CLO_TADIR-KORRNUM
332
              WE_POSSIBLE_USER_EDIT_TASK = CLO_ICORR
333
         EXCEPTIONS
334
              EMPTY_KEY                  = 01
335
              NO_SYSTEMNAME              = 02
336
              NO_SYSTEMTYPE              = 03
337
              UNALLOWED_LOCK_ORDER       = 04.
338
    IF SY-SUBRC NE 0.
339
      MESSAGE I095(SV) WITH E071-TRKORR. "Systemfehler
340
*     RAISE MISSING_CORR_NUMBER.
341
      CLO_RETURN = 8. EXIT.
342
    ENDIF.
343
    IF CLO_LOCKABLE EQ SPACE.
344
      VIM_CORR_OBJTAB-LOCKABLE = SPACE.
345
      MODIFY VIM_CORR_OBJTAB.
346
      EXIT.
347
    ENDIF.
348
    IF CLO_LOCKED NE SPACE.
349
      IF CLO_EDITABLE EQ SPACE.
350
        MESSAGE I132(SV) WITH CLO_LOCK_TASK CLO_LOCK_USER.
351
*       MAINT_MODE = STATUS-ACTION = ANZEIGEN.
352
*       EXIT.
353
        CLO_RETURN = 4. <STATUS>-CORR_NBR = VIM_LOCKED_IN_CORR. EXIT.
354
      ELSE.
355
*       CLO_E071-TRKORR = CLO_TADIR-KORRNUM.   "4.0 Namespace
356
        CLO_E071-TRKORR = CLO_ICORR.   "4.0 Namespace
357
      ENDIF.
358
    ENDIF.                             "clo_locked
359
  ENDIF.                               "devclass
360
  IF <STATUS>-CORR_NBR NE SPACE AND CLO_E071-TRKORR NE SPACE.
361
    IF CLO_E071-TRKORR NE <STATUS>-CORR_NBR.
362
      IF <STATUS>-ORDER_NBR NE CLO_LOCK_ORDER.
363
        MESSAGE I129(SV). "Zusammengehörige Objekte in verschied
364
*       RAISE MISSING_CORR_NUMBER.
365
        CLO_RETURN = 4. <STATUS>-CORR_NBR = VIM_LOCKED_IN_CORR. EXIT.
366
      ENDIF.
367
      VIM_CORR_OBJTAB-TRKORR = CLO_E071-TRKORR.
368
      MODIFY VIM_CORR_OBJTAB.
369
    ENDIF.
370
  ELSE.
371
    IF <STATUS>-CORR_NBR EQ SPACE.
372
      <STATUS>-CORR_NBR = CLO_E071-TRKORR.
373
      <STATUS>-ORDER_NBR = CLO_LOCK_ORDER.
374
    ENDIF.
375
  ENDIF.
376
  TRANSLATE <STATUS>-TR_ALRCHKD USING ' x'.
377
  CLEAR CLO_RETURN.
378
ENDFORM.                               "check_lockable_object