Liquid UI - Documentation - 20.07 Scenario 4 - Creating a Notification

20.07 Scenario 4 - Creating a Notification


Prerequisites


Purpose

Learn how to send notification details from one screen to another as per the requirement to create a notification. To explain this, we’ll walk you through the following steps.

  1. Change the title of the screen using title()
  2. Delete the Reference group box
  3. Customize the screen based on the transaction
  4. Add a function to copy and send the notification details

 

//Create this file inside your script folder for customizing the Create Notification screen SAPLIQSO.E0100.sjs
//Now, let's add the Liquid UI script to the above file and save it.

  1. Navigate to IW21 (Create PM Notification: Initial Screen) and change the title of the screen to Create PM Notification - Liquid UI, as shown below:
     
    //Changes the title of the screen
    title("Create PM Notification - Liquid UI"); 
    
     
  2. Using the del command, delete the Reference group box existing on the screen.
     
    // Deletes the reference group box
    del("G[Reference]"); 
    
     
  3. Assign a null value to the z_iw21_textbox1 variable.
     
    set("z_iw21_textbox1",""); 
     
  4. Add a function to customize your screen with the required screen elements on the screen.
     
    // Function to toggle the flag 
    if(_transaction=="IW21") {
      text([7,25],"Enter Notification Information",{"size":30});
      textbox([8,15],[14,66],{"name":"z_iw21_textbox1","enter text{":true,"textfont":"Arial","left":true,"textheight":"15","textweight":"5"});
      pushbutton([16,29],"@12@Create Notification","?",{"process":iw21_copytext}); 
    del("F[Notification]");
      text("F[Notification type]","Select Notification type",{"intensified":true,"text":true}); 
    }
    
     
  5. Add a function to copy the text entered in the Create PM notification initial screen to the textbox under the Maintenance request screen.
     
    // Function to copy the text from initial screen to final screen
    function iw21_copytext(){
      //Create PM Notification:Maintenance request
      enter();
      onscreen 'SAPLIQS0.7200' 
    copytext({"fromtext":"z_iw21_textbox1","toscreen":"X[TEXT]","append":true}); 
     } 

     
  6. Enter the Notification Type and notification details on the screen, as shown below; Click Create Notification.
     

     
  7. You will see the notification details copied from the initial screen to Create PM Notification: Maintenance Request screen, as shown below.
     
     

This article is part of the Screens combination/aggregation tutorial.


Next Steps

Get server name using _ashost variable
Learn how to acquire the SAP server name and customize the screen based on the SAP server.

5 min

This article is also a part of the Conditional scripts tutorial.

Attached files: sapliqs0.e0100.SJS, sapliqs0.e0100.sjs


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