Skip to Content

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 🙂

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 😉

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Sandeep Tyagi

    Hi Joseph,

    This is Sandeep Tyagi and my company is looking to build some robust solution for workflow. In one of the threads, I saw that you have built a solution, Can you please provide me more details about it. My email id is tyagi.sandeep10atgmaildotcom

    (0) 

Leave a Reply