Author Topic: Create Multiple Layouts on Same Screen  (Read 2096 times)

Benjamin Dasari

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 95
    • View Profile
Create Multiple Layouts on Same Screen
« on: February 19, 2016, 07:23:38 PM »
Purpose:
The same SAP screen can be used to display multiple layouts or different launch pads by passing different parameters.

Liquid UI Code:

// User Interface
// SAPLSMTR_NAVIGATION.E0100.sjs

del('X[IMAGE_CONTAINER]');      // Delete AxtiveX Container on SAP Easy Access screen

function isBlank(jvar){         // Function is called to validate if the variable holds blank or null value
   return(jvar == "" || jvar == null || jvar == void 0);
}

function next_screen(param) {   // Function to change layout based on parameter passed   
   set('V[z_view_layout]',param.l_scrn);
}

if(isBlank(z_view_layout)){
   box([2,9], [13,56], "Main Menu");
   pushbutton([4,20], "Material Management  ", { "process":next_screen, "size":[2,20], "using":{l_scrn:"MM"}});
   pushbutton([7,20], "Sales & Distribution ", { "process":next_screen, "size":[2,20], "using":{l_scrn:"SD"}});
   pushbutton([10,20], "Plant Maintenance    ", { "process":next_screen, "size":[2,20], "using":{l_scrn:"PM"}});
}

if(z_view_layout == 'MM'){
   box([2,9], [13,56], "Material Management");
   pushbutton([4,20], "Create Material      ", "/nmm01", { "size":[2,20]});
   pushbutton([7,20], "Change Material      ", "/nmm02", { "size":[2,20]});
   pushbutton([10,20], "Display Material     ", "/nmm03", { "size":[2,20]});
   pushbutton('[toolbar]', "@9S@ Back", { "process":next_screen,"size":[2,20], "using":{l_scrn:""}});
}

if(z_view_layout == 'SD'){
   box([2,9], [13,56], "Sales & Distribution");
   pushbutton([4,20], "Create Sales Order   ", "/nva01", { "size":[2,20]});
   pushbutton([7,20], "Change Sales Order   ", "/nva02", { "size":[2,20]});
   pushbutton([10,20], "Display Sales Order  ", "/nva03", { "size":[2,20]});
   pushbutton('[toolbar]', "@9S@ Back", { "process":next_screen,"size":[2,20], "using":{l_scrn:""}});
}

if(z_view_layout == 'PM'){
   box([2,9], [13,56], "Plant Maintenance ");
   pushbutton([4,20], "Create Notification  ", "/niw21", { "size":[2,20]});
   pushbutton([7,20], "Change Notification", "/niw22", { "size":[2,20]});
   pushbutton([10,20], "Display Notification ", "/niw23", { "size":[2,20]});
   pushbutton('[toolbar]', "@9S@ Back", { "process":next_screen,"size":[2,20], "using":{l_scrn:""}});
}


See attachments for code samples!
« Last Edit: February 19, 2016, 07:52:31 PM by Benjamin Dasari »