Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to de-activate a button in webdynpro dynamically

Former Member
0 Likes
521

Hi Experts,

How to de-activate a button and checkbox in webdynpro dynamically depending upon some condition.

Thanks,

3 REPLIES 3
Read only

former_member195383
Active Contributor
0 Likes
491

if sy-ucomm eq 'ENTE'

if <put ur condition wen u want to activate the button >

LOOP AT SCREEN.

IF screen-name EQ 'NAME1'.

screen-active = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

else

LOOP AT SCREEN.

IF screen-name EQ 'NAME1'.

screen-active = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

endif.

endif.

after the condition is changed u hit enter...then the activation or deactivation of the button will ocuur..

(Here NAME1 is the name of the button , that u wanna activate or deactivate)

Reward points if the above ans is useful...

Read only

Former Member
0 Likes
491

hi

to de-activate or disable a button, lets say u want to disable SAVE button once it is clicked...

then in the method where u write code for SAVE button

at the end:

  1. elem_btn_disable->set_attribute(

EXPORTING

name = `DIS_SAVE`

value = abap_false ).

  1. DIS_SAVE should be of type WDY_BOOLEAN in the context.

abap_false means deactivating the button .

  1. if you want to HIDE a button, then type should be WDY_VISIBILITY or WDY_UI_ELEMENT_VISIBLE

& value = 1 .

if you want to do this before screen loads, then do it in the INBOUND plug method of in tht WDDOINIT method.

give points if helpful.

--

rgds

prateek

Read only

Former Member
0 Likes
491

Hi,

Create an attribute of type WDY_BOOLEAN in context. In Layout bind the enable property of button to that attribute. Based on your condition

set the attribute.Here is the example code

wd_context->set_attribute( exporting name = 'INP_FIELDS' value = 'X').

Here INP_FIELDS is the attributein context.

Regards,

Asmitha.