Link Search Menu Expand Document

Image template declration

ZCL_XTT_IMAGE class

In the previous example №10 pictures were created using the ZCL_XTT_IMAGE class.
Is it possible to somehow simplify this process?

image

Why is this necessary?

  • To create a picture on the ABAP side you need a special factory method. If the internal implementation would be changed in the future, the “hard” reference to the class and method will not allow you to do this painlessly
  • To understand the template, you need to view the ABAP code, since the type {R-T-IMG} is unknown
  • If a template is used, the image actually needs only binary data
  • Without a template, you must also specify the height, width and extension of the file (.jpg by default)

Addition ‘;type=image’

This addition allows you to “convert” binary data (xString) into a picture without calling an additional ABAP method

image

The example 11 uses the data in the 10th. But by using RAW TYPE XSTRING field for output instead of IMG TYPE REF TO ZCL_XTT_IMAGE

image

The ZCL_XTT_IMAGE class is used only indirectly. All additional parameters to the ZCL_XTT_IMAGE=>CREATE_IMAGE( ) method can be passed through:

  • ;width=
  • ;height=
  • ;ext=

from the template itself, in more complex cases you need to use a special “template” for pictures (see column F)