11-05-2019 4:31 PM
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.
11-05-2019 5: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.
11-05-2019 5: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.
11-07-2019 12:51 PM
Hi Sandra,
Thank you for your answer, which was as always very helpful! 🙂