Quantcast
Channel: SCN : Blog List - SAP CRM: Webclient UI - Framework
Viewing all articles
Browse latest Browse all 195

Dynamic fields in WebUI using GET_A method (no new configuration needed)

$
0
0

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!

 

 

srqm_incident_h.png

 

 

 

The objective is to hide field LCSTATUS:

WebUI_ServReq.png

 

 

 

 

Now i will describe the steps to hide the field:

  • Create Switch using SFW1:

SFW1.png

  • Create Business Function using SFW2:

SFW2.png

  • Create Business Function Set using SFW3:

SFW3.png

  • Activate Business Function in SFW5
  • Go to SM30 and open CRMV_GIL_COMP_AT:

bol_attribute.png

  • In this view, we will set the attributes from BOL Objects with a switch ID and visible or not (check on GENIL_MODEL_BROWSER):

GENIL_MODEL_BROWSER.png

  • 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):

get_a.png

  • If we open the WebUI, the field status should be hidden:

invisible.png

 

 

 

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:

Untitled.png

Untitled.png

 

 

 

Hope this can solve some problems that both have in SAP CRM


Viewing all articles
Browse latest Browse all 195

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>