Author Topic: System Variable - _ashost  (Read 6822 times)

Sai Siddhartha

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 47
    • View Profile
System Variable - _ashost
« on: August 31, 2017, 10:16:28 AM »
This is an example of using system variable "_ashost". This system variable specifies the actual server name of the given SAP server.
Operations can be performed  based on a particular system name. this is particularly useful when users are connecting to multiple SAP ERP systems.

In the following example, based on the server name we navigate to different transactions using a single function.

Liquid UI Code:

///////////////////////// 'SAPLSMTR_NAVIGATION.E0100.sjs ///////////////////////////

println("Name of the server in use is "+_ashost);
del("X[IMAGE_CONTAINER]");
if(_ashost == "juneau"){
     set("V[z_tran]","/nVA01");
}
else if(_ashost == "ZEUS"){
     set("V[z_tran]","/nMM01");
}
onUIEvents['enter']=z_navigate;

//on enter navigates to "VA01" if server is Juneau and to "MM01" if server is zues
function z_navigate(){
     // SAP Easy Access
     onscreen 'SAPLSMTR_NAVIGATION.0100'
          enter("&V[z_tran]");
}