cancel
Showing results for 
Search instead for 
Did you mean: 

Creating Layout elements in Webdynpro ABAP dynamically depending on certain parameters

former_member217916
Participant
0 Kudos

Hi,

I am looking for a way to create UI layout elements in webdynpro ABAP depending on certain parameters. that i want to display only certain number of fields depending on the value of a particular parameter.

A typical way would be to hide UI layout elements but that would leave a blank space at that location, I dont want that but I am looking for a way to show UI elements dynamically in one webdynpro application i.e that is different layout elements appear for different parameter values.

Any help in this regard would be greatly appreciated.

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

amy_king
Active Contributor
0 Kudos

Hi Karan,

You wrote, "but that would leave a blank space at that location". That depends on your layout and how you use the Visibility property of the UI elements. For example, in Matrix layout if you hide both an InputField and the field's Label, the rest of the form elements will simply move up in the Matrix and no blank space will be left by the hidden elements. You can also hide the container that an element belongs to (Group, Panel, TransparentContainer, etc.) and everything inside the container will also be hidden.

If you still prefer dynamic programming  for your requirement, check out Thomas Jung's eLearning sessions, and .

Cheers,

Amy

former_member217916
Participant
0 Kudos

Hi Amy,

Thanks for the info on the blank spaces. I am actually looking for a way to create a generic form where different fields appear for different users and the layout also remains consistent.

Is there any standard way implementing such kind of mechanism or do we have to create UI element through code.

Thanks,

Karan.

amy_king
Active Contributor
0 Kudos

Hi Karan,

You've correctly identified the two options-- at design-time by controlling visibility and at runtime with dynamic programming.

If there aren't too many fields to consider, controlling visibility of fields created at design-time is a simpler approach. If there are too many fields for this to be manageable, runtime dynamic programming may be the way to go.

A third option I suppose could be to combine the two approaches. If you are able to separate out the various field "variants" into separate views, you could create these views at design-time. On the main view, you would also create at design-time as many ViewContainerUIElements as needed. Then at runtime, you could just assign the appropriate views to their view containers using dynamic programming.

In 2006, Thomas Jung published an eLearning video, "Web Dynpro ABAP - Dynamic Programming - SE16 Data Browser" which showed how to create a highly dynamic WDA that mimics the functionality of SAPgui transaction SE16. I've not be able to find the document since SAP reorganized the SCN site a year or two ago but if you can find it, it may be quite helpful to you.

Cheers,

Amy

former_member217916
Participant
0 Kudos

Hi Amy,

I think the third option is a really effective method in the direction of creating a generic webdynpro application for different users.

It really helps in accomplishing what I wanted to achieve.

Thanks for all the help.

Regards,

Karan

vineetrrakesh
Explorer
0 Kudos

HI Karan,

Sorry but may be you can try the FPM Form UIBB to implement the dynamic UI elements. Have you already considered this option?

former_member217916
Participant
0 Kudos

Hi vineet,

I have not tried that approach, but will try and experiment with FPM as well. Thanks for the heads up.

Regards,

Karan.

Answers (0)