Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Rahul Gera

Pages: 1 ... 4 5 [6]
76
SAP ROUTER configuration using Liquid UI Client:

Sample SAPgui Connection:



Sample Liquid UI ClientConnection:


77
Environment:
Liquid UI Server Version: 3.4.478.0 and above.

SAP ROUTER configuration using Liquid UI Server:

Sample SAPgui Connection:



Sample SAPPROXY.INI:

[control]
proxycount=1

[Proxy1]
ListenPort=3210                                                                                                                                              // (Liquid UI Client Instance/Port Number)
TargetServer=/H/<ROUTER-STRING>/S/<ROUTER-PORT>/H/<APPLICATION-SERVER-IP>/S/32<SAP Server Instance Number>      // (SAP Server Host Name or IP Address)
GuiXT=10

Sample SAPgui Connection after Liquid UI Server configuration:



78
This example, is to OPEN a URL with the click of a Liquid UI Pushbutton using VIEW command

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Author: Synactive, Inc. [1065 E. Hillsdale Blvd, Foster City, CA, 94404, USA]
// Email: support@guixt.com; sales@guixt.com;
// Contact: 650.341.3310
//////////////////////////////////////////////////////////////////////////////////////////////////////////////


Liquid UI Script:

pushbutton([TOOLBAR], "@01\\Qwww.liquid-ui.com@LiquidUI", "?", {"size":[1,25], "process":pm_launchpad, "using":{"l_layout":"htmlview", "l_html":"http://www.liquid-ui.com"}});
pushbutton([TOOLBAR], "@01\\Qwww.google.com@Google", "?", {"size":[1,25], "process":pm_launchpad, "using":{"l_layout":"htmlview", "l_html":"http://www.google.com"}});
pushbutton([TOOLBAR], "@01\\Qwww.yahoo.com@Yahoo", "?", {"size":[1,25], "process":pm_launchpad, "using":{"l_layout":"htmlview", "l_html":"http://www.yahoo.com"}});

function pm_launchpad(param){
                pm_layout = param.l_layout;
                pm_html = param.l_html;
}

if(pm_layout=="htmlview"){
                view([3,38], [30,193], "&V[pm_html]", {"floating":true});
                set("V[pm_layout]","");
                set("V[pm_html]","");
}

79
This example, is to convert a STRING type to NUMERIC type. This conversion needs to happen on Liquid UI variables with Numerical values assigned using SET command.

//////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Author: Synactive, Inc. [1065 E. Hillsdale Blvd, Foster City, CA, 94404, USA]
// Email: support@guixt.com; sales@guixt.com;
// Contact: 650.341.3310
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

Liquid UI Script:

// Integer
set("V[zstring]", "1000.28");
result = parseInt(zstring);

The value of resultwill be 1000 is a NUMERIC value.

// Float
set("V[zstring]", "1000.28");
result = parseFloat(zstring);

The value of resultwill be 1000.28 is a NUMERIC value.


// Removing COMMA and Converting to Integer
set("V[zstring]", "1,000.28");
result = parseInt(zstring.replace(/,/g,''"));

The value of resultwill be 1000 is a NUMERIC value.


// Removing COMMA and Converting to Float
set("V[zstring]", "1,000.28");
result = parseFloat(zstring.replace(/,/g,''"));

The value of resultwill be 1000.28 is a NUMERIC value.

80
Environment:
Liquid UI Server Version: 3.5.520.0 and above.

Purpose of Installation of License using Liquid UI Server:
- Liquid UI client does not have a License Installed.
- License not purchased from APP store / Google Play, or running on a temp license.

To Turn this feature ON, SAPPROXY.INI needs to be configured with CLIENTSY3 option. The license file specified in CLIENTSY3 path will be downloaded onto the device, upon a successful login of the user.

This means Liquid UI CLIENT customers, does not need to install the License manually.

Sample SAPPROXY.INI:

[control]
proxycount=1

[Proxy1]
ListenPort=3210                                                    // (Liquid UI Client Instance/Port Number)
TargetServer=SAPDEV.CORPNET.NET                   // (SAP Server Host Name or IP Address)
TargetServerPort=3200                                          // (SAP Server Instance/Port Number)
GuiXT=10
ClientSY3=\\Network\LiquidUI\CLIENT\License\LiquidUIClientLicense.sy3 // (Liquid UI Client License path)

81
Environment:
Liquid UI Server Version: 3.5.520.0 and above.

Purpose of TLS in Liquid UI Server:
For most secure network connectivity between Liquid UI Server and Liquid UI Client.
TLS is an encryption protocol used in SSL and HTTPS.
The encryption happens after a complex handshake and decides on an encryption cypher and session key to use on both ends.
To TURN-ON TLS, on Liquid UI Server one Server Certificate, and one Private Key which are specified in sapproxy.ini.

Sample SAPPROXY.INI:

[control]
proxycount=1

[Proxy1]
ListenPort=3210                                                     // (Liquid UI Client Instance/Port Number)
TargetServer=SAPDEV.CORPNET.NET                   // (SAP Server Host Name or IP Address)
TargetServerPort=3200                                          // (SAP Server Instance/Port Number)
GuiXT=10
servercert=R:\LiquidUI\sapproxy\servercert.pem  // (System Path for Server Certificate location)
privatekey=R:\LiquidUI\sapproxy\privatekey.pem  // (System Path for Private Key location)


Creating certificates using OPENSSL:
Certificate can be generated with the online openssl.exe tool, with the following commands:

>>openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout privatekey.pem -out servercert.pem

Note: -days means the valid days for this certificate.

You are about to be asked to enter information that will be incorporated into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.

Country Name (2 letter code) [AU]:US
State or Province Name (full name) [Some-State]:CA
Locality Name (eg, city) []:
Organization Name (eg, company) [Internet Widgits Pty Ltd]:Liquid UI Server
Organizational Unit Name (eg, section) []:LUS
Common Name (e.g. server FQDN or YOUR name) []:
Email Address []:



82
Liquid UI Code:

ScreenScript:
pushbutton([1,10], "TEXT LABEL", "/0", {"process":inputfunction,"using":{'label1':z_guixt_var1, 'label2':z_guixt_var2}});

Function Script:
function inputfunction(param){
           z_label1=param.label1;
           z_label2=param.label2;
 }

83
/* ******************************************************************
Function: getAuthorizations
Parameters:

Purpose: Calls function to read user SAP Profile
****************************************************************** */
function getAuthorizations(){
   call('BAPI_USER_GET_DETAIL', {"in.USERNAME":"&V[_user]","table.PROFILES":"Z_PROFILES"});
}

/* ******************************************************************
Function: profileExists
Parameters:
   profileName
Purpose: Checks to see if current user has the profileName match
****************************************************************** */
function profileExists(profileName) {
   for (ii = 0; ii < Z_PROFILES.length; ii++)   {
      if(profileName == Z_PROFILES[ii].toString().substring(0,12).trim()) {
         return true;
      }
   }
   return false;
}

84
/* *******************************************************************
Function: getAuthorizations
Parameters:

Purpose: Calls function to read user SAP Role
******************************************************************* */

function getAuthorizations(){
   call('BAPI_USER_GET_DETAIL', {"in.USERNAME":"&V[_user]","table.ACTIVITYGROUPS":"Z_ROLES"});
}

/* *******************************************************************
Function: roleExists
Parameters:
   roleName
Purpose: Checks to see if current user has the roleName match
******************************************************************* */

function roleExists(roleName){
   for (ii = 0; ii < Z_ROLES.length; ii++)   {
      var z_userrole = Z_ROLES[ii].toString().substring(0,30).trim();
      if(z_userrole == roleName) {
         return true;
      }
   }
   return false;
}

85
GuiXT.SJS File:

=============================================
//WS Configuration File

license = [];
license.push({"license":"1-XX-37296-0-7029-XXXXX-B67BC","data":{"company":"LiquidUI","systemid":["DEV","QAS","SBX","PRD"]}});

rfcuser = "rfcuser";
rfcunencryptedpassword = "rfcpassword";

rfcconnect = ["IFDATABASE=DEV, CLIENT=200, ASHOST=SAPDEV, SYSNR=00",
                     "IFDATABASE=QAS, CLIENT=300, ASHOST=SAPQAS, SYSNR=00"];

usercatalog="C:\\Folder\\SubFolder\\usercatalog.txt";  // Location of USERCATALOG file

OPENCONSOLE    =    0x00008000;
HIDECONSOLE    =    0x00000000;
TRACE_RFCCALL   =    0x10000000;

//TRACEFLAGS = HIDECONSOLE;
TRACEFLAGS = OPENCONSOLE;
=============================================

UserCatalog File:

=============================================
//----- User Configurations
// User groups:
// make correspondence to 1-4 script directories


SU         "C:\LiquidUI\Scripts\Directory"
SA         "\\network\Scripts\Directory"
DEV         "SAPWR:Z.SAP_OBJECT"
XX         None

//User:
// make correspondence to one user group
// because there is no '*' user designation, only specified users are allowed.


// SAP ROLES
// ROLES FOR SUPPORT

Role=ZLIQUIDSU         SU

// ROLES FOR SALES
Role=ZLIQUIDSA         SA

// ROLES FOR DEVELPOMENT
Role=ZLIQUIDDEV         DEV
=============================================

86
GuiXT.SJS File:

=============================================
//WS Configuration File

license = [];
license.push({"license":"1-XX-XXXXX-0-7029-XXXXX-B67BC","data":{"company":"LIQUIDUI","systemid":["DEV","QAS","SBX","PRD"]}});

rfcuser = "rfcuser";
rfcunencryptedpassword = "rfcpassword";

rfcconnect = ["IFDATABASE=DEV, CLIENT=200, ASHOST=SAPDEV, SYSNR=00",
                     "IFDATABASE=QAS, CLIENT=300, ASHOST=SAPQAS, SYSNR=00"];

usercatalog="C:\\Folder\\SubFolder\\usercatalog.txt";  // Location of USERCATALOG file

OPENCONSOLE    =    0x00008000;
HIDECONSOLE    =    0x00000000;
TRACE_RFCCALL   =    0x10000000;

//TRACEFLAGS = HIDECONSOLE;
TRACEFLAGS = OPENCONSOLE;
=============================================

UserCatalog File:

=============================================
//----- User Configurations
// User groups:
// make correspondence to 1-4 script directories


M1         "C:\LiquidUI\Scripts\Directory"
M2         "\\network\Scripts\Directory"
M3         "SAPWR:Z.SAP_OBJECT"
XX         None

//User:
// make correspondence to one user group
// because there is no '*' user designation, only specified users are allowed.


200/USER1   M1
300/USER2   M2
200/USER3   M3
=============================================

87
WS aka Web Scripts (Attended RPA for SAP) / Reading Values from JSON Object
« on: February 13, 2017, 04:24:24 PM »
Liquid UI Code:


Function Script:

=========================================================================

load('wscurl');

/* Function is used to input text in a non-Western language and then use a service
    such as Google Translate to change the text into English or some other language */

function translate(param){   
    var z_text = param.toTranslate;
    var z_language = param.targetLang;
   
    /* Initialize the Curl object for making the call*/
    var wsCurl = new Curl();
   
    /* Fixed string to fetch data after translation from googleapis.com*/
    var baseURL = "https://www.googleapis.com/language/translate/v2?key=AIzaSyChzKkNGfmuBAhZXPD7Pw-1nl4e0c6shNw&q=";
   
    /* Say the text you want to convert is stored in variable "z_text", lets covert it to URI for web*/
    var textToConvert = encodeURI(z_text);
   
    /* Set source language identifier*/
    var sourceLangIdentifier = "&source=";
   
    /* Set source language (see language format below)*/
    var sourceLang = "en";
   
    /* Set translation language identifier*/
    var translateLangIdentifier = "&target=";
   
    /* Set translation language (see language format below)*/
    var translateLang = z_language;
       
    /* LANGUAGE FORMAT:
     * google.language.Languages:
     *
     * 'AFRIKAANS' : 'af',
     * 'ALBANIAN' : 'sq',
     * 'AMHARIC' : 'am',
     * 'ARABIC' : 'ar',
     * 'ARMENIAN' : 'hy',
     * 'AZERBAIJANI' : 'az',
     * 'BASQUE' : 'eu',
     * 'BELARUSIAN' : 'be',
     * 'BENGALI' : 'bn',
     * 'BIHARI' : 'bh',
     * 'BULGARIAN' : 'bg',
     * 'BURMESE' : 'my',
     * 'CATALAN' : 'ca',
     * 'CHEROKEE' : 'chr',
     * 'CHINESE' : 'zh',
     * 'CHINESE_SIMPLIFIED' : 'zh-CN',
     * 'CHINESE_TRADITIONAL' : 'zh-TW',
     * 'CROATIAN' : 'hr',
     * 'CZECH' : 'cs',
     * 'DANISH' : 'da',
     * 'DHIVEHI' : 'dv',
     * 'DUTCH': 'nl',
     * 'ENGLISH' : 'en',
     * 'ESPERANTO' : 'eo',
     * 'ESTONIAN' : 'et',
     * 'FILIPINO' : 'tl',
     * 'FINNISH' : 'fi',
     * 'FRENCH' : 'fr',
     * 'GALICIAN' : 'gl',
     * 'GEORGIAN' : 'ka',
     * 'GERMAN' : 'de',
     * 'GREEK' : 'el',
     * 'GUARANI' : 'gn',
     * 'GUJARATI' : 'gu',
     * 'HEBREW' : 'iw',
     * 'HINDI' : 'hi',
     * 'HUNGARIAN' : 'hu',
     * 'ICELANDIC' : 'is',
     * 'INDONESIAN' : 'id',
     * 'INUKTITUT' : 'iu',
     * 'ITALIAN' : 'it',
     * 'JAPANESE' : 'ja',
     * 'KANNADA' : 'kn',
     * 'KAZAKH' : 'kk',
     * 'KHMER' : 'km',
     * 'KOREAN' : 'ko',
     * 'KURDISH': 'ku',
     * 'KYRGYZ': 'ky',
     * 'LAOTHIAN': 'lo',
     * 'LATVIAN' : 'lv',
     * 'LITHUANIAN' : 'lt',
     * 'MACEDONIAN' : 'mk',
     * 'MALAY' : 'ms',
     * 'MALAYALAM' : 'ml',
     * 'MALTESE' : 'mt',
     * 'MARATHI' : 'mr',
     * 'MONGOLIAN' : 'mn',
     * 'NEPALI' : 'ne',
     * 'NORWEGIAN' : 'no',
     * 'ORIYA' : 'or',
     * 'PASHTO' : 'ps',
     * 'PERSIAN' : 'fa',
     * 'POLISH' : 'pl',
     * 'PORTUGUESE' : 'pt-PT',
     * 'PUNJABI' : 'pa',
     * 'ROMANIAN' : 'ro',
     * 'RUSSIAN' : 'ru',
     * 'SANSKRIT' : 'sa',
     * 'SERBIAN' : 'sr',
     * 'SINDHI' : 'sd',
     * 'SINHALESE' : 'si',
     * 'SLOVAK' : 'sk',
     * 'SLOVENIAN' : 'sl',
     * 'SPANISH' : 'es',
     * 'SWAHILI' : 'sw',
     * 'SWEDISH' : 'sv',
     * 'TAJIK' : 'tg',
     * 'TAMIL' : 'ta',
     * 'TAGALOG' : 'tl',
     * 'TELUGU' : 'te',
     * 'THAI' : 'th',
     * 'TIBETAN' : 'bo',
     * 'TURKISH' : 'tr',
     * 'UKRAINIAN' : 'uk',
     * 'URDU' : 'ur',
     * 'UZBEK' : 'uz',
     * 'UIGHUR' : 'ug',
     * 'VIETNAMESE' : 'vi',
     * 'UNKNOWN' : ''
     */
   
     
    /* Build the URL to make a call*/
    var completeURL = baseURL + textToConvert + sourceLangIdentifier + sourceLang + translateLangIdentifier + translateLang;
    set("V[g_URL]",completeURL);
    /* This is the URL for your translation request. Note this use is for
     * calls made to Google Translate which returns us the JSON object in string */

    wsCurl.setopt(Curl.CURLOPT_URL, completeURL);
   
    /* Final step is to call execute to dispatch email. You can check the return
     * code to avoid errata string which can be found from "wsCurl.error"
     * return value 0 means success */

    var response = wsCurl.exec();
    var error = wsCurl.error;
    posStart = response.lastIndexOf(":") + 2;
    posEnd = response.lastIndexOf("\"") + 1;
    strTranslated = response.substring(posStart,posEnd);
   
    set("V[g_translated]", strTranslated);

    /* Response of THIS particular query is JSON. You can get HTML for other URLs
     * Parse to suite your requirements
     * e.g. response from the ABOVE URL is JSON string which looks like
     * {
     *    "data": {
     *        "translations": [
     *            {
     *                "translatedText": "Bonjour tout le monde"
     *                }
     *            ]
     *        }
     *  }
     */

   
   // This will Convert the Response text into a Key Pair Object so we can get the Values
   var JSON_Data = eval("(" + response + ")");
   var TranslatedText = JSON_Data.data.translations.translatedText;


    /* Close the http connection for the URL fetch*/
    wsCurl.close();
   
    /* Remove any reference for Garbage Collection*/
    wsCurl= NULL;
}
=========================================================================


User Interface SCRIPT:

=========================================================================

clearscreen();
inputfield([1,1], "Orignal String", [1,15], {"name":"g_source1", "size":50});
inputfield([3,1], "Target Language", [3,15], {"name":"g_langugage1", "size":5});
if(isBlank(g_URL)){
    g_URL = "";
}
text([7,1], "URL:  " + "&V[g_URL]" );
if(isBlank(g_translated)){
    g_translated = "";
}
inputfield([9,1], "Target String", [9,15], {"name":"g_translated", "size":200});
pushbutton([TOOLBAR], 'toTranslate', '?',{"process":translate, "using":{"toTranslate":g_source1,"targetLang":g_langugage1}});
=========================================================================

Pages: 1 ... 4 5 [6]