Liquid UI - Documentation - 19.24 Retaining Liquid UI design in old session

19.24 Retaining Liquid UI design in old session


Prerequisites

Purpose

Learn how to retain the customized Create Material screen in an old session even after opening a Material Document List screen in the new session using a function. The following steps will guide you.

  1. Delete unnecessary elements on the SAP screen
  2. Reposition the required screen elements
  3. Add group boxes
  4. Add radio buttons
  5. Add input fields
  6. Add push buttons
  7. Add checkbox
  8. Add a function to call another function and open the required transaction in a new session
  9. Add a function to change the SAP user interface


User Interface

//Create this file inside your script folder for customizing the Create Material ( Initial Screen), SAPMV45A.E0101.sjs

//Now, let's add the Liquid UI script to the above file and save it.


Customization

  1. Delete unnecessary screen elements on the Create Material (Intitial Screen).
     
    //Deletes Material input field 
    del("F[Material]");
    //Deletes Change Number input field 
    del("F[Change Number]");
    //Deletes Copy from... group box
    del("G[Copy from...]");
    
     
     
  2. Change the position of the Industry sector and Material Type input fields.
     
    // Changes the position of the Industry Sector input field 
    pos("F[Industry sector]", [4,33]);
    // Changes the position of the Material Type input field
    pos("F[Material Type]", [5,33]);
     
     
  3. Incorporate a group box without a title, followed by three additional labeled group boxes: Organizational Data, MRP Data, and Basic Data. These group boxes should contain the appropriate fields within them.
     
    //Creates a group box with no label
    box([2,19], [27,82], "");
    //Creates a group box with Organizational Data as label
    box([7,21], [11,81], "Organizational Data");
    //Creates a group box with MRP Data as label
    box([19,21], [23,81], "MRP Data");
    //Creates a group box with Basic Data as label
    box([13,21], [18,81], "Basic Data");
    
     
     
  4. Add three radio buttons with the label as Plant 1000, Plant 2000, and Plant 3000 to select any of the required plant value.
     
    //Creates a radiobutton Plant 1000 with technical name as z_mm01_plant and value as 1000
    radiobutton([8,22], "Plant 1000",{"name":"z_mm01_plant", "value":1000});
    //Creates a radiobutton Plant 2000 with technical name as z_mm01_plant and value as 2000
    radiobutton([8,42], "Plant 2000",{"name":"z_mm01_plant", "value":2000});
    //Creates a radiobutton Plant 3000 with technical name as z_mm01_plant and value as 3000
    radiobutton([8,62], "Plant 3000",{"name":"z_mm01_plant","value":3000});
    
     
     
  5. Add five input fields Stor. Loc, Desc, BUOM, Mat grp, Mrp type to enter the values to create a material.
     
    //Creates an input field Stor.Loc with technical name as z_mm01_storloc, searchhelp value as H_T001L, and it is a mandatory field
    inputfield( [10,22], "Stor.Loc", [10,33],{ "name":"z_mm01_storloc", "size":4, "required":true, "searchhelp":"H_T001L"});
    //Creates an input field Desc. with technical name as z_mm01_desc
    inputfield( [15,29], "Desc.", [15,39],{ "name":"z_mm01_desc", "size":32});
    //Creates an input field BUOM with technical name as z_mm01_buom and technical name as MARA-MEINS
    inputfield( [16,29], "BUOM", [16,39],{ "name":"z_mm01_buom", "size":2, "techname":"MARA-MEINS"});
    //Creates an input field Mat grp with technical name as z_mm01_matgrp           
    inputfield( [17,29], "Mat grp", [17,39],{ "name":"z_mm01_matgrp", "size":7});                             
    //Creates an input field Mrp type with technical name as z_mm01_mrptype          
    inputfield( [21,29], "Mrp type", [21,40],{ "name":"z_mm01_mrptype", "size":5});
     
     
  6. Add two push buttons Create Material and List of materials to run the required process on click.
     
    //Creates Create Material push button to run mm01_create process.
    pushbutton([25,39], "@2L@Create Material   ",{ "process":mm01_create});
    //Creates List of materials push button to run mb51_list_materials process.
    pushbutton([TOOLBAR],"List of materials","?",{"process":mb51_list_materials});
    
     
     
  7. Add the Bulk Material checkbox to assign its value.
     
    //Creates Bulk Material checkbox with technical name as z_mm01_blkmat
    checkbox([21,54], "Bulk Material",{"name":"z_mm01_blkmat", value:"bulk"});
    
     
     
  8. Add a function to open MB51 transaction in a new session and execute the mm01_screen function on the create material screen.
     
    //Creates mb51_list_materials function to open MB51 transaction in new session
    function mb51_list_materials(){
       onscreen 'SAPLMGMM.0060'
          mm01_screen();
          set("V[z_mm01_flag]", "X");
          enter("/oMB51");
    }
    
     
  9. Add a function to customize Create Material (Intitial Screen) on execution.
     
    //Create mm01_screen function to retain the Liquid UI design even after opening a new session.
    // Screen design should be loaded in a function to keep the old session design
    function mm01_screen(){   
    del("F[Material]");
    del("F[Change Number]");
    del("G[Copy from...]");
    pos("F[Industry sector]", [4,33]);
    pos("F[Material Type]", [5,33]);
    box([2,19], [27,82], "");
    box([7,21], [11,81], "Organizational Data");
    radiobutton([8,22], "Plant 1000",{"name":"z_mm01_plant", "value":1000});
    radiobutton([8,42], "Plant 2000",{"name":"z_mm01_plant", "value":2000});
    radiobutton([8,62], "Plant 3000",{"name":"z_mm01_plant","value":3000});
    inputfield( [10,22], "Stor.Loc", [10,33],{ "name":"z_mm01_storloc", "size":4, "required":true, "searchhelp":"H_T001L"});
    box([13,21], [18,81], "Basic Data");
    inputfield( [15,29], "Desc.", [15,39],{ "name":"z_mm01_desc", "size":32});
    inputfield( [16,29], "BUOM", [16,39],{ "name":"z_mm01_buom", "size":2, "techname":"MARA-MEINS"});
    inputfield( [17,29], "Mat grp", [17,39],{ "name":"z_mm01_matgrp", "size":7});
    box([19,21], [23,81], "MRP Data");
    inputfield( [21,29], "Mrp type", [21,40],{ "name":"z_mm01_mrptype", "size":5});
    checkbox([21,54], "Bulk Material",{"name":"z_mm01_blkmat"});
    pushbutton([25,39], "@2L@Create Material   ",{ "process":mm01_create});
    pushbutton([TOOLBAR],"List of materials","?",{"process":mb51_list_materials});
    }
    
     

SAP Process

  1. Refresh the MM01 screen and click the List of materials toolbar push button. This opens the MB51 transaction screen in a new session while keeping the customized MM01 screen in the old session.
     
     


Next Steps

Processing Statistics Calculation
Learn how to calculate the process statistics for required transactions on SAP GUI.

10 min.

This article is part of the Invoking functions tutorial.


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