Preparing the Web Dynpro Component 
Whether you have to change your Web Dynpro component to enable it to be used as a CHIP depends on how it is to be used. If you only want to display the Web Dynpro component and use its functions, you only have to create one CHIP for the component. If you want your component to have ports for communicating with other CHIPs, further steps are necessary.
Components of the Dictionary structure that are based on the port type can be used as inport and outport parameters provided the component type is an elementary data type. Table types of simple Dictionary structures can also be used.
Nested structures, table types, and reference types are not permitted. Dictionary structure components of this type therefore cannot be selected as port parameters.
If your CHIP is to have an inport so that it can be connected to from another CHIP, in the component controller create a method that you can use for the response.
Go to the component controller of your Web Dynpro component, open it with a double-click, and choose the Methods tab.
Create a method, for example, with the name INPORT_METH, and set the interface flag.
Create an importing parameter for this method, for example, PARAM_IN, and select an appropriate Dictionary structure as the reference type.
Recommendation
We recommend you write the data you want to pass with the parameter to the context in order to prevent data loss.
You can refererence this method when you create the inport for the CHIP.
For more information, see Creating Web Dynpro CHIPs.
If your CHIP is to have an outport so that it can connect to another CHIP, in the component controller create an event that you can use to fire a wiring to the other CHIP.
Go to the component controller of your Web Dynpro component, open it with a double-click, and choose the Events tab.
Create a new event, for example, with the name OUTPORT_EVEN, and set the Interface flag.
Create a parameter for this event, for example, with the name PARAM_OUT that has a Dictionary structure as the reference type.
Go to the action handler method from where the event is to be fired, for example, as a response to a button click, and open the Web Dynpro Code Wizard here.
Choose the General tab, then Method Call in Used Controller, and select the event method of the COMPONENTCONTROLLER that you created in step 2.
For event OUTPORT_EVENT this is method FIRE_OUTPORT_EVENT_EVT.
Fill the parameter with an appropriate local variable. The code looks like this:
lo_componentcontroller->fire_outport_event_evt( outparam = ls_search ).
You can refererence this event when you create the outport for the CHIP.
For more information, see Creating Web Dynpro CHIPs.