on 03-04-2013 12:47 PM
Hi experts,
I have the next question, I need to enhance method WDMODIFYVIEW in a view of a standard WD Component with some code.
For a better performance, which is the best solution, enhance the method with a pre/post/overwritten method or implement Badi WD_BADI_DOMODIFYVIEW for that component and view?
I think that it should be implement Badi WD_BADI_DOMODIFYVIEW, but I don't have any solid reason.
Can anybody argue an explanation of which solution is better?
Kind regards,
Pablo.
For sure you should not use the "overwrite" unless you want to completely alter the behavior. Whether to use Pre-, Post-, or a specific BAdI depends on what you are trying to do. If you want to influence the output of a method (appearance of a view in case of WDDoModify), then you do a post- method. If you want to influence the input to the WDDoModify, then you use the pre- method. As for the BAdI, it depends where it is actually being called in the code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just took a quick look at the BAdI. I don't have an prior experience with it. If I understand correctly, it seems that this BAdI applies to all web dynpro views (which is a little strange). If that's the case, I would definitely go with the post- method. The reason is that looking at the big picture, you will eventually have a huge IF statement to check which view you are modifying in the BAdI. Keep in mind that this IF statement will be irrelevant for 99% of your views that you don't want to enhance so you are impacting all views just to enhance a few. On the other hand, in the post- method, you already know the view so you avoid this whole IF statement and therefore improving the performance a little bit.
You are absolutely right; the filters will solve that problem. Another challenge, what if you needed to access view context? The post- method will have direct access to those. I'm sure you can do so in the BAdI, but it will be longer de-tour (probably creating an interface method or something).
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.