cancel
Showing results for 
Search instead for 
Did you mean: 

How to building User Interfaces dynamically

Former Member
0 Kudos

Hello WD gurus,

We have a table in R/3 that has the list of warehouses. This warhouse table is dynamic and may grow over a period of time. We have a function module to get the list of tables. Also, we have one more function module which takes the warehouse as an input and retrieves the warehouse information based on the input .

Our requirement is as follows:

Get the list of warehouses from the table using an RFC call. Now, iterate through the warehouses list and then build tabs dynamically for each and every warehouse, and build a table dynamically for each and every warehouse in respective tabs, then call one more RFC to populate this table. Here everything is created dynamically on the fly. Is it possible? If it is not, is there any alternative design for this? Please advice. Thanks in advance.

- Vicky.

Accepted Solutions (0)

Answers (1)

Answers (1)

ThatSAPGuy
Advisor
Advisor
0 Kudos

Vicky-

This is possible using Web Dynpro. You will have to create the UI dynamically based on the data retrieved from the backend. Here one way in which you can achieve this:

1. In the Web Dynpro Perspective of your NWDS add a tabstrip to your view with no tabs.

2. Create model nodes for your two RFCs in your component controller.

3. Create a context mapping to your view controller's context.

4. In your +wdDoModifyView() + of your view controller (the view which contains the empty tabstrip) execute your first RFC to retrieve the number of tabs you require.

5. In a loop:

5a. Get a reference to your existing TabStrip ( IWDTabStrip ) from the RootUIElementContainer ( IWDTransparentContainer ) which in turn is obtained from the view.

5b. Create a tab in the tabstrip ( IWDTab ).

5c. Create a table inside the newly created tab ( IWDTable ).

5d. Bind this table to your value/model node which contains the details.

5c. Execute your second RFC to get the details (which will populate the context mentioned in step 5d)

Note: The UI manupilation (steps 4 and 5) should happen only once, so use the boolean firstTime parameter.

Cheers-

Atul

Former Member
0 Kudos

Atul,

Thanks a million for your input. Hope you won't mind in getting touch with you if I get into any issues. I appreciate your help.

Kind Regards

Vicky.

Former Member
0 Kudos

You should also consider to populate the tab content only on selection of the tab. This can be done by assigning an action to the TabStrip.onSelect event, setting a flag in the context in the action handler and creating the tab content inside wdDoModifyView().

Armin

ThatSAPGuy
Advisor
Advisor
0 Kudos

Good idea! Why didn't I think of that