cancel
Showing results for 
Search instead for 
Did you mean: 

Disable a Table Column input field in a Standard Web Dynpro ?

Former Member
0 Kudos

Hi,

How to make disable input field in a table in Standard Web Dynpro? I have created Enhancement Implementation and in WDDOINT Post method I am trying to write a code to disable it. What logic do I need to put?

wd_node1 = wd_context->get_child_node( name = 'EMPLOYEE' ).

wd_sub_node = wd_node1->get_child_node( name = 'TABLE1' ).

lo_inp = wd_sub_node->GET_ELEMENT( EXPORTING ID = 'EMPNO' ).

lo_inp->SET_ENABLED( EXPORTING VALUE = 'X' ).

Please let me know.

Thanks,

Monica

Accepted Solutions (1)

Accepted Solutions (1)

ChrisPaine
Active Contributor
0 Kudos

Hello Monica,

if the enabled/disable attribute of the field is bound to the context, then you will be able to do it the way you are attempting, by setting the element attribute to the value you want.

I would guess, however, that it is unlikely that this is the case.

You could just enhance the layout - remove the editor for the field, and then insert your own, in a view state, or binding the enabled attribute to a attribute in the context - which I guess you would have to enhance too.

If however, you want to just disable a column in the application for all rows, then perhaps using a configuration of the application would be an easier path - you could then easily disable the column, and it doesn't need any code/enhancement.

Hope this helps,

Cheers,

Chris

TomVanDoo
Active Contributor
0 Kudos

KISS principle

enhance layout

replace the standard column of the table by your own column with editor field, which has all the same properties except the enabled property, which you set to unchecked (false)

Edited by: Tom Van Doorslaer on Apr 9, 2010 11:12 AM

Edited by: Tom Van Doorslaer on Apr 9, 2010 11:14 AM

Former Member
0 Kudos

Chris,

I have created a new column with the same properties of a standard column and created a Context attribute with WDY_BOOLEAN and mapped to Enabled property for that new column input field. I have disabled 'Enabled' Property in the properties. But my requirement is for Certain user this field should be enabled. What logic do I need to write in that method.

Thanks for your help!

Thanks,

Monica

Edited by: Monica Tubati on Apr 9, 2010 11:53 PM

Former Member
0 Kudos

Hi,

You'll have to fetch the logged in user name and compare it against the list of users maintained in some Ztable and then find whether that user should have input field enabled or not.

If you have to enable the input field for a user then just set the context attribute which you creted for enabled\ disabled to abap_false, Use the code wizard ( CTRL +F7 ) to set the attribute value.

Another way( which chris also suggested ) can be to create 2 different application configurations ( one which have column enabled and other for column disabled ). This will result in 2 different application URL, now you can give this URL's to user based on their role.

Regards

Manas Dua

Edited by: Manas Dua on Apr 10, 2010 9:40 AM

Answers (1)

Answers (1)

Former Member
0 Kudos

Thanks for all your answers. It helped to resolve the issue.