Properties SourceCde
txt
1
*---------------------------------------------------------------------*
2
*       FORM CHECK_TRANSP_OBJS_FOR_MAINT                              *
3
*---------------------------------------------------------------------*
4
*  check transport objects for logging during maintenance             *
5
*---------------------------------------------------------------------*
6
FORM check_transp_objs_for_maint USING ctofm_return TYPE i.
7
  DATA: obj_appendable(1) TYPE c, rc LIKE sy-subrc, e071_safe LIKE e071,
8
      last_order LIKE e071-trkorr, ctofm_ko200_tab LIKE ko200 OCCURS 10,
9
        ctofm_keytab_safe LIKE corr_keytab OCCURS 50,
10
        last_corr LIKE e071-trkorr.
11
 
12
  CLEAR ctofm_return.
13
  CHECK maint_mode EQ aendern.
14
* Insert IMG-activity
15
  PERFORM vim_get_img_activity CHANGING e071-activity.  "UF738595/2001
16
  IF vim_corr_obj_viewname NE x_header-viewname.
17
    CLEAR e071-trkorr.
18
    PERFORM get_transp_info.
19
    CHECK x_header-flag NE vim_transport_denied.
20
    IF maint_mode EQ anzeigen. ctofm_return = 4. EXIT. ENDIF.
21
  ELSE. " csn ext.382209 2002 XB
22
    IF NOT objh IS INITIAL.
23
      IF x_header-importable IS INITIAL.
24
        x_header-importable = objh-importable.
25
      ENDIF.
26
    ENDIF.
27
  ENDIF.
28
  CHECK vim_client_state EQ vim_log.
29
  IF <status>-corr_nbr NE <status>-l_corr_nbr.
30
    CLEAR: <status>-tr_alrchkd, <status>-corr_enqud.
31
  ENDIF.
32
  IF <status>-tr_alrchkd NE space.
33
    vim_corr_obj_viewname = x_header-viewname.
34
    EXIT.
35
  ENDIF.
36
* first get corr nbr for lockable transport objects
37
  e071_safe = e071.
38
  CLEAR vim_last_source_system.
39
  LOOP AT vim_corr_objtab WHERE lockable NE space.
40
    e071 = vim_corr_objtab.
41
    PERFORM check_lockable_object USING e071 ctofm_return.
42
    IF ctofm_return NE 0 OR x_header-flag EQ vim_transport_denied.
43
      EXIT.
44
    ENDIF.
45
  ENDLOOP.
46
  IF ctofm_return NE 0 OR x_header-flag EQ vim_transport_denied.
47
    e071 = e071_safe. EXIT.
48
  ENDIF.
49
  vim_corr_obj_viewname = x_header-viewname.
50
* second: check unlockable objects
51
* REFRESH VIM_ULO_TRSP_OBJS.
52
  LOOP AT vim_corr_objtab WHERE lockable EQ space.
53
    e071 = vim_corr_objtab.
54
*   APPEND E071 TO VIM_ULO_TRSP_OBJS.
55
    APPEND e071 TO ctofm_ko200_tab.
56
  ENDLOOP.
57
  IF sy-subrc EQ 0.                    "only if unlockable objects exist
58
* CTOFM_KO200_TAB = VIM_ULO_TRSP_OBJS.
59
    LOOP AT corr_keytab.               "save keys of other objects
60
      LOOP AT vim_corr_objtab WHERE lockable EQ space
61
                                AND object   EQ corr_keytab-mastertype
62
                                AND obj_name EQ corr_keytab-mastername.
63
        EXIT.
64
      ENDLOOP.
65
      CHECK sy-subrc NE 0.
66
      APPEND corr_keytab TO ctofm_keytab_safe.
67
      DELETE corr_keytab.
68
    ENDLOOP.
69
    last_order = <status>-order_nbr.
70
    last_corr = <status>-corr_nbr.
71
    CALL FUNCTION 'TR_OBJECTS_CHECK'
72
      IMPORTING
73
        we_order                = <status>-order_nbr
74
        we_task                 = <status>-corr_nbr
75
        we_objects_appendable   = obj_appendable
76
      TABLES
77
        wt_ko200                = ctofm_ko200_tab
78
        wt_e071k                = corr_keytab
79
      EXCEPTIONS
80
        cancel_edit_other_error = 1
81
        show_only_other_error   = 2
82
        OTHERS                  = 3.
83
    IF sy-subrc NE 0.
84
      rc = sy-subrc.
85
      MESSAGE ID      sy-msgid
86
              TYPE    'I'
87
              NUMBER  sy-msgno
88
              WITH    sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
89
      IF rc = 2.
90
*     MAINT_MODE = STATUS-ACTION = ANZEIGEN.
91
        ctofm_return = 4.
92
        e071 = e071_safe. EXIT.
93
      ELSE.                            "cancel edit
94
*     RAISE MISSING_CORR_NUMBER.
95
        ctofm_return = 8. e071 = e071_safe. EXIT.
96
      ENDIF.
97
    ENDIF.
98
    IF <status>-corr_nbr NE space AND last_corr NE space.
99
      IF last_corr NE <status>-corr_nbr.
100
        IF <status>-order_nbr NE last_order.
101
          MESSAGE i129(sv). "Zusammengehörige Objekte in verschied
102
*       RAISE MISSING_CORR_NUMBER.
103
          ctofm_return = 4. e071 = e071_safe. EXIT.
104
        ENDIF.
105
      ENDIF.
106
    ELSE.
107
      IF <status>-corr_nbr EQ space.
108
        <status>-corr_nbr = last_corr.
109
        <status>-order_nbr = last_order.
110
      ENDIF.
111
    ENDIF.
112
    LOOP AT ctofm_keytab_safe INTO corr_keytab. "restore saved entries
113
      APPEND corr_keytab.
114
    ENDLOOP.
115
    IF obj_appendable EQ space.        "no ...INSERT - call required
116
      vim_client_state = vim_noact.
117
    ENDIF.
118
  ENDIF.                               "unlockable objects exist
119
  e071 = e071_safe.
120
  <status>-tr_alrchkd = 'x'.
121
ENDFORM.                               "check_transp_objs_for_maint
122
*&---------------------------------------------------------------------*
123
*&      Form  vim_get_img_activity
124
*&---------------------------------------------------------------------*
125
*       Gets IMG-activity the dialogue has been called from.
126
*       UF738595/2001
127
*----------------------------------------------------------------------*
128
*      <--P_ACTIVITY  IMG-activity
129
*----------------------------------------------------------------------*
130
FORM vim_get_img_activity  CHANGING p_activity TYPE e071-activity.
131
 
132
  CALL FUNCTION 'READ_IMG_ACTIVITY_FROM_MEMORY'
133
    IMPORTING
134
      img_activity = p_activity.
135
ENDFORM.                    " get_img_activity