cancel
Showing results for 
Search instead for 
Did you mean: 

Conversion of pasted content in textEdit UIE

mike_mcinerney
Participant
0 Kudos

I have a question about pasting content into a textEdit element, and the subsequent (unintended) conversion of that data.

The best way to viuslaize this might be to think of a simple component as follows:

create a new web dynpro component
add an attribute of type string to the view context
add a textedit element and bind to the string
add a button with a dummy action to force interaction

that'll do

create the application and run it

Copy, then paste in, apostrophe’d text from different sources like

  • can’t
  • We’ll
  • she’s

from Notepad, Word, etc.     (ymmv))

Hit the  button.

From some sources, (Word for me) my pasted in text converts, from say
                     ‘can’t’           to          ‘can#t’


When pasting from Notepad, it stays the same

I want to
a) understand more about this
b) know how I can maintain the integrity of what the user has pasted in a more consistent manner

Thanks…

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Mike,

To retrieve the user entered data in the same format can be attained

The following are the steps which I followed in attaining the user entered format.

  • I created a text-editor and bind it to a string
  • created a button with action save into data base
  • In the button action, I fetched the user entered  STRING and converted into XSTRING using the function module "SCMS_STRING_TO_XSTRING"
  • Saved the data entered in the textedit field into data base field of type RAWSTRING
  • While retrieving the saved data I fetched the data from the table and used the function module "HR_KR_XSTRING_TO_STRING" to reconvert the saved XSTRING data into STRING format and passed it to the TEXTVIEW data element which is binded to a STRING
  • You can find the above user entered text to the left and retrieved text from the data base which is in the same format as the user entered text.

Points please if helpful

Regards

Subhash

mike_mcinerney
Participant
0 Kudos

Thank you Subhash, but that does not quite get me there.

I coded what what you suggested.

For me, it did not work.

It seems that prior to the save, as soon as there is a round trip, my input string is converted into ( can't goes to can#t )  within the text_edit.

..Mike

Former Member
0 Kudos

Mike, it worked in my program, you can find the same in the below screen shots

I have used the below code it worked!

* while saving entered comments into data base

  CALL FUNCTION 'SCMS_STRING_TO_XSTRING'

    EXPORTING

      text   = ls_remarks-description

    IMPORTING

      buffer = ls_remarks-ACTDEC          "RAWSTRING format declared in table

    EXCEPTIONS

      failed = 1.

* while retrieving the entered comments from data base table

  CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'

     EXPORTING

       in_xstring          = ls_comments-ACTDEC

     IMPORTING

       OUT_STRING          = ls_comments-DESCRIPTION.     "string format

Hope this helps.

Points please if helpful

Regards

Subhash