Eigenschaften | Quelltext
Titel | X_CALL_VIEWMAINTENANCE |
Originalsprache | DE | Deutsch
Erstellt | 27.10.1998 |  | SAP |
Letzte Änderung | 23.06.2003 |  | SAP |
Status | aktiv |
Attribute
Typ | Include-Programm |
Status | Testprogramm |
Anwendung | Basis (System) |
Paket | SVIM | Basis Viewmaintenance
| Editorsperre
txt
    1
    *&--------------------------------------------------------------------*
    2
    *&      Form X_CALL_VIEWMAINTENANCE                                   *
    3
    *&--------------------------------------------------------------------*
    4
    * external call of view maintenance                                   *
    5
    *&--------------------------------------------------------------------*
    6
    * --> XCV_USE_LCL_TBL:  'X' Datencontainer XCV_TOTAL und XCV_EXTRACT
    7
    *                       sind nicht struktueriert und nicht vom Typ X
    8
    *                       => Daten müssen in lokale Container umgesetzt
    9
    *                       werden.
    10
    * --> XCV_IMP_SPECMODE: 'P' Profilimport/
    11
    *                       'T' Testmodus Import/'F' Forcemodus Import /
    12
    *                       'B' T + F Import
    13
    *&--------------------------------------------------------------------*
    14
    FORM x_call_viewmaintenance USING
    15
                                    value(xcv_use_lcl_tbl) LIKE tvdir-flag
    16
                                    value(xcv_import) LIKE tvdir-flag
    17
                                    xcv_corrnbr LIKE e070-trkorr
    18
                                    value(xcv_fcode) TYPE vimty_tcode
    19
                                    value(xcv_action) LIKE tvdir-flag
    20
                                    value(xcv_name) TYPE vimty_tablename
    21
                                    value(xcv_tot_name) TYPE c
    22
                                    value(xcv_ext_name) TYPE c
    23
                                    value(xcv_upgr_dest) LIKE rfcdes-rfcdest
    24
                                    value(xcv_upgr_clnt) LIKE sy-mandt
    25
                                    xcv_upd_requ LIKE tvdir-flag
    26
                                    xcv_e071k TYPE table
    27
                                    xcv_dba_sel TYPE table
    28
                                    xcv_dpl_sel TYPE table
    29
                                    xcv_excufc TYPE table
    30
                                    xcv_extract TYPE table
    31
                                    xcv_total TYPE table
    32
                                    xcv_header TYPE table
    33
                                    xcv_namtab TYPE table
    34
                                    xcv_last_command TYPE vimty_tcode
    35
                                    xcv_last_act_entry LIKE sy-tabix
    36
                                    xcv_results LIKE vimmodres
    37
                                    xcv_imp_results TYPE slctr_tables_keys
    38
                                    value(xcv_imp_specmode) LIKE tvdir-flag
    39
                                    value(xcv_cmp_slcnds) LIKE tvdir-flag.
    40
    41
      DATA: xcv_return TYPE i, xcv_i_fcode TYPE vimty_tcode,
    42
            line_name(30) TYPE c, length TYPE i, tabtype type ob_typ,
    43
            header_wa_loc TYPE vimdesc,
    44
            BEGIN OF tabline,
    45
              line(4096) TYPE c,
    46
            END OF tabline.
    47
      FIELD-SYMBOLS: <total> TYPE table, <extract> TYPE table,
    48
                     <tabline> TYPE ANY, <tabline_x> TYPE x,
    49
                     <tabline2> TYPE ANY, <tabline2_x> TYPE x,
    50
                     <header> TYPE vimdesc.
    51
      LOCAL: vim_import_mode_active, vim_no_dialog, vim_import_testmode,
    52
            vim_import_forcemode.          "SW  wg. Rekurs. im Cluster
    53
    54
      vim_no_dialog = xcv_import. TRANSLATE vim_no_dialog USING 'H DX'.
    55
      IF xcv_imp_specmode = 'P'.           "Profilimp
    56
        vim_import_profile = 'X'.
    57
      ENDIF.
    58
      vim_import_testmode = xcv_imp_specmode.
    59
      TRANSLATE vim_import_testmode USING 'TXBXF P '.
    60
      vim_import_forcemode = xcv_imp_specmode.
    61
      TRANSLATE vim_import_forcemode USING 'T BXFXP '.
    62
      IF xcv_use_lcl_tbl ne space.
    63
        ASSIGN: (xcv_tot_name) TO <total>, (xcv_ext_name) TO <extract>.
    64
        IF xcv_use_lcl_tbl ne 'L'.         "use not _only_ local tables
    65
          READ TABLE xcv_header ASSIGNING <header> INDEX 1.
    66
          IF <header>-bastab ne space and <header>-texttbexst ne space.
    67
            length = <header>-after_tabc + <header>-aft_txttbc
    68
                     + 3 * cl_abap_char_utilities=>charsize.
    69
          ELSE.
    70
            length = <header>-after_tabc
    71
                     + 2 * cl_abap_char_utilities=>charsize.
    72
          ENDIF.
    73
          SEARCH xcv_tot_name FOR '[' IN CHARACTER MODE.
    74
          MOVE xcv_tot_name(sy-fdpos) TO line_name.
    75
          ASSIGN: (line_name) TO <tabline2>,
    76
                  <tabline2> TO <tabline2_x> CASTING.
    77
          REFRESH: <total>, <extract>.
    78
          LOOP AT xcv_total ASSIGNING <tabline>.
    79
            ASSIGN <tabline> TO <tabline_x> CASTING.
    80
            MOVE <tabline_x> TO <tabline2_x>(length).
    81
            APPEND <tabline2> TO <total>.
    82
          ENDLOOP.
    83
          LOOP AT xcv_extract ASSIGNING <tabline>.
    84
            ASSIGN <tabline> TO <tabline_x> CASTING.
    85
            MOVE <tabline_x> TO <tabline2_x>(length).
    86
            APPEND <tabline2> TO <extract>.
    87
          ENDLOOP.
    88
    *      <total> = xcv_total. <extract> = xcv_extract.
    89
        ENDIF.
    90
      ELSE.
    91
        ASSIGN: xcv_total TO <total>, xcv_extract TO <extract>.
    92
      ENDIF.
    93
      vim_import_mode_active = xcv_import. xcv_i_fcode = xcv_fcode.
    94
      IF xcv_import ne space and xcv_fcode ne 'SAVE'.
    95
      ELSEIF xcv_import ne space and xcv_fcode eq 'SAVE'.       "SW
    96
        imp_results[] = xcv_imp_results[].                      "SW
    97
      ELSEIF xcv_fcode eq 'INS' or xcv_fcode eq 'DEL' or
    98
             xcv_fcode eq 'UPD' or xcv_fcode eq 'SHOW'.
    99
        vim_single_entry_function = xcv_fcode. xcv_i_fcode = 'EDIT'.
    100
      ENDIF.
    101
      IF xcv_import eq 'D' and xcv_fcode eq 'SAVE'.
    102
        vim_import_no_message = 'X'.
    103
      ENDIF.
    104
      CALL FUNCTION 'VIEW_MAINTENANCE_LOW_LEVEL'
    105
        EXPORTING
    106
          corr_number                 = xcv_corrnbr
    107
          fcode                       = xcv_i_fcode
    108
          view_action                 = xcv_action
    109
          view_name                   = xcv_name
    110
          rfc_destination_for_upgrade = xcv_upgr_dest
    111
          client_for_upgrade          = xcv_upgr_clnt
    112
          complex_selconds_used       = xcv_cmp_slcnds
    113
        IMPORTING
    114
          last_act_entry              = xcv_last_act_entry
    115
          ucomm                       = xcv_last_command
    116
          update_required             = xcv_upd_requ
    117
          corr_number                 = xcv_corrnbr
    118
        TABLES
    119
          corr_keytab                 = xcv_e071k
    120
          dba_sellist                 = xcv_dba_sel
    121
          dpl_sellist                 = xcv_dpl_sel
    122
          excl_cua_funct              = xcv_excufc
    123
          extract                     = <extract>
    124
          total                       = <total>
    125
          x_header                    = xcv_header
    126
          x_namtab                    = xcv_namtab
    127
        EXCEPTIONS
    128
          function_not_found          = 1
    129
          missing_corr_number         = 2
    130
          no_value_for_subset_ident   = 3
    131
          saving_correction_failed    = 4.
    132
    *  IF xcv_import NE space AND
    133
    *     ( sy-subrc NE 0 OR
    134
    *       xcv_fcode EQ save AND <status>-upd_flag NE space ).
    135
    * "HCG BC-Set: sy-subrc NE 0 -> always error message in log
    136
      IF ( xcv_import NE space OR vim_import_profile NE space ) AND
    137
         ( sy-subrc ne 0 or
    138
           xcv_fcode eq save and <status>-upd_flag ne space ).
    139
        IF sy-msgid ne space.
    140
          vim_import_no_message = 'X'.
    141
          IF vim_import_profile = 'X'.
    142
            read table xcv_header into header_wa_loc index 1.
    143
            IF header_wa_loc-bastab EQ space.
    144
              tabtype = 'V'.
    145
            ELSE.
    146
              tabtype = 'S'.
    147
            ENDIF.
    148
            PERFORM vim_bc_process_message USING sy-msgid 'I' 'E' sy-msgno
    149
                            sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4 tabtype.
    150
          ELSE.
    151
            PERFORM vim_process_message USING sy-msgid 'I' 'E' sy-msgno
    152
                           sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    153
          ENDIF.
    154
          CLEAR vim_import_no_message.
    155
        ENDIF.
    156
    *   IF XCV_IMPORT NE SPACE.
    157
        LOOP AT imp_results.
    158
          IF imp_results-import-inserted ne 0.
    159
            imp_results-import-errors = imp_results-import-inserted.
    160
            CLEAR imp_results-import-inserted.
    161
          ELSEIF imp_results-import-updated ne 0.
    162
            imp_results-import-errors = imp_results-import-updated.
    163
            CLEAR imp_results-import-updated.
    164
          ELSEIF imp_results-import-deleted ne 0.
    165
            imp_results-import-errors = imp_results-import-deleted.
    166
            CLEAR imp_results-import-deleted.
    167
          ENDIF.
    168
          MODIFY imp_results.
    169
        ENDLOOP.
    170
      ELSEIF xcv_import eq space and xcv_fcode eq 'READ' and
    171
             sy-subrc ne 0.                "probably called by VIEW_GET_DATA
    172
        IF sy-subrc eq 2. "probably individual authority check failed
    173
          MESSAGE i053(sv) RAISING no_authority.
    174
        ELSE.                              "other error
    175
          MESSAGE i037(sv) WITH view_name RAISING no_viewmaint_tool.
    176
        ENDIF.
    177
      ENDIF.
    178
      IF xcv_fcode eq 'EXED' or xcv_fcode eq 'DEL'.
    179
        xcv_results = vim_results_of_ext_mod.
    180
      ELSEIF xcv_fcode eq read.
    181
        DESCRIBE TABLE <total> LINES xcv_results-nbr_of_upd.
    182
      ELSEIF xcv_fcode eq save and xcv_import eq 'D'.
    183
        CLEAR vim_import_no_message.
    184
      ENDIF.
    185
      IF xcv_use_lcl_tbl ne space and xcv_use_lcl_tbl ne 'L'.
    186
        REFRESH: xcv_total, xcv_extract.
    187
        ASSIGN: tabline TO <tabline2_x> CASTING.
    188
        LOOP AT <total> ASSIGNING <tabline>.
    189
          ASSIGN <tabline> TO <tabline_x> CASTING.
    190
          MOVE <tabline_x> TO <tabline2_x>(length).
    191
          APPEND tabline TO xcv_total.
    192
        ENDLOOP.
    193
        LOOP AT <extract> ASSIGNING <tabline>.
    194
          ASSIGN <tabline> TO <tabline_x> CASTING.
    195
          MOVE <tabline_x> TO <tabline2_x>(length).
    196
          APPEND tabline TO xcv_extract.
    197
        ENDLOOP.
    198
    *    MOVE: <total> TO xcv_total, <extract> TO xcv_extract.
    199
      ENDIF.
    200
      CLEAR vim_single_entry_function.                          "SW
    201
      IF xcv_import ne space.
    202
        xcv_imp_results = imp_results[].
    203
        REFRESH imp_results.                                    "SW
    204
      ENDIF.
    205
    ENDFORM.                               "x_call_viewmaintenance