Liquid UI - Documentation - 17.07 Copy text from one screen to another screen

17.07 Copy text from one screen to another screen


Purpose

The article is a demonstration of how to copy text from one screen to another using text(), focusing on the Create PM Notification: Initial Screen and Create Material (Initial Screen). 

SAP screen Text Modification commands

Syntax Description
text([row_number,col_number],"Text Label",{option:"optionvalue"}); Adds text to a SAP screen.
var z_txt = "text"; text([rows,cols],+z_txt); Adds text to a SAP screen from a variable.
text("C[checkboxName]","New Name"); Changes a checkbox's name.
text("F[fieldName]","New Name"); Changes an input field's name.
text("O[optionMenu_label]","New option menu label"); text("O[functionKey_label]","New function key label"); Changes the label of a context menu or a function key.
text("P[pushbuttonName]","New Name"); Changes a pushbutton's name.
text("R[radiobuttonName]","New Name"); Changes a radio button's name.
text("T[tabName]","New Name"); Changes a tab's name.

User Interface

Text display using variable

//Create the file SAPLIQS0.E0100.sjs inside your scripts folder for customizing the Create PM Notification: Initial Screen.
//Now, add the Liquid UI script to the above file and save it.

In this example, we will customize the Create PM Notification: Initial Screen using Liquid UI through the following steps.

  1. Navigate to Create PM Notification: Initial Screen and change the screen title using the title().
     
    //Changes the screen title
    title ("Create PM Notification - Liquid UI");
    
     
     
  2. Delete the Notification input field and Reference group box using the del().
     
    //Deletes Notification and Reference input field
    del("F[Notification]");
    del("G[Reference]");
    
     
     
  3. Change the Notification type input field to Select Notification type and add a text box labeled Enter Notification Information using the text(), as shown below.
     
    //Changes screen element name and adds text box
    text("F[Notification type]","Select Notification type",{"text":true});
    text([7,30],"Enter Notification Information");
    textbox([8,15],[14,66],{"name":"z_iw21_textbox","textfont":"Arial","textheight":"30","textweight":"5"});
    
     
     
  4. Add a push button labeled Notify to execute the iw21_copytext process on click.
     
    //Creates a pushbutton to execute the process
    pushbutton([16,35],"Notify",{"process":iw21_copytext}); 
    
     
     
  5. Add the iw21_copytext function to copy the notification entered in the textbox to the next screen.
     
    //Function to copy the notification entered
    function iw21_copytext()
    {
    //Create PM Notification:Maintenance request
    onscreen 'SAPLIQS0.7200'
    copytext({"fromtext":"z_iw21_textbox","toscreen":"X[TEXT]"});
    }
    

SAP Process

  1. Refresh the SAP screen, enter the notification type, and enter the details in the Enter Notification Information box. Click the Notify push button to navigate to the final notification screen, as shown below.
     
     

Text display using variable

//Create the file SAPLMGMM.E0060.sjs inside your scripts folder for customizing the Create PM Notification: Initial screen.
//Now, add the Liquid UI script to the above file and save it.

  1. Login to SAP, navigate to the MM01 screen and add text labeled Raw Material concerning the Material input field.
     
    //Creates text Raw Material parallel to the Material input field
    text("F[Material]+[0,46]","Raw Material");
    

SAP Process

  1. Refresh the SAP screen, then you can see the text Raw Material is displayed parallel to the Material input field, as shown in the image below.
     
     

Can't find the answers you're looking for?