Purpose With Image you can display image files in the SAP screens. What is the point of having images and graphics in SAP screens? Four principal reasons spring to mind. Firstly, to create a recognizable context. Secondly, to orientate us within a screen. Thirdly, to give the screen a personal, friendly touch. Fourthly, images can carry a mass of vital information, in particular if the choice of image is data dependent.
Example Image (10,40) "C:\Images\logo.jpg"  

The image file C:\Images\logo.jpg is displayed as of position (10,40), i.e. the upper left corner of the image is in row 10, column 40.

Image standards The following image standards are supported: 
  • bmp
  • gif
  • jpg
  • png

As a rule it makes sense to use bmp for smaller images (like icons) and to use gif, jpg or png for larger ones.

Format
  • Image (row,column) "Name of image file"

    The coordinates
    (row,column) are the upper left corner of the image. They can be specified as decimal numbers in order to position the image exactly. The image is displayed in its original size. The image is searched in the current script directory unless a full path is specified, e.g. "E:\pictures\logo1.bmp". The image files are internally buffered.

Instead of (row,column) the position  (toolbar)is supported as well.  In this case the image size should be 18x18 pixels. The image is displayed at the right hand side of the toolbar.

  • Image (row1,column1) (row2,column2) "Name of image file"

    Here
    (row1,column1) is the upper left corner and (row2,column2) is the right lower corner. The image is stretched to fit into the given rectangular screen area, without keeping its original proportions (but see -noStretch option).
Options
-noStretch Keeps the height/width ratio of the original image.
-plain No 3D-frame is displayed around the image.
-noBuffer The image is read from the file system each time it is displayed. Without this option GuiXT keeps the image in memory in order to avoid reading it from the file system each time.

This option is useful if new versions of the image are provided by external programs (e.g. from SAP or timer controlled).

-transparent The image is displayed in a transparent way. The color of the pixel in the upper left corner of the image is replaced with the SAP background.
Multiple
 Images
It is also possible to display multiple images using the Image command in a way such that the user can click through the images. 

In order to do this you name the images using a sequence number, e.g. "img01.gif", "img02.gif", "img03.gif". You then put the special character combination &# (or &##, &###) into the image filename: 

Image (10,40) (16,65) "img&##.gif" 

The system substitutes 1, 2, 3... (or 01, 02, 03... or 001, 002, 003...) in the place of &# (&##, &###), increasing the number each time the user clicks on the image, and decreasing the number with each right mouse click. 
The mouse cursor shows the image number.

Please see example in GuiXT tutorial 6 Add images.

Data dependent images The image file name can contain variables that are replaced by their values before the image is loaded. Example: 

Image (4,80) "C:\products\img&F[Material].jpg" 

If the user enters the material 00500187, the image C:\products\img00500187.jpg will appear.

Please see example in GuiXT tutorial 6 Add images.

Dynamic image construction Sometimes it is not possible or does not make sense to store all images in the local file system. In this case you can specify an exe- or bat-File in the Image command which copies the image file into the local directory from another source: 

Image (row,column) "Name of image file" exe="program name" 

If the system does not find the image file, it carries out the given exe- or bat-program with the name of the image file as first parameter. After the program has finished, the image file is displayed. Example of an Image command: 

Image (10,40) (18,74) "C:\tempimg\chart&F[Account]\&F[Date].gif" exe="C:\prog\getchart.exe"

Interaction with SAP through images By clicking on the image, you can call optional user inputs which will be simulated within SAP. This is obtained by using the additional parameter input="string": 

Image (row,column) "Name of image file" input="string" 

  • You can put values into SAP input fields
  • You can call up menu functions

The notations is as follows: 

input="field1:value1;field2:value2;field3:value3;OK:fcode" 

The function code fcode can either be an internal code taken from the screen menu, e.g. SCMP, or a transaction code as for example /NFB01 or /OMM02

You will find the internal menu codes as follows: choose the desired function in the transaction menu and press F1 while the mouse cursor points to this function. Now the SAP system displays the internal function code in a pop-up window. 

The Enter button, without any special function code, can be called up with OK at the end of the SAP URL

input="field1:value1;field2:value2;field3:value3;OK"

If you use GuiXT to support a touchscreen, the following special functions will be helpful for offering easy navigation in SAP controls, for example the grid control. You can represent the arrow keys on the keyboard (forward/backward one line or one page, top or botton of the list) with your own images and execute the function with the "Input=..." option. Example:

Image (0,1) (3,8) "nextline.gif" input="X[Grid1]:<DOWN>"  

Folllowing functions are available:

  • <DOWN>  Cursor down
  • <UP> Cursor up
  • <LEFT>  Cursor left
  • <RIGHT> Cursor right
  • <NEXT> Page down
  • <PRIOR> Page up
  • <END>  End
  • <HOME> Home
  • <BOTTOM>  Ctrl+End
  • <TOP>  Ctrl+Home
Starting an InputScript In conjunction with InputAssistant you can also start an InputScript. You have to add the process= attribute to the OK:fcode.

Example:

input="field1:value1;field2:value2;field3:value3;OK:fcode,Process=displaymaterial.txt"

"Using" parameters can be passed to the InputScript  with the notation U[name]:value. You can also set internal GuiXT variables with V[name]:value and use this value in your InputScript or in GuiXT scripts.

Example 1 "input=OK:PR03" 

Clicking on the image calls up the function PR03 in SAP.

Example 2 input="Material:00012345;Plant:0021;OK" 

Clicking on the image completes the fields "Material" and "Plant" and then automatically activates the Enter button.

Start of PC-applications through images By clicking on the image, you can start PC applications. This is obtained by using the additional parameter Start="string": 

Image (row,column) "Name of image file" start="string" 

  • You can display documents of all registered file types
  • You can start .exe or .bat files with parameters
Example 1 start="\\P00800\Doc12\me21.html" 

Clicking on the image displays the html file \\P00800\Doc12\me21.html in your standard browser.

Display your own help Component "Controls"  is needed for this function

With viewHelp= you specify an html or pdf file. Clicking on the image will display the html file in the upper right hand side of the window.

The ConnectHTML function is automatically executed for the page displayed.

Image (row,column) "image file" viewHelp="docfilename.html"

Example Image (toolbar) "help.gif" viewHelp="doc_order.pdf"

Options for viewHelp

viewHelpWidth= Width of the help display (in pixel). If no width is specified, 40% of the total window width is taken.
It is also possible to specify the width in percentage, e.g. viewHelpWidth=60%
viewHelpHeight= Height of the help display (in pixel). If no height is specified, 40% of the total window height is taken.
It is also possible to specify the height in percentage, e.g. viewHelpHeight=50%
viewHelpPosition= Position (upper left corner) of the help display in the form (row,column). E.g.: viewHelpPosition=(10,50). Or relative to other screen elements, e.g.  viewHelpPosition="[Material]+(1,30)".
If you specify a position without specifying width and height, the whole window is used, starting at the specified position (lower right part of the window).
Example Image (toolbar) "help.gif" viewHelp="doc_intorder.html"  viewHelpWidth="200"
Dynamic text output 
textString= An additional text is drawn on the image.
You can indicate new lines with "
\n". Example:
textString=
"First line\nSecond line\nThird line"
Options for textString
textFont= Selected font. Default is "Arial" or, in the case of Unicode systems "Arial Unicode MS" .
textColor= Text color. Default is black. Possible values: "red", "blue", "green", "white", "black", "yellow", or "RGB(x,y,z)" where x,y,z are the  RGB-values of the color.
textHeight= Text height in pixels. Default is 10.
textWeight= Text weight between 1 (thin) and  9 (heavy). Default is 5. Bold is approximately 7.
textArea= Image area where the text is drawn. Format: (x1,y1) or (x1,y1,x2,y2), in pixel coordinates. Default: the whole image. When you specify negative numbers, the bottom right corner as taken as basis. Examples:
... textArea=(10,20)          // Offset (10,20) from upper left corner
... textArea=(-50,-50)        // a square at the bottom right corner, size 50x50 pixels
... textArea=(30,50,-30,-50)  // central area of the image
-textCenter The text is centered in the given image area. If it contains new line indicators "\n", it is centered horizontally only.  
Example Image (1.1,0.5)  (10,20) "logon.gif" textString="&V[_database]"  textHeight="24" textWeight="8"  textColor=""yellow"
Telephony You can pass a phone number to the TAPI component ("Telephony Application Programming Interface", outgoing calls), using the parameter  dial=.
Example

Image (10,24) "phone.gif" dial="&F[Phone number]"

If TAPI is installed and configured on the PC, clicking on the image initiates a phone call to the specified number.

Components GuiXT