The After_Window_Key_Generation user exit is invoked after window keys have been generated and before the Duplicate Check routine. You use this user exit to check the completeness of window keys to ensure an efficient search routine. For example, winkey03 comprises up to four characters from the city name and up to four characters from the street name. You can use this user exit to verify that the window key has at least one character from each element, and to ignore records when the condition is not met. The figure below illustrates this example.
The AFTER_WINDOW_KEY_GENERATION user exit can also be used to check the completeness of generated window keys. For example, window key 03 is defined with four characters of city name and four characters of street name. This window key should only be used when both address elements exist, otherwise it should be deleted and not used to initiate a search. Figure illustrates example logic for this use of the AFTER_WINDOW_KEY_GENERATION user ext.
LOOP AT ch_t_winkey INTO l_winkey.
CASE l_winkey-windowkeyid.
WHEN '03'. "Check for city & street name
IF I_winkey-windowkey+0(1) IS INITIAL
OR l_winkey-windowkey+4(1) IS INITIAL.
DELETE ch_t_winkey WHERE windowkeyid = '03'.
ENDIF.
ENDCASE.
ENDLOOP.
where:
-
I_winkey_windowkey+0(1)
is the first character of the city element used for the window key generation. -
I_winkey_windowkey+4(1)
is the first character of the street element used for the window key generation.