1 |
2 |
3 |
4 |
5 |
6 | FORM vim_address_keytab_entries USING value(vake_action) TYPE c |
7 | vake_rc TYPE i. |
8 | STATICS: sadr2_keylen type syfleng. |
9 | DATA: rc1 LIKE sy-subrc, x030l_wa type x030l. |
10 | |
11 | if sadr2_keylen is initial. |
12 | CALL FUNCTION 'DDIF_NAMETAB_GET' |
13 | EXPORTING |
14 | tabname = 'SADR2' |
15 | IMPORTING |
16 | X030L_WA = x030l_wa |
17 | EXCEPTIONS |
18 | OTHERS = 2. |
19 | IF sy-subrc = 0. |
20 | sadr2_keylen = x030l_wa-keylen / cl_abap_char_utilities=>charsize. |
21 | else. |
22 | RAISE nametab_get_failed. |
23 | ENDIF. |
24 | endif. |
25 | SELECT SINGLE * FROM sadr WHERE adrnr EQ <address_number>. |
26 | IF sy-subrc NE 0. |
27 |
28 | CALL FUNCTION 'ADDR_CONVERT_ADRC_TO_SADR' |
29 | CHANGING |
30 | address_number = <address_number>. |
31 | IF <address_number> NE space. |
32 | SELECT SINGLE * FROM sadr WHERE adrnr EQ <address_number>. |
33 | ELSE. |
34 | EXIT. |
35 | ENDIF. |
36 | ENDIF. |
37 |
38 | vake_rc = 8. |
39 | PERFORM vim_addr_keytab_entries_intern USING 'SADR' sadr |
40 | sadr_keylen |
41 | vake_action rc1. |
42 | IF rc1 EQ 0. |
43 | CLEAR vake_rc. |
44 | ELSE. |
45 | IF vake_action EQ pruefen. |
46 | EXIT. |
47 | ENDIF. |
48 | ENDIF. |
49 | SELECT COUNT(*) FROM sadr2 WHERE adrnr EQ sadr-adrnr. |
50 | CLEAR sadr2. |
51 | MOVE: sadr-mandt TO sadr2-mandt, |
52 | sadr-adrnr TO sadr2-adrnr, |
53 | '*' TO sadr2-stdfl. |
54 | IF sy-dbcnt GT 0. "only if entries exist |
55 | PERFORM vim_addr_keytab_entries_intern USING 'SADR2' sadr2 |
56 | sadr2_keylen |
57 | vake_action rc1. |
58 | IF rc1 EQ 0. |
59 | CLEAR vake_rc. |
60 | ELSE. |
61 | IF vake_action EQ pruefen. |
62 | vake_rc = 8. EXIT. |
63 | ENDIF. |
64 | ENDIF. |
65 | ENDIF. |
66 | SELECT COUNT(*) FROM sadr3 WHERE adrnr EQ sadr-adrnr. |
67 | IF sy-dbcnt GT 0. "only if entries exist |
68 | sadr3 = sadr2. |
69 | PERFORM vim_addr_keytab_entries_intern USING 'SADR3' sadr3 |
70 | sadr2_keylen |
71 | vake_action rc1. |
72 | IF rc1 EQ 0. |
73 | CLEAR vake_rc. |
74 | ELSE. |
75 | IF vake_action EQ pruefen. |
76 | vake_rc = 8. EXIT. |
77 | ENDIF. |
78 | ENDIF. |
79 | ENDIF. |
80 | SELECT COUNT(*) FROM sadr4 WHERE adrnr EQ sadr-adrnr. |
81 | IF sy-dbcnt GT 0. "only if entries exist |
82 | sadr4 = sadr2. |
83 | PERFORM vim_addr_keytab_entries_intern USING 'SADR4' sadr4 |
84 | sadr2_keylen |
85 | vake_action rc1. |
86 | IF rc1 EQ 0. |
87 | CLEAR vake_rc. |
88 | ELSE. |
89 | IF vake_action EQ pruefen. |
90 | vake_rc = 8. EXIT. |
91 | ENDIF. |
92 | ENDIF. |
93 | ENDIF. |
94 | SELECT COUNT(*) FROM sadr5 WHERE adrnr EQ sadr-adrnr. |
95 | IF sy-dbcnt GT 0. "only if entries exist |
96 | sadr5 = sadr2. |
97 | PERFORM vim_addr_keytab_entries_intern USING 'SADR5' sadr5 |
98 | sadr2_keylen |
99 | vake_action rc1. |
100 | IF rc1 EQ 0. |
101 | CLEAR vake_rc. |
102 | ELSE. |
103 | IF vake_action EQ pruefen. |
104 | vake_rc = 8. |
105 | ENDIF. |
106 | ENDIF. |
107 | ENDIF. |
108 | ENDFORM. "vim_address_keytab_entries |