cancel
Showing results for 
Search instead for 
Did you mean: 

How to reuse views in other webdynpro components

Former Member
0 Kudos

Hi All,

Can we reuse views of one webdynpro component into another webdynpro component?

How? Pls explain.

Regards.

Accepted Solutions (0)

Answers (9)

Answers (9)

alex_campbell
Contributor
0 Kudos

Hi Ravi,

Normally I would refer you to the documentation on Component Usages, but it sounds like you've taken a look at the documentation and are still having problems. Here's a short checklist of things to know:

- Regular Views cannot be reused directly. Only Interface Views can be used by other components (in SE80, expand Component Interface -> Interface Views to see the available Interface Views). These Interface Views are actually Windows, which have the Interface checkbox checked on the Properties tab. In short, you cannot reuse the view, you have to reuse the window that is plugged to the view.

- To reuse interface views (or any other interface part) of a component, you need to specify the used component in the "Used Components" tab of the using component (the top-level node in the SE80 tree).

- Your using component's window needs to have the used component specified on it's properties tab. This will make the used component's interface views available to the using component's window.

After you've done those three things, you can refer to the using component's interface view just as you would refer to a view in the using component itself (Set it as default, link an outbound plug to it, embed it in a view container, etc.)

amy_king
Active Contributor
0 Kudos

Hi Ravi,

You can incorporate views from other components by using component usages. You can read about component usages in the SAP help documentation and see a working example by looking at component WDR_TEST_CMPUSAGE in your system.

Cheers,

Amy

Pawan_Kesari
Active Contributor
0 Kudos

Ravi Kiran Pothula wrote:

Hi All,

Can we reuse views of one webdynpro component into another webdynpro component?

How? Pls explain.

Regards.

Hi Ravi,

Answer to you first question is Yes.

Classic example of this is SALV_WD_TABLE. When you display ALV using SALV_WD_TABLE you are actually using view of another component.

Coming to How.

If you have ever used SALV_WD_TABLE then you already know how.

I think your question is how to create a webdynpro component so that its view can be used in another webdynpro.

1. Make sure the view which you want to reuse is added to window and window is in Interview View. There is an 'Interface' tick box on window properties window. If you have multiple view in webdynpro you might consider creating new window adding view to it and adding this window to Interface view.

2. You might also consider exposing your context, methods and event through 'Component Interface' so using webdynpro component can interact with view. All depends on you scenario.

Hope this helps.

Regards,

Pawan.

Former Member
0 Kudos

Hi Pawan,

Yes, you understand my question correctly.

I done wat u said.but,still i didn't get view created in another webdynpro component in current webdynpro component.

Can you help me.

Regards.

Former Member
0 Kudos

Hi Ravi,

The same problem i also faced.  See here   say

component A has view A and Component has B and view B.

Wen u use comp A with name D u use, when u embed a view in window B(view container) it ll show

your view A as D not A. But D is the form of view A.

It ll do ur view A job.

I hope this is your problem and it ll solve.

Thanks

Vijay

Message was edited by: Vijay Vikram

Former Member
0 Kudos

Hello Ravi,

Yes you can call the views of one webdynpro componnet in another webdynpro component. This can be achieved by component usage.

Component usage is nothing but using one component in another component. For every component there is a tab called used components, under this tab we can use any component as component usage.

For example if we are using comp1 in comp2, then all the views of comp1 can be called from comp2 also.

Regards,

Venkat

Former Member
0 Kudos

Hi Ravi,

As suggested by others above you can achieve what you are intent to.   For a detailed explanation further, you can refer the below link.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2e71ce83-0b01-0010-11a4-98c28a331...

Thanks

Vijay

m_aravindan
Active Participant
0 Kudos

Hi Ravi,

             As far as i know , we can call one  web dynpro component in another web dynpro component. Since views in  1 web dynpro component needs a window and a web dynpro application to get executed .

For calling 1 web dynpro component in another web dynpro component , check the below tutorial.

http://saptechnical.com/Tutorials/WebDynproABAP/Call/Webdynpro.htm

Regards

Aravindan

former_member184958
Active Participant
0 Kudos

Hi,

Using component usage and window exit plug you can achieve.

Regards,

John.

Former Member
0 Kudos

Hi Jhon,

I can't understand ur answer. Can you explain it clearly?

Regards.

Former Member
Former Member
0 Kudos

Hi Ravi,

You can call the view of another webdynpro component in current view.

  • Lets take two examples Ztest1 and Ztest2 which are the 2 webdynpro components which contain test1 and test2 as the view respectively.
  • We will be calling TEST1 view of component ZTEST1 in view test2 of component ZTEST2
  • Double click on the component ZTEST2, under the tab Used components add the ZTEST1 under component and some custom name(ZTEST1) under component use.
  • now go to view TEST2 and create a view container.
  • Now expand window node of ZTEST2, expand the window structure ZTEST2 view and right click on the view container and select embed view
  • In the popup select F4 in the View to be Embedded and select the TEST1 view of ZTEST1 component and press ok
  • Now we can reuse the View of ZTEST1 inside ZTEST2 component.

Check the below example for further details

REUSABILITY OF VIEWS

Points please if helpful!

Regards

Subhash

Former Member
0 Kudos

Hi Ravi,

Right click on the view and click copy, a pop up window will open and will ask for component name and view name.

Check the screenshot.

Regards,

Sanjeev.

alex_campbell
Contributor
0 Kudos

Creating a copy is not ideal unless you need to ensure that changes in the used component does not impact the using component. Otherwise, the additional overhead (and confusion) of maintianing two identical views is not worth it.

Generally, it's better to implement component usages, as described below.