You are on page 1of 6

10/18/2014 Dynamic fields in WebUI using GET_A method (no ...

| SCN
http://scn.sap.com/community/crm/webclient-ui-framework/blog/2014/02/14/dynamic-fields-in-webui-using-geta-method-no-new-configuration-needed# 1/6
Getting Started Newsletters Store

Products Services & Support About SCN Downloads
Industries Training & Education Partnership Developer Center
Lines of Business University Alliances Events & Webinars Innovation
Log On Join Us Hi, Guest Search the Community
Activity Communications Actions
Browse
SAP CRM: Webclient UI - Framework
Previous
post
Next
post
Hi community,



Yesterday i've found a nice way to show/hide fields dynamically in WebUI!!


The first idea that occurred to me was to create 2 different configurations, one with the field and the other without...
Then go to method DO_CONFIG_DETERMINATION and select the correct configuration according to the logic that i
wanted...

For me, this is not the right approach! WHY? imagine a requirement where we have 10 dynamic fields:


For 1 dynamic field, we need 2 configurations;
For 2 dynamic fields, we need 4 configurations;
...



I've tryed to find a new solution using different foruns and blogs but unsucessfully... and then i've found the light (:P)




My solution is based on the creation of a custom Switch and Business Function, and used them in the BSP application
(using method GET_A to change the visibility). Please check the following example:





Go to transaction BSP_WD_CMPWB, open Component SRQM_INCIDENT_H and view IncidentHeaderEF.
Let's assume that we want to show/hide field "status" (LCSTATUS) from context node BTADMINH.


Note: All the objects should be enhanced!


Dynamic fields in WebUI using GET_A method (no
new configuration needed)
Posted by Andre Mendes in SAP CRM: Webclient UI - Framework on Feb 14, 2014 6:25:58 PM
10/18/2014 Dynamic fields in WebUI using GET_A method (no ... | SCN
http://scn.sap.com/community/crm/webclient-ui-framework/blog/2014/02/14/dynamic-fields-in-webui-using-geta-method-no-new-configuration-needed# 2/6



The objective is to hide field LCSTATUS:




Now i will describe the steps to hide the field:
Create Switch using SFW1:
Create Business Function using SFW2:
10/18/2014 Dynamic fields in WebUI using GET_A method (no ... | SCN
http://scn.sap.com/community/crm/webclient-ui-framework/blog/2014/02/14/dynamic-fields-in-webui-using-geta-method-no-new-configuration-needed# 3/6
Create Business Function Set using SFW3:
Activate Business Function in SFW5
Go to SM30 and open CRMV_GIL_COMP_AT:
In this view, we will set the attributes from BOL Objects with a switch ID and visible or not (check on
GENIL_MODEL_BROWSER):
10/18/2014 Dynamic fields in WebUI using GET_A method (no ... | SCN
http://scn.sap.com/community/crm/webclient-ui-framework/blog/2014/02/14/dynamic-fields-in-webui-using-geta-method-no-new-configuration-needed# 4/6
Now the BOL attribute has a switch ID. Next step is to maintain the visibility in the view of the component. This
should be done in method GET_A of the attribute (in this case LCSTATUS):
If we open the WebUI, the field status should be hidden:



IMPORTANT NOTE: this will not work for extensions in AET!!! the standard will not go through GET_A of the attribute.
The reason why is because the name of the attribute starts with "EXT."...
To solve that a new method should be created in the class of the context node:
10/18/2014 Dynamic fields in WebUI using GET_A method (no ... | SCN
http://scn.sap.com/community/crm/webclient-ui-framework/blog/2014/02/14/dynamic-fields-in-webui-using-geta-method-no-new-configuration-needed# 5/6
Average User Rating
(1 rating)



Hope this can solve some problems that both have in SAP CRM
1484 Views Products: sap_crm_7.0 Tags: sap, webui, context_node, bol_, bol/genil;
5 Comments
Lus Prez Grau Feb 17, 2014 9:41 AM
Thanks for your effort on sharing this with the community, but, don't you think the switch framework is
not mean to do stuff "bigger" than hide fields?

Cheers!

Luis
10/18/2014 Dynamic fields in WebUI using GET_A method (no ... | SCN
http://scn.sap.com/community/crm/webclient-ui-framework/blog/2014/02/14/dynamic-fields-in-webui-using-geta-method-no-new-configuration-needed# 6/6
Follow SCN
Site Index Contact Us SAP Help Portal
Privacy Terms of Use Legal Disclosure Copyright
Like (1)
Like (1)
Hasan Rafiq Feb 17, 2014 10:16 AM (in response to Lus Prez Grau)
Hi Luis ,

I completely agree with you on this one

I can extend this blog with the info that it's not necessary to make changes to the switch. You
can simply re-define the GET_A method of the field and pass the output field
REACTION = ' H'

/Hasan
Like (1)
Lus Prez Grau Feb 17, 2014 2:58 PM (in response to Hasan Rafiq)
yuup I already saw implementing GET_A approch in some scn discussions and to
be honest I don't like this approach either, I mean, I understand having 10000
configurations is hard to maintain and not very flexible, overwrite a GET which is
meant for the switch framework is also a "dirty trick" and if we speak in the OO
paradigm you have highly chances to violate it, its very easy,common, find you don't
have enough criteria to hide the attribute X without considering the attribute Y and
last but not least you lose the SAP support

Let's face it, the WebUI framework doesn't have the flexibility in a task which the
users and developers are used to, LOOP AT SCREEN. so what we can do? I could
agree on a method in the context node which is mean to hide/show fileds
dinamically like the GET_I, but we don't have that so...let's go to our friend
GET_A...hmmmm...not good.

I've seen Andrei's and Nitish blogs:

Dynamic modification of Configuration fields ( Part -1) : Form View
Form Iterator and How It Should Be Cooked
Form iterator. Reviewing mistakes.

I never tried it but looks like a clearer approach to me, if we implement something is
not in the standard at least let's do it offically

Cheers!

Luis

PD: This is a very nice topic and as we don't have a SAP best practice about this, it
will be cool if we try to "standardize" with the help of the experience of ht community
Like (0)
Andrea Molina Feb 17, 2014 4:59 PM
Tanto tempo sem ver uma tela em portugus... timo post!
Like (0)
Nuno Lopes Apr 10, 2014 11:50 AM
Hey Andr, thank you, for the tutorial, it have help us passing from allot of ui configuration, just to hide
a simple field, to a really simple development.

Yes switch framework do allot more than hide fields, but in the meantime i can use it to simple my
code/program, and just redefining the method get_A will not work..

You might also like