2020 May 20 9:32 AM
Hi Gurus! Im trying to upload an image BMP to SE78 with white background color. Firstly I get the image with the methodif_cl_gui_gp_pres=>graphic_proxy~export (the image is a pie diagram painted like in program GFW_PROG_PIE)
CALL METHOD gp_inst->if_graphic_proxy~export
EXPORTING
format = if_graphic_proxy=>co_format_BMP
width = 50
height = 50
IMPORTING
*CONTENT_TYPE = S
content_length = lv_length
content = lt_bin_content
retval = retval.
When I´m trying to upload this image to SE78 with my program, all is ok but the background in the image is grey, I wan´t to upload the image with the white background, as I can see it in my PC if I download it.
To upload the image to SE78, I call the FM SAPSCRIPT_CONVERT_BITMAP_BDS passing my LT_BIN_CONTENT table (whitch has the graphic in line in type W3MIMETABTYPE = RAW 255) but inside this functiion, in the PERFORM FILL_BMFILE_FROM_BMP, I can see that my file has a bitcount 24 instead of 8 (To see the background white I need to get 256 color bitmap, not 16 million colors bitmap):
"Code inside the FILL_BMFILE _FROM_BMP
case bmp_bitcount.
when 1.
otf_bminfo-bmtype = c_itf_hex_bcol. "2 color
otf_bminfo-is_monochrome = c_false.
when 4.
otf_bminfo-bmtype = c_itf_hex_bcol. "16 color
otf_bminfo-is_monochrome = c_false.
when 8.
otf_bminfo-bmtype = c_itf_hex_bcol. "256 color
otf_bminfo-is_monochrome = c_false.
when 24.
otf_bminfo-bmtype = c_itf_hex_bcol. "16 million colors
otf_bminfo-is_monochrome = c_false.
when others. "16 or 32 bit true color
message e875 with bmp_bitcount raising bmperr_no_colortable.
endcase.
Is there any function, method or something to convert my bin tab to 256 colors? I need to do It inside SAP, not with Paint program.
Thank you .
2020 May 20 9:41 AM
Hi soportefuncional.euskousuariopara
There is a Z* class for bitmap transformations in ABAP. Maybe it will help solve your issue.
https://blogs.sap.com/2007/09/05/abap-bitmap-image-processing-class/
https://code.google.com/archive/p/abap-sdn-examples-tpj/downloads
Regards,2020 May 20 11:04 AM
Hi, Thanks! how can I open the file of this class? I found this blog, but I can´t open the nugg files, or I don´t know how...
2020 May 20 11:11 AM
Hi
You need to have the ZSAPLINK report on your system. Then you can upload the class using that report.
You can find it here: https://github.com/sapmentors/SAPlink
Regards,2020 May 20 11:28 AM
Hi! I´ve got it! I,m going to review the class, thank you so much!!