cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic call of view

Former Member
0 Kudos

Hello folks,

Sorry for the long message Its somehow difficult for me to explain correctly where my problem is.

I started with Webdynpro development, displayed the content of a table, a static tree and developed some other funny things but this is where my HowTos and books simply end and this is not application development.

My application should be like this:

I want to display a tree on the left side of the window.

When the user double clicks a tree leaf another component (or lets say another part of my application) should be displayed right to that tree. The tree should still be visible.

How is such a "component" be called? E.g if the user double clicks a tree leaf, a ALV should be displayed showing the content of a table. How is this done?

But my question does not end here. Depending on what "kind" of tree leaf the user double clicks, different "components" should be displayed. E.g. is the user clicks the leaf called "ALV display of table T005" an ALV should appear showing the table content of table T005.

If the user clicks the tree leaf "Enter text" an editable text box should appear right to the tree.

As I said, the tree should always be visible.

From my point of view my problem can be divided into three parts.

1.

How to differentiate different nodes reasonable? My approach is to use a naming convention for the "WDR_NAME_VALUE_LIST-VALUE". Do you agree or do you use other techniques to make ABAP know what kind of leaf the user clicked?

2. How to react on a double click? this is done by an event, right?

3. How to call different - lets say "views" (e.g. a text box or an ALV) depending on the user action? I can with my knowledge only display tree, ALV and textbox at the same time using one view. but i dont know how to display a textbox if the user request one and make it disappear when the user requests for the ALV and so on... Thats somehow dynamic and thats where my knowledge so far comes to an end.

Would be great of someone of you could help me with those three problems.

Regards, Hendrik

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Hendrik,

In the tree UI element, you have tree nodes and tree items. Define an onAction event on a tree item so that you can handle a click on the leaf node.

For displaying selected elements for each click on the tree, one approach would be to use view container elements. Have each set of UI elements in separate views and only a view container ui element in the main view. Depending on which node is clicked, fire the corresponding outbound plugs to the respective views so that they get embedded into the container.

Another approach would be to define each set of elements in separate containers and manipulate only the visibility using context attributes.

For instance, on clicking leaf node 1, if you want an ALV table and button to be visible, then define a transparent container in your view and put the ALV and button in the container. Now bind the 'Visible' property of the container to a context attribute of type char01. In the onAction event of the tree item, set this context attribute to true. This will make the container visible. Similarly you can embed each set of elements that you want to display every time into separate containers and have <b>separate context attributes</b> to control them. When you set one attribute true, remember to set all others false. In the wddoinit method of your view, set all the attributes to false so that nothing is visible initially.

You can take a look at the component WDR_TEST_EVENTS. Check out the views TREE_* in the component, all of them deal with various types of trees and event handling in the tree element.

And the basic layout of the whole component, if you see the main view, is a panel on the left and data getting changed on the right. The left panel will always be visible. Thats very similar to what you need, only that you need a tree instead of links. Most of your doubts will be clarified with having a look at WDR_TEST_EVENTS.

Hope this helps.

Regards,

Nithya

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Koen,

Thanks for your link, this is indeed very interesting and gives some good overview about what is possible. I appreciate your answer.

Hello Nithya,

thanks for your detailed explanation and the two different options. They widen my understanding of how this stuff works and the different alternatives exists in WD. I was already able to implement the event handler correctly and to create the coding to determine which tree item has been fired the action.

For sure SAP has some lack regarding detailed HowTos, especially for ABAP WD. Nevertheless they have some cool sample applications and what is even more important, a nice forum with helpful members of ability. Discussing problems and solutions here makes even more fun than sitting alone in the office copy/pasting a HowTo paper.

Thanks again for you help, folks!

Best regards, Hendrik

Former Member
0 Kudos

Hi,

this <a href="/people/thomas.jung/blog/2006/06/20/web-dynpro-abap-demonstration-videos of videos</a> handle a few of your problems,

maybe they can help you further

look at the bottom for the solutions,

Web Dynpro ABAP - Dynamic Programming - SE16 Data Browser

gives a bit your total requirements

grtz,

Koen