Properties SourceCde
txt
1
*&--------------------------------------------------------------------*
2
*&      Form  AFTER_TEMPORAL_DELIMITATION                             *
3
*&--------------------------------------------------------------------*
4
* fill EXTRACT with new due to temporal delimitation entries          *
5
*---------------------------------------------------------------------*
6
*                                                                     *
7
*&--------------------------------------------------------------------*
8
FORM after_temporal_delimitation.
9
  LOCAL: extract, <table1>.
10
  DATA: index_safe TYPE i, rec TYPE i.
11
  LOOP AT vim_delim_entries WHERE index3 NE space.
12
    DELETE extract INDEX vim_delim_entries-index3.
13
    MOVE vim_delim_entries-index3 TO index_safe.
14
    IF vim_special_mode EQ vim_reset.
15
      SUBTRACT 1 FROM <status>-maxlines.
16
      IF <status>-st_mode EQ detail_bild AND
17
         <status>-cur_line GE vim_delim_entries-index3.
18
        SUBTRACT 1 FROM <status>-cur_line.
19
      ENDIF.
20
    ELSE.
21
      SUBTRACT 1 FROM maxlines.
22
    ENDIF.
23
    IF vim_delim_entries-index1 NE 0.
24
      CLEAR vim_delim_entries-index3.
25
      MODIFY vim_delim_entries.
26
    ENDIF.
27
    LOOP AT vim_delim_entries WHERE index2 GT index_safe
28
                                OR  index3 GT index_safe.
29
      IF vim_delim_entries-index2 GT index_safe.
30
        SUBTRACT 1 FROM vim_delim_entries-index2.
31
      ENDIF.
32
      IF vim_delim_entries-index3 GT index_safe.
33
        SUBTRACT 1 FROM vim_delim_entries-index3.
34
      ENDIF.
35
      MODIFY vim_delim_entries.
36
    ENDLOOP.
37
  ENDLOOP.
38
  CLEAR extract.
39
  LOOP AT vim_delim_entries WHERE index3 EQ space.
40
    READ TABLE total INDEX vim_delim_entries-index1.
41
    MOVE total TO extract.
42
    IF x_header-delmdtflag EQ 'E' AND <vim_begdate> LE sy-datum AND
43
       <vim_enddate> GE sy-datum OR x_header-delmdtflag EQ 'B' AND
44
       <vim_begdate> GE sy-datum AND <vim_enddate> LE sy-datum.
45
      rec = 8.
46
      LOOP AT vim_collapsed_mainkeys.
47
        check <vim_collapsed_mkey_bfx> EQ <vim_tot_mkey_beforex>.
48
*                WHERE mkey_bf EQ <vim_tot_mkey_before>.
49
        IF vim_mkey_after_exists NE space.
50
          CHECK <vim_collapsed_key_afx> EQ <vim_tot_mkey_afterx>.
51
*          CHECK <vim_collapsed_key_af> EQ <vim_tot_mkey_after>.
52
        ENDIF.
53
        READ TABLE extract WITH KEY <vim_collapsed_keyx>
54
*        READ TABLE extract WITH KEY <vim_collapsed_key>
55
                           TRANSPORTING NO FIELDS.
56
        IF sy-subrc EQ 0.
57
          MODIFY extract INDEX sy-tabix. CLEAR rec.
58
        ENDIF.
59
        IF <vim_collapsed_keyx> NE <vim_xtotal_key>.
60
*        IF vim_collapsed_mainkeys-mainkey NE <vim_total_key>.
61
          <vim_collapsed_keyx> = <vim_xtotal_key>.
62
*          vim_collapsed_mainkeys-mainkey = <vim_total_key>.
63
          <vim_collapsed_mkey_bfx> = <vim_tot_mkey_beforex>.
64
*          vim_collapsed_mainkeys-mkey_bf = <vim_tot_mkey_before>.
65
          MODIFY vim_collapsed_mainkeys.
66
        ENDIF.
67
        EXIT.
68
      ENDLOOP.
69
      CHECK rec NE 0.
70
    ELSE.
71
      PERFORM check_if_entry_is_to_display USING 'L' <vim_xtotal_key>
72
                                                 space <vim_begdate>.
73
      CHECK sy-subrc LT 8.
74
    ENDIF.
75
    INSERT extract INDEX vim_delim_entries-index2.
76
    ADD 1 TO maxlines.
77
    MOVE vim_delim_entries-index2 TO index_safe.
78
    LOOP AT vim_delim_entries WHERE index2 GE index_safe.
79
      IF vim_delim_entries-index2 EQ index_safe.
80
        CHECK vim_delim_entries-index_corr NE space.
81
      ENDIF.
82
      ADD 1 TO vim_delim_entries-index2.
83
      MODIFY vim_delim_entries.
84
    ENDLOOP.
85
  ENDLOOP.
86
  REFRESH vim_delim_entries.
87
ENDFORM.                               "after_temporal_delimitation.