IT_EVENT 

Use

IT_EVENT is the event structure, which represents a single R/3 screen.

The event structure contains some of the overall information of the screen, while the more detailed information resides in the related structures. The IT_EVENT structure contains information about the screen as a whole. For example it contains the title of the screen, the text of the message at the bottom of the screen as well as details about the scroll bar of the screen. It then points to the IT_MENUS, IT_PFKEYS, and IT_SCREEN structures, which contain more information on the event: the IT_MENUS holds information on the menu bar, the IT_PFKEYS details the buttons on the toolbar, and the IT_SCREEN contains more information about the user area of the screen, on which the various controls reside.

 

You can read or change the contents of the event structure and its related structure in one of the following methods:

Syntax

typedef struct IT_EVENT_t {
long cbSize;
long Version;
long eventtype;
HANDLE hMerlin; // Handle to IT session
IT_SCREEN screen;
IT_PFKEYS pfkeys;
IT_MENUS menus;
union {
int key; // send key or
HANDLE hMenu; // send menu or
long lPos; // send scroll message
};

/* EVT_OKCODE */
char okcode[MAX_OK];

/* EVT_MESSAGE */
char szMessage[MAX_MESSAGE];

/* Static information */
unsigned short nDiagVersion;
char szDB[128];
char szCPU[128];
unsigned short nModeNumber;
char szTCode[64];
char szUsername[64];
char szClient[64];

/* EVT_TITLE */
char szNormTitle[MAX_TITLE];

/* EVT_SESSION_ADDED | EVT_SESSION_REMOVED */
int iSessionId;

} IT_EVENT;
typedef IT_EVENT *PIT_EVENT;
typedef PIT_EVENT *PPIT_EVENT;
#define IT_EVENT_SIZE (sizeof(IT_EVENT))

Members

cbSize

Specifies the size of the whole event structure in bytes.

Version

Specifies the R/3 release (version) number of the system from which the event structure is taken

eventtype

A bit mask that indicates which type of information exists in the event structure and all of its related structures.

After getting an event from R/3 you can use this field for determining which fields are valid in the event structure.

Before sending an event to the R/3 application server your application must set the relevant bits in this mask. See the detailed description of eventtype and its bits by following the link.

hMerlin

Handle to the SAP Automation GUI session.

screen

The structure containing the detailed information of the screen. See IT_SCREEN structure.

pfkeys

The structure containing the detailed information of the toolbar and its buttons. See IT_PFKEYS structure.

menus

The structure containing the detailed information of the menu bar. See the IT_MENUS structure.

key

The key to send (See the topic Windows Virtual Key Values for listing of the key values).

Filled in by client. Your program must set the MES_KEY bit of eventtype to on to indicate that you are sending a key.

hMenu

Which menu option was requested. Filled in by the client. Note that to send the menu option request, you must turn the MES_MENU bit of eventtype on.

lPos

Position to scroll to on the screen. This is used for either horizontal or vertical scrolling. It specifies the row to appear at the top of the screen after a vertical scroll, or the first column on the screen when scrolling horizontally. To show the first row at the top of the screen or to show the first column as the beginning of the screen use 1 for lPos.

Works in conjunction with the MES_HSCROLL or MES_VSCROLL of eventtype.

okcode

OK code is what you enter in the command field in the SAPGUI screen. Most of the time it is a transaction code. Filled by the client.

szMessage

Error, warning, or informational message. Valid (that is, you can only check its value) if the EVT_MESSAGE bit in eventtype is on.

nDiagVersion

DIAG is an internal protocol used for the communication between the application server and Front. It has different versions, each of which may include different features. nDiagVersion indicates the version of DIAG.

This is static information, which is only available if the EVT_STATIC_INFO bit of eventtype is on.

szDB

Name of database. (the Name field in the Database data group on the System: Status screen in SAPGUI.

This is static information, which is only available if the EVT_STATIC_INFO bit of eventtype is on.

szCPU

Name of CPU. This is equivalent to the Server name field in the Host data group on the System: Status screen in SAPGUI.

This is static information, which is only available if the EVT_STATIC_INFO bit of eventtype is on.

nModeNumber

Mode number, which is the session number.

This is static information, which is only available if the EVT_STATIC_INFO bit of eventtype is on.

szTCode

Reserved

szUsername

Username for this session.

This is static information, which is only available if the EVT_STATIC_INFO bit of eventtype is on.

szClient

Client for this session.

This is static information, which is only available if the EVT_STATIC_INFO bit of eventtype is on.

szNormTitle

Title of this screen.

iSessionId

Reserved

See also

IT_SCREEN, IT_PFKEYS, IT_MENUS.