1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 | FORM vim_get_trspkeylen USING p_tabname TYPE tabname |
14 | CHANGING p_keylength TYPE syfleng. |
15 | |
16 | TYPES: BEGIN OF tabkeylen_type, |
17 | tabname TYPE tabname, |
18 | keylen TYPE syfleng, |
19 | END OF tabkeylen_type. |
20 | STATICS: tabkeylen_tab TYPE HASHED TABLE OF tabkeylen_type |
21 | WITH UNIQUE KEY tabname. |
22 | DATA: w_tabkeylen TYPE tabkeylen_type, |
23 | x030l_wa TYPE x030l. |
24 | |
25 | READ TABLE tabkeylen_tab INTO w_tabkeylen |
26 | WITH TABLE KEY tabname = p_tabname. |
27 | IF sy-subrc <> 0. |
28 | CALL FUNCTION 'DDIF_NAMETAB_GET' |
29 | EXPORTING |
30 | tabname = p_tabname |
31 | IMPORTING |
32 | x030l_wa = x030l_wa. |
33 | w_tabkeylen-tabname = p_tabname. |
34 | w_tabkeylen-keylen = x030l_wa-keylen. |
35 | IF p_tabname = x_header-texttab AND x_header-genertxtrp <> space. |
36 | w_tabkeylen-keylen = x_header-maxtrtxkln. |
37 | ELSEIF x_header-generictrp <> space. |
38 | w_tabkeylen-keylen = x_header-maxtrkeyln. |
39 | ENDIF. |
40 | INSERT w_tabkeylen INTO TABLE tabkeylen_tab. |
41 | ENDIF. |
42 | p_keylength = w_tabkeylen-keylen. |
43 | ENDFORM. " vim_get_trspkeylen |
44 | |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | FORM vim_get_bc_keylen USING p_tabname TYPE tabname |
55 | CHANGING p_keylength TYPE syfleng. |
56 | |
57 | CONSTANTS max_bc_keylen TYPE i VALUE 255. |
58 | |
59 | TYPES: BEGIN OF tabkeylen_type, |
60 | tabname TYPE tabname, |
61 | keylen TYPE syfleng, |
62 | END OF tabkeylen_type. |
63 | STATICS: tabkeylen_tab TYPE HASHED TABLE OF tabkeylen_type |
64 | WITH UNIQUE KEY tabname. |
65 | DATA: w_tabkeylen TYPE tabkeylen_type, |
66 | x030l_wa TYPE x030l, max_keylen_byte TYPE i. |
67 | |
68 | READ TABLE tabkeylen_tab INTO w_tabkeylen |
69 | WITH TABLE KEY tabname = p_tabname. |
70 | IF sy-subrc <> 0. |
71 | CALL FUNCTION 'DDIF_NAMETAB_GET' |
72 | EXPORTING |
73 | tabname = p_tabname |
74 | IMPORTING |
75 | x030l_wa = x030l_wa. |
76 | w_tabkeylen-tabname = p_tabname. |
77 | w_tabkeylen-keylen = x030l_wa-keylen. |
78 | max_keylen_byte = max_bc_keylen * cl_abap_char_utilities=>charsize. |
79 | IF w_tabkeylen-keylen > max_keylen_byte. |
80 | w_tabkeylen-keylen = max_keylen_byte. |
81 | ENDIF. |
82 | INSERT w_tabkeylen INTO TABLE tabkeylen_tab. |
83 | ENDIF. |
84 | p_keylength = w_tabkeylen-keylen. |
85 | ENDFORM. " vim_get_bc_keylen |