1 |
2 |
3 |
4 |
5 |
6 | FORM collapse USING value(c_begin_ix) TYPE i value(c_end_ix) TYPE i. |
7 | LOCAL: extract. |
8 | DATA: first(1) TYPE c VALUE 'X', hf_ind TYPE i, hf_ind2 TYPE i, |
9 | act_ix TYPE i. |
10 | |
11 | LOOP AT total. |
12 | act_ix = sy-tabix. |
13 | PERFORM select USING <status>-selected. |
14 | CHECK sy-subrc EQ 0. |
15 | CHECK <vim_tot_mkey_beforeX> EQ <vim_mkey_beforeX> AND |
16 | ( vim_mkey_after_exists EQ space OR |
17 | <vim_tot_mkey_afterx> EQ <vim_mkey_afterx> ). |
18 |
19 |
20 |
21 | IF first NE space. |
22 |
23 | <vim_collapsed_keyx> = <vim_xtotal_key>. |
24 |
25 | if <vim_collapsed_mkey_bfx> ne <vim_tot_mkey_beforex>. |
26 | <vim_collapsed_mkey_bfx> = <vim_tot_mkey_beforex>. |
27 |
28 | endif. |
29 | hf_ind = act_ix. |
30 | CLEAR first. |
31 | ENDIF. |
32 |
33 | |
34 | IF x_header-delmdtflag EQ 'E'. |
35 | CHECK <vim_begdate> LE sy-datum AND |
36 | <vim_enddate> GE sy-datum. |
37 | ELSE. |
38 | CHECK <vim_begdate> GE sy-datum AND |
39 | <vim_enddate> LE sy-datum. |
40 | ENDIF. |
41 | <vim_collapsed_keyx> = <vim_xtotal_key>. |
42 |
43 | if <vim_collapsed_mkey_bfx> ne <vim_tot_mkey_beforex>. |
44 | <vim_collapsed_mkey_bfx> = <vim_tot_mkey_beforex>. |
45 | endif. |
46 |
47 |
48 |
49 | |
50 |
51 | hf_ind = act_ix. |
52 | EXIT. |
53 | ENDLOOP. |
54 | READ TABLE vim_collapsed_mainkeys |
55 | with key <vim_collapsed_keyx> |
56 |
57 | BINARY SEARCH |
58 | TRANSPORTING NO FIELDS. |
59 | INSERT vim_collapsed_mainkeys INDEX sy-tabix. |
60 | vim_delim_entries-index1 = hf_ind. |
61 | vim_delim_entries-index2 = c_begin_ix. |
62 | vim_delim_entries-index3 = c_begin_ix. |
63 | vim_delim_entries-index_corr = 'X'. |
64 | APPEND vim_delim_entries. |
65 | hf_ind2 = c_begin_ix + 1. |
66 | CLEAR vim_delim_entries. |
67 | LOOP AT extract FROM hf_ind2 TO c_end_ix. |
68 | vim_delim_entries-index3 = sy-tabix. |
69 | APPEND vim_delim_entries. |
70 | ENDLOOP. |
71 | CLEAR vim_old_viewkey. |
72 | TRANSLATE vim_no_mainkey_exists USING vim_no_mkey_not_procsd_patt. |
73 | ENDFORM. "collapse |