Using the offset option

One of the great strengths of the pos method is that it is not restricted to moving screen elements to different positions - it can also be used in repositioning the parts of a screen element in relation to each other. For example, you can move the label of an input field in relation to the field, or move the field in relation to the label. In the following example, we will demonstrate how to offset a screen element with the pos command.

Note: The field and offset options must be used together in order to offset an element. The field option identifies the element which will be used as the base and the offset option defines the parameters of where in relation to the base element you will move the other element.
  1. Go to the VA01 screen in SAP. It appears as follows:


  2. Open the VA01 script file (SAPMV45A.E0101.sjs) and enter the following code. Create the file if it does not already exist.
    pos("F[Sales Organization]", {"field":"F[Distribution Channel]", "offset":[0,30]});
  3. Save your changes and refresh the SAP screen.

The VA01 screen now appears as shown below. Note that the field and the field label have moved to a new posisiton relative to the Division field on the VA01 screen.