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 - Sai Siddhartha

Pages: 1 [2] 3 4
16
Purpose:
Assign values entered into Liquid UI table into SAP table with Liquid UI function.

Below example demonstrates assigning of values form Liquid UI table created on easy access screen into "All Items" table of VA01 transaction.

Liquid UI Code:
////////////////////////////// SAPLSMTR_NAVIGATION.E0100.sjs ///////////////////////////////

del("X[IMAGE_CONTAINER]"); // deletes image
pushbutton( [TOOLBAR], "Assign to SAP Table","?",{  "process":z_AssigntoSAPTbale,"size":[2,23]}); // pushbutton to call function

//creating table
table([1,5],[10,45],{"name":"va01_AllItems","title":"All items", "rows":10, "rowselection":true,"columnselection":true});
column('Item',{"table":"va01_AllItems","size":4,"name":"z_va01_item","position":1});
column('Material',{"table":"va01_AllItems","size":15,"name":"z_va01_material","position":2});
column('Order Quantity',{"table":"va01_AllItems","size":15,"name":"z_va01_Orderquantity","position":3});

//function to assign values to All Items table
function z_AssigntoSAPTbale(){
   k = 0; //declaring variables and arrays
   temp_items=[];
   temp_material=[];
   temp_quantity=[];
   
        // code to fetch data from Liquid table to arrays
   STARTLABEL:   
   z_temp1 = va01_AllItems.z_va01_item[k];   
   z_temp2 = va01_AllItems.z_va01_material[k]; 
   z_temp3 = va01_AllItems.z_va01_Orderquantity[k];
   
   if(isBlank(z_temp1) && isBlank(z_temp2) && isBlank(z_temp3)){
      goto ENDLOOP;
   }
   
   temp_items.push(z_temp1);
   temp_material.push(z_temp2);
   temp_quantity.push(z_temp3);
   k=k+1;
   goto STARTLABEL;
   
   ENDLOOP:
   enter('/nva01');

// Create Standard Order: Overview
onscreen 'SAPMV45A.0101'
   set('F[Order Type]', 'OR');
   enter();

// Create Standard Order: Overview
onscreen 'SAPMV45A.4001'
   set('F[Sold-to party]', '1460');
   enter();

// Logic to assign array values to All item table
onscreen 'SAPMV45A.4001'
   gettableattribute("T[All items]", {"lastvisiblerow":"LVisRow"}) // gets lastvisible row
   var z=1;
   for(j=0;j<LVisRow;j++){  // assign values to visible rows in table
      z_item_temp = temp_items[j];
      z_item_material = temp_material[j];
      z_item_quantity = temp_quantity[j];   
      set("cell[All items,Item,&V[z]]" , "&V[z_item_temp]");   
      set("cell[All items,Material,&V[z]]" , "&V[z_item_material]");
      set("cell[All items,Order Quantity,&V[z]]" , "&V[z_item_quantity]");
      z=z+1;
   }

   // on enter cursor moves to next row in table
   START:
   enter();

// logic assign values to rows after scrolling table using enter()
onscreen 'SAPMV45A.4001'   
   z_item_temp = temp_items[j];
   z_item_material = temp_material[j];
   z_item_quantity = temp_quantity[j];
   set("cell[All items,Item,&V[LVisRow]]" , "&V[z_item_temp]");
   set("cell[All items,Material,&V[LVisRow]]" , "&V[z_item_material]");
   set("cell[All items,Order Quantity,&V[LVisRow]]" ,  "&V[z_item_quantity]");
   j=j+1;

   if(j<=i){ // loops until all liquid ui table values are assigned to sap table
      goto START;
   }
   enter();
}

After executing you can see values from Liquid UI table assigned to "All Items" table of "VA01" transaction.

See Attachment for more information and screenshots.

17
WS aka Web Scripts (Attended RPA for SAP) / Creating Files with WS function
« on: November 09, 2017, 07:47:26 AM »
Purpose:
To create file with WS function using ActiveXObject object.

Usage:
ActiveXObject adds support for the Microsoft COM objects. It enables user to utilize the local file system.
Using this functionality we can create a new file in any specified folder. It comes in handy if user wants to create any logfiles.

ActiveXObject requires the wsoffice.dll installed and loaded before making the call.

Below example demonstrates the creating of text file with filename as current date and time in a specified folder and add text to it.

Liquid UI Code:
////////////////////////////// SAPLIQS0.E0100.sjs ///////////////////////////

load("wsoffice.dll"); // loads wsoffice.dll file
onUIEvents['Enter'] = {"process":iw21_createfile}; //  executes function on clicking enter

function iw21_createfile(){
        var d = new Date();
        var fso  = new ActiveXObject("Scripting.FileSystemObject"); // creates activex object
        //creates file with current date and time as filename
        var fh = fso.CreateTextFile("C:\\guixt\\Files\\"+d.getFullYear()+""+(d.getMonth()+1)
        +""+d.getDate()+""+d.getHours()+""+d.getMinutes()+" "+d.getSeconds()+".txt", true);
         fh.WriteLine("some text goes here..."); // adds text to file
         fh.close(); // close created file
}

Navigate to path specified to view created files.

See attachment for screenshots



18
Process:
The linerecordsplit command is used to break up a long string into its component parts based on the parameters.

Syntax:
var elementArr = linerecordsplit(z_string, [{"label":"Name1", "length":10}, {"label":"Name2", "length":20}]);
label: the label is always paired with a length. Together, they identify the split parts of the string.
length: length specifies the length to split from the string and it is always paired with label.

You can either use a single entry format or an array.
Below are the Possible syntaxes
Single entry:
{"label":"Name1","length":20}
Array:
[{"label":"NAME1", "length":20}, {"label":"NAME2", "length":10}]

LiquidUI Script:
/////////////////////////// SAPLSMTR_NAVIGATION.E0100.sjs //////////////////////////

var z_string = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var elementArr = linerecordsplit(z_string, [{"label":"NUMBERS", "length":10}, {"label":"ALPHABETS", "length":20}]);

println("label NUMBERS is "+elementArr.NUMBERS);
println("label ALPHABETS is "+elementArr.ALPHABETS);

You can see output on Cornelius window.
elementArr.NUMBERS as "0123456789"
elementArr.ALPHABET as "ABCDEFGHIJKLMNOPQRST"

Note: The split will always start from the frist character of the string.
You cannot extract a portion of the original string from the middle.


See attachment for more screenshots

19
WS aka Web Scripts (Attended RPA for SAP) / Using 'del()' as a Method
« on: November 02, 2017, 09:00:30 AM »
Purpose:
Using 'del()' command as an object method to remove element of the referenced object.
The syntax would be as follows:

var objectName = <'[screen_control]'>;
objectName.del(); 

Below example demonstrates the 'del()' with object method on MB51 screen.

LiquidUI code
//////////////////////////////// RM07DOCS.E1000.sjs ////////////////////////////

for(a=firstChild; a!=null; a=a.nextSibling)   
a.del();

You will find the all the elements on screen deleted.

Note:
Using the 'del()' method with radiobuttons may return an error in certain situations.
If this happens, use the standard 'del()' command instead of the object method to delete the element as shown in the following example.

radiobutton([6,15], "Test 1", {"name":"testbutton1", "F[Field_name]":'001'});
radiobutton ([6,37], "Test 2", {"name":"testbutton1",  "F[Field_name]":'002', "default":true});
box([4,8], [8,55], "Group");

See the attachment for screenshots

20
Purpose:

To use properties of the field object as options in the fieldname command.

Field object properties:

name.label
Specifies the onscreen label of a given pushbutton or other screen element.
Columns in a table are excluded.
name.icon
For pushbuttons, this specifies the icon ID.
name.tip
For pushbuttons, this specifies the tooptip.

Below example demonstrates the getfieldattribute command to return pushbutton attributes.
the getfieldattribute command is used within a function to return the attributes of a given pushbutton. We will use the Head.data pushbutton in the MIGO screen and script is conditionalized based on the tooltip value obtained to display println statement on cornelius output window.

LiquidUI code:
///////////////////////////////////// SAPLMIGO.E0001.sjs ///////////////////////////////////
// function for fetching pushbutton properties with getfieldattributes command
function printButton(){
getfieldattribute("P[Head.data]", {"name.icon":"fbuttonicon", "name.tip":"fbuttontip",  "name.label":"fbuttontext"});  // getfieldattribute command
println("\t fbuttonicon = " + fbuttonicon);
println("\t fbuttontip = " + fbuttontip);
println("\t fbuttontext = " + fbuttontext);
}
printButton(); // function calling

//condition based on tooltip obtained to display println statement
 if(fbuttontip == "Open header data"){ 
      println("----------------button is visible--------------------");
 }

21
Purpose:
Using view command to display and execute SAP URLs.

Usage:
View command can be used to populate the data from a HTML page into a SAP screen. Both inputsets and process execution are possible.
An inputset is defined as a set of values to be input into SAP. SAPurls are displayed using the view command and appear within a SAP screen. In this case we are displaying them in the VA01 screen. 

Below example demonstrates the using of SAP URLs with view command on "VA01" initial screen.
Liquid UI Code:
////////////////////////// SAPMV45A.E0101.sjs //////////////////////////////

view([0,84],[24,131], "SAPLinks.htm");

////////////////////////// SAPLIQS0.E0100 ///////////////////////////////////
function executeIw21( ) {
onscreen 'SAPLIQ50.0100' 
set("F[Notification type]", "M1");
enter( );
 }

HTML Code
//////////////////////////////  SAPLinks.htm //////////////////////////////

<a href="SAP://OrderType:OR">Launch VA01[/url]
  // assign value 'OR' to order type field
 
<a href="SAP://OK:/nMM01">Launch MM01[/url]
// navigates to MM01 t-code
 
//navigates to IW21 transaction and executes function executeIw21
<a href="SAP://OK:/nIW21, process=executeIw21">Launch IW21  1[/url]

 
//navigates to MM01 t-code by click on image displayed
<a href="SAP://OK:/nmm01"> <img src="mm01.gif" alt="Launch MM01" width="60" height="20"><BR> [/url]

//navigates to IW21 t-code by click on image displayed
<a href="SAP://OK:/niw21"> <img src="iw21.gif" alt="Launch IW21" width="60" height="20"><BR> [/url]
 
//displays button and executes function launchva01 on click
<form> <input type="button"  value="Launch VA01 " onclick="launchva01()" />
</form>

//displays button and executes function launchmm01 on click
<form> <input type="button"  value="Launch MM01 " onclick="launchmm01()" />
</form>

//displays button and executes function launchiw21  on click
<form> <input type="button"  value="Launch IW21 " onclick="launchiw21()" />
</form>
 
// javascript functions under <script> tags
<script>
function launchva01() {
   window.location = "SAP:// OrderType:OR;/OK";
}

function launchmm01() {
   window.location = "SAP://OK:/ nMM01";
}

function launchiw21() { 
   window.location = "SAP://OK:/ niw21";
}
</script>

See attachment for more information and screenshots

22
Purpose:
To Select and De-select the checkboxes present in column of a table.

Usage:
To select and de-select the checkbox in a table we need to use set command with tablename,columnname and row number.
Syntax to select:
set('cell[tablename,columnname,rownumber]', 'X'); // 'X' select the checkbox in table
Syntax to Deselect:
set('cell[tablename,columnname,rownumber]', ''); // blank value de-select the checkbox in table

Below is a simple example to demonstrate the selection and de-selection of a checkbox present in a table with functions called by pushbuttons.
Liquid Code:
/////////////////////////// SAPLMEGUI.E0014.sjs ///////////////////////////////   

pushbutton( [TOOLBAR], "Select Checkbox",{ "process":z_select_ckbx});
pushbutton( [TOOLBAR], "Deselect Checkbox",{ "process":z_deselect_ckbx});

function z_select_ckbx(){
     onscreen 'SAPLMEGUI.0014'
          set('cell[TABLE,D,1]', 'X'); // select checkbox in first row
          enter("?");
}

function z_deselect_ckbx(){
     onscreen 'SAPLMEGUI.0014'
          set('cell[TABLE,D,1]', ''); // de-select checkbox in first row
          enter("?");
}

See attachment for more information and screenshots

23
Purpose:
The statusmessage command is used when it is necessary to view messages relating to the status of a particular SAP session or connection.
All messages are displayed in an onscreen message box/listbox.

Syntax:
statusmessage({"title":"Title", "size":[rows, cols], "position":[startRow, startCol]});

To add messages to the created message box/listbox 'addstring' option is used.

Syntax:
statusmessage({"addstring":string/variable to display});

In below example, we will display a listbox containing four separate status messages.
LiquidUI Code:
/////////////////////// SAPLSMTR_NAVIGATION.E0100.SJS ////////////////////////

var z_msgtitle = "Sample StatusMessage Listbox";
var z_msg = "Statusmessage command example!";
var z_msg2 = "Order Type is 'OR'";
pushbutton([TOOLBAR], "Test StatMsg", {"process":z_statmsg});

function z_statmsg() { 
     onscreen 'SAPLSMTR_NAVIGATION.0100' 
          statusmessage({"title":z_msgtitle, "size":[10,60], "position":[5,10], "addstring":z_msg}); 
          statusmessage({"addstring":"Navigating to VA01!"}); 
          enter('/nva01'); 
     onscreen 'SAPMV45A.0101' 
          set("F[Order Type]", "OR"); 
          enter(); 
          statusmessage({"title":z_msgtitle, "size":[10,60], "position":[5,10], "addstring":"VA01 Overview screen!"}); 
          statusmessage({"addstring":z_msg2});
}

See attachment for more information and screenshots.

24
Process:
To pass parameters to onUIEvents command with the 'using' option.

In below example we will pass order number as parameter to a liquid UI function with using option which is triggered by "onUIEvents" command.
LiquidUI Code:
//////////////////////////////////SAPLSMTR_NAVIGATION.E0100.sjs//////////////////////////////////

onUIEvents['Enter']={"fcode":"/nva02","process":test_UIEvent, "using": {z_ord_no:5455}};

function test_UIEvent(param){
     onscreen 'SAPMV45A.0102' 
          set("F[Order]" , param. z_ord_no);
          enter();
     onscreen 'SAPMSDYP.0010' // to handle information pop up if encountered
          enter();
     onscreen 'SAPMV45A.4001'
          enter();
}

On click 'Enter', screen navigates to overview screen of "VA02" t-code with details of order number passed as parameter.

25
WS aka Web Scripts (Attended RPA for SAP) / Dependent Dropdownlists using WS
« on: September 28, 2017, 09:45:54 AM »
Purpose:
Creating dependent dropdownlist using WS dropdownlist command.

Interface:
On 'VA01' transaction initial screen, a dropdown for 'Sales Organization' is displayed.                 
On selecting an option in that dropdown another dropdown for 'Distribution Channel' is displayed dynamically
With options varying based on selection Criteria.

Liquid UI Script:
////////////////////////////// SAPMV45A.E0101.sjs /////////////////////////

String.prototype.trim = function() { //trim function
   return this.replace(/^\s+|\s+$/g,"");
}

function isBlank(jvar){ // isBlank function to check value of variable
      if(typeof jvar == 'string') {
               jvar = jvar.trim();
     }
     if(typeof jvar == 'undefined') {
              jvar = '';
      }
      return(jvar == 'undefined' || jvar == undefined || jvar == null || jvar == "" || jvar == void 0);
}

// dropdownlist for sales organization
set("V[z_salesorg_list]", "=--- Select Sales Organization ---;1000=Germany Frankfurt;2000=UK Heathrow/Hayes;3000=USA Philadelphia;");
dropdownlist([5, 30], "z_salesorg_list", {"refer":"z_va01_salesorg","width":25,"process":z_set_sorg});

if(!isBlank(z_va01_salesorg)){
     switch(z_va01_salesorg){  // switch case for changing selection list based on sales organization value
          case "1000":
          set("V[z_dchl_list]", "=--- Select Distribution Channel ---;01=General Trade;02=Exports;10=Final customer sales;");
          break;

          case "2000":
          set("V[z_dchl_list]", "=--- Select Distribution Channel ---;10=Final customer sales;12=Sold for resale;14=Service;16=Factory sales;30=Internet Sales;");
          break;

          case "3000":
          set("V[z_dchl_list]", "=--- Select Distribution Channel ---;01=General Trade;02=Exports;10=Final customer sales;12=Sold for resale;14=Service;");
          break;
     }
     dropdownlist([6, 30], "z_dchl_list", {"refer":"z_va01_dchl","width":25,"process":z_set_dchl}); // Distribution channel dropdown list
}

function z_set_sorg(){ // function to set value dropdown option into "Sales Organization" field
   set("F[Sales Organization]","&V[z_va01_salesorg]");
   println("-------------------z_va01_salesorg--------------"+z_va01_salesorg);
   enter('?');
}

function z_set_dchl(){ // function to set value dropdown option into "Distribution Channel" field
   set("F[Distribution Channel]","&V[z_va01_dchl]");
   println("-------------------z_va01_dchl--------------"+z_va01_dchl);
   enter('?');
}

See attachment for screenshots

26
Below example explains the scrolling on listscreen in both horizontal and vertical directions with enter command using WS functions.

Horizontal scroll syntax:
enter("/hscrollto=x");
x - specifies number of columns to scroll

Vertical scroll syntax:
enter("/scrolltoline=y");
y - specifies the number of rows to scroll

Liquid UI Code:
/////////////////////////////////// RVKRED01.E0120.sjs ////////////////////////////////

pushbutton( [TOOLBAR], "Scroll Horizontal",{ "process": z_HorScroll }); // pushbutton to call z_HorScroll  function

pushbutton( [TOOLBAR], "Scroll Vertical",{ "process": z_VerScroll }); // pushbutton to call z_VerScroll function

function z_HorScroll(){ // function to horizontal scrolling on listscreen
     onscreen 'RVKRED01.0120'
          enter("/hscrollto=20");
}

function z_VerScroll (){// function to vertical scrolling on listscreen
     onscreen 'RVKRED01.0120'
          enter("/scrolltoline=10");
}

27
Purpose:
Reading data from listscreen into array.

In Below example data from column "Document" of listscreen is read into an array by using position in set command.

LiquidUI Code:
/////////////////////////////////// RVKRED01.E0120.sjs ////////////////////////////////

pushbutton( [TOOLBAR], "scroll  ",{ "process": z_readfromlist }); // pushbutton to call function

function z_readfromlist(){ // function to reading data from listscreen and assign it to array
    z_doc = []; // array to store data
    lfvrow = 1;

    onscreen 'RVKRED01.0120'
        SCROLL_NEXT:;
        enter("/scrolltoline=&V[lfvrow]"); // scroll the list vertically

    onscreen 'RVKRED01.0120'
        enter("/hscrollto=0"); // scroll list horizontally

     // goes to end of function when end of listscreen is reached
     if(lfvrow >= _listlastvisiblerow){
          goto END;
     }

    START:;
    lfvrow = _listfirstvisiblerow;
    llvrow = _listlastvisiblerow;
    z_row = 3;

    LOOP:;
    // column data read into variable using position on screen
    set("V[doc_val]","&#["+z_row+",30]");
    z_doc.push(doc_val); // data from variable pushed into array
    lfvrow = lfvrow+1;
    if(lfvrow <= _listlastvisiblerow){ // fetches data from next row
      z_row = z_row+1;
      goto LOOP;
    }
    else{ // navigates to scroll code if end of screen is reached
      goto SCROLL_NEXT
    }

    END:;
    for(j=0;j<z_doc.length;j++){ // display array elements on cornelius output window
         println("document number at z_doc["+j+"]="+z_doc[j]);
    }
}
You can view data from document column of listscreen on cornelius output window.

See attachment for screenshots

28
Purpose:
Displays data from arrays in the form of grid with to-and-fro navigation if data exists in multiple pages.

Below example explains the notification data in arrays displayed in the form of grid with to-and-fro navigation buttons based on the number of pages.
This can be helpful in representing data read from grid and table.

Liquid UI Code:
////////////////////////// SAPLSMTR_NAVIGATION.E0100.sjs ///////////////////////////

// Function to check if the string value is blank
function isBlank(jvar){
   if(typeof jvar == 'string') {
      jvar = jvar.trim();
   }
   if(typeof jvar == 'undefined') {
      jvar = '';
   }
   return(jvar == 'undefined' || jvar == undefined || jvar == null || jvar == "" || jvar == void 0);
}

if(isBlank(z_rowsperpage)){   //initializing variables
   z_rows_notification = 1;
   z_limit_notification = 4;
   z_pageno_notification = 1;
   z_rowsperpage = 4;
}

// arrys with notification data
var notifications = ["","10000101","10000102","10000103","10000104","10000105","10000106","10000107","10000108","10000109","10000110"]; // array
var not_Des = ["","first","second","third","fourth","fifth","sixth","seventh","eight","ninth","tenth"]; // array
var not_date = ["","01/01/2017","01/20/2017","02/10/2017","03/03/2017","04/05/2017","05/22/2017","06/25/2017","07/19/2017","08/20/2017","09/10/2017"]; // array
length_notif_array = notifications.length;

box([3,4], [13,69], "Notification Grid"); // group box
del("X[IMAGE_CONTAINER]"); // deletes image on easy access screen

if(length_notif_array>0){
   // calculates number of pages
   println("notification z_rowsperpage="+z_rowsperpage);
   z_notif_noofpages = length_notif_array/z_rowsperpage;
   z_number_pages = z_notif_noofpages;
   z_number_pages = z_number_pages.toString();
   z_index_notif = z_number_pages.indexOf('.');
   if(z_index_notif != -1){
      z_number_pages = z_number_pages.slice(0,z_index_notif);
      z_number_pages = parseInt(z_number_pages)+1;
   }
   else{
      z_number_pages = parseInt(z_number_pages);
   }
    // logic to display navigation buttons
   if(!isBlank(z_number_pages)){
      if(z_limit_notification <= z_rowsperpage){
         if(z_number_pages==1){
               
         }else{
         pushbutton([4,65], "@0E@",{ "process":z_next_notification, "size":[1,3], "fcode":"/n"});
         }
      }
      else{
         if(z_pageno_notification > 1){
            if(z_pageno_notification >= z_number_pages){
               pushbutton([4,60], "@0D@",{ "process":z_previous_notification, "size":[1,3], "fcode":"/n"});
            }         
            else{
            pushbutton([4,60], "@0D@",{ "process":z_previous_notification, "size":[1,3], "fcode":"/n"});
            pushbutton([4,65], "@0E@",{ "process":z_next_notification, "size":[1,3], "fcode":"/n"});
            }
         }
      }
   }
   // assigning array values to text fields
   for(idx = z_rows_notification, z_notif_row = 0;idx <= z_limit_notification;idx++){

      text([5+z_notif_row,47],  not_Des[idx],{ "size":20});
      text([5+z_notif_row,26], not_date[idx],{ "size":15});
      text([5+z_notif_row,6], notifications[idx],{ "size":15});
      z_notif_row = z_notif_row+2;
   }
}

// to load next page of notification numbers
function z_next_notification(){                   
      z_limit_notification = z_limit_notification + z_rowsperpage;
      z_rows_notification = z_rows_notification + z_rowsperpage;
      z_pageno_notification = z_pageno_notification+1;
}


// to load previous page of notification numbers
function z_previous_notification(){               
      z_limit_notification = z_limit_notification - z_rowsperpage;
      z_rows_notification = z_rows_notification - z_rowsperpage;
      z_pageno_notification = z_pageno_notification-1;
}

See attachment for more information and screenshots

29
Purpose:
Auto logon to SAP server using "ELOGON.sjs" file.

Usage:
User will be navigated to Easy Access screen as soon as clicked on server connection on "SAP LOGON" pad, eliminating the manual entry of username and password.

Liquid UI Code
///////////////ELOGON.sjs//////////////////////////////

set("F[User]","username"); // sap user name
set("F[Password]","password"); // sap password
enter();

Password can be encrypted and decrypted then assigned to variable which in turn can be passed to "Password" inputfiled with a simple WS function using "RC4 Encryption Algorithm".

Please see below link for more information on encrypting and decrypting the password.
http://www.guixt.com/forum/index.php?topic=241.msg245#msg245

30
WS aka Web Scripts (Attended RPA for SAP) / Error Handling - Pop up Errors
« on: September 07, 2017, 08:27:42 AM »
Purpose:
Handling pop up errors using WS functions.

Usage Scenario:
When an error occurs while entering data on a popup screen.
In "MM01" transaction, while entering data on "Organizational Levels" pop up, SAP issues the error on another pop up.
Below example explains the handling of such errors in a function.

Example:
On "Create Material(Initial Screen)", enter "Industry Sector" and "Material Type" and click on enter to execute below function.

Liquid UI Code
/////////////////////////////  SAPLMGMM.E0060.sjs /////////////////////////

onUIEvents['Enter'] = {"process":mm01_create_material}; // calls function on enter

function mm01_create_material(){
    onscreen 'SAPLMGMM.0060'
      enter("/5");

   onscreen 'SAPLMGMM.0070' // code to selects table rows
     set('Cell[Table,0,1]', 'X');
     set('Cell[Table,0,4]', 'X');
     set('Cell[Table,0,6]', 'X');
     set('Cell[Table,0,12]', 'X');
     set('Cell[Table,0,13]', 'X');
     set('Cell[Table,0,14]', 'X');
     enter("/6");

    onscreen 'SAPLMGMM.0080' // defaulting data on popup
     set('F[Plant]', '');  // no data entered in F[Plant] causes popup error.
     set('F[Stor. Location]', '0001');
     enter();

   //code for handling popup error
   onscreen 'SAPMSDYP.0010' //error  pop up screen
     set("V[z_message]","&F[MESSTXT1]");  // error message
     enter();

   onscreen 'SAPLMGMM.0080'
     message("E:"+z_message);  //display error message on initial screen
     enter('/12');
}

You can see error message displayed on "Create Material(Initial Screen)" instead of popup.

See attachment for more information and screenshots.

Pages: 1 [2] 3 4