Liquid UI - Documentation - 17.12 Using enter() with activeX controls

17.12 Using enter() with activeX controls


Prerequisites


Purpose

The enter command can be used to launch ActiveX menus, including SAP's Services for Object functionality. This is done by passing the codes directly through the enter command, instead of using the apply guiscript command to call an external VBScript, which was necessary for earlier versions of WS. This method had certain limitations, so we have implemented a new way of scripting the Service for Object menu enables you to attach files and perform other supported actions.

Note: This functionality was added in WS 1.2.213.0 and is available for all features of the Services for Object menu. 

 

Syntax

enter({"control":"control_ID", "item":"item_code", "event":event_code});


Parameters

Each of the parameters defines one aspect of the Services for Object menu.

control

The 'control' parameter defines the actual ActiveX object. In our example below, we are referring to the Services for Object menu in the FBV2 transaction.

enter({"control":"GOSCONTAINERCTRL.Toolbar", "item":"item_code", "event":event_code});
item

The 'item' parameter refers to the sub-menu selection from the ActiveX menu. In our example, we will trigger the 'Create > Store business object' menu item.

enter({"control":"GOSCONTAINERCTRL.Toolbar", "item":"%GOSTOOLBOX;381;328", "event":event_code});
event

Events are used to notify ActiveX containers that some action has been performed by a user. Some of the stock events that can be sent are clicks, key presses, double clicks, and so forth. Each of these events has a code assigned so that we can easily specify which event will occur and we use the event parameter in our script to pass this event code to the ActiveX control. In our example, we will send the event number '2', which is a click. The example code is shown below.

enter({"control":"GOSCONTAINERCTRL.Toolbar", "item":"item_code", "event":2});
 

Note: The control ID, the item code, and the event code can be obtained by recording the transaction in Liquid UI Designer, reading the generated script, and finding the appropriate codes.


User Interface

Example using Object For Services

To demonstrate passing ActiveX parameters through the enter command, please do the following. In our example, we will trigger the Services for Object functionality.

  1. Navigate to the FV60 transaction. The script file name is 'SAPMF05A.E1100.sjs'. Create this file in your scripts folder if it does not exist.

  2. Add a toolbar pushbutton "Store Business Doc" on the screen and link it to the process that will execute the necessary actions.
     
    //Creates toolbar pushbutton Store Business Doc
    pushbutton([TOOLBAR], "Store Business Doc", {"process":objServicesExecute});
    function objServicesExecute()
      
     
  3. Add the following Liquid UI script to the above file and save it. This code loads the file that contains the function that triggers the Services for Object menu.
     
    //Edit Parked Vendor Invoice 1900002694 1000 2006
     {
    
    onscreen 'SAPMF05A.1100'
      enter({"control":"GOSCONTAINERCTRL.Toolbar", "item":"%GOS_TOOLBOX;381;328", "event":2});
    
    // Edit Parked Vendor Invoice 1900002694 1000 2006 
    onscreen 'SAPMF05A.1100'
      enter({"control":"GOSCONTAINERCTRL.Toolbar", "item":"%GOS_ARL_LINK", "event":1});
    }
    
     
  4. Click the push button to trigger the process that calls the Services for Object menu. In the second screen block, it actually opens the 'Archives from Front End' popup window.

  5. Save your changes and close the script files. Then launch and log into SAP GUI.

 

SAP Process

  1. Logon to SAP and navigate to the FBV2 transaction, and click the Document list(F5) button on the toolbar, as shown below.
     
     
  2. The search screen will display as shown below. Enter the values for an existing document to edit. In our example, we will use the values shown below.
     

    Note: These values will probably not be the same in your environment. Use values for an actual document to see the results as shown in the example.

    • Company code: 1000
    • Document number: 1900002694
    • Fiscal year 2006
     
      
  3. Once you have entered your values, click the Execute(F8) button, as shown below.
     
     
  4. You will be navigated to the Change Parked Documents: List screen. Now click the toolbar Choose (F2)button, which is the first button on the grid screen, as shown below.
     
     
  5. Now, you will be navigated to the FV60 transaction and the script you previously created will take effect. Click the created toolbar pushbutton Store Business Doc, as shown below.
     
     
  6. Click the Store Business doc button that executes the WS script 'performServicesForObject' and will send parameters to the ActiveX Services For Object menu. In this example, we are triggering the action to store a business document, but you can use the same functionality to perform other actions on ActiveX controls as well. If the operation completes successfully, you will see the Archive from Frontendwindow popup, as shown in the following image.
     

Can't find the answers you're looking for?