Start of Content Area

Background documentation Your Own Component as Your Own Configuration Editor Locate the document in its SAP Library structure

You can use a configuration editor you created yourself instead of the generic configuration editor. You can then use your own component for your own configuration editor:

...

       1.      Create the component you want to use as the configuration editor.

       2.      Implement component interface IWD_CFG_COMP_EDITOR in the component you want to use as the configuration editor.

       3.      Make sure that the context for the configuration is the same as the context for the component you want to use as the configuration editor. You can do this in two ways:

       Set up the context structure manually in the same way as it is for the component to be edited.

Here it is easy to bind the UI elements. Bear in mind that if changes are later made to the context of the component to be edited, double maintenance will be necessary.

       Generate the context structure dynamically.

Changes made later to the context are automatically included in the generation, but dynamic assignments can prove complicated.

       4.      Implement the component interface methods.

In the component interface method INIT you get a reference to interface IF_WD_CFG_COMP_EDITOR. From this interface you have to call method INIT again. If you enter value X in parameter I_GENERATE_NODE_INFOS in interface IF_WD_CFG_COMP_EDITOR->INIT, the context structure is generated dynamically. Otherwise it is not.

The component interface enables the outer component (the frame component) to notify the embedded configuration editor of events, for example, the user of the editor has pressed the Save button. 

Methods of IWD_CFG_COMP_EDITOR:

       INIT

Transfer of the service handler used for communication.

       CANCEL

Notification that Cancel was pressed.

       SAVE

Notification that Save was pressed.

       CHECK

Notification that a validation is necessary. This method is always called before SAVE.

       REFRESH

Notification that Refresh was pressed.

       ENTER_CHANGE_MODE and LEAVE_CHANGE_MODE

By default the configuration is started in the display mode. If you want to go to the change mode, ENTER_CHANGE_MODE has to be called. You have to call method REFRESH_CONTEXT using the service handler. The service handler must always be called if you make changes to attributes or create new attributes.

Caution

Never work directly in the context, always use the service handler methods.

       5.      Assign your new editor to the component you want to configure by choosing Edit ® Configuration Data and test your configurator.

The methods of the component interface enable the embedded configuration editor to be notified of actions executed in the surrounding component and to respond to them. The developer of the new configuration editor maintains the data using methods of the class interface.  The developer has to create a user interface and make the communication secure by means of the two interfaces.

Example

You can find an example in the system in component WDR_TEST_CONFIG_EDITOR.

 

 

End of Content Area