Properties SourceCde
txt
1
*---------------------------------------------------------------------*
2
*       FORM VIM_ASSIGN_MKEY_AFTER_2                                  *
3
*---------------------------------------------------------------------*
4
* assign symbols to after-date-part of mainkey part 2                 *
5
*---------------------------------------------------------------------*
6
FORM vim_assign_mkey_after_2 USING value(vama2_tabix) TYPE i.
7
  LOCAL:x_namtab.
8
  DATA: vama_ix TYPE i, keylen TYPE i, position TYPE i.
9
  FIELD-SYMBOLS: <x_namtab> TYPE vimnamtab.
10
 
11
  check vim_mkey_after_exists <> space.
12
  vama_ix = vama2_tabix + 1.
13
  READ TABLE x_namtab ASSIGNING <x_namtab> INDEX vama_ix.
14
  vama_ix = x_header-keylen - <x_namtab>-position.
15
  ASSIGN: <vim_xtotal>+<x_namtab>-position(vama_ix)
16
                            TO <vim_tot_mkey_afterx>,
17
          <vim_xextract>+<x_namtab>-position(vama_ix)
18
                            TO <vim_ext_mkey_afterx>.
19
  IF x_header-generictrp <> 'X'.
20
* charlike key or non-unicode-system (FS is only assigned for
21
* downward compatibility).
22
    keylen = x_header-keylen / cl_abap_char_utilities=>charsize.
23
    position = <x_namtab>-position / cl_abap_char_utilities=>charsize.
24
    vama_ix = keylen - position.
25
    ASSIGN: <vim_ctotal>+position(vama_ix)
26
                              TO <vim_tot_mkey_after> TYPE 'C',
27
            <vim_cextract>+position(vama_ix)
28
                              TO <vim_ext_mkey_after> TYPE 'C'.
29
  ELSE.
30
    ASSIGN: <vim_xtotal>+<x_namtab>-position(vama_ix)
31
             TO <vim_tot_mkey_after>,
32
            <vim_xextract>+<x_namtab>-position(vama_ix)
33
             TO <vim_ext_mkey_after>.
34
  ENDIF.
35
ENDFORM.                               "vim_assign_mkey_after_2