Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Joseph_BERTHE
Active Contributor

Weird question isn't it ? The main purpose of this article is not to discuss about Web Dynpro ABAP but just to show you how to use NOT pattern in your context binding :smile:

Let me show you with an example: when you use boolean attributes, often we want to have the opposite value depending on how you think : isActivated or isDisable ?

Static option

The easiest way to do this NOT operation is using the wizard when you bind context attribute to graphical element property. On the bottom of the wizard you will appear an option called : INVERT. Select it and that's it !

Thus, each TRUE value will be FALSE for the property element, and each FALSE will be TRUE for that element.

Dynamic option

Now, how to do the same thing but in dynamic context, such as in ALV element?

The key of the problem is: ":NOT"

Here is an easy example in ALV context to add button and bind the enabled property to the context and invert the value.

CREATE OBJECT lo_button.
lo_button->set_enabled_fieldname( 'ALV_MD__SAVED_ACTION:NOT' ).

Conclusion

It is easy to use the NOT operator in the context binding so do not hesitate to use it. I would like to thanks a friend of my Guillaume G. who ask me the question and bring me the ALV example.

Enjoy :wink:

1 Comment
Labels in this area