Eigenschaften | Quelltext
Titel | CORR_UPD |
Originalsprache | DE | Deutsch
Erstellt | 27.10.1998 |  | SAP |
Letzte Änderung | 13.11.2001 |  | SAP |
Status | aktiv |
Attribute
Typ | Include-Programm |
Status | Testprogramm |
Anwendung | Basis (System) |
Paket | SVIM | Basis Viewmaintenance
| Editorsperre
txt
    1
    *---------------------------------------------------------------------*
    2
    *       FORM CORR_UPD.                                                *
    3
    *---------------------------------------------------------------------*
    4
    *       Behandlung des FCODES 'SAVE' im Transportmodus                *
    5
    *       logging of changes                                            *
    6
    *---------------------------------------------------------------------*
    7
    FORM corr_upd.
    8
      DATA: ko200 LIKE ko200, cu_e071k_tab LIKE e071k OCCURS 100,
    9
          cu_e071_tab LIKE e071 OCCURS 10, cu_trpar LIKE trpar_int OCCURS 1,
    10
            cu_trmess LIKE trmess_int OCCURS 1, cu_tadir LIKE tadir,
    11
            cu_e071_htb LIKE e071 OCCURS 10, cu_dderr LIKE dderr,
    12
            cu_corr_keytab_safe LIKE corr_keytab OCCURS 50,
    13
            cu_corr_keyhtb LIKE corr_keytab OCCURS 50,
    14
            lockable_objects_exist(1) TYPE c, e071_safe LIKE e071,
    15
           cu_ko200_tab LIKE ko200 OCCURS 10, cu_last_corr LIKE e071-trkorr,
    16
            w_cu_ko200 LIKE ko200,
    17
            corr_for_insert LIKE e071-trkorr, rc LIKE sy-subrc,
    18
            cu_new_locks LIKE strlocktab OCCURS 10, cu_begix TYPE i,
    19
            cu_hobjfunc(1) TYPE c, cu_tdevc LIKE tdevc,
    20
            cu_order_type LIKE e070-trfunction, cu_obj_not_chkd(1) TYPE c,
    21
            cu_task_type LIKE e070-trfunction, cu_appendable(1) TYPE c,
    22
            cu_request TYPE trwbo_request, cu_category LIKE vim_syst,
    23
            cu_corr_objtab LIKE LINE OF vim_corr_objtab OCCURS 0,
    24
            cu_last_cat LIKE vim_syst, cu_h_flag(1) TYPE c,
    25
            cu_h_e071 LIKE e071, cuiorder LIKE e071-trkorr,
    26
            cuitask LIKE e071-trkorr.
    27
    28
      DATA: lt_edt_objects       TYPE tredt_objects,
    29
            ls_edt_object        TYPE LINE OF tredt_objects.
    30
      FIELD-SYMBOLS: <ls_e071>   TYPE e071.
    31
    32
      FIELD-SYMBOLS: <vim_corr_objtab> LIKE vim_corr_objtab,
    33
                     <e071> LIKE e071.
    34
    35
      CHECK maint_mode EQ transportieren OR vim_client_state EQ vim_log.
    36
      CHECK x_header-flag NE vim_transport_denied.
    37
      cu_h_flag = x_header-flag.
    38
      IF vim_corr_obj_viewname NE x_header-viewname.
    39
        REFRESH vim_corr_objtab.
    40
      ELSE.
    41
        cu_corr_objtab = vim_corr_objtab[].
    42
      ENDIF.
    43
      e071_safe = e071.
    44
      CLEAR e071.
    45
      LOOP AT corr_keytab WHERE mastername EQ x_header-viewname
    46
                            AND ( mastertype EQ vim_unlockable_object
    47
                                  OR mastertype EQ vim_lockable_object ).
    48
        MOVE: corr_keytab-trkorr  TO e071-trkorr,    "fill object tab
    49
              corr_keytab-pgmid   TO e071-pgmid,
    50
              corr_keytab-object  TO e071-object,
    51
    *         CORR_KEYTAB-OBJNAME TO E071-OBJ_NAME,
    52
              corr_keytab-objfunc TO e071-objfunc,
    53
              corr_keytab-activity TO e071-activity. "UF738595/2001
    54
        IF corr_keytab-objname EQ vim_long_objname.
    55
          e071-obj_name = corr_keytab-tabkey.
    56
        ELSE.
    57
          e071-obj_name = corr_keytab-objname.
    58
        ENDIF.
    59
        APPEND e071 TO cu_e071_tab.
    60
        READ TABLE vim_corr_objtab WITH KEY pgmid = e071-pgmid
    61
                                            object = e071-object
    62
                                            obj_name = e071-obj_name
    63
                                   TRANSPORTING NO FIELDS.
    64
        IF sy-subrc NE 0.                  "entry not found...
    65
    *      vim_corr_objtab = e071.
    66
          MOVE-CORRESPONDING e071 TO vim_corr_objtab.     "UNICODE
    67
          IF corr_keytab-mastertype EQ vim_unlockable_object.
    68
    *       APPEND E071 TO VIM_ULO_TRSP_OBJS.
    69
            vim_corr_objtab-lockable = space.
    70
          ELSE.
    71
    *       APPEND E071 TO VIM_LCK_TRSP_OBJS.
    72
            vim_corr_objtab-lockable = lockable_objects_exist = 'X'.
    73
          ENDIF.
    74
          APPEND vim_corr_objtab.
    75
          IF corr_keytab-flag EQ 'V'.
    76
            IF vim_corr_obj_viewname NE x_header-viewname.
    77
              APPEND vim_corr_objtab TO cu_corr_objtab.
    78
            ENDIF.
    79
          ELSE.
    80
            cu_obj_not_chkd = 'X'.
    81
          ENDIF.
    82
        ELSEIF corr_keytab-mastertype EQ vim_lockable_object.
    83
          lockable_objects_exist = 'X'.
    84
        ENDIF.
    85
      ENDLOOP.
    86
      LOOP AT cu_e071_tab INTO e071.
    87
        LOOP AT corr_keytab WHERE mastertype EQ e071-object
    88
                              AND mastername EQ e071-obj_name
    89
                              AND pgmid EQ vim_deleted_key.
    90
          corr_keytab-pgmid = transporter. "collect all keys to
    91
          APPEND corr_keytab TO cu_e071k_tab. "delete for all objects
    92
          DELETE corr_keytab.
    93
        ENDLOOP.
    94
      ENDLOOP.
    95
      vim_corr_obj_viewname = x_header-viewname.
    96
    * save keytab entries related to objects not in e071 tab
    97
      LOOP AT corr_keytab.
    98
        IF x_header-flag NE space AND x_header-frm_e071 EQ space AND
    99
           ( x_header-frm_e071ka NE space OR x_header-frm_e071ks NE space ).
    100
          IF corr_keytab-objname EQ vim_long_objname.
    101
            READ TABLE cu_e071_tab WITH KEY
    102
             object = corr_keytab-object
    103
             obj_name = corr_keytab-tabkey
    104
             TRANSPORTING NO FIELDS.
    105
          ELSE.
    106
            READ TABLE cu_e071_tab WITH KEY
    107
             object = corr_keytab-object
    108
             obj_name = corr_keytab-objname
    109
             TRANSPORTING NO FIELDS.
    110
          ENDIF.
    111
          IF sy-subrc EQ 0.                "delete corr_keytab anyway
    112
            DELETE corr_keytab.
    113
          ENDIF.
    114
        ELSE.
    115
          READ TABLE cu_e071_tab WITH KEY
    116
           object = corr_keytab-mastertype
    117
           obj_name = corr_keytab-mastername
    118
           TRANSPORTING NO FIELDS.
    119
        ENDIF.
    120
        CHECK sy-subrc NE 0.
    121
        APPEND corr_keytab TO cu_corr_keytab_safe.
    122
        DELETE corr_keytab.
    123
      ENDLOOP.
    124
      IF maint_mode EQ aendern AND lockable_objects_exist EQ space AND
    125
         cu_obj_not_chkd NE space.
    126
    * may be objects are not yet checked
    127
        LOOP AT cu_e071_tab ASSIGNING <e071>.        "UNICODE
    128
          MOVE-CORRESPONDING <e071> TO w_cu_ko200.   "UNICODE
    129
          APPEND w_cu_ko200 TO cu_ko200_tab.         "UNICODE
    130
    *    cu_ko200_tab = cu_e071_tab.
    131
        ENDLOOP.                                     "UNICODE
    132
        CALL FUNCTION 'TR_OBJECTS_CHECK'
    133
    *       exporting
    134
    *            IV_NO_SHOW_OPTION              = 'X'
    135
           IMPORTING
    136
                we_order                       = cuiorder
    137
                we_task                        = cuitask
    138
                we_objects_appendable          = cu_appendable
    139
             TABLES
    140
                  wt_ko200                     = cu_ko200_tab
    141
                  wt_e071k                     = corr_keytab
    142
           EXCEPTIONS
    143
           cancel_edit_other_error       = 1
    144
           show_only_other_error         = 2
    145
           OTHERS                        = 3.
    146
        IF sy-subrc NE 0 OR cu_appendable EQ space.
    147
          rc = sy-subrc.
    148
          LOOP AT cu_corr_keytab_safe INTO corr_keytab.
    149
            APPEND corr_keytab.
    150
          ENDLOOP.
    151
          e071 = e071_safe. vim_corr_objtab[] = cu_corr_objtab.
    152
          IF rc NE 0.
    153
            MESSAGE ID     sy-msgid
    154
                    TYPE   'I'
    155
                    NUMBER sy-msgno
    156
                    WITH sy-msgv1 sy-msgv2  sy-msgv3 sy-msgv4.
    157
            RAISE saving_correction_failed.
    158
          ELSE.
    159
            sy-subrc = rc.
    160
            EXIT.
    161
          ENDIF.
    162
        ELSEIF cuiorder NE space OR cuitask NE space.
    163
          <status>-order_nbr = cuiorder.
    164
          <status>-corr_nbr = cuitask.
    165
        ENDIF.
    166
        REFRESH cu_ko200_tab.
    167
      ENDIF. "may be objects are not yet checked
    168
      IF maint_mode EQ aendern AND lockable_objects_exist NE space OR
    169
         maint_mode EQ transportieren AND cu_obj_not_chkd NE space.
    170
        IF cu_obj_not_chkd NE space.
    171
    * first check previously unchecked lockable objects
    172
          CLEAR vim_last_source_system.
    173
          LOOP AT vim_corr_objtab WHERE lockable NE space.
    174
            READ TABLE cu_corr_objtab
    175
                             WITH KEY pgmid  = vim_corr_objtab-pgmid
    176
                                     object  = vim_corr_objtab-object
    177
                                     obj_name = vim_corr_objtab-obj_name
    178
                             TRANSPORTING NO FIELDS.
    179
            CHECK sy-subrc NE 0.
    180
            e071 = vim_corr_objtab.
    181
            PERFORM check_lockable_object USING e071 rc.
    182
            IF rc NE 0 OR x_header-flag EQ vim_transport_denied.
    183
              x_header-flag = cu_h_flag. MODIFY x_header INDEX 1.
    184
              MESSAGE i162(sv) WITH vim_corr_objtab-pgmid
    185
                                    vim_corr_objtab-object
    186
                                    vim_corr_objtab-obj_name.
    187
              IF maint_mode EQ aendern.
    188
                rc = 9. EXIT.
    189
              ELSE.
    190
                DELETE vim_corr_objtab.
    191
              ENDIF.
    192
            ENDIF.
    193
          ENDLOOP.
    194
          DESCRIBE TABLE vim_corr_objtab.
    195
          IF maint_mode EQ aendern AND rc NE 0 OR sy-tfill EQ 0.
    196
    * restore saved keytab entries and corr_objtab
    197
            LOOP AT cu_corr_keytab_safe INTO corr_keytab.
    198
              APPEND corr_keytab.
    199
            ENDLOOP.
    200
            e071 = e071_safe.
    201
            RAISE saving_correction_failed.
    202
          ENDIF.
    203
        ENDIF.                             "cu_obj_not_chckd ne space
    204
        IF <status>-corr_nbr EQ space.
    205
          LOOP AT vim_corr_objtab INTO e071.
    206
            CALL FUNCTION 'TR_CHECK_TYPE'
    207
              EXPORTING
    208
                wi_e071     = e071
    209
              IMPORTING
    210
                we_tadir    = cu_tadir
    211
                we_category = cu_category.
    212
           CHECK cu_category EQ vim_syst OR cu_category EQ vim_cust_syst OR
    213
                         cu_category EQ vim_appl.
    214
            cu_last_cat = vim_syst. cu_h_e071 = e071.
    215
          ENDLOOP.
    216
          IF cu_last_cat EQ space.
    217
            cu_category = vim_cust.
    218
          ELSE.
    219
            cu_category = cu_last_cat. e071 = cu_h_e071.
    220
          ENDIF.
    221
          CALL FUNCTION 'TRINT_GET_REQUEST_TYPE'
    222
    * UF041099 inserted instead of TRINT_CHECK_ORDER_TYPE
    223
               EXPORTING
    224
                    iv_pgmid                   = e071-pgmid
    225
                    iv_object                  = e071-object
    226
                    iv_obj_name                = e071-obj_name
    227
                    iv_category                = cu_category
    228
                    is_tadir                   = cu_tadir
    229
                    is_tdevc                   = cu_tdevc
    230
    *                IV_USE_MEMORY              = 'X'
    231
               IMPORTING
    232
                    ev_request_type            = cu_order_type
    233
                    ev_task_type               = cu_task_type
    234
    *                EV_TARGET                  =
    235
               EXCEPTIONS
    236
                    internal_error             = 1
    237
                    no_request_needed          = 2
    238
                    cts_initialization_failure = 3
    239
                    OTHERS                     = 4.
    240
          CASE sy-subrc.
    241
            WHEN 0.
    242
            WHEN 2.
    243
              cu_order_type = 'K'.
    244
              cu_task_type = 'S'.
    245
            WHEN OTHERS.
    246
              LOOP AT cu_corr_keytab_safe INTO corr_keytab.
    247
                APPEND corr_keytab.
    248
              ENDLOOP.
    249
              e071 = e071_safe. vim_corr_objtab[] = cu_corr_objtab.
    250
              MESSAGE ID     sy-msgid
    251
                      TYPE   'I'
    252
                      NUMBER sy-msgno
    253
                      WITH sy-msgv1 sy-msgv2  sy-msgv3 sy-msgv4.
    254
              RAISE saving_correction_failed.
    255
          ENDCASE.
    256
          DO.
    257
            CALL FUNCTION 'TRINT_ORDER_CHOICE'
    258
              EXPORTING
    259
                wi_order_type          = cu_order_type
    260
                wi_task_type           = cu_task_type
    261
                wi_category            = cu_category
    262
                wi_cli_dep             = space
    263
              IMPORTING
    264
                we_order               = <status>-order_nbr
    265
                we_task                = <status>-corr_nbr
    266
              TABLES
    267
                wt_e071                = cu_e071_tab
    268
                wt_e071k               = corr_keytab
    269
              EXCEPTIONS
    270
                no_correction_selected = 1
    271
                display_mode           = 2
    272
                object_append_error    = 3
    273
                recursive_call         = 4
    274
                OTHERS                 = 5.
    275
            IF sy-subrc NE 0.
    276
    * restore saved keytab entries and corr_objtab
    277
              LOOP AT cu_corr_keytab_safe INTO corr_keytab.
    278
                APPEND corr_keytab.
    279
              ENDLOOP.
    280
              e071 = e071_safe. vim_corr_objtab[] = cu_corr_objtab.
    281
              IF sy-subrc NE 1.
    282
                MESSAGE ID     sy-msgid
    283
                        TYPE   'I'
    284
                        NUMBER sy-msgno
    285
                        WITH sy-msgv1 sy-msgv2  sy-msgv3 sy-msgv4.
    286
              ENDIF.
    287
              RAISE saving_correction_failed.
    288
            ENDIF.                         "sy-subrc ne 0
    289
            IF maint_mode EQ transportieren.
    290
    * enqueue corr
    291
              CALL FUNCTION 'ENQUEUE_E_TRKORR'
    292
                   EXPORTING
    293
                        trkorr = <status>-corr_nbr
    294
    *               X_TRKORR = E02
    295
                   EXCEPTIONS
    296
                        foreign_lock = 01
    297
                        system_failure = 02.
    298
              CASE sy-subrc.
    299
                WHEN 0.
    300
                WHEN 1.
    301
              MESSAGE s092(sv) WITH <status>-corr_nbr. "Korr. wirdger.bearb.
    302
                  CONTINUE.
    303
                WHEN 2.
    304
                  MESSAGE a095(sv) WITH <status>-corr_nbr. "Systemfehler
    305
                  CONTINUE.
    306
              ENDCASE.
    307
              <status>-corr_enqud = 'X'.
    308
              EXIT.
    309
            ELSE.                          "change mode
    310
              EXIT.
    311
            ENDIF.                         "maint_mode eq transportieren
    312
          ENDDO.
    313
        ENDIF.                             "<status>-corr_nbr eq space.
    314
    * store corr number into tables
    315
        LOOP AT cu_e071_tab INTO e071 WHERE trkorr EQ space.
    316
          e071-trkorr = <status>-corr_nbr.
    317
          MODIFY cu_e071_tab FROM e071.
    318
          LOOP AT vim_corr_objtab WHERE pgmid = e071-pgmid
    319
                                    AND object = e071-object
    320
                                    AND obj_name = e071-obj_name.
    321
            vim_corr_objtab-trkorr = <status>-corr_nbr.
    322
            MODIFY vim_corr_objtab. EXIT.
    323
          ENDLOOP.
    324
          sy-fdpos = strlen( e071-obj_name ).
    325
          IF sy-fdpos GT vim_71k_name_length.
    326
            READ TABLE corr_keytab WITH KEY pgmid = e071-pgmid
    327
                                            object = e071-object
    328
                                            objname = vim_long_objname
    329
                                            tabkey  = e071-obj_name.
    330
          ELSE.
    331
            READ TABLE corr_keytab WITH KEY pgmid = e071-pgmid
    332
                                            object = e071-object
    333
                                            objname = e071-obj_name.
    334
          ENDIF.
    335
          IF sy-subrc EQ 0.
    336
            corr_keytab-trkorr = <status>-corr_nbr.
    337
            MODIFY corr_keytab INDEX sy-tabix.
    338
          ENDIF.
    339
        ENDLOOP.
    340
      ENDIF.
    341
      IF maint_mode EQ transportieren OR lockable_objects_exist NE space.
    342
        SORT cu_e071_tab BY trkorr.
    343
        LOOP AT cu_e071_tab INTO e071 WHERE objfunc NE 'D'.
    344
          cu_begix = sy-tabix + 1.
    345
          EXIT.
    346
        ENDLOOP.
    347
        IF sy-subrc EQ 0.
    348
          APPEND e071 TO cu_e071_htb.
    349
          LOOP AT corr_keytab WHERE mastertype EQ e071-object
    350
                                AND mastername EQ e071-obj_name.
    351
            APPEND corr_keytab TO cu_corr_keyhtb.
    352
          ENDLOOP.
    353
          cu_last_corr = e071-trkorr.
    354
          LOOP AT cu_e071_tab INTO e071 FROM cu_begix WHERE objfunc NE 'D'.
    355
            IF e071-trkorr NE cu_last_corr.
    356
    *___________________________________________________________________
    357
              LOOP AT cu_e071_htb ASSIGNING <ls_e071>.
    358
                MOVE-CORRESPONDING <ls_e071> TO ls_edt_object.
    359
                APPEND ls_edt_object TO lt_edt_objects.
    360
              ENDLOOP.
    361
              CALL FUNCTION 'TR_EC_CUST_ORIG_LANG'
    362
                EXPORTING
    363
                  it_objects   = lt_edt_objects
    364
                  iv_checkmode = ' '
    365
                  iv_dialog    = 'X'
    366
                CHANGING
    367
                  ct_keys      = cu_corr_keyhtb
    368
                EXCEPTIONS
    369
                  cancel       = 1
    370
                  display_only = 2
    371
                  OTHERS       = 3.
    372
              IF sy-subrc <> 0.
    373
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    374
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    375
              ENDIF.
    376
    *--------------------------------------------------------------------
    377
              CALL FUNCTION 'TRINT_APPEND_TO_COMM_ARRAYS'
    378
                EXPORTING
    379
                  wi_trkorr     = cu_last_corr
    380
                TABLES
    381
                  wt_e071       = cu_e071_htb
    382
                  wt_e071k      = cu_corr_keyhtb
    383
                  wt_trmess_int = cu_trmess
    384
                  wt_trpar_int  = cu_trpar
    385
                EXCEPTIONS
    386
                  OTHERS        = 08.
    387
              IF sy-subrc NE 0.
    388
    * restore saved keytab entries and corr_objtab
    389
                LOOP AT cu_corr_keytab_safe INTO corr_keytab.
    390
                  APPEND corr_keytab.
    391
                ENDLOOP.
    392
                e071 = e071_safe. vim_corr_objtab[] = cu_corr_objtab.
    393
                MESSAGE ID     sy-msgid
    394
                        TYPE   'I'
    395
                        NUMBER sy-msgno
    396
                        WITH sy-msgv1 sy-msgv2  sy-msgv3 sy-msgv4.
    397
                RAISE saving_correction_failed.
    398
              ENDIF.
    399
              REFRESH: cu_e071_htb, cu_corr_keyhtb.
    400
              cu_last_corr = e071-trkorr.
    401
            ENDIF.
    402
            APPEND e071 TO cu_e071_htb.
    403
            LOOP AT corr_keytab WHERE mastertype EQ e071-object
    404
                                  AND mastername EQ e071-obj_name.
    405
              APPEND corr_keytab TO cu_corr_keyhtb.
    406
            ENDLOOP.
    407
          ENDLOOP.
    408
        ENDIF.                             "sy-subrc of loop at e071_tab
    409
        DESCRIBE TABLE cu_e071_htb.
    410
        IF sy-tfill NE 0.
    411
    *      CALL FUNCTION 'TR_APPEND_TO_COMM_OBJS_KEYS'
    412
    *        EXPORTING
    413
    **         WI_SIMULATION                        = ' '
    414
    **         WI_SUPPRESS_KEY_CHECK                = ' '
    415
    *          wi_trkorr                            = e071-trkorr
    416
    *        tables
    417
    *          wt_e071                              = cu_e071_htb
    418
    *          wt_e071k                             = cu_corr_keyhtb
    419
    *       EXCEPTIONS
    420
    *         KEY_CHAR_IN_NON_CHAR_FIELD           = 1
    421
    *         KEY_CHECK_KEYSYNTAX_ERROR            = 2
    422
    *         KEY_INTTAB_TABLE                     = 3
    423
    *         KEY_LONGER_FIELD_BUT_NO_GENERC       = 4
    424
    *         KEY_MISSING_KEY_MASTER_FIELDS        = 5
    425
    *         KEY_MISSING_KEY_TABLEKEY             = 6
    426
    *         KEY_NON_CHAR_BUT_NO_GENERIC          = 7
    427
    *         KEY_NO_KEY_FIELDS                    = 8
    428
    *         KEY_STRING_LONGER_CHAR_KEY           = 9
    429
    *         KEY_TABLE_HAS_NO_FIELDS              = 10
    430
    *         KEY_TABLE_NOT_ACTIV                  = 11
    431
    *         KEY_UNALLOWED_KEY_FUNCTION           = 12
    432
    *         KEY_UNALLOWED_KEY_OBJECT             = 13
    433
    *         KEY_UNALLOWED_KEY_OBJNAME            = 14
    434
    *         KEY_UNALLOWED_KEY_PGMID              = 15
    435
    *         KEY_WITHOUT_HEADER                   = 16
    436
    *         OB_CHECK_OBJ_ERROR                   = 17
    437
    *         OB_DEVCLASS_NO_EXIST                 = 18
    438
    *         OB_EMPTY_KEY                         = 19
    439
    *         OB_GENERIC_OBJECTNAME                = 20
    440
    *         OB_ILL_DELIVERY_TRANSPORT            = 21
    441
    *         OB_ILL_LOCK                          = 22
    442
    *         OB_ILL_PARTS_TRANSPORT               = 23
    443
    *         OB_ILL_SOURCE_SYSTEM                 = 24
    444
    *         OB_ILL_SYSTEM_OBJECT                 = 25
    445
    *         OB_ILL_TARGET                        = 26
    446
    *         OB_INTTAB_TABLE                      = 27
    447
    *         OB_LOCAL_OBJECT                      = 28
    448
    *         OB_LOCKED_BY_OTHER                   = 29
    449
    *         OB_MODIF_ONLY_IN_MODIF_ORDER         = 30
    450
    *         OB_NAME_TOO_LONG                     = 31
    451
    *         OB_NO_APPEND_OF_CORR_ENTRY           = 32
    452
    *         OB_NO_APPEND_OF_C_MEMBER             = 33
    453
    *         OB_NO_CONSOLIDATION_TRANSPORT        = 34
    454
    *         OB_NO_ORIGINAL                       = 35
    455
    *         OB_NO_SHARED_REPAIRS                 = 36
    456
    *         OB_NO_SYSTEMNAME                     = 37
    457
    *         OB_NO_SYSTEMTYPE                     = 38
    458
    *         OB_NO_TADIR                          = 39
    459
    *         OB_NO_TADIR_NOT_LOCKABLE             = 40
    460
    *         OB_PRIVAT_OBJECT                     = 41
    461
    *         OB_REPAIR_ONLY_IN_REPAIR_ORDER       = 42
    462
    *         OB_RESERVED_NAME                     = 43
    463
    *         OB_SYNTAX_ERROR                      = 44
    464
    *         OB_TABLE_HAS_NO_FIELDS               = 45
    465
    *         OB_TABLE_NOT_ACTIV                   = 46
    466
    *         TR_ENQUEUE_FAILED                    = 47
    467
    *         TR_ERRORS_IN_ERROR_TABLE             = 48
    468
    *         TR_ILL_KORRNUM                       = 49
    469
    *         TR_LOCKMOD_FAILED                    = 50
    470
    *         TR_LOCK_ENQUEUE_FAILED               = 51
    471
    *         TR_NOT_OWNER                         = 52
    472
    *         TR_NO_SYSTEMNAME                     = 53
    473
    *         TR_NO_SYSTEMTYPE                     = 54
    474
    *         TR_ORDER_NOT_EXIST                   = 55
    475
    *         TR_ORDER_RELEASED                    = 56
    476
    *         TR_ORDER_UPDATE_ERROR                = 57
    477
    *         TR_WRONG_ORDER_TYPE                  = 58
    478
    *         OB_INVALID_TARGET_SYSTEM             = 59
    479
    *         TR_NO_AUTHORIZATION                  = 60
    480
    *         OB_WRONG_TABLETYP                    = 61
    481
    *         OB_WRONG_CATEGORY                    = 62
    482
    *         OB_SYSTEM_ERROR                      = 63
    483
    *         OB_UNLOCAL_OBJEKT_IN_LOCAL_ORD       = 64
    484
    *         TR_WRONG_CLIENT                      = 65
    485
    *         OB_WRONG_CLIENT                      = 66
    486
    *         KEY_WRONG_CLIENT                     = 67
    487
    *         OTHERS                               = 68
    488
    *                .
    489
    *___________________________________________________________________
    490
              LOOP AT cu_e071_htb ASSIGNING <ls_e071>.
    491
                MOVE-CORRESPONDING <ls_e071> TO ls_edt_object.
    492
                APPEND ls_edt_object TO lt_edt_objects.
    493
              ENDLOOP.
    494
              CALL FUNCTION 'TR_EC_CUST_ORIG_LANG'
    495
                EXPORTING
    496
                  it_objects   = lt_edt_objects
    497
                  iv_checkmode = ' '
    498
                  iv_dialog    = 'X'
    499
                CHANGING
    500
                  ct_keys      = cu_corr_keyhtb
    501
                EXCEPTIONS
    502
                  cancel       = 1
    503
                  display_only = 2
    504
                  OTHERS       = 3.
    505
              IF sy-subrc <> 0.
    506
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    507
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    508
              ENDIF.
    509
    *--------------------------------------------------------------------
    510
          CALL FUNCTION 'TRINT_APPEND_TO_COMM_ARRAYS'
    511
               EXPORTING
    512
                    wi_trkorr     = e071-trkorr
    513
               TABLES
    514
                    wt_e071       = cu_e071_htb
    515
                    wt_e071k      = cu_corr_keyhtb
    516
                    wt_trmess_int = cu_trmess
    517
                    wt_trpar_int  = cu_trpar
    518
    *           EXCEPTIONS
    519
    *                OTHERS        = 08.
    520
           EXCEPTIONS
    521
             key_check_keysyntax_error          = 1
    522
             ob_check_obj_error                 = 2
    523
             tr_lockmod_failed                  = 3
    524
             tr_lock_enqueue_failed             = 4
    525
             tr_wrong_order_type                = 5
    526
             tr_order_update_error              = 6
    527
             file_access_error                  = 7
    528
             ob_no_systemname                   = 8
    529
             OTHERS                             = 9.
    530
          IF sy-subrc NE 0.
    531
    * restore saved keytab entries and corr_objtab
    532
            LOOP AT cu_corr_keytab_safe INTO corr_keytab.
    533
              APPEND corr_keytab.
    534
            ENDLOOP.
    535
            e071 = e071_safe. vim_corr_objtab[] = cu_corr_objtab.
    536
            MESSAGE ID     sy-msgid
    537
                    TYPE   'I'
    538
                    NUMBER sy-msgno
    539
                    WITH sy-msgv1 sy-msgv2  sy-msgv3 sy-msgv4.
    540
            RAISE saving_correction_failed.
    541
          ENDIF.
    542
        ENDIF.
    543
        IF maint_mode EQ transportieren.
    544
    * process deletion
    545
          LOOP AT cu_e071_tab INTO e071 WHERE objfunc NE space.
    546
            IF e071-objfunc EQ 'K'.
    547
              CALL FUNCTION 'TRINT_DELETE_COMM_KEYS'
    548
                EXPORTING
    549
                  wi_e071                = e071
    550
                  wi_trkorr              = <status>-corr_nbr
    551
                TABLES
    552
                  wt_e071k               = cu_e071k_tab
    553
                EXCEPTIONS
    554
                  e070_update_error      = 01
    555
                  keys_protected         = 02
    556
                  order_already_released = 03
    557
                  unallowed_ordertyp     = 04
    558
                  user_not_owner         = 05
    559
                  wrong_client           = 06.
    560
              IF sy-subrc NE 0.
    561
    * restore saved keytab entries and corr_objtab
    562
                LOOP AT cu_corr_keytab_safe INTO corr_keytab.
    563
                  APPEND corr_keytab.
    564
                ENDLOOP.
    565
                e071 = e071_safe. vim_corr_objtab[] = cu_corr_objtab.
    566
    *         MESSAGE S097(SV) WITH <STATUS>-CORR_NBR.
    567
                MESSAGE ID     sy-msgid
    568
                        TYPE   'I'
    569
                        NUMBER sy-msgno
    570
                        WITH sy-msgv1 sy-msgv2  sy-msgv3 sy-msgv4.
    571
                RAISE saving_correction_failed.
    572
              ELSE.
    573
    * check if object is to be deleted and delete it if necessary
    574
                LOOP AT corr_keytab WHERE mastertype EQ e071-object
    575
                                      AND mastername EQ e071-obj_name.
    576
                  EXIT.
    577
                ENDLOOP.
    578
              ENDIF.                       "sy-subrc of function call
    579
            ELSEIF e071-objfunc EQ 'D'.
    580
              sy-subrc = 8.
    581
            ELSE.
    582
              CLEAR sy-subrc.
    583
            ENDIF.                         "e071-objfunc
    584
            IF sy-subrc NE 0.
    585
    * delete object
    586
              cu_hobjfunc = e071-objfunc.
    587
              cu_request-objects = cu_e071_tab.
    588
              cu_request-objects_filled = 'X'.
    589
              CALL FUNCTION 'TRINT_DELETE_COMM_OBJECT_KEYS'
    590
                   EXPORTING
    591
                        is_e071_delete              = e071
    592
                        iv_dialog_flag              = ' '
    593
    *                IMPORTING
    594
    *                     ET_NEW_LOCKS                =
    595
                   CHANGING
    596
                        cs_request                  = cu_request
    597
                   EXCEPTIONS
    598
                        OTHERS = 8.
    599
    600
              IF sy-subrc NE 0.
    601
    * restore saved keytab entries and corr_objtab
    602
                LOOP AT cu_corr_keytab_safe INTO corr_keytab.
    603
                  APPEND corr_keytab.
    604
                ENDLOOP.
    605
                e071 = e071_safe. vim_corr_objtab[] = cu_corr_objtab.
    606
                MESSAGE ID     sy-msgid
    607
                        TYPE   'I'
    608
                        NUMBER sy-msgno
    609
                        WITH sy-msgv1 sy-msgv2  sy-msgv3 sy-msgv4.
    610
                RAISE saving_correction_failed.
    611
              ENDIF. "sy-subrc of function call corr_delete_entry.
    612
              IF sy-subrc EQ 0 AND "del. was successful or entry didn't ex.
    613
                 cu_hobjfunc EQ 'D'.       "and no table entry
    614
                DELETE cu_corr_keytab_safe
    615
                  WHERE pgmid EQ e071-pgmid AND object EQ e071-object
    616
                    AND ( objname EQ e071-obj_name OR
    617
                          objname EQ vim_long_objname AND
    618
                          tabkey EQ e071-obj_name )
    619
                    AND objfunc EQ e071-objfunc.
    620
              ENDIF.
    621
            ENDIF.                         "sy-subrc for deletion
    622
          ENDLOOP.
    623
          CLEAR: <status>-keytbmodfd, <status>-upd_flag.
    624
          MESSAGE s096(sv) WITH <status>-corr_nbr.
    625
        ENDIF.                             "maint_mode eq transportieren.
    626
      ELSE.
    627
    * change mode and no lockable objects
    628
        ASSIGN vim_corr_objtab TO <vim_corr_objtab>.
    629
        LOOP AT vim_corr_objtab.
    630
          MOVE-CORRESPONDING <vim_corr_objtab> TO w_cu_ko200. "UNICODE
    631
          APPEND w_cu_ko200 TO cu_ko200_tab.                  "UNICODE
    632
        ENDLOOP.
    633
        IF <status>-order_nbr NE space.
    634
          corr_for_insert = <status>-order_nbr.
    635
        ELSE.
    636
          corr_for_insert = <status>-corr_nbr.
    637
        ENDIF.
    638
    639
        CALL FUNCTION 'TR_OBJECTS_INSERT'
    640
             EXPORTING
    641
    *             WI_ORDER                       = <STATUS>-ORDER_NBR
    642
                  wi_order                       = corr_for_insert
    643
             IMPORTING
    644
                  we_order                       = <status>-order_nbr
    645
                  we_task                        = <status>-corr_nbr
    646
             TABLES
    647
                  wt_ko200                       = cu_ko200_tab
    648
                  wt_e071k                       = corr_keytab
    649
             EXCEPTIONS
    650
                  cancel_edit_other_error        = 4
    651
                  show_only_other_error          = 6
    652
                  OTHERS                         = 8.
    653
        IF sy-subrc NE 0.
    654
          rc = sy-subrc.
    655
    * restore saved keytab entries and corr_objtab
    656
          LOOP AT cu_corr_keytab_safe INTO corr_keytab.
    657
            APPEND corr_keytab.
    658
          ENDLOOP.
    659
          e071 = e071_safe. vim_corr_objtab[] = cu_corr_objtab.
    660
          IF rc GT 4.
    661
    *       MESSAGE I097(SV) WITH <STATUS>-CORR_NBR.
    662
            MESSAGE ID     sy-msgid
    663
                    TYPE   'I'
    664
                    NUMBER sy-msgno
    665
                    WITH sy-msgv1 sy-msgv2  sy-msgv3 sy-msgv4.
    666
          ENDIF.
    667
          RAISE saving_correction_failed.
    668
        ENDIF.
    669
        PERFORM vim_synchronizer_call
    670
                                 USING
    671
                                      cu_ko200_tab[]
    672
                                      corr_keytab[]
    673
                                      space.
    674
      ENDIF. "maint_mode eq transportieren or lockable_objects_exist ne spac
    675
    * delete saved keytab entries - but not in transport mode
    676
      IF maint_mode EQ aendern.
    677
        IF x_header-flag NE space AND x_header-frm_e071 EQ space AND
    678
           ( x_header-frm_e071ks NE space OR x_header-frm_e071ka NE space ).
    679
          REFRESH corr_keytab.
    680
        ELSE.
    681
          DELETE corr_keytab WHERE mastertype NE vim_unlockable_object
    682
                               AND mastertype NE vim_lockable_object.
    683
        ENDIF.
    684
      ENDIF.
    685
    * restore saved keytab entries and set used task number
    686
      LOOP AT cu_corr_keytab_safe INTO corr_keytab.
    687
        IF corr_keytab-mastername EQ x_header-viewname AND
    688
           ( corr_keytab-mastertype EQ vim_unlockable_object OR
    689
             corr_keytab-mastertype EQ vim_lockable_object ).
    690
          corr_keytab-trkorr = <status>-corr_nbr.
    691
        ENDIF.
    692
        APPEND corr_keytab.
    693
      ENDLOOP.
    694
      SUBTRACT sy-subrc FROM sy-subrc.
    695
      e071 = e071_safe.
    696
      LOOP AT vim_corr_objtab.
    697
        READ TABLE cu_corr_objtab WITH KEY pgmid = vim_corr_objtab-pgmid
    698
                                           object = vim_corr_objtab-object
    699
                                         obj_name = vim_corr_objtab-obj_name
    700
                                  TRANSPORTING NO FIELDS.
    701
        CHECK sy-subrc NE 0.               "delete added entries
    702
        DELETE vim_corr_objtab.
    703
      ENDLOOP.
    704
      e071-trkorr = <status>-corr_nbr.
    705
      last_corr_number = <status>-l_corr_nbr = <status>-corr_nbr.
    706
      CLEAR <status>-keytbmodfd.
    707
      FREE: cu_e071k_tab, cu_trmess, cu_trpar, cu_e071_tab,
    708
            cu_corr_keytab_safe, cu_ko200_tab, cu_e071_htb, cu_new_locks.
    709
    ENDFORM.                    "corr_upd