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: 

FM SO_SOLIXTAB_TO_SOLITAB - Junk data issue

former_member213851
Active Contributor
0 Kudos

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
  TABLES
    data_tab   = lt_doc_content[].
* convert from raw type to text

CALL FUNCTION'SO_SOLIXTAB_TO_SOLITAB'
EXPORTING
    ip_solixtab = lt_doc_content[]
IMPORTING
    ep_solitab  = lt_cont[].
1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor

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.

1 REPLY 1

Sandra_Rossi
Active Contributor

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.