cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic ALV Display

Former Member
0 Kudos

Hi,

I have been assigned to a requirement wherein i need to create 2 buttons lets say YES and NO, on click of YES i need to display ALV for input from user and on click of NO,ALV should not be visible to user. How can i proceed with this requirement?

Thanks

Parag

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182372
Active Contributor
0 Kudos

Bind your ViewContainerUIElement 's (where you embed ALV) visibility property to the context attribute and set that attribute to VISIBLE or NO in event handlers for your buttons.

Lukas_Weigelt
Active Contributor
0 Kudos

Above poster's approach is easiest and cleanest. Alternatively you can downcast the UI-Element-Tree and and set the visibility over the class of the UI-Element.

Cheers, Lukas

Former Member
0 Kudos

HI,

The requirement is quite difficult as i m being new to web dynpro. There would be one question against which there are 2 buttons ..One for YES n another for NO. Now when i pressed YES one table should be visible for user to input data and when i press NO, then another button get displayed. How to proceed with d requirement? Should i create 2 views one for question and another for table or whether there are properties of view table by which i can make it visible or invisible upon button click?

Thanks

Parag

Former Member
0 Kudos

Hi parag,

You can do it in same view, lets say you have question with two buttons YES and NO and also the table

in same view where the table will be invisible.

Now when you click on YES you make the question and two buttons invisible and the table as visible.

To change the visibility of a UI element take a context attribute of type WDY_BOOLEAN and bind it to the

visibility property of UI element and on click of button change the value of the attribute to ABAP_TRUE if

you want it to be visible or ABAP_FALSE if you want to make it invisible.

Alternatly you can use two views where the question and buttons will be in one view and the table in the

other view.

Now when you click on YES display second view.You can navigate between the views by creating outbound plug

in the source view and inbound plug in destination view and create a link between these two and the fire the

respective outbound plug on button click. So similarly you can do it for NO button also.

you can choose any of the above.