CRM and CX Blogs by SAP
Stay up-to-date on the latest developments and product news about intelligent customer experience and CRM technologies through blog posts from SAP experts.
cancel
Showing results for 
Search instead for 
Did you mean: 
corrine_guan
Employee
Employee
In CRM WebUI, we have editors like BTF or RTE. They are used to disply email contents. Sometimes, email content might be displayed unproperly. For example, part or all of the content is lost in editor while the email content might show well in SOIN at the same time.

When this kind of problem happens, what can we do to find out the cause?

Purpose:

In this blog, I will display an E-Mail in new RTE editor in IC business role( view is CRMCMP_CCS_EML/MailBody ). With this sample, we will have some ideas about how E-mail content is transferred from backend to the frontend editor. And thus understand where to set breakpoint to check the E-mail content.

Steps to display E-Mail:

  1. Login CRM IC business role.

  2. Go to INBOX, search an E-Mail.

  3. Display the E-Mail.


A structure with 4 points:

With this structure, we can understand easily where to find out the email contents in different points.



*Please notice, these 4 points are just good starts which we can use to analyze problems when an E-Mail content is not displayed properly in frontend editor. It doesn't contain all the detailed logics how the E-mail content is read from database, processed and finally displayed.

 

 

Details to start our analysis by using these 4 points:

  1. Point 1: If an E-mail content is even not displayed properly in T-code SOIN, as we are talking E-mail content from CRM application perspective in this document, please contact experts in BC area(BC-SRV-COM).

  2. Point 2:
    1). Execute T-code bsp_wd_cmpwb, display component CRMCMP_CCS_EML and then view MailBody. Double click on CRMCMP_CCS_EML/MailBody.htm, set breakpoint where RTE editor instance is created.

    2). In IC agent, search an E-Mail to display the Email.
    3). Breakpoint will stop. Double click the variant for attribute document 's_documentdata-btf_doc', it will appear in the 'Variables 1' section. Then double click this variant from 'Variables 1' again.
    4). Then we can see the attribute TEXT. Double click on this 'TEXT'.

    5). Now, if we change the view type to 'HTML Browser' in the dropdown list.

    6). We can see the html file now.

    7). We can even use 'view source' to get html source codes of the E-Mail body by right click.

  3. Point 3:
    1). Set breakpoint in method CL_THTMLBX_RT_EDITOR_MCE=>ENCODE_DOCUMENT_CONTENT.
    2). Display the E-Mail. The breakpoint will stop in this method. Let's codes executed until line 35.
    3). Check the variant xstr and l_xstr.

    xstr and l_xstr should contain correct content.


    4). If we continue further, in this method, we can see whether the content is filtered and changed and why.

    *We need to know that, variant m_filterdocumentcontent by default is TRUE, it can be controlled also by attribute filterDocumentContent:

    *We also need to know that our RTE editor support standard HTML 4.01 and HTML 5 content. For example, if tag "noBr" is used in an E-Mail content to envelope some textual information, these information will be filtered out and won't be displayed because "noBr" tag was part of standard HTML code until HTML 2.0 and since has been deprecated.
    5). If let codes go after statement CALL FUNCTION 'SSFC_BASE64_ENCODE' , l_xstr will be encode into str.

    6). We can decode STR values into texts and check its content using this URL: https://www.base64decode.org/
    *We need to know, this encoded content of STR will be sent to frontend. We can watch this using HTTPWATCH trace. JavaScript function decode_base64 is used to decode it before it is finally displayed on the WebUI RTE editor.
    Thus in Point 3, we can know if the content is sent out to front end correctly or not.

  4. Point 4:
    1). We can get Email body's html source codes using 'Source Code' icon.

    * For view CRMCMP_CCS_EML/MailBody, if this icon is not visible, we can bring it up by setting user parameter CRM_IC_EML_SOURCE to X (Details is explained in KBA 2441744).This is how html source codes look like in the RTE editor.


 

Keywords:

BTF, CL_THTMLBX_BTF_EDITOR=>ENCODE_DOCUMENT_CONTENT, CL_THTMLBX_BTF_EDITOR=>FILTER_DOCUMENT_CONTENT