Properties SourceCde
txt
1
*---------------------------------------------------------------------*
2
*       FORM SET_POSITION_INFO                                        *
3
*---------------------------------------------------------------------*
4
* fill position info                                                  *
5
*---------------------------------------------------------------------*
6
* SPI_POSITION      ---> current position                             *
7
* SPI_ENTRIES       ---> total number of entries                      *
8
* VIM_POSITION_INFO <--- (global) string filled with position info    *
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
* XB 585898B
31
* call methode to caculat the visible length of vim_position_info
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
*      EXCEPTIONS
39
*        INVALID_TEXT_ENVIROMENT = 1
40
*        others                  = 2
41
        .
42
    IF sy-subrc <> 0.
43
*     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
44
*                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
45
    ENDIF.
46
 
47
*    HF2 = VIM_POSITION_INFO_LEN - STRLEN( VIM_POSITION_INFO ).
48
    HF2 = VIM_POSITION_INFO_LEN - P_VIM_POSITION_INFO_LEN.
49
* XB 585898E
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