Liquid UI - WS Reference Library

textbox()


Purpose

With textbox(), you can display and edit a text.


Syntax

textbox([startrow,startcol],[endrow,endcol],{"name":"name","option":"option"});


Properties

  • startrow, startcol, endrow, endcol - row and column co-ordinates


Available Options

You can use the following options with the textbox:

"nowordwrap":".."

"nowordwrap":true - The text does not wrap and the user has to click Enter to start a new line.

"readonly":".."

"readonly":true - The text cannot be changed.

"textfont":".."

"textfont":"font_name" - Specifies the selected font. Default font is Arial.

"textheight":".."

""textheight":x - Sets the text height in pixels. Default height is 12.

"textweight":".."

""textweight":x - Sets the text weight. Default weight is 5 and default bold setting is 7.


Options Detail

nowordwrap

  1. This option stops auto text wrap. The user has to click Enter to start a new line in textbox.

  2. textbox([1,5],[5,50],{"name":"z_mm0x_gen_text","nowordwrap":true});
  3. As per the code, user has to hit the enter key manually to initiate the text from new line.

readonly

  1. The readonly option will make a text box non-editable. User will not be able to change the default text present in the textbox.

  2. textbox([1,5],[5,50],{"name":"z_va0x_soldToPartyDesc","readonly":true});
  3. As we have set readonly to true, we cannot edit the textbox.

textfont

  1. This option specifies text font in the text box. Default font is Arial.

  2.  textbox([1,5],[5,50],{"name":"z_mm0x_gen_text",'textfont':'Arial'});
  3. The text entered in the textbox would appear in arial font.

textheight

  1. This option specifies the height of the text in pixels. Default height is 12.

  2.  textbox([1,5],[5,50],{"name":"z_mm0x_gen_text",'textheight':'12'});
  3. The height of the text characters in the textbox is 12.

textweight

  1. This option specifies text weight in the text box. The range is from 1 (thin) to 9 (heavy). Default weight is 5 and the default bold setting is 7.

  2. textbox([1,5],[5,50],{"name":"z_mm0x_gen_text",'textweight':'5'});
  3. The weight of the text characters in the textbox is 5.


Example

Creating a textbox

In this example, we will create a textbox on the SU01 screen in SAP. To demonstrate the process of creating new textbox, please do the following:

  • Go to SU01 screen.
  • Open the 'SAPLSUU5.E0050.sjs' script file and enter the code from the below script. Create the file if it does not exist.
  • Save the changes and refresh the SAP screen. It will display as sown below:


Script

textbox([7,0],[11,51],{"textfont":"Arial","textheight":"12","textweight":"5"});


Tips and Tricks

  • Creating a Notification

    The scenario provides a simplified option to create a Plant Maintenance notification. The initial screen provides users to select a notification type and enter the notification details on PM Notification screen. Then,  based on the notification type selected, the final screen appears with the notification details auto populated from the Create Notification - Initial screen, as shown in the following:

    Create Notification Screen - Liquid UI
    Create Notification - Final Screen 

    textbox([8,15],[14,66],{"name":"z_iw21_textbox1","enter text":true,"textfont":"Arial","left":true,"textheight":"15","textweight":"5"});
  • Copy text between files

    The copytext and textbox are employed together to copy text between files, screen areas and text variables. For example navigate to iw21 transaction and execute the following code:

    copytext({"fromtext":"z_iw21_textbox1","toscreen":"X[TEXT]","append":true});

    Learn more about Copy text using copytext and textbox.