Properties SourceCde
txt
1
*---------------------------------------------------------------------*
2
*       FORM REQUEST_CORR_NUMBER                                      *
3
*---------------------------------------------------------------------*
4
*       request correction number                                     *
5
*---------------------------------------------------------------------*
6
FORM request_corr_number.
7
  DATA: rc LIKE sy-subrc, e071_safe LIKE e071.
8
 
9
  CHECK maint_mode EQ transportieren.  "manual transport mode
10
  IF <status>-l_corr_nbr NE space.
11
    IF <status>-corr_nbr NE <status>-l_corr_nbr.
12
      CLEAR: <status>-tr_alrchkd, <status>-corr_enqud.
13
    ELSE.
14
      IF vim_external_mode EQ space.
15
        TRANSLATE <status>-tr_alrchkd USING 'Xx'.
16
      ENDIF.
17
    ENDIF.
18
  ENDIF.
19
  PERFORM vim_get_img_activity CHANGING e071-activity.  "UF738595/2001
20
  IF vim_corr_obj_viewname NE x_header-viewname.
21
    CLEAR e071-trkorr.
22
    PERFORM get_transp_info.
23
    CHECK x_header-flag NE vim_transport_denied.
24
  ENDIF.
25
  IF <status>-tr_alrchkd EQ space.
26
* first get corr nbr for lockable transport objects
27
    e071_safe = e071.
28
    CLEAR vim_last_source_system.
29
    LOOP AT vim_corr_objtab WHERE lockable NE space.
30
      e071 = vim_corr_objtab.
31
      PERFORM check_lockable_object USING e071 rc.
32
      CASE rc.
33
        WHEN 4. maint_mode = anzeigen.
34
        WHEN 8. RAISE missing_corr_number.
35
      ENDCASE.
36
      IF maint_mode EQ anzeigen OR
37
         x_header-flag EQ vim_transport_denied.
38
        EXIT.
39
      ENDIF.
40
    ENDLOOP.
41
    e071 = e071_safe.
42
  ENDIF.                               "<status>-tr_alrchkd eq space
43
  CHECK maint_mode NE anzeigen AND
44
        x_header-flag NE vim_transport_denied.
45
  vim_corr_obj_viewname = x_header-viewname.
46
  IF <status>-corr_nbr NE space AND    "task specified and...
47
     corr_nbr EQ space AND          "...task not setted by caller and...
48
     <status>-corr_enqud EQ space.     "...corr not yet enqueued
49
    CALL FUNCTION 'ENQUEUE_E_TRKORR'
50
         EXPORTING
51
              trkorr = <status>-corr_nbr
52
*               X_TRKORR = E02
53
         EXCEPTIONS
54
              foreign_lock = 01
55
              system_failure = 02.
56
    CASE sy-subrc.
57
      WHEN 1.
58
        MESSAGE s092(sv) WITH <status>-corr_nbr. "Korr. wird ger.bearb.
59
      WHEN 2.
60
        MESSAGE a095(sv) WITH <status>-corr_nbr. "Systemfehler
61
    ENDCASE.
62
    <status>-corr_enqud = 'X'.
63
  ENDIF.
64
* if no lockable objects exist get corr nbr for other objects...
65
* but only if objects exist....
66
  DESCRIBE TABLE vim_corr_objtab.
67
  IF <status>-corr_nbr EQ space AND sy-tfill GT 0.
68
    DO.
69
      CALL FUNCTION 'TR_ORDER_CHOICE_CORRECTION'
70
           EXPORTING
71
                iv_category            = objh-objcateg
72
                iv_cli_dep             = objh-clidep
73
           IMPORTING
74
                ev_order               = <status>-order_nbr
75
                ev_task                = <status>-corr_nbr
76
           EXCEPTIONS
77
                invalid_category       = 01
78
                no_correction_selected = 02.
79
      CASE sy-subrc.
80
        WHEN 1.
81
          IF objh-objcateg NE vim_syst AND objh-objcateg NE vim_cust.
82
            CASE objh-objcateg.
83
              WHEN vim_cust_syst. objh-objcateg = vim_syst.
84
              WHEN vim_appl.      objh-objcateg = vim_syst.
85
              WHEN OTHERS.
86
                MESSAGE ID     sy-msgid
87
                        TYPE   'I'
88
                        NUMBER sy-msgno
89
                        WITH sy-msgv1 sy-msgv2  sy-msgv3 sy-msgv4.
90
                RAISE missing_corr_number.
91
            ENDCASE.
92
            CONTINUE.
93
          ENDIF.
94
        WHEN 2.
95
          CLEAR vim_corr_obj_viewname.
96
          RAISE missing_corr_number.
97
      ENDCASE.
98
      CALL FUNCTION 'ENQUEUE_E_TRKORR'
99
           EXPORTING
100
                trkorr = <status>-corr_nbr
101
*               X_TRKORR = E02
102
           EXCEPTIONS
103
                foreign_lock = 01
104
                system_failure = 02.
105
      CASE sy-subrc.
106
*       WHEN 0.
107
        WHEN 1.
108
          MESSAGE s092(sv) WITH <status>-corr_nbr. "Korr. wirdger.bearb.
109
          CONTINUE.
110
        WHEN 2.
111
          MESSAGE a095(sv) WITH <status>-corr_nbr. "Systemfehler
112
          CONTINUE.
113
      ENDCASE.
114
      IF ( last_corr_number NE space AND
115
           <status>-corr_nbr NE last_corr_number ) OR
116
         <status>-tr_alrchkd EQ space.
117
        LOOP AT corr_keytab.           "UF 514599/1999beg
118
          READ TABLE vim_corr_objtab
119
           WITH KEY pgmid    = corr_keytab-pgmid
120
           object   = corr_keytab-object obj_name = corr_keytab-objname.
121
          CHECK sy-subrc = 0 AND vim_corr_objtab-lockable = space.
122
* new corrnumber for unlockable objects only
123
          CLEAR vim_corr_objtab-trkorr.
124
* will be filled again in form PREPARE_CORR
125
          MODIFY vim_corr_objtab INDEX sy-tabix.
126
        ENDLOOP.                       "UF 514599/1999end
127
        REFRESH corr_keytab.
128
        MOVE <status>-corr_nbr TO last_corr_number.
129
      ELSEIF last_corr_number EQ space.
130
        LOOP AT corr_keytab WHERE
131
                                ( mastertype EQ vim_unlockable_object OR
132
                                  mastertype EQ vim_lockable_object ).
133
*                           AND TRKORR EQ SPACE.
134
* SW: bei TRSP -> neue Korrnummer, alte blieb aber in CORR_KEYTAB-TRKORR
135
          IF  corr_keytab-trkorr EQ space.
136
            corr_keytab-trkorr = <status>-corr_nbr.
137
            MODIFY corr_keytab.
138
          ELSE.                        "SW ..
139
            READ TABLE vim_corr_objtab
140
                    WITH KEY pgmid    = corr_keytab-pgmid
141
                             object   = corr_keytab-object
142
                             obj_name = corr_keytab-objname.
143
            IF sy-subrc = 0.
144
              corr_keytab-trkorr = <status>-corr_nbr.
145
              MODIFY corr_keytab.
146
            ENDIF.
147
          ENDIF.                       ".. SW
148
        ENDLOOP.
149
      ENDIF.
150
      EXIT.
151
    ENDDO.
152
    <status>-corr_enqud = 'X'.
153
  ENDIF.                               "<status>-corr_nbr eq space
154
  MOVE: <status>-corr_nbr TO e071k-trkorr,
155
        <status>-corr_nbr TO e071-trkorr,
156
        <status>-corr_nbr TO e070-trkorr.
157
  TRANSLATE <status>-tr_alrchkd USING ' x'.
158
ENDFORM.