Creation of Addresses

Prerequisites

See Maintenance of Addresses.

Process Flow

  1. Define a new handle for the address:
  • Address type 1: An address handle
  • Address type 2: An address and a person handle
  • Address type 3: A person handle (and an address handle if the company address does not yet exist)

The glossary of the documentation for function group SZA0 contains a recommendation concerning the convention according to which you should set up your handle.

  1. If required, lock your application objects and the associated address/person (see also: Notes on Lock Management).
  2. If you use a BAS standard dialog, set the access mode to CREATE when you call the dialog. Otherwise, you use the function module <type>_INSERT that is appropriate for the address type (see function module overview in Working with the BAS). In both cases, you pass the handle that you defined in the first step to the BAS.

    If you want to enter more than one address (before saving the data to the database), start again with step one.

    There are function modules for address type 2 and 3 that you can use to create an entirely new address or maintain additional address data for a person.

    Having entered and checked the address and application data, you convert the address/person handle into an address/person number:

  3. Fill a structure of type ADDR_REF for the where-used list of the address and assign an address number using function module ADDR_NUMBER_GET.
  4. If you use an address of type 2 or 3, also fill a structure of type PERS_REF for the where-used list of the person. You assign the person number using function module ADDR_PERSON_NUMBER_GET.

    You now update the address data together with the application data.

  5. Fill the fields that contain the address/person references (in your application table) with the numbers assigned and save your application data.
  6. If on account of your dialog handling, you can change only one address, call function module ADDR_SINGLE_SAVE. In all other cases, you have to use function module ADDR_MEMORY_SAVE. Then use COMMIT WORK to update the address data together with the application data.

    You can use function modules ADDR_MEMORY_PUSH, ADDR_MEMORY_POP and ADDR_MEMORY_RESTORE to implement an undo function. You use ADDR_MEMORY_CLEAR to initialize the local memory.

  7. If you have set any locks in the second step, do not forget to remove them.

Result

Depending on the address type, you find the saved address records and the associated where-used lists in the corresponding tables.