cancel
Showing results for 
Search instead for 
Did you mean: 

Visibility & WdDoInit

Former Member
0 Kudos

Hi,

I have one view where I want to set different UI-Elements visible/invisible. Therefore I have an context-attribute of the type wdy_boolean. This attribute should be set only once for the whole wd right at the start. Its value depends on sy-uname.

CASE SY-UNAME.

WHEN 'USER'.

Item_Visible = abap_true.

...set-Methode...

I've placed this code in the WDDOINIT-Method.

Now, at the start, the variable has the right value, but if I click a button, which changes the visibility of other ui-elements in this view, my variable is set to "false" everytime. I really don't know why. Its only referenced in the WDDOINIT-Method an bound from the context to the designated ui-elements

Regards

Torsten

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

you should do this action in de wddomodifyview

you can use the first_time parameter to limit the adaptations of parameters once

or on every page refresh

grtz

Koen

Former Member
0 Kudos

How exactly do I use the first_time parameter?

And what's the difference between WDDOINIT and WDDOMODIFYVIEW with this parameter?

Message was edited by:

Torsten Nordmann

Former Member
0 Kudos

Hi,

it is a standard importing parameter which is true on the first time,

that way you have the effect of setting things op at wddoinit

grtz

Koen

Former Member
0 Kudos

I've copied the whole code into the WDDOMODIFYVIEW and used the first_time parameter with an if-block. I also cleared the WDDOINIT. But it's the same result. My UI-Elements still turn invisilbe after the first action.

Former Member
0 Kudos

if you don't use the first time parameter?

do they have the right values then?

grtz

Koen

Former Member
0 Kudos

Yes, I've just tried it. If I don't use the parameter, it's working as intended. Still it's a mystery to me, why. There shouldn't be a need to set the variable over and over again with the same value...

Former Member
0 Kudos

Hi,

your values are refreshed with the ones hardcoded in the design phase

so it's a logical continuation of the process

please close thread is sufficient (reward if necessary)

grtz

Koen