image

The image command is used to display images on SAP screens.

The image command is used primarily to display an image in a SAP screen. This is useful to create a recognizable context for users, to orientate users within a given screen, to personalize a particular screen. Images can also contain a variety of information, particularly if the image is data-dependent. The basic syntax for this is as follows:

image([startRow, startCol], "image_filename", {"options":"value"…});
Note: The use of image is restricted to design scripts - it will not be available in functions

Images are always positioned starting with the top left, so the startRow and startCol coordinates will identify where the upper left corner of the image will be anchored on the SAP screen. An optional pair of coordinates for the lower right corner can also be shown as in the example below:

image([1, 10], [5, 20], "image_filename", {"nostretch":true});

In this case, the image will be automatically resized to fit the specified dimensions unless the 'nostretch' option is used as is the case in our example. If the image is hosted on a network share, the full file path must be included. Variables can be used in the filenames as well as shown in the following example where we will use the value entered into the 'F[Material]' field to specify the filename. If the user enters the value '12345', for example, then the filename would be 'img12345.jpg. The code is as follows:

 image([1,1], "C:\guixt\img&F[Material].jpg 

The image command supports the following file types:

Note: Synactive recommends using the BMP format for smaller images (e.g. icons) and the GIF or JPG format for larger images.

Options

The image command takes the following options:

[TOOLBAR]

This option will place an image on the SAP toolbar.

Note: The image must be pre-sized since the [TOOLBAR] placement offers no options for resizing to fit the toolbar.
nobuffer

The image will be read from the file system each time it is displayed instead of being held in a buffer. This is useful if new versions of the image are being provided from external file systems such as SAP itself. The syntax is as follows:

{"nobuffer":true}
nostretch

Maintains the height-to-width proportions of the original image, regardless of the size specified by the user. The syntax is:

{"nostretch":true}
plain

No three-dimensional (3D) frame will be displayed around the given image. The syntax is:

{"plain":true}
start

This option enables users to launch a website or an executable file from an image. the following file types are supported:

  • .BAT
  • .EXE

There are two possible syntaxes, which are as follows:

{"start":"C:\\directory\\filename"}
{"start":"http://www.guixt.com"}
						
viewhelp

When a user clicks on the image, a viewhelp window is created as shown below. This window is used to display help for a given field or screen that is contained in an external location. Currently we support HTML and RTF documents. Viewhelp can only be used in a local environment with SAP GUI - it cannot be utilized in a server-based environment. The sybntax is as follows:

{"viewhelp":true}
viewhelp_height

Specifies the height of the window to be displayed. The syntax is:

{"viewhelp_height":x}
viewhelp_position

Specifies the width of the window to be displayed. The syntax is:

{"viewhelp_width":x}
viewhelp_width

Specifies the position on the screen where the viewhelp window will be displayed. The syntax is as follows:

{"viewhelp_position":x}