GuiXT Tutorial General Topics 1 Change screen layout 2 3 4 5 6 continue

The SAP standard screens often contain a number of fields that you don’t need. With GuiXT you can get rid of unnecessary elements and rearrange the screen to your liking. As an example, let’s look at transaction MM03, Material Master, Basic data 1.  

In contrast to special configuration tools within SAP applications (e.g. for material master data), GuiXT works in the same way for all applications and screens. By mastering a small set of instructions (e.g. del to delete and pos to modify an element’s position) you can rearrange a screen on your own PC, and then release it for a large number of users.

Sap Guixt image.1.1 Change screen layout 

       Starting point: SAP standard screen in materials management

 

 

Sap Guixt image.1.2 Change screen layout 

        Unnecessary fields are crossed out

How to proceed: Click on  “Script” in GuiXT in order to open the screen script for editing. Delete all unwanted elements using the “del”  command. Instead of writing down the fieldnames, you can click on the element in the GuiXT window  “Screen elements”, and then paste it into your script with Ctrl+V.

del F[Ext. matl group]
del F[Lab./office]
del F[Prod.hierarchy]
del F[X-plant matl status]
del F[Valid from]
del C[Assign effect. vals]
del F[GenItemCatGroup]
del G[Material authorization group]

del F[Volume]
del F[Volume unit]
del F[Size/dimensions]

GuiXT window “Screen elements”:

Sap Guixt image.1.5 Change screen layout  

 

 

 

 

 

 

 

 

Here F[...] stands for  field, G[...] for group box, P[...] pushbutton, C[...] checkbox. 

Sap Guixt image.1.3 Change screen layout 

     Rearrangement of remaining fields

 

To achieve your final layout, you can rearrange the remaining fields using the “pos” command:

 

// Rearrange fields
pos F[EAN/UPC] F[Net weight]+(1,0)
pos F[EAN category] F[EAN/UPC]+(0,40)
pos G[General data] F[Material]+(2,0)
pos G[Dimensions/EANs] (10,1)
pos G[Packaging material data] (15,1)
pos G[Basic data texts] (18,1)

In the “pos” command, name the element and its new position as above. The coordinates can be absolute or relative to other elements.

As a final touch, use “BoxSize” in order to resize the group boxes:

// Define new box size
boxSize G[General data] (6,78)
boxSize G[Dimensions/EANs] (5,78)
boxSize G[Packaging material data] (3,78)
boxSize G[Basic data texts] (3,78)

Sap Guixt image.1.4 Change screen layout 

      Final Layout

The new layout is meant for “Basic data 1″ only.  Since GuiXT scripts are stored for each screen (SAP dynpro),  but not for different tab views on the screen, you need to restrict the script to the active tab “Basic data 1″:

// GuiXT Script saplmgmm.e4004.txt
// Material master

if Q[Page=Basic data 1]

// Delete unnecessary fields
del F[Ext. matl group]
del F[Lab./office]
del F[Prod.hierarchy]
del F[X-plant matl status]
del F[Valid from]
del C[Assign effect. vals]
del F[GenItemCatGroup]
del G[Material authorization group]
del F[Volume]
del F[Volume unit]
del F[Size/dimensions]

// Rearrange fields 
pos F[EAN/UPC] F[Net weight]+(1,0)
pos F[EAN category] F[EAN/UPC]+(0,40)
pos G[General data] F[Material]+(2,0)
pos G[Dimensions/EANs] (10,1)
pos G[Packaging material data] (15,1)
pos G[Basic data texts] (18,1)

// Define new box size
boxSize G[General data] (6,78)
boxSize G[Dimensions/EANs] (5,78)
boxSize G[Packaging material data] (3,78)
boxSize G[Basic data texts] (3,78)

endif

If you wish to have the layout active only for displaying materials (transaction MM03), but not for material creation or change, you can indicate this using

// Check: transaction MM03
if Q[Transaction=MM03]

endif

Tip: Instead of entering the script manually, you can use the wysiwyg tool “GuiXT Designer” to generate the script automatically. See Designer-Tutorial for details.

Sap Guixt weiter Change screen layout

Change screen layout