/* @(#) $Id: //bas/710_REL/src/ca/cad/cadtst1.c#1 $ SAP*/ /*--------------------------------------------------------------------*/ /* */ /* SAP AG Walldorf */ /* SAP Systeme, Anwendungen und Produkte in der Datenverarbeitung */ /* */ /* (C) Copyright SAP AG 1992 */ /* */ /*--------------------------------------------------------------------*/ /* File: cadtst1.c */ /*--------------------------------------------------------------------*/ /* Simple test program for the CAD dialog interface */ /* Program connects to SAP and requests material master */ /* informations. */ /* */ /* Routines: */ /* --------- */ /* main() main program */ /*--------------------------------------------------------------------*/ /* 3.1G */ /* BINK105580 180297 change of sendstring */ /* 3.0F */ /* BINK097985 231096 get rid of compiler warnings */ /* 1.10 */ /* YENK000000 290693 Aenderungen fuer DOS/Windows */ /* 1.00 */ /* YENK000000 210892 Neu aufgenommen */ /*--------------------------------------------------------------------*/ #include #include #include #include "caddialg.h" char sndstr[16500]; /*--------------------------------------------------------------------*/ /* main */ /*--------------------------------------------------------------------*/ /* NAME DESCRIPTION */ /* ---------------- ------------------------------------ */ /* INPUT : argc */ /* argv */ /* OUTPUT: ---- */ /*--------------------------------------------------------------------*/ /* RETURN: ---- */ /*--------------------------------------------------------------------*/ main (int argc, char *argv[]) { SAPHD hd; char *rcvstr; char *sapmes; char *version; /* Connect: Parameters about SAP system, user name and password */ /* will be read in configuration file cadrfc.ini. */ argc = argc; /* only for compiler purpose RM600 */ hd=SapVersi(&version); printf("SAP-CAD function library, interface version: %s\n",version); printf("-------------------------------------------------\n"); printf("\n"); hd = SapConnc(argv,"","","","","","","",&sapmes); printf("CONNC --- CPIC-RC=%ld\n",hd.cpicrc); printf("--------------------\n"); if (hd.cpicrc == 0) printf("Received Message: %s\n\n",sapmes); else { printf("Received CPIC-Error: %s\n\n",hd.cpicmes); exit(1); } /* Request material master. All fields for send and receive */ /* must be defined in the SAP customizing tables TCIM, TCIU, and */ /* TCID. */ strcpy(sndstr,"EB01 X"); /* 180297 */ hd = SapMatrq("MR",sndstr,&rcvstr,&sapmes); printf("MATRQ --- CPIC-RC=%ld\n",hd.cpicrc); printf("--------------------\n"); if (hd.cpicrc == 0) { printf("Sended Data: %s\n",sndstr); rcvstr[hd.datalen] = 0x0; printf("Received Data: %s\n",rcvstr); sapmes[hd.meslen] = 0x0; printf("Received Message: %s\n\n",sapmes); } else { printf("Received CPIC-Error: %s\n\n",hd.cpicmes); exit(1); } /* Disconnect */ hd = SapDisco(); printf("DISCO --- CPIC-RC=%ld\n",hd.cpicrc); return(0); }