Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Moving raw255 to char255

former_member201275
Active Contributor

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.
1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor

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.

2 REPLIES 2

Sandra_Rossi
Active Contributor

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.

Hi Sandra,

Thank you for your answer, which was as always very helpful! 🙂