Setting Initial Default Values for the Configuration Dialog

Use

For an initial default value to be available at runtime, it must be retrieved when the CHIP is started. To do this, you need an outport event that can be fired when the CHIP is initialized. For this you need interface IF_CHIP_API.

Procedure

Implementing Interface IF_CHIP_API to Fire Event to Save Default Values

  1. To implement interface IF_CHIP_API, choose Change in the context menu of your Web Dynpro component, and then choose tab Implemented Interfaces.

  2. Choose the name IF_CHIP_API and save it.

  3. Choose button Reimplement, which is now visible in column Action.

    After the interface has been activated, there are two new methods available in the component controller:

    • CHIP_DO_INIT

    • CHIP_DO_EXIT

    You need method CHIP_DO_INIT to fire the outport event with which the default values for the CHIP are set.

  4. Go to method CHIP_DO_INIT and set the default values you want.

  5. Open the Web Dynpro code wizard, choose Method Call in Current Controller, and select the relevant event handler method.

  6. Pass the parameter value to this method.

Creating an Outport with an Appropriate Tag

CHIP contract INITIAL_VALUE_CONFIGURATION_OUTPORT enables you to set default values for settings in the configuration dialog on different adaptation layers and to persist these values.

  1. Create an interface event with an appropriate parameter, as described in Defining an Event for an Outport.

  2. In the context menu of the CHIP choose Change, and go to the Outports tab.

  3. Create a new outport with the necessary parameters.

  4. Choose Show Tags, and create a new tag of type CHIP_CONTRACT:INITIAL_VALUE_CONFIGURATION_OUTPORT.

Example

For an SAVE_DEFAULTS event with a parameter of type SPFLI the source code may look like:

DATA ls_spfli TYPE SPFLI.

ls_spfli-CARRID = 'LH'.

wd_this->fire_event_save_defaults_evt( config_data = ls_spfli ).