Handling scrollable screen areas

Some R/3 screens contain one or more scrollable areas. There is a vertical or horizontal scroll bar on one edge of the area, and the user can scroll through this part of the screen.

Example (Transaction VD03):  

Sap Guixt scroll1 Handling scrollable screen areas

 

 

It is possible to handle these areas with GuiXT in the usual manner, for example to rename and delete fields. But special care has to be taken when you create new elements within such an area. Let us assume that you want to display a small additional box containing a couple of  pushbuttons:

Sap Guixt scroll3 Handling scrollable screen areas

Your script coding might look as follows:

if Q[Page=Address]
  Box (5,86) (9,100) “Test”
    Pushbutton (6,91) “abc1″ “xyz1″
    Pushbutton (7,91) “abc2″ “xyz2″
    Pushbutton (8,91) “abc3″ “xyz3″
endif

The problem now is that GuiXT uses the absolute coordinates that you specified, but does not assign your new elements to the right scrollable area, thus causing repainting problems during and after scrolling. For example, the screen might look like this: 

Sap Guixt scroll4 Handling scrollable screen areas

There is a way to ensure that your new elements become part of the scrollable area: use the Offset command. When you specify an Offset referencing an existing screen element, GuiXT not only takes the coordinates of this element as new base, but also assumes that further new elements should become part of the same screen area as the referenced element.

In our example, you could use the Preview pushbutton:

 if Q[Page=Address]
  Offset P[Preview]
    Box (1,81) (5,95) “Test”
      Pushbutton (2,86) “abc1″ “xyz1″
      Pushbutton (3,86) “abc2″ “xyz2″
      Pushbutton (4,86) “abc3″ “xyz3″
endif

Your new elements are then correctly shown during and after all scrolling operations.

Instead of using the Offset command, you could also use relative coordinates in each line, i.e. 

if Q[Page=Address]
     Box P[Preview]+(1,81) P[Preview]+(5,95) “Test”
      Pushbutton P[Preview]+(2,86) “abc1″ “xyz1″
      Pushbutton P[Preview]+(3,86) “abc2″ “xyz2″
      Pushbutton P[Preview]+(4,86) “abc3″ “xyz3″
endif

To clarify the difference again, with a simple example, look at the following scripts (same screen):

A: Text (20,90) “xxxxxxxxxx”

B: Text P[Preview]+(16,85) “xxxxxxxxxx”

Since P[Preview] is on (4,5), the absolute text coordinates are the same. But the assigned screen areas are different:

Sap Guixt scroll5 Handling scrollable screen areas

In case A the text is displayed within the non-scrollable main area of the screen.

 

Sap Guixt scroll6 Handling scrollable screen areas

In case B it is initially not shown at all, but…

 

Sap Guixt scroll7 Handling scrollable screen areas

…when the user scrolls down, the text becomes visible.

 

 

 

Handling scrollable screen areas