Skip to Content

             This blog explains how to declare the usage of other webdynpro DC,how to pass data between the two DCs and Difference between External Context mapping and Normal mapping with working example.

1)Go to File->New->Webdynpro Project.


You will get the above popup stating that local projects don’t support reusing any objects defined in other projects and they cannot publish any objects for reuse within any other projects.

  To overcome the above limitations we need to create webdynpro Development components instead of local projects. To do that follow the below steps

1) Go to File->New->Webdynpro Development Component->My Components


2) Similarly create another dc named “innerdc”, so that it can be used in the “outerdc”.

3) Now create a component “OuterComp” in the “outerdc” with default views and windows.


4) Similarly create component “InnerComp” in the innerdc with default views and windows.

5) Now we have to expose the “InnerComp” of the “innerdc”, by adding it to the Public Part of the dc.

6)Go to the “innerdc”->”InnerComp” and right click on it as shown below




A name for the public part. This name must be unique within DC.


Specify the application purpose.

You can choose between the following three values:

COMPILATION – Choose this option whenever the objects from the public part of the DC being used are also required for compiling in the DC. Using the Component Build function, these objects are bundled together in a separate JAR archive in the DC used.

  • 1. ASSEMBLY – Choose this option if the objects from the public part in the DC being used are to be bundled together to a larger whole, possible together with the DCs used, and then to be deployed – but not in a separate archive.

      The public part in this case is not required for compiling the DC used.

  • 1. INFRASTRUCTURE – This option is not of relevance for Web Dynpro DCs. It is only important for plug-in developments.


Name by which the public part will be identified in visual tools.


Optional, freely editable text that explains the meaning of the public part.



7) Now go to “outerdc”->”OuterComp”->Used Components. Right click on the Used Components and go to Development Component->Show InàComponent Properties as shown in the below figure


   8) Go to the Dependencies Tab and click on “ADD” button


9)  Now go to My Components and select the “innerdc” and click on “Next”.



10) Give the dependency details as shown in the below figure.




11) Now build the used Development Component.



12) Now go the Used Components of the OuterComp right click and choose Add Used Component.Give the usage name as “InnerCompInst”.Browse and choose the “InnerComp”.


   Now the exchange of data between the two DCs can take place using the Context of the Interface Controller.

At design time, a Web Dynpro component does not know the context structures of its embedding Web Dynpro component. Therefore, it is not possible at design time to map context elements in the component interface controller of Web Dynpro component A to context elements that belong to a controller context of Web Dynpro component B, which has declared a usage of A. However, if Web Dynpro component A itself uses another Web Dynpro component within itself, this is possible (general context mapping).

There are many cases in which it is desirable for a Web Dynpro component to refer to context elements (context mapping) that belong to a controller context of its user. This method of data retrieval within a Web Dynpro component is provided by External Context Mapping (external context mapping cannot be used for value attributes that are directly inferior to the root node). During the development of a Web Dynpro component, external context mapping does not directly declare context mapping to an outer user, but declares the possibility of a subsequent general context mapping from a concrete component usage to its user.

The below procedure explains about the External Context Mapping.

1) The “innerdc” is used by the “outerdc”. The original data is stored in the component controller context of “outerdc”. To be able to access this data from within “innerdc”, the corresponding context elements must first be declared as “mappable” in the context of the component interface controller. To do this, the element property isInputElement is set to true.So,in the Interface controller context  of the “innerdc” create the below mentionded context structure.  

         Create Node      : DataConsume.

        Create Attribute: count (Parent Node – DataConsume)


2)Since the component controller implements the interface controller,the same context structure should be present in the component controller.So,copy the above node structure and paste it in the component controller.

3)Create the same node structure in the view controller of InnerCompView and map it to the component controller.Now create the below given view layout


4)In the component controller of the “outerdc” create the following node structure.

            Create Node      : DataSouce(cardinality ->1:1, InputElement ->false)

           Create Attribute: count (Parent Node – DataSource)

5)Now map from component controller of “outerdc” to the Interface controller of the used dc “innerdc”.As,this mapping occurs outside the dc “innerdc”,this is called External Mapping.

6)Paste the following code in the wdDoInit() method of the component controller of “outerdc”.

public void wdDoInit()  {

    //@@begin wdDoInit()




7)Now open the OuterCompWindow,remove the default view OuterCompView,embed the InnerCompInst.InnerCompInterfaceView,create a outbound plug “toInnerCompViewOut”,Create a navigation link from this outbound plug to the default inbound plug of the “InnerCompInterfaceView”.


       In the Default input plug event handler of “InnerCompWindow” fire the “toInnerCompViewOut” out bound plug.

public void onPlugDefault( wdEvent )  {

    //@@begin onPlugDefault(ServerEvent)




8)Now create a Application in the “outerdc” which uses the “OuterComp”.Build,deploy

and run the project.The below figure shows the expected result.


  If the OuterComp is the consumer of data and InnerComp is the producer,then in “InnerComp” we need not declare “DataConsume” node as InputElement true.And in the “OuterComp” since the mapping occurs in the same component it doesnot come under external context mapping.

For understanding normal context mapping please refer my blog

Componentization of Webdynpro Application in CE7.1

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Sushil Kumar Jain
    Just one comment
    In Step 4

    In the component controller of the “outerdc” create the following node structure.

                Create Node      : DataSouce(cardinality ->1:1, InputElement ->false)

    I understand “InputElement ->false” the following prop.. is available only for Interface controllers.



Leave a Reply