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 to convert binary to image

Former Member
0 Kudos

Hi All,

Does anyone know any function module to convert 'image binary data' back to 'image' (bmp, jpeg..etc) format?

I appreciate any help.

Regards.

Edited by: mike curtis on Aug 12, 2010 9:10 PM

12 REPLIES 12

Emre_tr
Active Participant
0 Kudos

you can use GUI_DOWNLOAD function,

fullpath = 'C:\sample.jpg'

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = fullpath

filetype = 'BIN'

TABLES

data_tab = gt_f.

Former Member
0 Kudos

Hatsan,

thanks for the great idea but isn't this FM converting jpg to binary? I am trying to do the opposite.

Former Member
0 Kudos

Hatsan,

thanks for the great idea but isn't this FM converting jpg to binary? I am trying to do the opposite.

No. This FM will get your Binary code, convert it to a JPG file and download it to your harddrive at the path especified.

Then you can open the JPG file and see the image.

Former Member
0 Kudos

Thank you for your reply. and sorry for my ignorance but if I have this binary code

FF0601010202800031313030000000009E020000121F9D028C998F81818171099060E061C0023CFDDCFCE39D7D4283435C83

Could you please show me how to place and where to place this binary code in this FM. Do I need to put it in a txt file first?

Thank you

Edited by: mike curtis on Aug 12, 2010 11:04 PM

Former Member
0 Kudos

How do you importing this binary data to SAP? Where exacly do you have this binary code?

You need to have it in a internal table and pass it in DATA_TAB parameter of GUI_DOWNLOAD FM.

Former Member
0 Kudos

Heber,

Sorry for the late response. This binary code resides in ECC system

Emre_tr
Active Participant
0 Kudos

hi mike,

for upload an image to internal table with binay data you can use 'GUI_UPLOAD' function,

data :begin of gt_f occurs 1000,

data(1000) ,

end of gt_f.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = 'C:\sample.jpg'

filetype = 'BIN'

IMPORTING

filelength = gv_file_length

TABLES

data_tab = gt_f

0 Kudos

Hi, Mike

Check My Blog's Preview Part [Export or Preview Graphic of SE78 |http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/13637] [original link is broken];

Hope this will help you to solve out your problem,

Thanks and Regards,

Faisal

Former Member
0 Kudos

hello mike .

I am facing with the similar problem that u have faced . I am very happy to see that your question has been answered.

Conversion of binary data into photo in sap. the binary data is of the same type as u faced , but still i am sending the data

FFD8FFE000104A46494600010101006000600000FFDB004300080606070605080707070909080A0C140D0C0B0B0C1912130F141D1A1F1E1D1A1C1C20242E2720

this data i need to convert into image (or) photo.

could you please help me in finding the solution for it. i will be very thankful and will be waiting for ur reply.

thanks in advance.

Former Member
0 Kudos

Hi,

Even i got one requirement like this , To convert binary to image conversion .

Please let me know if you solved your issue....

Thanks,

Arun

Former Member
0 Kudos

Hi mike,

I got same requirement like this to convert Binary to image using function module.

Please let me know if your issue solved.

Thanks,

Arun

0 Kudos

Hi,

You can refer the below link where I have just now posted a possible solution & see whether that helps.

Regards,

Gokul