‎2008 Jun 19 11:46 PM
Hi Experts,
How to de-activate a button and checkbox in webdynpro dynamically depending upon some condition.
Thanks,
‎2008 Jun 20 4:16 AM
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...
‎2008 Jun 20 4:57 AM
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:
elem_btn_disable->set_attribute(
EXPORTING
name = `DIS_SAVE`
value = abap_false ).
DIS_SAVE should be of type WDY_BOOLEAN in the context.
abap_false means deactivating the button .
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
‎2008 Jun 20 5:42 AM
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.