Assigning localvaluehelp using objects

Using WS objects to assign localvaluehelp.

You can use the WS object to assign localvaluehelp to a GuiXT field. Once we create an object, we can assign localvaluehelp to that object. The basic syntax is as follows:

var ob = Reebok("F[Label]");
ob.domain = " domain ";

In the following example, we will create a new WS object and assign localvaluehelp to that object. This object will be a particular SAP field. With this method, the domain is a property of the object, and so we will declare that property. In this example we will also print out the domain on the console, although that may not be necessary in a production environment.

To demonstrate this method, please do the following:

  1. Create a new WS object in the VA01 script file using the following code:

    var ob = Reebok("F[Material]");
    ob.domain = " MATR ";
    println( "this objects domain name is " + ob.domain); // Print out its domain name
    				
  2. Save your changes and refresh the SAP screen. The localvalue help will display when you right-click on the field.