Skip to Content

Woe, woe and thrice woe…

image

This all goes back to a session some months ago at SAP Mastering Technologies where Karin Tillotson did an excellent presentation about the ASUG UI Influence Council. At the time I was irritated, annoyed frustrated by the presentation. The Council had some excellent points, but I felt that they perhaps misdirected. To add to my frustration, although Karin pointed out all the shortcomings that exist in SAP’s offering, because of NDAs we weren’t allowed to know what SAP had responded to any of this!

Recently Why I believe in the power of ASUG Influence Councils Part 2 – The ASUG UI Influence Council, I’d recommend you read it – it’s a good summary and development of the presentation linked above. But for me, it just scratched an itch that I’d been harbouring since I saw the presentation.

That’s not what Web Dynpro is for!

One of the main complaints that the Council raised was that Web Dynpro isn’t flexible enough. Well – should it be? If I want to dig a hole in the ground I start with my pickaxe, and then when I’ve broken up the soil, I use my shovel to scoop it out. I don’t try to strap on a sheet of metal on my pickaxe to try and turn it into a spade. Likewise, Web Dynpro is not the leatherman tool of web development. It is not designed to allow customer tweeking to the level that the Council was/is demanding. There are RIA Islands that do allow a certain amount of custom build, but if you want a completely custom interface – well Web Dynpro is not the tool! I don’t think the UI Influence Council should be calling for changes to this framework! I think they should be (to use some terms that I deal with every day) be writing Functional Specifications – not Tech Specs. Tell us what is wanted, by all means, but please don’t then specify the technology!

But Fair play – they have a point…

Their list of points when abstracted from the particular technology however, is right. (again, my opinion!) BSP is slowly being removed from the market, and without it we are loosing our ability to build UI’s in SAP in simple, enhance-able HTML. I think that the introduction of an HTML5 Island for WD would go a long way to fixing this – but it’s certainly not going to fix the desire for a totally flexible UI experience – and building a UI using only RIA Islands isn’t going to deliver much of the potential benefits of the WD framework. You’d be better off using another tool. (In my opinion).

But they were wrong – sort of…

However, on one particular point, they were wrong. You can event from an F4 help in Web Dynpro. It’s not at all obvious how to do it, but it is possible. I’m not sure that it would even be a good idea to follow this code pattern – and I would encourage SAP to listen to the UI Influence Council and come up with a simple way of doing the same thing.

Firing an event from an F4 help selection.

First off, create an event handler in your component controller:

method ON_VH_CLOSED .

do_update_on_f4_help( cl_wdr_value_help_handler=>m_context_element ).

endmethod. 

which would be called when the Value Help window is closed/selection made.

This passes the value of the context element selected to your method to do whatever logic you want.

now this method should be triggered by an event. So create an event also, I’ll call it VH_WINDOW_CLOSED. Attach your event handler to this event.image

Now in the WDDOINT, register this event listener

* register as value help listener

  data: lo_listener type ref to cl_wdr_component,
        lo_component_api type ref to if_wd_component,
        lo_component type  ref to if_wd_component.
  lo_component_api = wd_this->wd_get_api( ).
  lo_component = lo_component_api->get_component( ).
  lo_listener ?= lo_component.
  zpa_pa_empl_maintain_vh=>register_listener(
      listening_component = lo_listener ).
* add reference to handler
  lo_component->add_event_handler(
       listener_name = 'COMPONENTCONTROLLER'
       handler_name = 'ON_VH_CLOSED'
       controller_name = 'COMPONENTCONTROLLER'
       event_name = 'VH_WINDOW_CLOSED' ).

You can see here that I have made reference to a method register_listener of a custom ABAP class  zpa_pa_empl_maintain_vh.

image

Here there are three event handlers. I’ll cover them each – but first the method we called… REGISTER_LISTENER

 method REGISTER_LISTENER.
  ao_component = listening_component.
  set handler handle_vh_close.
  set handler on_ddic_search..
endmethod.

It has one import parameter – LISTENING_COMPONENT TYPE REF TO CL_WDR_COMPONENT.

This is also the type of the static class attribute ao_component.

image

It activates the two event handlers.

Event Handler method HANDLE_VH_CLOSE – Is a handler for the event

Class:CL_WDR_VALUE_HELP_HANDLER Event:IF_WD_VALUE_HELP_FORWARD~VALUE_HELP_CLOSED

method HANDLE_VH_CLOSE.
* window is closing - register change of context element
set handler on_search_context_changed.
endmethod.

It just starts up another handler – one which we only want to be active for a very short time!

Event Handler ON_SEARCH_CONTEXT_CHANGED – is a handler for the event

Class:CL_WDR_CONTEXT_ELEMENT

Event:ON_ATTRIBUTE_CHANGED

method ON_SEARCH_CONTEXT_CHANGED.
* deactivate handler
  set handler on_search_context_changed activation abap_false.
   ao_component->fire_event(
               controller_name = 'COMPONENTCONTROLLER'
               event_name      = 'VH_WINDOW_CLOSED'  ).
endmethod. 

It firstly deactivates listening for context changes and then fires the event in our WD component. The event has many parameters, but we can ignore all of them.

Event Handler Method ON_DDIC_SEARCH – is a handler for the event

Class:CL_WDR_VALUE_HELP_HANDLER

Event:IF_WD_VALUE_HELP_FORWARD~DDIC

method on_ddic_search.
  cl_wdr_value_help_handler=>if_wd_value_help_forward~set_context(
         context_element = cl_wdr_value_help_handler=>m_context_element
         context_attribute = cl_wdr_value_help_handler=>m_attribute_info-name ).
endmethod.

This method ensures that the context of the value help is available to us when the value help window is called.

Finally, one last method DEREGISTER_LISTENER

 method deregister_listener.
  set handler handle_vh_close activation abap_false.
  set handler on_ddic_search activation abap_false.
endmethod.

Because you don’t want to having these events occurring when you don’t want them to!

To wrap up

So using this code you CAN cause an event to trigger on the use of a standard F4 value help. But you can see it’s pretty complex! 

And Finally

I still feel that perhaps the Influence Council are possibly going down the wrong path trying to make Web Dynpro the be-all tool for web development in SAP. It isn’t that, and I doubt it will ever be that! I’ve published this method of getting an event from an F4 value help as much for the desire to educate others about the possibility, as from a desire to show that the Council were wrong. Wrong to try to consider making large scale requests of a specific technology without understanding how that technology works (as demonstrated), and whether it had ever been designed to do the things that they were wanting it to do.

But don’t get me wrong – the job these guys do is GREAT!  I just got a bit “woe is me” about it all 😉

These are all my own opinions, I’ve often been wrong in the past, and I’m sure that I’ll be so in the future, please don’t assume that these opinions in any way reflect that of my company.

To report this post you need to login first.

14 Comments

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

    1. Chris Paine
      Thanks Yariv,

      Yes it is great that SAP is actively supporting this kind of feedback. I just wish that they could be a little more public with the responses to the issues.  I’d happily sign an NDA as well if it could mean that I _could_ know what was happening – as would many others, I believe. It sure is frustrating only knowing one side of the story. (more “woe is me” 😉

      (0) 
      1. VR V

        Hi Chris,

        I followed the same procedure as mentioned here but my WD component is showing an error with the message

        Method ON_VH_CLOSED

        Method “DO_UPDATE_ON_F4_HELP” is unknown or PROTECTED or PRIVATE.
        (0) 
        1. Chris Paine

          That method is the one that you use to do whatever logic you want. – create it yourself!

          (0) 
  1. James Geddes
    Hi Chris

    Great blog — I’m bookmarking it for the F4 hints in particular.

    We started a discussion on Karin’s blog a couple of days ago, but I thought I’d continue it here.

    I take your point regarding people expecting too much from Web DynPro. But by saying that WDP isn’t some sort of UI Swiss Army Knife, we’re implying that there is some lesser, still legitimate purpose that it does perform well. I don’t think that implication is correct.

    We can all agree that Web DynPro’s purpose is to present SAP functionality over the web. Leaving aside points such as a single, coherent route of access across an enterprise, and centralized access management, a primary reason for the “over the web” part is that users expect an attractive, immersive, intuitive, modern web interface that classic DynPros can’t deliver.

    I think it’s plain to see that Web DynPro does not deliver that — its design does not allow it to. And that’s a big part of what the council seems to want: more attractive, more immersive, more intuitive, more up-to-date. Either SAP would have to provide many more out-of-the-box visual functions, or let developers create their own. They’ve done neither yet. (I maintain that Flex/Silverlight islands are not the solution, and am holding out for the HTML5 equivalent — but I don’t think we can safely say that it will deliver this requirement.)

    If a primary purpose of Web DynPro is to deliver an attractive, immersive interface, and it can’t fulfil that requirement, isn’t it fair to say that it’s a failed framework? We’re left with applications that fail to fulfil users’ expectations. In fact, they fail just as badly as the DynPros they’re replacing: they’re a little better in some areas, and a little worse in others.

    This problem is compounded by a problem of expectations: WDP is _perceived_ as a web framework that _should_ be on par with the others that customers are using outside of the SAP ecosystem in their companies. And it’s obviously not.

    That perception partly stems from the fact that it’s SAP’s only “modern” GUI framework, and they’re expecting to use an SAP-endorsed technology to interface with SAP services, as they have in the past. I don’t think it was necessary for SAP to invent this one in the first place, and I think they should think carefully before trying to invent another. But if they’re marketing it as the way to interface with their applications over the web, it should fulfil all of the requirements that that statement implies, and endure comparison to other frameworks.

    Customers could jump ship to another web framework and interface with SAP through web services or function modules over JCo. But they’re more locked in than you might think. They feel forced to use WDP because SAP’s own web-based software is written in it, and because of its integration with the NW Enterprise Portal. In order to interface with SAP’s existing software, they really do have to use WDP, so they can’t enhance SAP-delivered applications to fulfil their requirements. They could duplicate most of the interface with the portal in another framework, but it’s a lot trickier, which deters them. (On the Java side of things, some years ago I managed to embed the open-source Wicket framework into the portal’s runtime, which provided Wicket applications access to portal services. But it wasn’t easy.) What is even tougher to duplicate is WDP’s integration with the portal themes, which is more of a deal-breaker than you might think for some customers.

    To sum up: SAP customers feel (and to a sizeable extent, actually are) locked in to a web framework that doesn’t meet its own design goals, and doesn’t fulfil their expectations, which have been created by SAP (though perhaps inadvertently). I think that’s a problem — and a problem the council should be helping to address with specific, pointed requests.

    (0) 
    1. Chris Paine
      James,

      Thanks for your comments – and also for replying to Thomas Jung’s points in Karin’s weblog.

      I’m not sure we do disagree, I think that customers do, as you say “feel locked into a web framework that doesn’t meet its own design goals”. What I would argue is that the customers are not understanding what those design goals were, and are expecting WD to be something that it is not. My original issue was that the ASUG UI Influence Council were perpetuating this misconception by demanding that WDA do things that it wasn’t designed to do. They should instead point out the general issues, not ask a technology to deliver something it shouldn’t.

      That there is a need for a very flexible web UI development tool is not in doubt. Should SAP provide it – I’m not sure.

      I like that I don’t have to retrain users on each WD app that I produce – because so much of the functionality is the same as they are using. If buttons could be resized at will, look and feel drastically altered by each individual project’s offering, I would have to do a lot of retraining.

      As Thomas mentioned, there is/was a call for standardisation of components.

      Personally, I’d never(well I shouldn’t say that or for sure next week I’ll be asked to do it) expose WD to an external facing website – it’s too ugly 😉 But in the interests of rapid development, easy support, and reduced training requirements I think the standardisation it enforces make it perfect for internal deployment.

      Thanks again for the very interesting comments and views.

      Chris

      (0) 
      1. James Geddes
        Thanks, Chris. I think our “disagreement” can be distilled to the fact that I think that a web framework must be more immersive and intuitive than WDP to succeed on any level, regardless of its audience or constraints. Your opinion is tempered by other considerations, which are all reasonable.

        Perhaps we’ll have to agree to disagree on that single point.

        Thanks again to you and Thomas for a very interesting discussion.

        (0) 
  2. Chris Paine

    Interesting how SAPUI5 has come along since this blog and filled the clear gaps. And surprise, surprise, it wasn’t an enhancement to WDA, but a new technology.

    Anyway – thought I’d rename the blog to make the tech bit in it a little easier to find, since I doubt anyone now cares about ASUG making secret deals with SAP.

    Cheers,

    Chris

    (0) 
    1. Sahir Nidagundi

      Hi Chris,

      Thanks for sharing the knowledge.

      With regard to HR Renewal 1.0, many of the application are based on FLUID designer?

      Refer:

      http://help.sap.com/erp_hcm_ias_2012_03/helpdata/en/3d/8bf4fe6365452197bf4dbb179aa11b/content.htm

      http://help.sap.com/erp_hcm_ias_2012_03/helpdata/en/d2/4a93399862467282539abe1995d98d/content.htm?frameset=/en/43/1d639b3fce3566e10000000a11466f/frameset.htm

      Have you been able to achieve similar functionality

      With regards,

      Sahir.

      (0) 
  3. Amy King

    Awesome post! I’ve often lamented there are not more UI events in web dynpro the developer can capture– onClick and onSearchHelp being the ones I’ve most wished for. Though complex, this is a terrific solution. Thanks so much for sharing this.

    Cheers.

    (0) 
  4. Tomasz Mackowski

    Hi Chris,

    Thanks for the blog. I tried the approach and it works perfect except for one case.

    When user has saved a personal value list it is getting displayed before  the ‘normal’ search help dialog. IF_WD_VALUE_HELP_FORWARD~DDIC is getting called then but when user selects value from this list VALUE_HELP_CLOSED is not triggered.

    Do you know any workaround for the Personal Value List?

    (0) 
    1. Chris Paine

      Sorry Tomasz, I didn’t see your comment until now, about a year later!

      I’d suggest you check out – http://scn.sap.com/docs/DOC-44817

      it may help you. But not sure what would be done to make my code work for your case. (probably need to do a lot of debugging to figure it out!)

      Sorry,

      Chris

      (0) 

Leave a Reply