Function Group SAPLSZA1
Use
The function group contains function modules for using address maintenance standard dialogs flexibly in applications.
The address maintenance dialog is available as a dialog box, a subscreen, or a full screen (like a transaction).
The use of the various dialog types is described below.
The function module ADDR_DIALOG_PREPARE controls the field selection, certain key words, and the exclusion of functions, application- specifically for all dialog techniques.
The function modules ADDR_NUMBER_GET, ADDR_MEMORY_SAVE, and ADDR_MEMORY_CLEAR are to be used for saving and getting numbers (= registering first reference) when including subscreens and dialog boxes. For further information see the documentation of function group SZA0 or the function modules.
The registration or deletion of other references has to occur with the function modules ADDR_REFERENCE_INSERT and ADDR_REFERENCE_DELETE, irespective of the dialog technique used. Further information is in the SZA0 or function module documentation.
Which dialog technique?
Subscreen - if the address is an integral or central part of an application object and is usually maintained;
Dialog box - if the address is one application object attribute among others and the maintenance is optional;
Fullscreen - if the addresses are entered without reference to a concrete application object, and may be assigned later.
Features of Full Screen
The maintenance dialog can be called using the parameterized transaction SADR (without parameterization such as field selection).
Specify an address group. An address group must be specified. New SAP standard address groups are put in the control table TSAD7 by the person responsible for the table at SAP (name conventions); customers can then make entries in the customer namespace.
If application-specific parameterization is required, the function module ADDR_DIALOG_PREPARE should first be called, followed by the function module ADDR_SELECT_FOR_DIALOG, instead.
The address dialog saves and gets numbers, as the application has no reference to the address number at creation.
Features of Popup
Integration into the application using the function module ADDR_DIALOG.
The application has to use the function modules ADDR_ENQUEUE and ADDR_DEQUEUE to lock and unlock addresses.
Saving, getting numbers, and registering, or deleting references: see above
Features of Subscreen
Use in the main screen: In the fullscreen editor: Reserve an area <subscreen> of the static size of the screen SAPLSZA1 0300 (50 lines) in the main screen for the address subscreen. If the size of the area is too small, the bottom lines in the subscreen may be cut off at runtime, as the whole screen is first assembled statically and then compressed. Flow logic: CALL SUBSCREEN <subscreen> INCLUDING 'SAPLSZA1' '0300' and call function modules ADDR_EXP_SUBSCREEN, ADDR_IMP_SUBSCREEN, ADDR_EXIT_SUBSCREEN (see example below).
Saving, getting numbers, and registering, or deleting references: see above
The status SAPLSZA1 ADDR0300, which can also be used in the main menu, if there is a menu entry free, is the address management function code reference. The status cannot currently be included as a submenu for technical reasons.
The function module ADDR_EXP_SUBSCREEN must be called before the call of the host screen (possibly also in main screen PBO where the calling program may be able to react better to exceptions).
The function module ADDR_EXIT_SUBSCREEN must be called in a PAI module at event AT EXIT-COMMAND (Cancel, F12) to determine whether unsaved data exist in the address management, and to tell the address subscreen to continue with the unchecked data if the user has cancelled the POPUP_TO_CONFIRM_LOSS_OF_DATA confirmation prompt.
The main screen OK code must be passed to the subscreen in PAI before it is processed if it is relevant for the address subscreen.
The function module ADDR_SUBSCREEN_SET_OKCODE must be called for this at the start of PAI.
The OK codes for the address subscreen all begin with the dollar sign '$'.
The OK code $CHC (for 'CHECK') must also be passed to the function module ADDR_SUBSCREEN_SET_OKCODE whenever a general data check is to be made. This always applies, for example, for Enter (check, refresh, continue, copy), but also for most main object processing functions, which can usually only proceed when all checks including the address check were successful.
The address is checked implicitly at all other $ OK codes in the address subscreen.
The function module ADDR_IMP_SUBSCREEN, which returns information from the subscreen to the application, must be called in a PAI module, after processing the subscreen.
The parameter ERROR_IN_ADDRESS_DATAW is important for the dialog flow. The value 'X' for this flag means that the address check found an error, which is output by the address subscreen with an S message. In this case, the application program must process the screen again, without PAI processing (e.g. "SET SCREEN SY-DYNNR. LEAVE SCREEN." in the PAI module).
The application has to use the function modules ADDR_ENQUEUE and ADDR_DEQUEUE to lock and unlock addresses.
Undo functions, for example, for processing other applications without saving first in the main screen, or processing several screens of the same type of objects, must be realized by the application using the function modules ADDR_MEMORY_PUSH, ADDR_MEMORY_POP and ADDR_MEMORY_RESTORE.
Prerequisites
The central address management terms are described in the documentation of the function group SZA0.
Output
Aufruf ADDR_EXP_SUBSCREEN vor Aufruf des Trägerdynpros (z.B im PAI des Vorgängerdynpros)
PROCESS BEFORE OUTPUT. "Trägerdynpro MODULE PBO_MODULE.
CALL SUBSCREEN SUB1 INCLUDING 'SAPLSZA1' '0300'.
*
PROCESS AFTER INPUT.
MODULE EXIT_MODULE AT EXIT-COMMAND. "Aufruf ADDR_EXIT_SUBSCREEN
MODULE SET_OK_CODE. " Aufruf ADDR_SUBSCREEN_SET_OKCODE
CALL SUBSCREEN SUB1.
MODULE PAI_MODULE. " Aufruf ADDR_IMP_SUBSCREEN