Link to Content's target Space :
CRM WebClient UI
Providing content download option in CRM WebClient UI.
Arun Prakash Karuppanan
Created on: April 15 2010
Arun Prakash Karuppanan is a Software Programmer employed with Accenture, working on CRM implementations
Want to provide content download via the browser in CRM WebClient UI? This wiki will show you how.
There are two ways you can do this. One is using the SICF service and the other is creating a service URL dynamically and using it. The advantage in the SICF option is that the service can be switched off with ease by administrators in case the situation demands it.
Method 1 - Creating and Using SICF services
Creating SICF node itself is easy. Execute transaction SICF and create your service node in the desired hierarchy available under default host. You may want to use the customer namespace here. In change mode, go to the tab "Handler List" and provide a handler class here. You must create this class beforehand. This class must implement the interface method "IF_HTTP_EXTENSION~HANDLE_REQUEST". For template as to how to use this method, please refer to the class "CL_CHTMLB_CONFIG_TAB_EXCEL_EXP". This is the service used by the "Export to Excel" button in the CHTMLB table view. See how they set the response object to trigger the download.
So now, the service has been created. How to access it? First, note down the path and name of the service.
Then, create the URL using this method.
For example, to access the table view excel service, you can generate the URL in the following way. The iv_query parameter is used to send optional parameters with values to this service. Each parameter should be separated by an & symbol. For example, if you wish to send two parameters "format" and "num_lines",
lv_query = 'format=xml&num_lines=10'. Details on how to fetch these parameters are already available in this handler class.
Add a button to the view with a onClientClick script attached to it.
Sometimes, it is useful to get a reference to the view controller class in the handler method. This may be because we would want to access the context data. Get the page id and include it as a parameter, when you create the URL.
Next, in the handler class method, use this page ID to get hold of the controller class.
Method 2 - Creating & Utilizing Service URLs
Create a handler class and implement this method "IF_CRM_WEB_CALLBACK~HANDLE_REQUEST". Note that this interface is different from that required by the SICF service. The implementation of this method itself is no different from the SICF examples. So, go ahead and put your code there.
Create the URL.
Provide content download service in CRM WebClient UI