Properties SourceCde
txt
1
*&--------------------------------------------------------------------*
2
*&      Form  TIME_DEPENDENT_DISPLAY_MODIF.                           *
3
*&--------------------------------------------------------------------*
4
* process display modification (collapse/expand)                      *
5
*&--------------------------------------------------------------------*
6
FORM time_dependent_display_modif.
7
  DATA: ex_ix TYPE i, modif_mode(1) TYPE c, first(1) TYPE c,
8
        ex_begin TYPE i, ex_end TYPE i, key_safe TYPE vrsdat1000,
9
        to_ix TYPE i, rc like sy-subrc.
10
  READ TABLE extract INDEX nextline.
11
  key_safe = <vim_xextract_key>.
12
  CLEAR vim_mainkey.
13
  TRANSLATE vim_no_mainkey_exists USING vim_no_mkey_not_procsd_patt.
14
  LOOP AT extract.
15
    ex_ix = sy-tabix.
16
    IF vim_no_mainkey_exists EQ vim_no_mkey_not_procsd OR
17
       <vim_ext_mkey_beforex> NE <vim_mkey_beforex> OR
18
       ( vim_mkey_after_exists NE space AND
19
         <vim_ext_mkey_afterx> NE <vim_mkey_afterx> ).
20
*       <vim_ext_mkey_before> NE <vim_mkey_before> OR
21
*       ( vim_mkey_after_exists NE space AND
22
*         <vim_ext_mkey_after> NE <vim_mkey_after> ).
23
      ex_end = sy-tabix - 1.
24
      IF modif_mode EQ 'C'.
25
        PERFORM collapse USING ex_begin ex_end.
26
        modif_mode = 'X'.
27
      ENDIF.                           "modif_mode eq collapse
28
      ex_begin = ex_ix.
29
      <vim_h_mkey> = <vim_xextract_key>.
30
*      vim_mainkey = <vim_extract_key>.
31
      TRANSLATE vim_no_mainkey_exists USING vim_no_mkey_procsd_patt.
32
    ENDIF.                             "new mainkey in extract.
33
    CHECK <xmark> EQ markiert.
34
    READ TABLE total WITH KEY <vim_xextract_key> BINARY SEARCH.
35
    <mark> = nicht_markiert. SUBTRACT 1 FROM mark_total.
36
    MODIFY total INDEX sy-tabix.
37
    SUBTRACT 1 FROM mark_extract.
38
    IF modif_mode CO ' X'.
39
      rc = 4.
40
      LOOP AT vim_collapsed_mainkeys.
41
        check <vim_collapsed_mkey_bfx> = <vim_mkey_beforex>.
42
*      WHERE mkey_bf EQ <vim_mkey_before>.
43
        IF vim_mkey_after_exists NE space.
44
          CHECK <vim_collapsed_key_afx> EQ <vim_mkey_afterx>.
45
        ENDIF.
46
        DELETE vim_collapsed_mainkeys.
47
        clear rc.
48
        EXIT.
49
      ENDLOOP.
50
      IF rc EQ 0.
51
* entry in collapsed mode -> expand
52
        modif_mode = 'E'.
53
      ELSE.
54
* entry in expanded mode -> collapse
55
        modif_mode = 'C'.
56
      ENDIF.
57
    ENDIF.
58
    IF modif_mode = 'E'.
59
      CLEAR vim_delim_entries.
60
      vim_delim_entries-index3 = ex_ix.
61
      APPEND vim_delim_entries.
62
      CLEAR vim_delim_entries-index3.
63
      vim_delim_entries-index_corr = 'X'.
64
      LOOP AT total.
65
        CHECK <vim_tot_mkey_beforex> EQ <vim_mkey_beforex> AND
66
              ( vim_mkey_after_exists EQ space OR
67
                <vim_tot_mkey_afterx> EQ <vim_mkey_afterx> ).
68
*        CHECK <vim_tot_mkey_before> EQ <vim_mkey_before> AND
69
*              ( vim_mkey_after_exists EQ space OR
70
*                <vim_tot_mkey_after> EQ <vim_mkey_after> ).
71
        to_ix = sy-tabix.
72
        PERFORM select USING <status>-selected.
73
        CHECK sy-subrc EQ 0.
74
        vim_delim_entries-index1 = to_ix.
75
        vim_delim_entries-index2 = ex_ix.
76
        APPEND vim_delim_entries.
77
      ENDLOOP.
78
      modif_mode = 'X'.
79
    ENDIF.
80
  ENDLOOP.
81
  IF modif_mode EQ 'C'.
82
    CLEAR vim_delim_entries.
83
    PERFORM collapse USING ex_begin maxlines.
84
  ENDIF.
85
  PERFORM after_temporal_delimitation.
86
  <vim_xextract_key> = key_safe.
87
  READ TABLE extract WITH KEY <vim_ext_mkey_beforex>.
88
*  READ TABLE extract WITH KEY <vim_ext_mkey_before>.
89
  IF sy-subrc EQ 0.
90
    nextline = sy-tabix.
91
  ELSE.
92
    nextline = 1.
93
  ENDIF.
94
* ENDIF.
95
ENDFORM.                               "time_dependent_display_modif