Author Topic: Using enter with ActiveX Controls  (Read 2096 times)

Benjamin Dasari

  • GuiXT Forum
  • Newbie
  • *
  • Posts: 95
    • View Profile
Using enter with ActiveX Controls
« on: August 21, 2017, 01:20:35 PM »
Purpose:
Use the enter command to execute on an ActiveX control.
This command can be directly copied from "Cornelius" output window of Liquid UI.

When user clicks on the selection in Standard SAP, the command is generated in the output (Cornelius) window which can be directly copied and used.
The below example is executing CN42N transaction, where the "Details" and "Export->Local file" buttons are being clicked in the background through the below functions.

NOTE:
// onUIEvent on an OCX control can also be obtained from "Cornelius" output window of Liquid UI.
// Syntax formats: Separated by semicolon AND commas
onUIEvents["%_GC DOCKINGCTRL.TableTreeControl 35@[0001;Column01,]"]= z_process_treecontrolclick;
onUIEvents["%_GC DOCKINGCTRL.TableTreeControl 35@[0001;Column01,]"]= {'process':z_process_treecontrolclick};
onUIEvents["%_GC DOCKINGCTRL.TableTreeControl 35@[0001;Column01,]"]= {'fcode':"/niw21",'process':z_process_treecontrolclick};
onUIEvents["%_GC DOCKINGCTRL.TableTreeControl 35@[0001;Column01,,0\\1]"]= z_process_treecontrolclick;


Liquid UI Code:
----------------------------------------------------------------------------------------------------------------------------------------------
Script File Name: SAPLSMTR_NAVIGATION.E0100.sjs
----------------------------------------------------------------------------------------------------------------------------------------------
// Function is called when clicked on "Details" Toolbar pushbutton
function clickDetails(){
   onscreen 'SAPLSMTR_NAVIGATION.0100'
      enter("/nCN42N");   

   onscreen 'SAPLCNIS.0600'
      set('F[Database prof.]', '000000000001');
      enter();
   
   onscreen 'RPSISPD000.1000'
      set('F[Project]', 'I/2302');
      set('F[Layout]', '1SAP');
      enter('/8');
   
   onscreen 'SAPLPSIS_SINGLE01.0100'
      enter({'control':'CONTAINERCTRL.GridViewCtrl','item':'&DETAIL','event':10});      
}

// Function is called when exporting local file on "CN42N" transaction
function exportLocalFile(){
   onscreen 'SAPLSMTR_NAVIGATION.0100'
      enter("/nCN42N");   

   onscreen 'SAPLCNIS.0600'
      set('F[Database prof.]', '000000000001');
      enter();
   
   onscreen 'RPSISPD000.1000'
      set('F[Project]', 'I/2302');
      set('F[Layout]', '1SAP');
      enter('/8');
   
   onscreen 'SAPLPSIS_SINGLE01.0100'
      enter({'control':'CONTAINERCTRL.GridViewCtrl','item':'&MB_EXPORT;1139;159','event':11});      
   
   onscreen 'SAPLPSIS_SINGLE01.0100'
      enter({'control':'CONTAINERCTRL.GridViewCtrl','item':'&PC','event':14});         
}

// User Interface - Pushbuttons on TOOLBAR
pushbutton([TOOLBAR],"Details",{"process":clickDetails});
pushbutton([TOOLBAR],"Local File",{"process":exportLocalFile});


See attachments for code samples!
« Last Edit: August 21, 2017, 01:30:15 PM by Benjamin Dasari »