1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | FORM SET_POSITION_INFO USING VALUE(SPI_POSITION) TYPE I |
11 | VALUE(SPI_ENTRIES) TYPE I. |
12 | DATA: HF1 TYPE I, HF2 TYPE I, HF3 TYPE I, |
13 | P_VIM_POSITION_INFO_LEN TYPE I. |
14 | |
15 | MOVE VIM_POSITION_INFO_MASK TO VIM_POSITION_INFO. |
16 | HF1 = VIM_POSITION_INFO_LG1 + 1. |
17 | IF SPI_ENTRIES EQ 0. |
18 | HF3 = 0. |
19 | ELSE. |
20 | HF3 = SPI_POSITION. |
21 | ENDIF. |
22 | WRITE HF3 TO |
23 | VIM_POSITION_INFO+HF1(VIM_POSITION_INFO_LG3) NO-SIGN. |
24 | HF1 = VIM_POSITION_INFO_LG1 + VIM_POSITION_INFO_LG2 |
25 | + VIM_POSITION_INFO_LG3 + 3. |
26 | WRITE SPI_ENTRIES TO |
27 | VIM_POSITION_INFO+HF1(VIM_POSITION_INFO_LG3) NO-SIGN. |
28 | DO. |
29 | CONDENSE VIM_POSITION_INFO. |
30 |
31 |
32 | CALL METHOD cl_scp_linebreak_util=>get_visual_stringlength |
33 | EXPORTING |
34 | im_string = VIM_POSITION_INFO |
35 | IM_LANGU = SY-LANGU |
36 | IMPORTING |
37 | EX_POS_VIS = P_VIM_POSITION_INFO_LEN |
38 |
39 |
40 |
41 | . |
42 | IF sy-subrc <> 0. |
43 |
44 |
45 | ENDIF. |
46 | |
47 |
48 | HF2 = VIM_POSITION_INFO_LEN - P_VIM_POSITION_INFO_LEN. |
49 |
50 | |
51 | IF HF2 GT 0. |
52 | SHIFT VIM_POSITION_INFO RIGHT BY HF2 PLACES. |
53 | ENDIF. |
54 | IF HF2 GE 0. EXIT. ENDIF. |
55 | HF1 = STRLEN( SVIM_TEXT_028 ). |
56 | REPLACE SVIM_TEXT_028 LENGTH HF1 WITH '/' INTO VIM_POSITION_INFO. |
57 | IF SY-SUBRC NE 0. |
58 | HF1 = STRLEN( SVIM_TEXT_027 ) + HF2 - 1. |
59 | IF HF1 GT 0. |
60 | WRITE '.' TO VIM_POSITION_INFO+HF1(1). |
61 | ADD 1 TO HF1. HF2 = - HF2. |
62 | WRITE ' ' TO VIM_POSITION_INFO+HF1(HF2). |
63 | ELSE. |
64 | EXIT. |
65 | ENDIF. |
66 | ENDIF. |
67 | ENDDO. |
68 | ENDFORM. "set_position_info |