Menus can be directly accessed in the 3.1G version of the SAP Automation GUI software.
However, directly accessing a menu is usually not the most efficient method for accessing menu functionality, as menu traversal involves several round trips to the application server.
Several alternatives are available. These techniques are also required to access menu entries in SAP Automation GUI software prior to 3.1G.
Every menu choice is assigned to an OK code within the SAP Menu Painter software. Sending the OK code associated with the menu choice has the same affect as selecting the menu entry.
To determine the OK code for a menu entry within the current R/3 screen:
The effect of many menu entries can be simulated without going to the Menu Painter. Menu entries that go to other transactions can be simulated usingIt_GetTransaction in the C API, or the Transaction method in the OLE Automation Server. These methods add the "/n" prefix before the transaction code argument and set the OK code to the resulting value.
Note that when an OK Code for another transaction is set in an event using the "/n" prefix, other event settings are generally ignored. If the current transaction needs to be finished before moving to the next transaction, first send one event to finish the current transaction. Then get the returned event and send a second event to set the OK Code for the next transaction.
Some menu paths duplicate function key entries. In this case, the appropriate function key can be sent in order to move to the appropriate screen. Function keys also have OK codes associated with them, so sending the function key has the same effect as manually sending the OK code.