Show TOC

Implementing a DialogLocate this document in the navigation structure

To provide a dialog for central access to the personalization data, a function module must be implemented with a fixed interface and stored when the key for the personalization object is registered.

FUNCTION BMENU_SETTINGS_EDIT.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     REFERENCE(P_PERS_OBJECT) TYPE REF TO CL_PERS_OBJECT_DATA
*"     REFERENCE(P_VIEW_MODE) TYPE CHAR1
*"  EXCEPTIONS
*"     DIALOG_CANCELED
*"     PERS_OBJECT_ERROR
*"----------------------------------------------------------------------
* clear global data
  clear d215_settings.

* set global structure
  call method p_pers_object->get_data
    exporting
      p_reload_data   = space
    importing
      p_pers_data     = d215_settings
    exceptions
      data_type_error = 1
      no_data_found   = 2
      internal_error  = 3
      others          = 4.

  case sy-subrc.
    when 1 or 3 or 4.
      raise pers_object_error.
  endcase.

* set view mode
  d215_view_mode = p_view_mode.

* call dialog
  call screen 215 starting at 10 5.

  case d215_okcode.
    when okay_command.
*     set object data
      call method p_pers_object->set_data
        exporting
          p_pers_data     = d215_settings
          p_write_through = space
        exceptions
          data_type_error = 1
          internal_error  = 2
          others          = 3.

      if sy-subrc <> 0.
        raise pers_object_error.
      endif.

    when cancel_command.
      raise dialog_canceled.
  endcase.

endfunction.

In the example, the data is read from the personalization object and written in a structure for the screen.

Note

If the dialog is to support the buffering mechanism, the data may not be written directly to the database when they are stored (flag p_write_through must be space).