Properties | SourceCde
Title |  |
Original language | DE | Englisch
Created | 27.10.1998 |  | SAP |
Last changed by | 13.11.2001 |  | SAP |
Status | Active |
Attributes
Type | INCLUDE program |
Status | Test program |
Application | Basis |
Package | SVIM | Basis View Maintenance
| Editor lock
txt
    1
    *---------------------------------------------------------------------*
    2
    *       FORM GET_TRANSP_INFO                                          *
    3
    *---------------------------------------------------------------------*
    4
    * get client state and transport objects                              *
    5
    *---------------------------------------------------------------------*
    6
    FORM get_transp_info.
    7
      LOCAL: e071.
    8
      DATA: obj_type LIKE objh-objecttype, last_category LIKE objh-objcateg,
    9
            last_clidep LIKE objh-clidep VALUE 'X', gti_e071 LIKE e071,
    10
            last_protect LIKE objh-protect, gti_cliindep_state(1) TYPE c,
    11
            gti_x030l LIKE x030l, gti_tabname TYPE tabname,
    12
            gti_client_role LIKE t000-cccategory, gti_flag_safe(1) TYPE c,
    13
            cursetting TYPE cursetting, addr_e071k LIKE e071k,
    14
            importable TYPE objimp value '4',
    15
            tr_result LIKE trpari-s_checked, addr_e071k2 LIKE e071k.
    16
    17
    * check if logging of changes is necessary
    18
      gti_flag_safe = x_header-flag.
    19
      IF x_header-customauth CO no_transport_classes."transport impossible
    20
        x_header-flag = vim_transport_denied. "no standard logging
    21
        CLEAR: x_header-frm_e071,          "no individual transport
    22
               x_header-frm_e071ks,
    23
               x_header-frm_e071ka.
    24
        IF maint_mode EQ aendern.
    25
          MOVE 'TRSP' TO excl_cua_funct-function. COLLECT excl_cua_funct.
    26
        ELSEIF maint_mode EQ transportieren.
    27
          MESSAGE i128(sv) WITH "Auslieferungsklasse &, kein Transport mög
    28
                  x_header-customauth.
    29
          RAISE missing_corr_number.
    30
        ENDIF.
    31
        MOVE 'ORDR' TO excl_cua_funct-function. COLLECT excl_cua_funct.
    32
        sy-subrc = 9.
    33
      ELSEIF x_header-customauth CO no_transport_log_classes.
    34
        IF x_header-frm_e071 EQ space AND x_header-frm_e071ks EQ space AND
    35
           x_header-frm_e071ka EQ space.   "no individual transport routines
    36
          x_header-flag = vim_transport_denied. "no transport
    37
          IF maint_mode EQ aendern.
    38
            MOVE 'TRSP' TO excl_cua_funct-function. COLLECT excl_cua_funct.
    39
          ELSEIF maint_mode EQ transportieren.
    40
            MESSAGE i128(sv) WITH "Auslieferungsklasse &, kein Transport mög
    41
                    x_header-customauth.
    42
            RAISE missing_corr_number.
    43
          ENDIF.
    44
          MOVE 'ORDR' TO excl_cua_funct-function. COLLECT excl_cua_funct.
    45
        ELSE.
    46
          x_header-flag = 'X'.             "no standard logging
    47
        ENDIF.
    48
        sy-subrc = 9.
    49
      ENDIF.
    50
      IF sy-subrc EQ 9.
    51
        MODIFY x_header INDEX 1.
    52
      ENDIF.
    53
    *<<< Übergangslösung Transportstatus des Mandanten Anfang
    54
    * check if client allows transport
    55
      CALL FUNCTION 'VIEW_GET_CLIENT_STATE'
    56
        IMPORTING
    57
          transp_state   = vim_client_state
    58
          cliindep_state = gti_cliindep_state
    59
          client_state   = gti_client_role.
    60
      IF x_header-clidep NE space AND      "clientdependent and
    61
         x_header-customauth CN sap_only_classes. "not delclass `S`
    62
        CASE vim_client_state.
    63
          WHEN vim_local_clnt. "client is local -> transport denied
    64
            IF maint_mode EQ aendern OR maint_mode EQ anzeigen.
    65
              excl_cua_funct-function = 'TRSP'. COLLECT excl_cua_funct.
    66
              excl_cua_funct-function = 'ORDR'. COLLECT excl_cua_funct.
    67
              x_header-flag = vim_transport_denied.
    68
            ELSE.
    69
              MESSAGE i130(sv) WITH "Mandant ist lokal, keine Transporte m
    70
                      sy-mandt.
    71
              RAISE missing_corr_number.
    72
            ENDIF.
    73
          WHEN vim_locked. "client is locked -> no changes but transport
    74
    *       IF MAINT_MODE EQ AENDERN.  "only for CUST/CUSY objects!!!!!!
    75
    *         MESSAGE I430(TK) WITH SY-MANDT."Mandant &1 'nicht änderbar'
    76
    *         MAINT_MODE = STATUS-ACTION = ANZEIGEN.
    77
    *         EXIT.
    78
    *       ENDIF.
    79
        ENDCASE.
    80
      ELSE. "clientindependent or deliveryclass 'S'
    81
        vim_client_state = vim_log.        "such objects always log
    82
      ENDIF.                               "xheader-clidep ne space.
    83
    *<<< Übergangslösung Transportstatus des Mandanten Ende
    84
    * if transport allowed -> get transport objects
    85
      REFRESH vim_corr_objtab.
    86
      gti_e071 = e071.
    87
      IF x_header-frm_e071 NE space.       "individual transport objects
    88
        PERFORM (x_header-frm_e071) IN PROGRAM (sy-repid).
    89
      ENDIF.
    90
      IF gti_flag_safe EQ space.                                "240997
    91
    * automatic recording of changes switched on in SE54
    92
        APPEND gti_e071 TO vim_corr_objtab.
    93
        IF x_header-adrnbrflag EQ 'N'.     "new version of addresses used
    94
    * addresses
    95
          REFRESH: vim_addr_e071k_tab, vim_addr_e071_tab.
    96
          CALL FUNCTION 'ADDR_TRANSPORT_TDAT_ENTRIES'
    97
            TABLES
    98
              e071k_tab = vim_addr_e071k_tab.
    99
          addr_e071k2 = e071k.
    100
          LOOP AT vim_addr_e071k_tab INTO addr_e071k.
    101
            gti_e071-object = addr_e071k2-mastertype
    102
             = addr_e071k-mastertype.
    103
            gti_e071-obj_name = addr_e071k2-mastername
    104
             = addr_e071k-mastername.
    105
            APPEND gti_e071 TO vim_addr_e071_tab.
    106
            APPEND gti_e071 TO vim_corr_objtab.
    107
            MODIFY vim_addr_e071k_tab FROM addr_e071k2.
    108
          ENDLOOP.
    109
        ENDIF.
    110
      ELSEIF x_header-frm_e071 EQ space AND    "no individual transport
    111
             x_header-frm_e071ks EQ space AND  "routines and no standard
    112
             x_header-frm_e071ka EQ space.
    113
    * no events concerning change recording are used
    114
        APPEND gti_e071 TO vim_corr_objtab.    "but check cliiendep settings
    115
        x_header-flag = vim_transport_denied. MODIFY x_header INDEX 1.
    116
        IF maint_mode EQ aendern.
    117
          MOVE 'TRSP' TO excl_cua_funct-function. COLLECT excl_cua_funct.
    118
        ENDIF.
    119
        MOVE 'ORDR' TO excl_cua_funct-function. COLLECT excl_cua_funct.
    120
        gti_flag_safe = '@'.
    121
      ENDIF.
    122
    * get object category and client dependency for transport objects
    123
      LOOP AT vim_corr_objtab.
    124
        CASE vim_corr_objtab-object.
    125
          WHEN vim_view_type.              "-> view
    126
            obj_type = vim_view.
    127
          WHEN transp_object.              "-> tables
    128
            obj_type = vim_tabl.
    129
          WHEN vim_tran_type.              "-> individual transaction
    130
            obj_type = vim_tran.
    131
          WHEN vim_clus_type.           "-> cluster of views/tables/clusters
    132
            obj_type = vim_clst.
    133
          WHEN OTHERS.                     "-> may be: TLOGO object ?
    134
            obj_type = vim_logo.
    135
        ENDCASE.
    136
        IF obj_type NE vim_logo.
    137
          SELECT SINGLE * FROM objh
    138
                          WHERE objectname EQ vim_corr_objtab-obj_name
    139
                            AND objecttype EQ obj_type.
    140
        ELSE. "TLOGO -> use obj type as obj name
    141
          SELECT SINGLE * FROM objh
    142
                          WHERE objectname EQ vim_corr_objtab-object
    143
                            AND objecttype EQ obj_type.
    144
        ENDIF.
    145
        IF sy-subrc NE 0.
    146
          IF obj_type NE vim_logo. "set defaults for table transp. obj.
    147
            IF x_header-viewname EQ vim_corr_objtab-obj_name AND
    148
               ( x_header-bastab EQ space AND
    149
                 vim_corr_objtab-object EQ vim_view_type OR
    150
                 x_header-bastab NE space AND
    151
                 vim_corr_objtab-object EQ transp_object ) OR
    152
               vim_called_by_cluster NE space AND
    153
               vim_calling_cluster EQ vim_corr_objtab-obj_name AND
    154
               vim_corr_objtab-object EQ vim_clus_type.
    155
              IF x_header-clidep EQ space. "clientindependent
    156
                IF x_header-customauth CO customizing_delivery_classes.
    157
                  objh-objcateg = vim_cust_syst.
    158
                ELSEIF x_header-customauth CO sap_only_classes.
    159
                  objh-objcateg = vim_syst.
    160
                ELSEIF x_header-customauth CO application_delivery_classes.
    161
                  objh-objcateg = vim_appl.
    162
                ELSE.
    163
                  objh-objcateg = vim_syst.
    164
                ENDIF.
    165
              ELSE.                        "clientdependent
    166
                IF x_header-customauth CO customizing_delivery_classes.
    167
                  objh-objcateg = vim_cust.
    168
                ELSEIF x_header-customauth CO sap_only_classes.
    169
                  objh-objcateg = vim_cust_syst.
    170
                ELSEIF x_header-customauth CO application_delivery_classes.
    171
                  objh-objcateg = vim_appl.
    172
                ELSE.
    173
                  objh-objcateg = vim_syst.
    174
                ENDIF.
    175
              ENDIF.
    176
              objh-clidep   = x_header-clidep.
    177
            ELSE.           "unknown object -> check if clientdep. table
    178
              IF vim_corr_objtab-object EQ transp_object. "table
    179
                gti_tabname = vim_corr_objtab-obj_name.
    180
                CALL FUNCTION 'DDIF_NAMETAB_GET'
    181
                  EXPORTING
    182
                    tabname   = gti_tabname
    183
                  IMPORTING
    184
                    x030l_wa  = gti_x030l
    185
                  EXCEPTIONS
    186
                    not_found = 1
    187
                    OTHERS    = 2.
    188
                IF sy-subrc EQ 0 AND gti_x030l-flagbyte O vim_clidep.
    189
                  objh-objcateg = vim_cust."clientdependent table
    190
                  objh-clidep   = 'X'.
    191
                ELSE.                      "no nametab or clientindependent
    192
                  objh-objcateg = vim_syst.
    193
                  objh-clidep   = space.
    194
                ENDIF.
    195
              ELSE.                        "unknown object -> syst
    196
                objh-objcateg = vim_syst.
    197
                objh-clidep   = space.
    198
              ENDIF.
    199
            ENDIF.
    200
          ELSE. "vim_logo                  "no objh-object -> syst
    201
            objh-objcateg = vim_syst.
    202
            objh-clidep   = space.
    203
    * note lockable transport object
    204
            vim_corr_objtab-lockable = 'X'.
    205
            MODIFY vim_corr_objtab.
    206
          ENDIF.                           "obj_type ne vim_logo
    207
        ELSE.
    208
    * entry in OBJH found -> check current setting, importability,
    209
    * protect-flag
    210
          IF objh-cursetting <> space.           "UF615995/2000b
    211
            cursetting = objh-cursetting.
    212
          ENDIF.                                 "UF615995/2000e
    213
          IF objh-importable <> space
    214
           AND objh-importable < importable.     "#EC PORTABLE
    215
    * "most unimportable" object sets standard
    216
            importable = objh-importable.
    217
          ENDIF.
    218
          IF objh-protect NE space.
    219
            IF objh-objectname EQ x_header-viewname AND "current VIM object
    220
               ( x_header-bastab EQ space AND objh-objecttype EQ vim_view OR
    221
                 x_header-bastab NE space AND objh-objecttype EQ vim_tabl ).
    222
              IF x_header-frm_e071 EQ space AND
    223
                 x_header-frm_e071ks EQ space AND
    224
                 x_header-frm_e071ka EQ space. "no individ. transp. routines
    225
                x_header-flag = vim_transport_denied. "no transport
    226
                MOVE 'TRSP' TO excl_cua_funct-function.
    227
                COLLECT excl_cua_funct.
    228
                MOVE 'ORDR' TO excl_cua_funct-function.
    229
                COLLECT excl_cua_funct.
    230
    *           EXIT.                                         "240997
    231
              ELSE.
    232
                x_header-flag = 'X'.       "no standard logging
    233
                DELETE vim_corr_objtab.
    234
              ENDIF.
    235
              MODIFY x_header INDEX 1.
    236
            ENDIF. "curr. VIM obj./ignore added individual transport objects
    237
          ENDIF.                           "protect ne space
    238
    *     IF OBJH-OBJECTTYPE EQ VIM_LOGO.
    239
    * note object as lockable transport object until TR_OBJECTS_* force
    240
    * TLOGO-objects too  "changed in 4.0
    241
          IF objh-checkid EQ 'L'.          "note lockable object!
    242
            vim_corr_objtab-lockable = 'X'.
    243
            MODIFY vim_corr_objtab.
    244
          ENDIF.
    245
        ENDIF.                             "sy-subrc ne 0.
    246
        IF ( objh-objcateg EQ vim_syst OR
    247
             objh-objcateg EQ vim_cust_syst ) AND
    248
           last_category NE vim_syst.
    249
          last_category = objh-objcateg.
    250
        ENDIF.
    251
        IF objh-clidep EQ space.
    252
          last_clidep = objh-clidep.
    253
        ENDIF.
    254
      ENDLOOP.
    255
    * IF SY-SUBRC NE 0.  "may be user exits.....
    256
      IF sy-subrc NE 0.
    257
        IF ( x_header-frm_e071 NE space OR
    258
           x_header-frm_e071ks EQ space AND x_header-frm_e071ka EQ space ).
    259
          x_header-flag = vim_transport_denied. MODIFY x_header INDEX 1.
    260
          IF maint_mode EQ aendern.
    261
            MOVE 'TRSP' TO excl_cua_funct-function. COLLECT excl_cua_funct.
    262
          ENDIF.
    263
          MOVE 'ORDR' TO excl_cua_funct-function. COLLECT excl_cua_funct.
    264
        ENDIF.
    265
        EXIT. "if no object could be determined exit this routine
    266
      ELSEIF gti_flag_safe EQ '@'.         "temporaryly appended
    267
        REFRESH vim_corr_objtab.
    268
      ENDIF.
    269
    * CHECK X_HEADER-FLAG NE VIM_TRANSPORT_DENIED.             "240997
    270
      IF objh-objcateg NE vim_syst AND
    271
         ( last_category EQ vim_syst OR
    272
           last_category EQ vim_cust_syst ).
    273
        objh-objcateg = last_category.
    274
      ENDIF.
    275
      objh-clidep = last_clidep.
    276
    * no logging for settings in productive clients
    277
      IF cursetting NE space.
    278
        x_header-cursetting = x_header-flag.
    279
        TRANSLATE x_header-cursetting USING ' XXY'.
    280
        MODIFY x_header INDEX 1.
    281
      ENDIF.
    282
    * put importable-flag into x_header.
    283
      IF importable <> 4.
    284
        x_header-importable = importable.
    285
        MODIFY x_header INDEX 1.
    286
      ENDIF.
    287
      IF maint_mode EQ aendern AND objh-clidep NE space AND
    288
         cursetting NE space AND gti_client_role EQ 'P'.
    289
        x_header-flag = vim_transport_denied. MODIFY x_header INDEX 1.
    290
        MOVE 'ORDR' TO excl_cua_funct-function. COLLECT excl_cua_funct.
    291
        EXIT.                                                   "240997
    292
      ENDIF.
    293
    * CHECK X_HEADER-FLAG NE VIM_TRANSPORT_DENIED.          "240997
    294
      IF x_header-flag NE vim_transport_denied AND
    295
         vim_client_state EQ vim_locked AND
    296
         ( objh-objcateg EQ vim_cust OR objh-objcateg EQ vim_cust_syst ) AND
    297
         maint_mode EQ aendern.            "only for CUST/CUSY objects!!!!!!
    298
        MESSAGE i430(tk) WITH sy-mandt.    "Mandant &1 'nicht änderbar'
    299
        maint_mode = status-action = anzeigen.
    300
        ASSIGN dba_sellist-*sys* TO <vim_sellist>.
    301
        vim_enqueue_range = x_header-subsetflag.
    302
        PERFORM enqueue
    303
                    USING
    304
                        'D'
    305
                        space.
    306
        EXIT.
    307
      ENDIF.
    308
      CASE gti_cliindep_state.
    309
        WHEN vim_noact.
    310
        WHEN vim_nocliindep_cust.
    311
          IF maint_mode EQ aendern AND objh-objcateg = vim_cust_syst.
    312
            CHECK x_header-flag NE vim_transport_denied.
    313
            MESSAGE i731(tk).              " WITH SY-MANDT.
    314
            maint_mode = status-action = anzeigen.
    315
            ASSIGN dba_sellist-*sys* TO <vim_sellist>.
    316
            vim_enqueue_range = x_header-subsetflag.
    317
            PERFORM enqueue
    318
                        USING
    319
                            'D'
    320
                            space.
    321
            vim_client_state = vim_noact. EXIT.
    322
          ENDIF.
    323
        WHEN vim_noreposiandcust.
    324
          IF maint_mode EQ aendern AND
    325
           ( objh-objcateg = vim_syst OR objh-objcateg = vim_cust_syst ).
    326
            CHECK x_header-flag NE vim_transport_denied.
    327
            MESSAGE i730(tk).              " WITH SY-MANDT.
    328
            maint_mode = status-action = anzeigen.
    329
            ASSIGN dba_sellist-*sys* TO <vim_sellist>.
    330
            vim_enqueue_range = x_header-subsetflag.
    331
            PERFORM enqueue
    332
                        USING
    333
                            'D'
    334
                            space.
    335
            vim_client_state = vim_noact. EXIT.
    336
          ENDIF.
    337
        WHEN vim_noreposichanges.
    338
          LOOP AT vim_corr_objtab INTO e071.
    339
            CALL FUNCTION 'TR_CHECK_TYPE'
    340
              EXPORTING
    341
                wi_e071   = e071
    342
              IMPORTING
    343
                pe_result = tr_result.
    344
    *  PE_RESULT        syntax  transport  TADIR     TLOCK
    345
    *           SPACE     -         -        -         -
    346
    *             S       X         -        -         -
    347
    *             R       X         X        -         -
    348
    *             T       X         X        X         -  (only for sapsccs)
    349
    *             L       X         X        X         X
    350
    *             P     system object or illegal name selection
    351
    *                   (T100, SAPL...., ... )
    352
    * no repository object and not lockable?
    353
            IF 'TLP' CS tr_result.
    354
              MESSAGE i729(tk).              "WITH SY-MANDT.
    355
              IF x_header-flag NE vim_transport_denied.
    356
                maint_mode = status-action = anzeigen.
    357
                ASSIGN dba_sellist-*sys* TO <vim_sellist>.
    358
                vim_enqueue_range = x_header-subsetflag.
    359
                PERFORM enqueue
    360
                            USING
    361
                                'D'
    362
                                space.
    363
                vim_client_state = vim_noact.
    364
              ENDIF.
    365
              EXIT.
    366
            ENDIF.
    367
          ENDLOOP.
    368
      ENDCASE.
    369
    ENDFORM.                               "get_transp_info