Eigenschaften | Quelltext
Titel | LISTE_LOESCHE |
Originalsprache | DE | Deutsch
Erstellt | 27.10.1998 |  | SAP |
Letzte Änderung | 01.07.2002 |  | SAP |
Status | aktiv |
Attribute
Typ | Include-Programm |
Status | Testprogramm |
Anwendung | Basis (System) |
Paket | SVIM | Basis Viewmaintenance
| Editorsperre
txt
    1
    *---------------------------------------------------------------------*
    2
    *       FORM LISTE_LOESCHE                                            *
    3
    *---------------------------------------------------------------------*
    4
    *       ........                                                      *
    5
    *---------------------------------------------------------------------*
    6
    FORM liste_loesche.
    7
      DATA: rec LIKE sy-subrc,
    8
            delete_fix_value(1) TYPE c,
    9
            entry_contains_fix_val(1) TYPE c,
    10
            w_field TYPE vimty_fields_type,
    11
            bc_fix_del_info_sent(1) TYPE c VALUE ' '.
    12
    13
      READ TABLE extract INDEX firstline.
    14
      IF x_header-delmdtflag <> space.
    15
        <vim_h_old_mkey>(x_header-keylen) = <vim_xextract_key>.
    16
      ENDIF.
    17
    *  vim_old_viewkey = <vim_extract_key>.
    18
      counter = 0.
    19
      LOOP AT extract.
    20
        CHECK <xmark> EQ markiert.
    21
    *   -------Authority check before deleting fix values from BC-Sets------
    22
        delete_fix_value = vim_bc_chng_allowed.
    23
        IF vim_bc_chng_allowed = space.  "fix field changeability forced
    24
          READ TABLE vim_bc_entry_list INTO vim_bc_entry_list_wa
    25
          WITH TABLE KEY viewname = x_header-viewname
    26
          keys = <vim_xextract_key>.
    27
          IF sy-subrc = 0.
    28
            CLEAR entry_contains_fix_val.
    29
            LOOP at vim_bc_entry_list_wa-fields into w_field.
    30
              IF w_field-flag = vim_profile_fix.
    31
                entry_contains_fix_val = 'X'.
    32
              ENDIF.
    33
            ENDLOOP.
    34
            IF entry_contains_fix_val = 'X'.
    35
              IF bc_fix_del_info_sent EQ SPACE AND
    36
                 <status>-bcfixdelinfosent NE 'Y'."HCG: del dependent VCL
    37
                bc_fix_del_info_sent = 'X'.
    38
                <status>-bcfixdelinfosent = 'X'.
    39
                MESSAGE i177(SV).
    40
              ENDIF.
    41
            ELSE.
    42
              delete_fix_value = 'X'.
    43
            ENDIF.
    44
          ELSE.
    45
            delete_fix_value = 'X'.
    46
          ENDIF.
    47
        ENDIF.
    48
        CHECK delete_fix_value EQ 'X'.
    49
    *   -------------------------------------------------------------"HCG---
    50
        READ TABLE total WITH KEY <vim_xextract_key> BINARY SEARCH.
    51
        rec = sy-tabix.
    52
        IF x_header-existency EQ 'M'.      "no mainkey delete allowed
    53
          PERFORM check_if_entry_can_be_deleted.
    54
          IF sy-subrc NE 0.
    55
            <xmark> = uebergehen. ignored_entries_exist = 'X'.
    56
            MODIFY extract.
    57
            <mark> = uebergehen.
    58
            MODIFY total INDEX rec.
    59
            CONTINUE.
    60
          ENDIF.
    61
        ENDIF.
    62
        PERFORM delete_check_keyrange.
    63
        CASE sy-subrc.
    64
          WHEN 0.
    65
          WHEN 4. CONTINUE.
    66
          WHEN 8. EXIT.
    67
        ENDCASE.
    68
        counter = counter + 1.
    69
        PERFORM logical_delete_from_total USING rec.
    70
        IF x_header-delmdtflag NE space.
    71
          IF vim_special_mode NE vim_upgrade.
    72
            PERFORM check_if_entry_is_to_display USING 'L' <vim_xtotal_key>
    73
                                                       space <vim_begdate>.
    74
          ELSE.
    75
            CLEAR sy-subrc.
    76
          ENDIF.
    77
          CASE sy-subrc.
    78
            WHEN 0. DELETE extract.
    79
            WHEN 4.
    80
              <f1_x> = <vim_xtotal_key>. CLEAR <vim_enddate_mask>.
    81
              <vim_h_old_mkey>(x_header-keylen) = <f1_x>.
    82
    *          vim_old_viewkey = <f1>.
    83
              <vim_h_mkey> = <vim_xtotal_key>.
    84
    *          vim_mainkey = <vim_total_key>.
    85
              rec = 8.
    86
              LOOP AT total.
    87
                PERFORM select USING <status>-selected.
    88
                CHECK sy-subrc EQ 0.
    89
                CHECK <vim_tot_mkey_beforex> EQ <vim_f1_beforex> AND
    90
                   ( vim_mkey_after_exists EQ space OR
    91
                   <vim_tot_mkey_afterx> EQ <vim_f1_afterx> ). "same mainkey
    92
    *            CHECK <vim_tot_mkey_before> EQ <vim_f1_before> AND
    93
    *                  ( vim_mkey_after_exists EQ space OR
    94
    *                    <vim_tot_mkey_after> EQ <vim_f1_after> ).
    95
                extract = total.
    96
                PERFORM mod_extract_and_mainkey_tab USING 'M' 0.
    97
                CLEAR rec.
    98
                EXIT.
    99
              ENDLOOP.
    100
              IF rec NE 0.
    101
                DELETE extract.
    102
              ENDIF.
    103
          ENDCASE.
    104
        ELSE.
    105
          DELETE extract.
    106
        ENDIF.
    107
        mark_total  = mark_total - 1.
    108
        mark_extract = mark_extract - 1.
    109
      ENDLOOP.
    110
      CHECK vim_special_mode NE vim_upgrade.
    111
      DESCRIBE TABLE extract LINES maxlines.
    112
      IF status-action EQ hinzufuegen.
    113
        SUBTRACT nbr_of_added_dummy_entries FROM maxlines.
    114
      ENDIF.
    115
      IF ignored_entries_exist EQ space AND maxlines GT 0.
    116
        MESSAGE s011(sv) WITH counter.
    117
      ELSE.
    118
        MESSAGE i011(sv) WITH counter.
    119
      ENDIF.
    120
      IF x_header-delmdtflag <> space.
    121
        <f1_x> = <vim_h_old_mkey>.
    122
      ENDIF.
    123
    *  <f1> = vim_old_viewkey.
    124
      READ TABLE extract WITH KEY <f1_x>.
    125
      IF sy-subrc NE 8.
    126
        rec = firstline + looplines - 1.
    127
        IF sy-tabix GT rec OR nextline GT maxlines.
    128
          nextline = sy-tabix.
    129
        ENDIF.
    130
      ELSE.
    131
        nextline = 1.
    132
      ENDIF.
    133
      IF maxlines EQ 0 AND status-action EQ hinzufuegen.
    134
        status-action = aendern.
    135
        title-action = aendern.
    136
        l = 1. o = 0.
    137
      ENDIF.
    138
      CLEAR vim_old_viewkey.
    139
      TRANSLATE vim_no_mainkey_exists USING vim_no_mkey_not_procsd_patt.
    140
    ENDFORM.