Skip to Content

Moving raw255 to char255

Hi,

We are moving a field of type raw255 to a field of char255.

The program syntax checks okay however we get an error later on and therefore I wanted to ask if moving from raw255 to char255 is allowed, or will some of the characters at the end be cut off? Or is there a better way to do this i.e. a Method or a Function Module?

DATA: ls_mime TYPE  w3mime. 
DATA: ls_objbin LIKE solisti1.
MOVE-CORRESPONDING  ls_mime TO ls_objbin.
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Nov 05, 2019 at 05:39 PM

    In fact, your question is not really about byte (raw) and character, but about the old formats of APIs for SAPoffice or BCS.

    Before Unicode, there was no issue to have APIs with a character parameter for containing also bytes, because one character was one byte. When Unicode has been introduced, one character was stored on 2 bytes (255 characters used 510 bytes). SAP decided to store bytes on the first 255 bytes of the character parameter.

    You may use the function module SO_SOLIXTAB_TO_SOLITAB to store a table of 255 bytes into a table of 255 characters.

    Some function modules have also be improved to propose a new parameter of type SOLIX_TAB or XSTRING (both are bytes), to avoid the storage of bytes in characters.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.