Properties SourceCde
txt
1
*&--------------------------------------------------------------------*
2
*&      Form  BUILD_MAINKEY_TAB_1                                     *
3
*&--------------------------------------------------------------------*
4
* build mainkey tab for display modification - part one               *
5
* merge identical entries for same mainkey into one entry
6
* assumptions: TOTAL is sorted ascending by <VIM_TOTAL_KEY>
7
*              Now, with unicode: sorted by <VIM_TOTAL_KEYX>
8
*&--------------------------------------------------------------------*
9
FORM build_mainkey_tab_1.
10
  DATA: date_safe TYPE d, date_safe_1 TYPE d, date_safe_2 TYPE d,
11
        date_safe_3 TYPE d.
12
 
13
  date_safe = <vim_begdate>.           "TOTAL
14
  date_safe_1 = <vim_enddate>.         "TOTAL
15
  date_safe_2 = <vim_new_begdate>.                          "<TABLE1>
16
  date_safe_3 = <vim_enddate_mask>.                         "<TABLE1>
17
  <vim_begdate> = <vim_enddate> = <vim_new_begdate> =
18
                  <vim_enddate_mask> = '99999999'.
19
  IF <vim_xtotal> NE <table1_x>.
20
    MOVE: date_safe   TO <vim_begdate>,
21
          date_safe_1 TO <vim_enddate>,
22
          date_safe_2 TO <vim_new_begdate>,
23
          date_safe_3 TO <vim_enddate_mask>.
24
    IF vim_no_mainkey_exists EQ vim_no_mkey_not_procsd OR
25
       <vim_tot_mkey_beforex> NE <vim_f1_beforex>.
26
*       <vim_tot_mkey_before> NE <vim_f1_before> OR
27
*       ( vim_mkey_after_exists NE space AND
28
*         <vim_tot_mkey_after> NE <vim_f1_after> ).
29
      IF vim_coll_mkeys_first EQ space.
30
        APPEND vim_collapsed_mainkeys.
31
        CLEAR vim_collapsed_mainkeys-log_key.
32
      ELSE.
33
        CLEAR vim_coll_mkeys_first.
34
      ENDIF.
35
      <vim_collapsed_keyx> = <vim_xtotal_key>.
36
      <vim_collapsed_mkey_bfx> = <vim_tot_mkey_beforex>.
37
*      vim_collapsed_mainkeys-mainkey = <vim_total_key>.
38
*      vim_collapsed_mainkeys-mkey_bf = <vim_tot_mkey_before>.
39
* If the position <= 0, the <vim_collapsed_mkey_bfx> shouldn't be
40
* assigned. XB am 27.03.2002 CSN int1332679 2002
41
    ELSEIF vim_mkey_after_exists NE space AND
42
         <vim_tot_mkey_afterx> NE <vim_f1_afterx>.
43
      IF vim_coll_mkeys_first EQ space.
44
        APPEND vim_collapsed_mainkeys.
45
        CLEAR vim_collapsed_mainkeys-log_key.
46
      ELSE.
47
        CLEAR vim_coll_mkeys_first.
48
      ENDIF.
49
      <vim_collapsed_keyx> = <vim_xtotal_key>.
50
*      <vim_collapsed_mkey_bfx> = <vim_tot_mkey_beforex>.
51
*      vim_collapsed_mainkeys-mainkey = <vim_total_key>.
52
*      vim_collapsed_mainkeys-mkey_bf = <vim_tot_mkey_before>.
53
    ELSE.
54
      IF x_header-delmdtflag EQ 'E' AND <vim_begdate> LE sy-datum AND
55
       <vim_enddate> GE sy-datum OR x_header-delmdtflag EQ 'B' AND
56
       <vim_begdate> GE sy-datum AND <vim_enddate> LE sy-datum.
57
        <vim_collapsed_keyx> = <vim_xtotal_key>.
58
* change xb 12.06.02 begin--------------------------------------------
59
        if <vim_collapsed_mkey_bfx> NE <vim_tot_mkey_beforex>.
60
          <vim_collapsed_mkey_bfx> = <vim_tot_mkey_beforex>.
61
        endif.
62
* change xb 12.06.02 ***********************************************
63
*        vim_collapsed_mainkeys-mainkey = <vim_total_key>.
64
*        vim_collapsed_mainkeys-mkey_bf = <vim_tot_mkey_before>.
65
      ENDIF.
66
    ENDIF.
67
* end correction XB am 27.03.2002 CSN int1332679 2002
68
    <table1_x> = <vim_xtotal>.
69
    TRANSLATE vim_no_mainkey_exists USING vim_no_mkey_procsd_patt.
70
  ELSE.
71
    MOVE: date_safe   TO <vim_begdate>,
72
          date_safe_1 TO <vim_enddate>,
73
          date_safe_2 TO <vim_new_begdate>,
74
          date_safe_3 TO <vim_enddate_mask>.
75
    IF x_header-delmdtflag EQ 'E' AND <vim_begdate> LE sy-datum AND
76
      <vim_enddate> GE sy-datum OR x_header-delmdtflag EQ 'B' AND
77
      <vim_begdate> GE sy-datum AND <vim_enddate> LE sy-datum.
78
      <vim_collapsed_keyx> = <vim_xtotal_key>.
79
* change xb 12.06.02 begin--------------------------------------------
80
      if <vim_collapsed_mkey_bfx> NE <vim_tot_mkey_beforex>.
81
        <vim_collapsed_mkey_bfx> = <vim_tot_mkey_beforex>.
82
      endif.
83
* change xb 12.06.02 ***********************************************
84
 
85
*      vim_collapsed_mainkeys-mainkey = <vim_total_key>.
86
*      vim_collapsed_mainkeys-mkey_bf = <vim_tot_mkey_before>.
87
    ENDIF.
88
  ENDIF.
89
 
90
ENDFORM.                               "build_mainkey_tab_1