cancel
Showing results for 
Search instead for 
Did you mean: 

How to changethe property of tray in View

Former Member
0 Kudos

Hi Guys,

Can anyone let me know how to chagethe property of Tray which is screen element through coding.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Dhiraj,

You can make use of attributes to govern the behaviour of your UI element. Just bind the property attributes of UI element to the context node attributes via which you want to control the behaviour and then control the UI element by attribute values through coding .

Hope this helps.

Regards,

Anoop

Former Member
0 Kudos

Hi

Is it possible for you to tell it in breif as i am a lilbit confuse how ca ni bind UI element propertty with context.

Former Member
0 Kudos

Hi Dhiraj,

Just for the sake of example we will try to govern the behaviour of "Expand/Collapse or Open/Close" property of Tray UI element. For this follow the steps mentioned:

1) Create a attribute, open_close, of type Boolean in your view context

2) Go to Property table of Tray UI element and then click on the button which is present next to Expanded.

3) Create a button and label it as say "Open/Close" and in the OnAction write a mehtod name say "Open_Close_Tray".

4) In this method insert code which will set the attribute "open_close" value to abap_true or abap_false depending on the current value ..

In a similar manner you can govern the behaviour of rest of the property attributes of Tray UI element as well.

Hope this helps. If this post was of any use do award points.

Also if your query has been answered then mark this thread as "Answered".

Regards,

Anoop

Former Member
0 Kudos

Hi Anoop

My query is nearly answered but one last query can u jst let me know the piece of code to set attibute through code. I will confiming it after this doubt

Former Member
0 Kudos

Hi,

to set attribute:

node->set_attribute( exporting name = 'name attribute'

value = lv_value ).

grtz

Koen

Former Member
0 Kudos

Hi Dhiraj,

I hope you do know how to use the WD Wizard .. its the thing on top with a torch light symbol .. click on it and then select the radio button with "read context" and then chose the context attribute .. once u have done this replace the Get_attribute method with Set_attribute .. for tht just do the changes i suggest ..

1) rename the method

2) remove the importing and exporting TEXT .. but not the variables and attribute name ..

3) now pass abap_true or abap_false to your "value" parameter ..

By the way Dhiraj there are a few threads that you opened and the query i am sure has been answered but you havent closed the thread .. I would request you to close those threads as well and award points to the posts tht deserve ..

Thanks and regards,

Anoop

Answers (0)