Author Topic: Error Handling - Pop up Errors  (Read 2112 times)

Sai Siddhartha

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 47
    • View Profile
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.
« Last Edit: September 08, 2017, 11:00:02 AM by Rahul Gera »