SAP_BASIS SAPKB73105
SAP_ABA SAPKA73105
WEBCUIF SAPK-73105INWEBCUIF
BBPCRM SAPKU70204
Hi,
In my current Project we had to deal with conditions, we had to add custom fields in the pricing field catalog and make available those fields in the Web UI.
If anyone worked before with the pricing field catalog, you should know the behavior of those fields is controlled with the BADI /SAPCND/ROLLNAME ( check values, translate the data from external to internal, search help, etc. ) In this blog I will focus on the search help. For more information about the BADI I suggest to check the BADI documentation and the interface documentation (/SAPCND/IF_EX_ROLLNAME) it’s pretty well explained, this BADI is widely internally implemented, so you can also take a look to all the classes which implements this interface via SE80 or Eclipse in order to understand better how it works.
The GAP that I found is how complex Search helps can be implemented in the Web UI. The method F4_HELP only covers complex search help in SAP GUI (using the common functions inside the method to call search helps) this method only will work for you if you want to show a list of values in the Web UI which only have two available fields (key and description), one good example is the implementation CRM_SALES_INDUST_CND which uses the class CL_IM_CRM_COUNTRY_CND, which covers both scenarios, SAP GUI y Web UI.
Now I will talk about my journey to implement a complex search help in the Web UI, where all my fun started. If you check the component/views for conditions CRMCMP_CND/CondRecEditConfView and CRMCMP_CND/CondRecEditListView, first of all I would recommend implementing the Note 1575115 - Enhanced setter method not getting called, if you will deal with those views and the note Note 1731897 - Incorrect F4 help for date related condition field, if you deal with custom fields in the pricing catalog which are date typed.
Well, getting back to the complex search help of custom fields in the views CRMCMP_CND/CondRecEditConfView and CRMCMP_CND/CondRecEditListView, if you check the configuration, you will see is generated dynamically from the pricing fieldcatalog merging the XML so you cannot configure the views.
If you analyze further the get_config_from_fcat you can also understand why some fields are mandatory and how you can do in customizing to make them non-mandatory, But getting back( again ) to the search help topic, it is also dynamically determined in the context node class. I was really surprised to see no see a single GET_V method implemented so I started to analyze where it came from….
Finally I found the class CL_CRM_CND_F4_CALLBACK which has the methodIS_SIMPLE_F4_HELP_DENIED where are mapped the fields/domains with the events in the view, so actually the complex search help are developed in the Web UI( BADI independent).
I raised a message to SAP in order to clarify this point, but until I received the response of SAP I created a enhancement spot in the beginning of the method IS_SIMPLE_F4_HELP_DENIED to overwrite the values in the internal table with the ones provided by the standard plus my own ones (from a customizing table).
I know maybe is not the best approach but was the only way which I could assure the search helps pointing to my custom fields will work properly allinged how the standard is working,
ls_value-context = cc_default_context.
ls_value-fieldname = 'XXXXXXXX. "Contex node attribute name
ls_value-deny_simple_f4 = 'X'. " if is initial Search help implemented in the GET_V method
ls_value-use_advanced_search = 'X'. "if is NOT initial will trigger the event as Outbound plug
ls_value-is_date_field = ''. "You don't need to inform this, In the case which you are using a date type search helps works without all this stuff
ls_value-event_name = 'F4_EVENT_USR_ID'. "The event, you need to have the Outbound plug with the same name defined in the view
INSERT ls_value INTO TABLE rt_value.
CLEAR ls_value.
Voila! Everything worked fine.
* INI 01/07/2013 Dealing with SAP - Not valid
Some days after, SAP came with a response and confirmed that we can implement the GET_V methods without worrying. So I undid the Enhancement keeping the events, which of course I needed. I found this information especially useful and I wanted to share it with you. I hope clarify this point and you don’t need to go through headaches like me.
* END 01/07/2013 - Dealing with SAP - Not valid
Cheers!
Luis