cancel
Showing results for 
Search instead for 
Did you mean: 

Corrupted data when reading back out of BTF-editor from BSP page

Former Member
0 Kudos

In CRM 5.2 (level 0002), SAP_BASIS 700 (level 0013), we have implemented the BTF-editor instead of the plain editor in some places of component BT126H_CALL (activities).

We have created a copy of component BTNOTE, extended it, provided it with 2 new views (overview and edit) in which we call BSP element thtmlbx:btf. We still use context node BTTEXT.

We also extended component B126H_CALL: we replaced in some viewsets the view BTNOTE in view area Note with our own BTF-views

It all works fine together with display on overview, save from overview and navigation from overview to edit and vice versa.

The problem arises when we read back the data u2013edited or not - from the BTF-editor in method DO_HANDLE_DATA from the edit-view.

In object lr_btf_editor we see nothing or only a part of the original text, surrounded by rubbish.

The method RESTORE_FROM_REQUEST from IF_HTMLB_DATA (called within method GET_DATA from class cl_btf_bsp_manager) returns this.

The border between rubbish and correct text is f.i. a change of color or font.

If we u2013 while editing the document in the HTML-code editor or in debugging - remove the leading html tags <HTML><BODY> and the trailing tags </BODY></HTML> everything seems ok.

With the other BTF-editor ( BSP-element btf:editor ) we get the same problem.

All SAP Notes for the BTF-editor are for older versions.

Does anybody have a suggestion what is happening here and how we can avoid this behavior?

In the BSP-page we use encoding UTF-8

We are reading back the edited data out of the BTF-document with method DO_HANDLE_DATA from the edit-view with following code:

CALL METHOD super->do_handle_data
    EXPORTING
      form_fields     = form_fields
      global_messages = global_messages.

 DATA: lv_id            TYPE string.
 DATA: lr_btf_editor    TYPE REF TO cl_btf_bsp_editor.

  lv_id = me->get_id( 'btf_editor' ).
  lr_btf_editor ?= cl_btf_bsp_manager=>get_data( request = request            
                                                 name    = 'editor'                             
                                                 id      =  lv_id ).

  IF lr_btf_editor IS NOT INITIAL.
    gs_btf_documentdata-btf_doc = lr_btf_editor->document.
    gv_btf_sourceview = lr_btf_editor->sourceview.

    set_btf_doc_data( ).

  ENDIF.

Edited by: Hans Wolff on Jul 17, 2009 9:21 AM

Edited by: Hans Wolff on Jul 17, 2009 9:41 AM

Edited by: Hans Wolff on Jul 17, 2009 10:03 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

athavanraja
Active Contributor
0 Kudos

i had used the following code to read the content from the btf editor and had no issues.


DATA: editor TYPE REF TO cl_btf_bsp_editor.
DATA: l_text TYPE xstring.
 DATA: l_encode TYPE string.
 DATA: l_lang   TYPE spras.

editor->document->get_content( IMPORTING text = l_text
                                                 encoding = l_encode
                                                 language = l_lang ).

Former Member
0 Kudos

After consuting SAP we found the solution: it is necessary to disable automatic delta handling.

This can be achieved on different ways:

- via customizing CRM-> UI Framework -> UI Framework Definition -> Disable Automatic Delta Handling

here you have to specify individual applications ande pages; however this had no result.

- via a user parameter in SU01: set CRM_TAJAX_DH_MODE to OFF; this works fine!

Hans

0 Kudos

Where did you write the Code.What should be passed for l_text parameter.