Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to convert JPEG binary data into 8-bit/256-color Bitmap binary data in ABAP

Hi ABAP Gurus --

The overview of the technical requirement:

  1. Convert JPEG rawstring/binary data received from mobile devices (e.g. iPad photo) stored in a SAP z-table into BMP  (IGS is used for conversion)
  2. Load the BMP in BDS programmatically  (modified se78 code is used here)
  3. Call a Smartforms which will take in an internal table containing the BDS details of the images.  The smartform will display single image per page.
  4. Convert the smartform into PDF and send it as an email attachment.

Note:

  • Everything is done programmatically.  No external/manual image conversion possible.
  • All logic is wrapped into an RFC function module which is used by the mobile device via SUP.
  • Client system is ECC 6
  • Adobe Document Services (ADS) is not available

Problem:

Bad image resolution from the 256-color bitmap on the forms.

Findings from prior research work:

  • SAP has a limitation of 256 colors for BDS and Smartforms.  This results in some loss in image quality.
  • The IGS converter has a fixed color bit depth of 24bit for BMP/TIFF data
  • Image resolution is not a problem if the image is converted to 8-bit BMP via image conversion program (e.g. Paint) before loading it to BDS (se78).  Image on the form looks fine if this is done. 
  • There is minimal degradation to image quality if the image loaded to BDS has a bit depth of 8 (256 colors).

Question:

How to convert a JPEG binary data/rawstring (or BMP 24-bit) into an 8-bit BMP data in ABAP?

Tags:
Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question