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"…});
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:
The image command takes the following options:
This option will place an image on the SAP toolbar.
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}
Maintains the height-to-width proportions of the original image, regardless of the size specified by the user. The syntax is:
{"nostretch":true}
No three-dimensional (3D) frame will be displayed around the given image. The syntax is:
{"plain":true}
This option enables users to launch a website or an executable file from an image. the following file types are supported:
There are two possible syntaxes, which are as follows:
{"start":"C:\\directory\\filename"}
{"start":"http://www.guixt.com"}
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}
Specifies the height of the window to be displayed. The syntax is:
{"viewhelp_height":x}
Specifies the width of the window to be displayed. The syntax is:
{"viewhelp_width":x}
Specifies the position on the screen where the viewhelp window will be displayed. The syntax is as follows:
{"viewhelp_position":x}