/*
------------------------------------------------------------------------
  SAP AG - R/3 Remote Function Call Interface Generation
    RFC_ANSIC_CL_EXP EN 46C
    13.07.2002 11:22
    Complete ANSI C client example
    saprfccl.h
------------------------------------------------------------------------
*/

#ifndef AGENT_BAPI_H
#define AGENT_BAPI_H

#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "saprfc.h"
#include "sapitab.h"

/*
------------------------------------------------------------------------

  Call function BAPI_SYSTEM_MON_GETTREE
      exporting
        EXTERNAL_USER_NAME like BAPIXMLOGR_EXTUSER  type RFC_CHAR length 16
        MAX_TREE_DEPTH like BAPIPARAMS_MAXLEVEL default 0 type RFC_INT length 4
        MONITOR_NAME structure BAPIMNNAME length
120 number of fields 2
        VIS_ON_USR_LEVEL like BAPIPARAMS_VISUSRLEV default 3 type RFC_INT length 4
      importing
        RETURN structure BAPIRET2 length
548 number of fields 14
      tables
        TREE_NODES structure BAPITNDEXT length 440 number of fields 40
      exceptions

------------------------------------------------------------------------
*/

/* field type definition */

#ifndef SAP_FT_BAPIXMLOGR_EXTUSER
#define SAP_FT_BAPIXMLOGR_EXTUSER
typedef RFC_CHAR BAPIXMLOGR_EXTUSER[16];
#endif

#ifndef SAP_FT_BAPIPARAMS_MAXLEVEL
#define SAP_FT_BAPIPARAMS_MAXLEVEL
typedef RFC_INT BAPIPARAMS_MAXLEVEL;
#endif

#ifndef SAP_FT_BAPIPARAMS_VISUSRLEV
#define SAP_FT_BAPIPARAMS_VISUSRLEV
typedef RFC_INT BAPIPARAMS_VISUSRLEV;
#endif

/* structure type definition */

#ifndef SAP_ST_BAPIMNNAME
#define SAP_ST_BAPIMNNAME
typedef struct {
  RFC_CHAR MoniName[60];
  RFC_CHAR MsName[60];
 } BAPIMNNAME;
#endif

#ifndef SAP_ST_BAPIRET2
#define SAP_ST_BAPIRET2
typedef struct {
  RFC_CHAR Type[1];
  RFC_CHAR Id[20];
  RFC_NUM Number[3];
  RFC_CHAR Message[220];
  RFC_CHAR LogNo[20];
  RFC_NUM LogMsgNo[6];
  RFC_CHAR MessageV1[50];
  RFC_CHAR MessageV2[50];
  RFC_CHAR MessageV3[50];
  RFC_CHAR MessageV4[50];
  RFC_CHAR Parameter[32];
  RFC_INT Row;
  RFC_CHAR Field[30];
  RFC_CHAR System[10];
 } BAPIRET2;
#endif

#ifndef SAP_ST_BAPITNDEXT
#define SAP_ST_BAPITNDEXT
typedef struct {
  RFC_CHAR Mtsysid[8];
  RFC_CHAR Mtmcname[40];
  RFC_CHAR Mtnumrange[3];
  RFC_CHAR Mtuid[10];
  RFC_CHAR Mtclass[3];
  RFC_CHAR Mtindex[10];
  RFC_CHAR Extindex[10];
  RFC_INT Altreenum;
  RFC_INT Alidxintre;
  RFC_INT Allevintre;
  RFC_INT Alparintre;
  RFC_CHAR Objectname[40];
  RFC_CHAR Mtnameshrt[40];
  RFC_CHAR Cusgrpname[40];
  RFC_INT Deliversta;
  RFC_INT Highalval;
  RFC_INT Highalsev;
  RFC_CHAR Alsysid[8];
  RFC_CHAR Msegname[40];
  RFC_CHAR Aluniqnum[10];
  RFC_CHAR Alindex[10];
  RFC_DATE Alertdate;
  RFC_TIME Alerttime;
  RFC_CHAR Dummyalign[2];
  RFC_DATE Lastvaldat;
  RFC_TIME Lastvaltim;
  RFC_CHAR Lastvaldum[2];
  RFC_INT Actualval;
  RFC_INT Actualsev;
  RFC_CHAR Valsysid[8];
  RFC_CHAR Vmsegname[40];
  RFC_CHAR Valuniqnum[10];
  RFC_CHAR Valindex[10];
  RFC_DATE Valertdate;
  RFC_TIME Valerttime;
  RFC_CHAR Valertdum[2];
  RFC_INT Countofact;
  RFC_INT Countsum;
  RFC_INT Visuserlev;
  RFC_INT Tdstatus;
 } BAPITNDEXT;
#endif

/* structure type handle and element definition */

#ifndef SAP_TH_BAPIMNNAME
#define SAP_TH_BAPIMNNAME
static RFC_TYPEHANDLE handleOfBAPIMNNAME;

static RFC_TYPE_ELEMENT typeOfBAPIMNNAME[] = {
  {"MONI_NAME", TYPC, 60, 0},
  {"MS_NAME", TYPC, 60, 0},
 };
#endif

#ifndef SAP_TH_BAPIRET2
#define SAP_TH_BAPIRET2
static RFC_TYPEHANDLE handleOfBAPIRET2;

static RFC_TYPE_ELEMENT typeOfBAPIRET2[] = {
  {"TYPE", TYPC, 1, 0},
  {"ID", TYPC, 20, 0},
  {"NUMBER", TYPNUM, 3, 0},
  {"MESSAGE", TYPC, 220, 0},
  {"LOG_NO", TYPC, 20, 0},
  {"LOG_MSG_NO", TYPNUM, 6, 0},
  {"MESSAGE_V1", TYPC, 50, 0},
  {"MESSAGE_V2", TYPC, 50, 0},
  {"MESSAGE_V3", TYPC, 50, 0},
  {"MESSAGE_V4", TYPC, 50, 0},
  {"PARAMETER", TYPC, 32, 0},
  {"ROW", TYPINT, sizeof(RFC_INT), 0},
  {"FIELD", TYPC, 30, 0},
  {"SYSTEM", TYPC, 10, 0},
 };
#endif

#ifndef SAP_TH_BAPITNDEXT
#define SAP_TH_BAPITNDEXT
static RFC_TYPEHANDLE handleOfBAPITNDEXT;

static RFC_TYPE_ELEMENT typeOfBAPITNDEXT[] = {
  {"MTSYSID", TYPC, 8, 0},
  {"MTMCNAME", TYPC, 40, 0},
  {"MTNUMRANGE", TYPC, 3, 0},
  {"MTUID", TYPC, 10, 0},
  {"MTCLASS", TYPC, 3, 0},
  {"MTINDEX", TYPC, 10, 0},
  {"EXTINDEX", TYPC, 10, 0},
  {"ALTREENUM", TYPINT, sizeof(RFC_INT), 0},
  {"ALIDXINTRE", TYPINT, sizeof(RFC_INT), 0},
  {"ALLEVINTRE", TYPINT, sizeof(RFC_INT), 0},
  {"ALPARINTRE", TYPINT, sizeof(RFC_INT), 0},
  {"OBJECTNAME", TYPC, 40, 0},
  {"MTNAMESHRT", TYPC, 40, 0},
  {"CUSGRPNAME", TYPC, 40, 0},
  {"DELIVERSTA", TYPINT, sizeof(RFC_INT), 0},
  {"HIGHALVAL", TYPINT, sizeof(RFC_INT), 0},
  {"HIGHALSEV", TYPINT, sizeof(RFC_INT), 0},
  {"ALSYSID", TYPC, 8, 0},
  {"MSEGNAME", TYPC, 40, 0},
  {"ALUNIQNUM", TYPC, 10, 0},
  {"ALINDEX", TYPC, 10, 0},
  {"ALERTDATE", TYPDATE, sizeof(RFC_DATE), 0},
  {"ALERTTIME", TYPTIME, sizeof(RFC_TIME), 0},
  {"DUMMYALIGN", TYPC, 2, 0},
  {"LASTVALDAT", TYPDATE, sizeof(RFC_DATE), 0},
  {"LASTVALTIM", TYPTIME, sizeof(RFC_TIME), 0},
  {"LASTVALDUM", TYPC, 2, 0},
  {"ACTUALVAL", TYPINT, sizeof(RFC_INT), 0},
  {"ACTUALSEV", TYPINT, sizeof(RFC_INT), 0},
  {"VALSYSID", TYPC, 8, 0},
  {"VMSEGNAME", TYPC, 40, 0},
  {"VALUNIQNUM", TYPC, 10, 0},
  {"VALINDEX", TYPC, 10, 0},
  {"VALERTDATE", TYPDATE, sizeof(RFC_DATE), 0},
  {"VALERTTIME", TYPTIME, sizeof(RFC_TIME), 0},
  {"VALERTDUM", TYPC, 2, 0},
  {"COUNTOFACT", TYPINT, sizeof(RFC_INT), 0},
  {"COUNTSUM", TYPINT, sizeof(RFC_INT), 0},
  {"VISUSERLEV", TYPINT, sizeof(RFC_INT), 0},
  {"TDSTATUS", TYPINT, sizeof(RFC_INT), 0},
 };
#endif

/*
------------------------------------------------------------------------

  Call function BAPI_SYSTEM_MTE_GETMLCURVAL
      exporting
        EXTERNAL_USER_NAME like BAPIXMLOGR_EXTUSER  type RFC_CHAR length 16
        TID structure BAPITID length
84 number of fields 7
      importing
        CURRENT_VALUE structure BAPIMLCVAL length 96 number of fields 9
        RETURN structure BAPIRET2 length 548 number of fields 14
        XMI_MSG_EXT structure BAPIXMIEXT length 255 number of fields 1
        XMI_MSG_RAW structure BAPIXMIRAW length 690 number of fields 11
      tables
      exceptions

------------------------------------------------------------------------
*/


/* structure type definition */

#ifndef SAP_ST_BAPITID
#define SAP_ST_BAPITID
typedef struct {
  RFC_CHAR Mtsysid[8];
  RFC_CHAR Mtmcname[40];
  RFC_CHAR Mtnumrange[3];
  RFC_CHAR Mtuid[10];
  RFC_CHAR Mtclass[3];
  RFC_CHAR Mtindex[10];
  RFC_CHAR Extindex[10];
 } BAPITID;
#endif

#ifndef SAP_ST_BAPIMLCVAL
#define SAP_ST_BAPIMLCVAL
typedef struct {
  RFC_CHAR Mscgllid[50];
  RFC_DATE Mscdate;
  RFC_TIME Msctime;
  RFC_INT Valueorig;
  RFC_INT Severorig;
  RFC_INT Valuefltrd;
  RFC_INT Severfltrd;
  RFC_CHAR Mandt[3];
  RFC_CHAR Userid[12];
 } BAPIMLCVAL;
#endif


#ifndef SAP_ST_BAPIXMIEXT
#define SAP_ST_BAPIXMIEXT
typedef struct {
  RFC_CHAR Msg[255];
 } BAPIXMIEXT;
#endif

#ifndef SAP_ST_BAPIXMIRAW
#define SAP_ST_BAPIXMIRAW
typedef struct {
  RFC_CHAR Msgclass[16];
  RFC_CHAR Msgid[30];
  RFC_CHAR Msgarg1[128];
  RFC_CHAR Argtype1[1];
  RFC_CHAR Msgarg2[128];
  RFC_CHAR Argtype2[1];
  RFC_CHAR Msgarg3[128];
  RFC_CHAR Argtype3[1];
  RFC_CHAR Msgarg4[128];
  RFC_CHAR Argtype4[1];
  RFC_CHAR Msgtext[128];
 } BAPIXMIRAW;
#endif

/* structure type handle and element definition */

#ifndef SAP_TH_BAPITID
#define SAP_TH_BAPITID
static RFC_TYPEHANDLE handleOfBAPITID;

static RFC_TYPE_ELEMENT typeOfBAPITID[] = {
  {"MTSYSID", TYPC, 8, 0},
  {"MTMCNAME", TYPC, 40, 0},
  {"MTNUMRANGE", TYPC, 3, 0},
  {"MTUID", TYPC, 10, 0},
  {"MTCLASS", TYPC, 3, 0},
  {"MTINDEX", TYPC, 10, 0},
  {"EXTINDEX", TYPC, 10, 0},
 };
#endif

#ifndef SAP_TH_BAPIMLCVAL
#define SAP_TH_BAPIMLCVAL
static RFC_TYPEHANDLE handleOfBAPIMLCVAL;

static RFC_TYPE_ELEMENT typeOfBAPIMLCVAL[] = {
  {"MSCGLLID", TYPC, 50, 0},
  {"MSCDATE", TYPDATE, sizeof(RFC_DATE), 0},
  {"MSCTIME", TYPTIME, sizeof(RFC_TIME), 0},
  {"VALUEORIG", TYPINT, sizeof(RFC_INT), 0},
  {"SEVERORIG", TYPINT, sizeof(RFC_INT), 0},
  {"VALUEFLTRD", TYPINT, sizeof(RFC_INT), 0},
  {"SEVERFLTRD", TYPINT, sizeof(RFC_INT), 0},
  {"MANDT", TYPC, 3, 0},
  {"USERID", TYPC, 12, 0},
 };
#endif


#ifndef SAP_TH_BAPIXMIEXT
#define SAP_TH_BAPIXMIEXT
static RFC_TYPEHANDLE handleOfBAPIXMIEXT;

static RFC_TYPE_ELEMENT typeOfBAPIXMIEXT[] = {
  {"MSG", TYPC, 255, 0},
 };
#endif

#ifndef SAP_TH_BAPIXMIRAW
#define SAP_TH_BAPIXMIRAW
static RFC_TYPEHANDLE handleOfBAPIXMIRAW;

static RFC_TYPE_ELEMENT typeOfBAPIXMIRAW[] = {
  {"MSGCLASS", TYPC, 16, 0},
  {"MSGID", TYPC, 30, 0},
  {"MSGARG1", TYPC, 128, 0},
  {"ARGTYPE1", TYPC, 1, 0},
  {"MSGARG2", TYPC, 128, 0},
  {"ARGTYPE2", TYPC, 1, 0},
  {"MSGARG3", TYPC, 128, 0},
  {"ARGTYPE3", TYPC, 1, 0},
  {"MSGARG4", TYPC, 128, 0},
  {"ARGTYPE4", TYPC, 1, 0},
  {"MSGTEXT", TYPC, 128, 0},
 };
#endif


/*
------------------------------------------------------------------------

  Call function BAPI_SYSTEM_MTE_GETPERFCURVAL
      exporting
        EXTERNAL_USER_NAME like BAPIXMLOGR_EXTUSER  type RFC_CHAR length 16
        TID structure BAPITID length
84 number of fields 7
      importing
        CURRENT_VALUE structure BAPIPACVAL length 104 number of fields 20
        RETURN structure BAPIRET2 length 548 number of fields 14
      tables
      exceptions

------------------------------------------------------------------------
*/

/* field type definition */

/* structure type definition */


#ifndef SAP_ST_BAPIPACVAL
#define SAP_ST_BAPIPACVAL
typedef struct {
  RFC_INT Alrelevval;
  RFC_DATE Alrelvaldt;
  RFC_TIME Alrelvalti;
  RFC_INT Lastalstat;
  RFC_INT Lastperval;
  RFC_INT Avg01pval;
  RFC_INT Avg05pval;
  RFC_INT Avg15pval;
  RFC_INT Avg01sval;
  RFC_INT Avg05sval;
  RFC_INT Avg15sval;
  RFC_INT Avg01cval;
  RFC_INT Avg05cval;
  RFC_INT Avg15cval;
  RFC_INT Maxpfvalue;
  RFC_DATE Maxpfdate;
  RFC_TIME Maxpftime;
  RFC_INT Minpfvalue;
  RFC_DATE Minpfdate;
  RFC_TIME Minpftime;
 } BAPIPACVAL;
#endif


/* structure type handle and element definition */


#ifndef SAP_TH_BAPIPACVAL
#define SAP_TH_BAPIPACVAL
static RFC_TYPEHANDLE handleOfBAPIPACVAL;

static RFC_TYPE_ELEMENT typeOfBAPIPACVAL[] = {
  {"ALRELEVVAL", TYPINT, sizeof(RFC_INT), 0},
  {"ALRELVALDT", TYPDATE, sizeof(RFC_DATE), 0},
  {"ALRELVALTI", TYPTIME, sizeof(RFC_TIME), 0},
  {"LASTALSTAT", TYPINT, sizeof(RFC_INT), 0},
  {"LASTPERVAL", TYPINT, sizeof(RFC_INT), 0},
  {"AVG01PVAL", TYPINT, sizeof(RFC_INT), 0},
  {"AVG05PVAL", TYPINT, sizeof(RFC_INT), 0},
  {"AVG15PVAL", TYPINT, sizeof(RFC_INT), 0},
  {"AVG01SVAL", TYPINT, sizeof(RFC_INT), 0},
  {"AVG05SVAL", TYPINT, sizeof(RFC_INT), 0},
  {"AVG15SVAL", TYPINT, sizeof(RFC_INT), 0},
  {"AVG01CVAL", TYPINT, sizeof(RFC_INT), 0},
  {"AVG05CVAL", TYPINT, sizeof(RFC_INT), 0},
  {"AVG15CVAL", TYPINT, sizeof(RFC_INT), 0},
  {"MAXPFVALUE", TYPINT, sizeof(RFC_INT), 0},
  {"MAXPFDATE", TYPDATE, sizeof(RFC_DATE), 0},
  {"MAXPFTIME", TYPTIME, sizeof(RFC_TIME), 0},
  {"MINPFVALUE", TYPINT, sizeof(RFC_INT), 0},
  {"MINPFDATE", TYPDATE, sizeof(RFC_DATE), 0},
  {"MINPFTIME", TYPTIME, sizeof(RFC_TIME), 0},
 };
#endif


/*
------------------------------------------------------------------------

  Call function BAPI_SYSTEM_MTE_GETSMVALUE
      exporting
        EXTERNAL_USER_NAME like BAPIXMLOGR_EXTUSER  type RFC_CHAR length 16
        TID structure BAPITID length
84 number of fields 7
      importing
        RETURN structure BAPIRET2 length 548 number of fields 14
        VALUE structure BAPISMCVAL length 276 number of fields 4
      tables
      exceptions

------------------------------------------------------------------------
*/


/* structure type definition */


#ifndef SAP_ST_BAPISMCVAL
#define SAP_ST_BAPISMCVAL
typedef struct {
  RFC_INT Smsgvalue;
  RFC_DATE Smsgdate;
  RFC_TIME Smsgtime;
  RFC_CHAR Msg[255];
 } BAPISMCVAL;
#endif

/* structure type handle and element definition */

#ifndef SAP_TH_BAPISMCVAL
#define SAP_TH_BAPISMCVAL
static RFC_TYPEHANDLE handleOfBAPISMCVAL;

static RFC_TYPE_ELEMENT typeOfBAPISMCVAL[] = {
  {"SMSGVALUE", TYPINT, sizeof(RFC_INT), 0},
  {"SMSGDATE", TYPDATE, sizeof(RFC_DATE), 0},
  {"SMSGTIME", TYPTIME, sizeof(RFC_TIME), 0},
  {"MSG", TYPC, 255, 0},
 };
#endif


/*
------------------------------------------------------------------------

  Call function BAPI_SYSTEM_MTE_GETTXTPROP
      exporting
        EXTERNAL_USER_NAME like BAPIXMLOGR_EXTUSER  type RFC_CHAR length 16
        TID structure BAPITID length
84 number of fields 7
      importing
        PROPERTIES structure BAPITXTPRP length 256 number of fields 1
        RETURN structure BAPIRET2 length 548 number of fields 14
      tables
      exceptions

------------------------------------------------------------------------
*/



/* structure type definition */


#ifndef SAP_ST_BAPITXTPRP
#define SAP_ST_BAPITXTPRP
typedef struct {
  RFC_CHAR Text[256];
 } BAPITXTPRP;
#endif


/* structure type handle and element definition */


#ifndef SAP_TH_BAPITXTPRP
#define SAP_TH_BAPITXTPRP
static RFC_TYPEHANDLE handleOfBAPITXTPRP;

static RFC_TYPE_ELEMENT typeOfBAPITXTPRP[] = {
  {"TEXT", TYPC, 256, 0},
 };
#endif

/*
------------------------------------------------------------------------

  Call function BAPI_SYSTEM_MTE_GETPERFPROP
      exporting
        EXTERNAL_USER_NAME like BAPIXMLOGR_EXTUSER  type RFC_CHAR length 16
        TID structure BAPITID length
84 number of fields 7
      importing
        PROPERTIES structure BAPIPAPROP length 124 number of fields 12
        RETURN structure BAPIRET2 length 548 number of fields 14
      tables
      exceptions

------------------------------------------------------------------------
*/
#ifndef SAP_ST_BAPIPAPROP
#define SAP_ST_BAPIPAPROP
typedef struct {
  RFC_INT Relvaltype;
  RFC_INT Threshdir;
  RFC_INT Threshstat;
  RFC_INT Treshg2y;
  RFC_INT Treshy2r;
  RFC_INT Treshy2g;
  RFC_INT Treshr2y;
  RFC_CHAR Msgclass[16];
  RFC_CHAR Msgid[30];
  RFC_CHAR Attrgroup[40];
  RFC_CHAR Valunit[4];
  RFC_INT Decimals;
 } BAPIPAPROP;
#endif


#ifndef SAP_TH_BAPIPAPROP
#define SAP_TH_BAPIPAPROP
static RFC_TYPEHANDLE handleOfBAPIPAPROP;

static RFC_TYPE_ELEMENT typeOfBAPIPAPROP[] = {
  {"RELVALTYPE", TYPINT, sizeof(RFC_INT), 0},
  {"THRESHDIR", TYPINT, sizeof(RFC_INT), 0},
  {"THRESHSTAT", TYPINT, sizeof(RFC_INT), 0},
  {"TRESHG2Y", TYPINT, sizeof(RFC_INT), 0},
  {"TRESHY2R", TYPINT, sizeof(RFC_INT), 0},
  {"TRESHY2G", TYPINT, sizeof(RFC_INT), 0},
  {"TRESHR2Y", TYPINT, sizeof(RFC_INT), 0},
  {"MSGCLASS", TYPC, 16, 0},
  {"MSGID", TYPC, 30, 0},
  {"ATTRGROUP", TYPC, 40, 0},
  {"VALUNIT", TYPC, 4, 0},
  {"DECIMALS", TYPINT, sizeof(RFC_INT), 0},
 };
#endif

/*
------------------------------------------------------------------------

  Call function BAPI_SYSTEM_MTE_SETPERFPROP
      exporting
        DECIMALS like BAPIPAPROP_DECIMALS  type RFC_INT length 4
        EXTERNAL_USER_NAME like BAPIXMLOGR_EXTUSER  type RFC_CHAR length 16
        RELEVANT_VALUE like BAPIPAPROP_RELVALTYPE  type RFC_INT length 4
        THRESHOLD_DIRECTION like BAPIPAPROP_THRESHDIR  type RFC_INT length 4
        THRESHOLD_GREEN_TO_YELLOW like BAPIPAPROP_TRESHG2Y  type RFC_INT length 4
        THRESHOLD_RED_TO_YELLOW like BAPIPAPROP_TRESHR2Y  type RFC_INT length 4
        THRESHOLD_YELLOW_TO_GREEN like BAPIPAPROP_TRESHY2G  type RFC_INT length 4
        THRESHOLD_YELLOW_TO_RED like BAPIPAPROP_TRESHY2R  type RFC_INT length 4
        TID structure ALGLOBTID length
84 number of fields 7
        TID_SPECIFIC like BAPIPARAMS_BOOL_PARA default ' ' type RFC_CHAR length 1
        VALUE_UNIT like BAPIPAPROP_VALUNIT  type RFC_CHAR length 4
        VARIANT_NAME like BAPIVARINT_NAME  type RFC_CHAR length 20
        XMI_MSG_CLASS like BAPIPAPROP_MSGCLASS  type RFC_CHAR length 16
        XMI_MSG_ID like BAPIPAPROP_MSGID  type RFC_CHAR length 30
      importing
        RETURN structure BAPIRET2 length
548 number of fields 14
      tables
      exceptions

------------------------------------------------------------------------
*/

/* field type definition */

#ifndef SAP_FT_BAPIPAPROP_DECIMALS
#define SAP_FT_BAPIPAPROP_DECIMALS
typedef RFC_INT BAPIPAPROP_DECIMALS;
#endif

#ifndef SAP_FT_BAPIPAPROP_RELVALTYPE
#define SAP_FT_BAPIPAPROP_RELVALTYPE
typedef RFC_INT BAPIPAPROP_RELVALTYPE;
#endif

#ifndef SAP_FT_BAPIPAPROP_THRESHDIR
#define SAP_FT_BAPIPAPROP_THRESHDIR
typedef RFC_INT BAPIPAPROP_THRESHDIR;
#endif

#ifndef SAP_FT_BAPIPAPROP_TRESHG2Y
#define SAP_FT_BAPIPAPROP_TRESHG2Y
typedef RFC_INT BAPIPAPROP_TRESHG2Y;
#endif

#ifndef SAP_FT_BAPIPAPROP_TRESHR2Y
#define SAP_FT_BAPIPAPROP_TRESHR2Y
typedef RFC_INT BAPIPAPROP_TRESHR2Y;
#endif

#ifndef SAP_FT_BAPIPAPROP_TRESHY2G
#define SAP_FT_BAPIPAPROP_TRESHY2G
typedef RFC_INT BAPIPAPROP_TRESHY2G;
#endif

#ifndef SAP_FT_BAPIPAPROP_TRESHY2R
#define SAP_FT_BAPIPAPROP_TRESHY2R
typedef RFC_INT BAPIPAPROP_TRESHY2R;
#endif

#ifndef SAP_FT_BAPIPARAMS_BOOL_PARA
#define SAP_FT_BAPIPARAMS_BOOL_PARA
typedef RFC_CHAR BAPIPARAMS_BOOL_PARA[1];
#endif

#ifndef SAP_FT_BAPIPAPROP_VALUNIT
#define SAP_FT_BAPIPAPROP_VALUNIT
typedef RFC_CHAR BAPIPAPROP_VALUNIT[4];
#endif

#ifndef SAP_FT_BAPIVARINT_NAME
#define SAP_FT_BAPIVARINT_NAME
typedef RFC_CHAR BAPIVARINT_NAME[20];
#endif

#ifndef SAP_FT_BAPIPAPROP_MSGCLASS
#define SAP_FT_BAPIPAPROP_MSGCLASS
typedef RFC_CHAR BAPIPAPROP_MSGCLASS[16];
#endif

#ifndef SAP_FT_BAPIPAPROP_MSGID
#define SAP_FT_BAPIPAPROP_MSGID
typedef RFC_CHAR BAPIPAPROP_MSGID[30];
#endif

/*
------------------------------------------------------------------------

  Call function BAPI_SYSTEM_ALERT_ACKNOWLEDGE
      exporting
        AID structure BAPIAID length 84 number of fields 7
        EXTERNAL_USER_NAME like BAPIXMLOGR_EXTUSER  type RFC_CHAR length 16
      importing
        RETURN structure BAPIRET2 length
548 number of fields 14
      tables
        BAPIAID_TBL structure BAPIAID_RC length 120 number of fields 9
      exceptions

------------------------------------------------------------------------
*/

/* structure type definition */

#ifndef SAP_ST_BAPIAID
#define SAP_ST_BAPIAID
typedef struct {
  RFC_CHAR Alsysid[8];
  RFC_CHAR Msegname[40];
  RFC_CHAR Aluniqnum[10];
  RFC_CHAR Alindex[10];
  RFC_DATE Alertdate;
  RFC_TIME Alerttime;
  RFC_CHAR Dummyalign[2];
 } BAPIAID;
#endif

#ifndef SAP_ST_BAPIAID_RC
#define SAP_ST_BAPIAID_RC
typedef struct {
  RFC_CHAR Alsysid[8];
  RFC_CHAR Msegname[40];
  RFC_CHAR Aluniqnum[10];
  RFC_CHAR Alindex[10];
  RFC_DATE Alertdate;
  RFC_TIME Alerttime;
  RFC_CHAR Dummyalign[2];
  RFC_INT Rc;
  RFC_CHAR RcText[32];
 } BAPIAID_RC;
#endif

/* structure type handle and element definition */

#ifndef SAP_TH_BAPIAID
#define SAP_TH_BAPIAID
static RFC_TYPEHANDLE handleOfBAPIAID;

static RFC_TYPE_ELEMENT typeOfBAPIAID[] = {
  {"ALSYSID", TYPC, 8, 0},
  {"MSEGNAME", TYPC, 40, 0},
  {"ALUNIQNUM", TYPC, 10, 0},
  {"ALINDEX", TYPC, 10, 0},
  {"ALERTDATE", TYPDATE, sizeof(RFC_DATE), 0},
  {"ALERTTIME", TYPTIME, sizeof(RFC_TIME), 0},
  {"DUMMYALIGN", TYPC, 2, 0},
 };
#endif


#ifndef SAP_TH_BAPIAID_RC
#define SAP_TH_BAPIAID_RC
static RFC_TYPEHANDLE handleOfBAPIAID_RC;

static RFC_TYPE_ELEMENT typeOfBAPIAID_RC[] = {
  {"ALSYSID", TYPC, 8, 0},
  {"MSEGNAME", TYPC, 40, 0},
  {"ALUNIQNUM", TYPC, 10, 0},
  {"ALINDEX", TYPC, 10, 0},
  {"ALERTDATE", TYPDATE, sizeof(RFC_DATE), 0},
  {"ALERTTIME", TYPTIME, sizeof(RFC_TIME), 0},
  {"DUMMYALIGN", TYPC, 2, 0},
  {"RC", TYPINT, sizeof(RFC_INT), 0},
  {"RC_TEXT", TYPC, 32, 0},
 };
#endif

/* entries */

#ifndef ENTRIES
#define ENTRIES(tab) (sizeof(tab)/sizeof((tab)[0]))
#endif

#endif


