Liquid UI Forum

Using Your Liquid UI Products => WS aka Web Scripts (Attended RPA for SAP) => Topic started by: Ashfaq Ahmed on January 30, 2020, 10:54:02 PM

Title: Implementation of onmessage
Post by: Ashfaq Ahmed on January 30, 2020, 10:54:02 PM
   Purpose:

   
   Syntax:

                            onscreen 'SAPSCREEN'
                       enter ();
                               onmessage
                                ----------------
                                ----------------

                               enter ();


   
   goto-label:
   goto label is used for altering the program flow in Liquid UI.

   Syntax:

                           goto labelname;
                          ---------------------
                           ---------------------

                          labelname:
                          ---------------------
                           ---------------------

   Note:

   •   onmessage should be used after the onscreen/enter block.

   •   An Action is Needed to Exit out of the onmessage block   


   Example:
   Below is the Example that Illustrates the Usage of onmessage.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
   onscreen 'SAPLIQS0.0100'

   set('F[Notification type]','&V[z_zguixt_notif]'); // Notification Type

   enter();

   onscreen 'SAPLIQS0.0100'

   set('F[Functional loc.]','&V[z_Functionalloc]'); //Functional Location

   set('F[VIQMEL-QMDAT]', '&V[z_date]');  //Date
      
   enter();

   onmessage

      if (_message. substring(0,2)=='E:') {  --------------------------------------------->If Error found then do the following

      set('F[Functional loc.]',''); ----------------------------------------------------------->Setting the value to Empty

      set('F[VIQMEL-QMDAT]',''); ---------------------------------------------------------->Setting the value to Empty

      message(_message); ---------------------------------------------------------------->Displaying the Message

      enter();

      goto SCRIPT_END;-------------------------------------------------------------------->After Enter go to End of the Function

   }

 else
   {   
     enter();--------------------------------------------------------------------------------->If it is not an Error then continue to the Script
   }
   onscreen 'SAPLIQS0.0100'

   set('F[VIQMEL-QMTXT]', '&V[z_zguixt_Description]');

   enter("=10\\TAB02");

   set('F[Priority]', "&V[z_zguixt_priority]"); //Priority

   enter("=10\\TAB04");

   onscreen ''SAPLSPO1.0500'

   enter("=OPT2");

   set("F[VIQMEL-AUSWK]","&V[z_zguixt_effect]");  //Effect

   enter("/11");    //Save

   SCRIPT_END:;
   }
   



Refer to the Attachment for Clarity.....