1 |
2 |
3 |
4 |
5 |
6 |
7 |
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 |
27 |
28 |
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 |
38 |
39 |
40 |
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 |
51 |
52 |
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 |
59 | if <vim_collapsed_mkey_bfx> NE <vim_tot_mkey_beforex>. |
60 | <vim_collapsed_mkey_bfx> = <vim_tot_mkey_beforex>. |
61 | endif. |
62 |
63 |
64 |
65 | ENDIF. |
66 | ENDIF. |
67 |
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 |
80 | if <vim_collapsed_mkey_bfx> NE <vim_tot_mkey_beforex>. |
81 | <vim_collapsed_mkey_bfx> = <vim_tot_mkey_beforex>. |
82 | endif. |
83 |
84 | |
85 |
86 |
87 | ENDIF. |
88 | ENDIF. |
89 | |
90 | ENDFORM. "build_mainkey_tab_1 |