Liquid UI - WS Reference Library

localvaluehelp() Example


Purpose

This example demonstrates the usage of localvaluehelp for Liquid UI fields.


User Interface



Liquid UI Script

To add localvaluehelp to a Liquid UI inputfield:

  1. Create a directory in your script folder entitled 'localvaluehelp'.
  2. In the directory, create a file called 'Dom.E.MATR.txt'.
  3. Inside the file, type the following:
    T-BW03-05 //Material1
    T-BW03-06 //Material2
    T-BW03-07 //Material3
    T-BW03-08 //Material4
    
  4. Save your changes and close the file.
  5. Add the following lines in the guixt.sjs file:
    historyonrightbutton = true;
    domains ="C:\\guixt\\localvaluehelp";		
  6. Open the VA01 script file and add the following code.
    inputfield([4,1],"Material",[4,10],{"name":"z_material","size":20});
    localvaluehelp("F[Material]",{"domain":"MATR"});
    text([4,35],"This example will display material values for this edit field on right click.");
    text([5,35],"Domain will be read from dom.Text.E.txt file"); 
    
    historyonrightbutton=true;
    domains = "\\\\company.com\\localvaluehelp";
  7. Save your changes and refresh the SAP screen.
  8. Right-click on the new field. The localvaluehelp will display as shown in the user interface above.

Once the configurations are applied in the guixt.sjs file as described above, localvaluehelp can be invoked in a variety of ways, such as following:

  • Assigning domains to SAP fields
  • Assigning domain names to SAP fields using coordinates
  • Assigning names to Liquid UI fields
  • Assigning domain names to Liquid UI fields using the nolabel parameter
  • Using WS objects

These methods are demonstrated in the following examples:


Assigning localvaluehelp to unlabeled Liquid UI fields

Using localvaluehelp with unlabeled Liquid UI fields.

You may sometimes want to create unlabeled inputfields. However, you can still assign localvaluehelp to an unlabeled field. The syntax:

inputfield([row,column],{"name":"name","nolabel":true,"size":"size"});
localvaluehelp("F[name]",{domain:"domain"});


Assigning localvaluehelp using objects

Using WS objects to assign localvaluehelp.

You can use the WS object to assign localvaluehelp to a Liquid UI 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.

  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.


Localvaluehelp with SAP domain names

Assigning localvaluehelp to SAP fields using domain names.

To assign a localvaluehelp domain to an SAP field using a domain name, please do the following:

  1. In the VA01 script file, type the following code:
    localvaluehelp("F[Material]",{domain:"MATR"});
  2. Save your changes and refresh the screen.

The localvaluehelp will appear, when you right-click on the field.


Localvaluehelp with coordinates

Assigning localvaluehelp to SAP fields using field coordinates.

In addition to using domain names, you can also assign localvaluehelp to inputfields using the fields' coordinates:

localvaluehelp("#[row,column]",{domain:"domain"});

This method is useful at times when the name of the field is not accessible. To assign localvaluehelp using coordinates, please do the following:

  1. In SAP, go to the VA01 screen and find the coordinates of the Order Type inputfield. For this exercise, we will assume that the field is located at the following coordinates:
    • Row: 3
    • Column: 22
  2. Open the VA01 script file and add the following code:
    localvaluehelp("#[3,22]",{domain:"MATR"});
  3. Right-click on the field to see the specified localvaluehelp.