Skip to Content
avatar image
Former Member

Messy code problem while translating XString to String in OfficeControl

Hi Expert,

I have messy code problem while translating XString to String in XML-Format Word Doc in OfficeControl.

I upload an XML-Format template Word Doc to server as a MIME Object.

When OfficeControl is started in Web Dynpro, OfficeControl automatically open the XML-Format template.

For the first time, I get the XString-type Context attribute bind to the content of the Word Doc,

then translate it to string, I got the XML-format content, it's great!

However, after the first time, when I input any new contents in MS Word in Web Dynpro,

no matter I execute "Ctrl + S" or click the "savedocument" button,

when I translate the XString Context attribute to String, I got messy code. (but the first time, it is good plain text)

I use the function module: ECATT_CONV_XSTRING_TO_STRING (good for first time, dump after first time),

SCMS_XSTRING_TO_BINARY, SCMS_BINARY_TO_STRING (good for first time, messy code after first time).

My Demo source code is in: (system) SMV --> (local object) zhaode --> (Dynpro Component) ztest_office_control

core source code is as:

clear itab.



BUFFER = lv_datas


OUTPUT_LENGTH = lv_length


binary_tab = itab.



input_length = lv_length

mimetype = 'text/plain; charset=utf-8'


text_buffer = lv_datas_string

output_length = lv_data_len


binary_tab = itab.

Can you give me some advice?

Many thanks in advance.

Best Regards,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Sep 16, 2010 at 02:05 PM

    You have already posted this same question several times (and some very similiar questions) within the forum. Please do NOT multiple post your questions. This is against the forum rules of engagement. SAP employee or not, you will find yourself banned from the forums if you don't follow the rules.

    Add comment
    10|10000 characters needed characters exceeded