Skip to Content


Sep 09, 2017 at 06:29 AM


avatar image

Hi All,

I have searched many SCN thread for below garbage data issue but couldn't find any solution for the same. I am using all the required FMs for type conversion but result is junk image data due to which image attchment is not opening.

I am adding image JPG file in Sales order using FM SO_OBJECT_INSERT.

1. Using GUI_UPLAOD ( BIN type ) - Image data is obtained in Raw string format

2. FM SO_SOLIXTAB_TO_SOLITAB - used to get the data SOLITAB format required for FM SO_OBJECT_INSERT

Here FM SO_SOLIXTAB_TO_SOLITAB is gving garbage data.


Can anybody please help me in addressing the issue.

Below is code file

REPORT ztp.DATA: lv_len         TYPEi,
       lt_doc_content TYPE solix_tab,
       lt_cont        TYPE soli_tab.
*/Function module for  Xstring to Binary ConversionCALLFUNCTION'GUI_UPLOAD'EXPORTING
    filename   ='P:\Windows\Desktop\Rio.jpg'
    filetype   ='BIN'IMPORTING
    filelength = lv_len
    data_tab   = lt_doc_content[].
* convert from raw type to text

    ip_solixtab = lt_doc_content[]
    ep_solitab  = lt_cont[].
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Sandra Rossi Sep 09, 2017 at 07:52 AM

What you call "garbage data" is simply the character representation of bytes of the original JPG file. Nothing abnormal (knowing that at the time of SO (SAPoffice) programs design, one character was equivalent to one byte). You should simply pass it to the SO_OBJECT_INSERT function module.

Note that if you want to send a mail with attachment, SO_OBJECT_INSERT is very old, and you should now use the CL_BCS class and classes of the BCS family. You won't have to bother with characters for binary files, if you use the parameter I_ATT_CONTENT_HEX of method ADD_ATTACHMENT of class CL_DOCUMENT_BCS. Search the forum for more information.

10 |10000 characters needed characters left characters exceeded