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 KOPIERE                                                  *
    3
    *---------------------------------------------------------------------*
    4
    * Kopieren als... und teilweise Gültigkeit abgrenzen                  *
    5
    *---------------------------------------------------------------------*
    6
    FORM kopiere.
    7
      DATA: z LIKE sy-tabix VALUE 1,
    8
            stat TYPE c, dum1 TYPE i.
    9
      status-action = kopieren.
    10
      MOVE status-data TO stat.
    11
      status-data = auswahldaten.
    12
      title-data = auswahldaten.
    13
      ADD 1 TO vim_copy_call_level.
    14
      IF vim_special_mode EQ vim_delimit.
    15
        title-action = vim_delimit.
    16
    *  ELSEIF <STATUS>-PROF_FOUND NE VIM_PR_INTO_DET.           "UFprofile
    17
    *    TITLE-ACTION = KOPIEREN.
    18
      ENDIF.
    19
    *  ASSIGN extract(x_header-keylen) TO <orig_key>.
    20
      ASSIGN <vim_xextract_key> TO <orig_key>.
    21
      IF status-mode EQ list_bild.
    22
        LOOP AT extract.
    23
          IF <xmark> NE markiert.
    24
            DELETE extract.
    25
          ELSE.
    26
            <xmark> = nicht_markiert.
    27
            MODIFY extract.
    28
          ENDIF.
    29
        ENDLOOP.
    30
        mark_extract = <status>-mk_xt = 0.
    31
        nextline = 1.
    32
        DESCRIBE TABLE extract LINES maxlines.
    33
        IF vim_copy_call_level = 1.
    34
          VIM_NR_ENTRIES_TO_COPY = maxlines.            "SW 510129/1999
    35
        ENDIF.
    36
        IF status-type EQ einstufig.
    37
          IF vim_special_mode NE vim_delimit.
    38
            MESSAGE s024(sv).
    39
          ELSE.
    40
            MESSAGE s124(sv).
    41
          ENDIF.
    42
          CALL SCREEN liste.
    43
          IF function NE 'ABR '.
    44
            DESCRIBE TABLE vim_copied_indices.
    45
            IF sy-tfill LT VIM_NR_ENTRIES_TO_COPY.     "SW 510129/1999
    46
                                 "not all selected entries where proc.
    47
              LOOP AT extract.
    48
                READ TABLE vim_copied_indices
    49
                     WITH KEY level = vim_copy_call_level ex_ix = z.
    50
                IF sy-subrc EQ 0.
    51
                  DELETE extract.
    52
                ELSE.
    53
                  <xmark> = markiert. MODIFY extract.
    54
                ENDIF.
    55
                ADD 1 TO z.
    56
              ENDLOOP.
    57
              PERFORM kopiere.
    58
            ENDIF.
    59
          ENDIF.
    60
        ELSE.
    61
          LOOP AT extract.
    62
            IF vim_special_mode NE vim_delimit.
    63
              neuer = 'J'.
    64
              MESSAGE s025(sv).
    65
            ELSE.
    66
              MESSAGE s125(sv).
    67
            ENDIF.
    68
            PERFORM move_extract_to_view_wa.
    69
            PERFORM process_detail_screen USING 'C'.
    70
            neuer = 'N'.
    71
            <status>-upd_flag = space.
    72
            IF temporal_delimitation_happened NE space.
    73
              CLEAR temporal_delimitation_happened.
    74
            ENDIF.
    75
            IF vim_special_mode EQ vim_delimit.
    76
              REFRESH vim_delim_entries.
    77
            ENDIF.
    78
            IF function EQ 'ABR '.
    79
              EXIT.
    80
            ENDIF.
    81
          ENDLOOP.
    82
        ENDIF.
    83
        IF vim_copy_call_level GT 1.
    84
          SUBTRACT 1 FROM vim_copy_call_level.
    85
          EXIT.
    86
        ENDIF.
    87
        IF vim_special_mode NE vim_delimit AND counter LE 1.
    88
          PERFORM fill_extract.
    89
          mark_extract = mark_total.
    90
          title-data = gesamtdaten.
    91
          IF counter EQ 1.
    92
            READ TABLE vim_copied_indices INDEX 1.
    93
            READ TABLE total INDEX vim_copied_indices-ix.
    94
            IF x_header-delmdtflag EQ space.
    95
              READ TABLE extract WITH KEY <vim_xtotal_key>
    96
                                 TRANSPORTING NO FIELDS.
    97
              nextline = sy-tabix.
    98
            ELSE.
    99
              nextline = 0.
    100
              LOOP AT vim_collapsed_mainkeys.
    101
                check <vim_collapsed_mkey_bfx> = <vim_tot_mkey_beforex>.
    102
    *            WHERE mkey_bf EQ <vim_tot_mkey_before>.
    103
                IF vim_mkey_after_exists NE space.
    104
                  CHECK <vim_collapsed_key_afx> EQ <vim_tot_mkey_afterx>.
    105
    *              CHECK <vim_collapsed_key_af> EQ <vim_tot_mkey_after>.
    106
                ENDIF.
    107
                READ TABLE extract WITH KEY <vim_collapsed_keyx>
    108
    *            READ TABLE extract WITH KEY <vim_collapsed_key>
    109
                                   TRANSPORTING NO FIELDS.
    110
                nextline = sy-tabix.
    111
                EXIT.
    112
              ENDLOOP.
    113
              IF sy-subrc NE 0 OR nextline EQ 0.
    114
                READ TABLE extract WITH KEY <vim_xtotal_key>
    115
                                   TRANSPORTING NO FIELDS.
    116
                IF sy-subrc NE 0.
    117
                  nextline = 1.
    118
                ELSE.
    119
                  nextline = sy-tabix.
    120
                ENDIF.
    121
              ENDIF.
    122
            ENDIF.
    123
          ELSE.
    124
            nextline = 1.
    125
          ENDIF.
    126
        ELSE.
    127
          status-action = title-action = hinzufuegen.
    128
          status-data = title-data = auswahldaten.
    129
          <status>-selected = neuer_eintrag.
    130
          REFRESH: extract, vim_delim_entries.
    131
          CLEAR: vim_mainkey, temporal_delimitation_happened.
    132
          TRANSLATE vim_no_mainkey_exists USING vim_no_mkey_not_procsd_patt.
    133
          mark_extract = 0.
    134
          LOOP AT vim_copied_indices.
    135
            READ TABLE total INDEX vim_copied_indices-ix.
    136
            extract = total.
    137
            APPEND extract.
    138
            IF x_header-delmdtflag NE space.
    139
              LOOP AT vim_collapsed_mainkeys.
    140
                check <vim_collapsed_mkey_bfx> = <vim_ext_mkey_beforex>.
    141
    *                             WHERE mkey_bf EQ <vim_ext_mkey_before>.
    142
                IF vim_mkey_after_exists NE space.
    143
                  CHECK <vim_collapsed_key_afx> EQ <vim_ext_mkey_afterx>.
    144
    *              CHECK <vim_collapsed_key_af> EQ <vim_ext_mkey_after>.
    145
                ENDIF.
    146
                READ TABLE excl_cua_funct WITH KEY function = 'EXPA'.
    147
                IF sy-subrc NE 0.
    148
                  APPEND 'EXPA' TO excl_cua_funct.
    149
                  vim_delim_expa_excluded = 'X'.
    150
                ENDIF.
    151
                vim_collapsed_mainkeys-log_key =
    152
                                            vim_collapsed_mainkeys-mkey_bf.
    153
                CLEAR vim_collapsed_mainkeys-mkey_bf.
    154
                MODIFY vim_collapsed_mainkeys. EXIT.
    155
              ENDLOOP.
    156
            ENDIF.
    157
          ENDLOOP.
    158
          vim_coll_mainkeys_beg_ix = 1.
    159
          nextline = 1.
    160
        ENDIF.
    161
        l = 1.
    162
        DESCRIBE TABLE extract LINES maxlines.
    163
      ELSE.
    164
    * Detailbild
    165
        CLEAR <status>-mark_only.          "ufdetail
    166
        IF vim_special_mode NE vim_delimit.
    167
          neuer = 'J'.
    168
          MESSAGE s025(sv).
    169
        ELSE.
    170
          MESSAGE s125(sv).
    171
        ENDIF.
    172
        PERFORM process_detail_screen USING 'C'.
    173
        neuer = 'N'.
    174
        <status>-upd_flag = space.
    175
        IF function NE 'IGN ' AND function NE 'ABR '.
    176
          IF vim_special_mode NE vim_delimit.
    177
    * copy mode
    178
            IF status-mark EQ markiert.
    179
              READ TABLE extract WITH KEY <orig_key> BINARY SEARCH.
    180
              IF sy-subrc EQ 0.
    181
                <xmark> = nicht_markiert.
    182
                MODIFY extract INDEX sy-tabix.
    183
                SUBTRACT 1 FROM mark_extract.
    184
              ENDIF.
    185
            ENDIF.
    186
          ELSE.
    187
    * delimit mode
    188
            IF temporal_delimitation_happened NE space.
    189
              PERFORM after_temporal_delimitation.
    190
            ENDIF.
    191
          ENDIF.
    192
          READ TABLE total WITH KEY <f1_x> BINARY SEARCH.
    193
          extract = total.
    194
    *     IF <STATUS>-DISPL_MODE EQ EXPANDED OR SY-SUBRC NE 0.
    195
          IF x_header-delmdtflag NE space.
    196
            PERFORM check_if_entry_is_to_display USING 'L' <vim_xtotal_key>
    197
                                                       'D' <vim_begdate>.
    198
            IF sy-subrc EQ 0.
    199
              PERFORM check_new_mainkey.
    200
              IF sy-subrc EQ 0.
    201
                READ TABLE vim_collapsed_mainkeys
    202
                 WITH KEY <vim_tot_mkey_beforex>
    203
    *            READ TABLE vim_collapsed_mainkeys WITH KEY <vim_total_key>
    204
                                                 BINARY SEARCH
    205
                                                 TRANSPORTING NO FIELDS.
    206
                <vim_collapsed_keyx> = <vim_xtotal_key>.
    207
    *            vim_collapsed_mainkeys-mainkey = <vim_total_key>.
    208
                <vim_collapsed_mkey_bfx> = <vim_tot_mkey_beforex>.
    209
    *            vim_collapsed_mainkeys-mkey_bf = <vim_tot_mkey_before>.
    210
                INSERT vim_collapsed_mainkeys INDEX sy-tabix.
    211
              ENDIF.
    212
              CLEAR sy-subrc.
    213
            ENDIF.
    214
          ENDIF.
    215
          IF x_header-delmdtflag EQ space OR sy-subrc LT 8.
    216
            READ TABLE extract WITH KEY <vim_xextract_key> BINARY SEARCH
    217
             TRANSPORTING NO FIELDS.       "UF 333778/1999
    218
            CASE sy-subrc.
    219
              WHEN 0.         "UF 333778/1999, for temporal delimitation
    220
                MODIFY extract INDEX sy-tabix.
    221
              WHEN 4.
    222
                INSERT extract INDEX sy-tabix.
    223
              WHEN 8.
    224
                APPEND extract.
    225
            ENDCASE.
    226
            MOVE: sy-tabix TO exind,
    227
                  sy-tabix TO nextline.
    228
          ENDIF.
    229
          IF looplines GT 0.
    230
            IF nextline LE firstline.
    231
              dum1 = ( firstline - nextline ) / looplines.
    232
              ADD 1 TO dum1.
    233
              DO dum1 TIMES.
    234
                firstline = firstline - looplines + 1.
    235
              ENDDO.
    236
              IF firstline LE 0. firstline = 1. ENDIF.
    237
            ELSE.
    238
              dum1 = firstline + looplines - 1.
    239
              IF nextline GT dum1.
    240
                dum1 = ( nextline - firstline ) / looplines.
    241
                DO dum1 TIMES.
    242
                  firstline = firstline + looplines - 1.
    243
                ENDDO.
    244
              ENDIF.
    245
            ENDIF.
    246
            l = nextline - firstline + 1.
    247
          ELSE.
    248
            l = nextline.
    249
          ENDIF.
    250
          MOVE: firstline TO <status>-firstline,
    251
                l         TO <status>-cur_line.
    252
          DESCRIBE TABLE extract LINES maxlines.
    253
        ENDIF.
    254
        MOVE: stat TO status-data,
    255
              stat TO title-data.
    256
      ENDIF.
    257
      REFRESH vim_copied_indices.
    258
      SUBTRACT 1 FROM vim_copy_call_level.
    259
      IF vim_special_mode NE vim_delimit.
    260
        MESSAGE s014(sv) WITH counter.
    261
      ELSE.
    262
        IF counter EQ 1.
    263
          MESSAGE s122(sv).
    264
        ELSE.
    265
          MESSAGE s123(sv) WITH counter.
    266
        ENDIF.
    267
      ENDIF.
    268
      status-action = aendern.
    269
      IF title-action NE hinzufuegen.
    270
        title-action = aendern.
    271
      ENDIF.
    272
      CLEAR vim_old_viewkey.
    273
      TRANSLATE vim_no_mainkey_exists USING vim_no_mkey_not_procsd_patt.
    274
      IF function EQ 'ABR '.
    275
        vim_next_screen = liste. vim_leave_screen = 'X'.
    276
      ELSEIF function NE 'IGN '.
    277
        IF vim_special_mode EQ vim_delimit AND status-mode EQ detail_bild.
    278
          function = 'DETA'.
    279
        ELSE.
    280
          CLEAR function.
    281
        ENDIF.
    282
      ENDIF.
    283
    ENDFORM.