/*****************************************************************************
* Header File: B55001XM.h
*
* Description: Copy Data From XML to Flat File Header File
*
* History:
* Date Programmer Email
* ---------- ---------- -------------------------------------------
* Author 11/10/2015 Lokesh Reddy - Created
*
*
* Copyright (c) J.D. Edwards World Source Company, 1996
*
* This unpublished material is proprietary to J.D. Edwards World Source
* Company. All rights reserved. The methods and techniques described
* herein are considered trade secrets and/or confidential. Reproduction
* or distribution, in whole or in part, is forbidden except by express
* written permission of J.D. Edwards World Source Company.
****************************************************************************/
#ifndef __B55001XM_H
#define __B55001XM_H
/*****************************************************************************
* Table Header Inclusions
****************************************************************************/
/*****************************************************************************
* External Business Function Header Inclusions
****************************************************************************/
#include <xerceswrapper.h>
/*****************************************************************************
* Global Definitions
****************************************************************************/
/*****************************************************************************
* Structure Definitions
****************************************************************************/
/*****************************************************************************
* DS Template Type Definitions
****************************************************************************/
/*****************************************
* TYPEDEF for Data Structure
* Template Name: Copy Data From XML to Flat File
* Template ID: D55001XML
* Generated: Thu Nov 11 16:37:25 2010
*
* DO NOT EDIT THE FOLLOWING TYPEDEF
* To make modifications, use the OneWorld Data Structure
* Tool to Generate a revised version, and paste from
* the clipboard.
*
**************************************/
#ifndef DATASTRUCTURE_D55001XML
#define DATASTRUCTURE_D55001XML
typedef struct tagDSD55001XML
{
JCHAR szXMLPath[251];
JCHAR szFlatFilePath1[256];
JCHAR szFlatFilePath2[256];
JCHAR szErrorMessage[101];
} DSD55001XML, *LPDSD55001XML;
#define IDERRszXMLPath_1 1L
#define IDERRszFlatFilePath1_2 2L
#define IDERRszFlatFilePath2_3 3L
#define IDERRszErrorMessage_4 4L
#endif
/*****************************************************************************
* Source Preprocessor Definitions
****************************************************************************/
#if defined (JDEBFRTN)
#undef JDEBFRTN
#endif
#if defined (WIN32)
#if defined (WIN32)
#define JDEBFRTN(r) __declspec(dllexport) r
#else
#define JDEBFRTN(r) __declspec(dllimport) r
#endif
#else
#define JDEBFRTN(r) r
#endif
/*****************************************************************************
* Business Function Prototypes
****************************************************************************/
JDEBFRTN (ID) JDEBFWINAPI copyDataXMLtoFlatFile (LPBHVRCOM lpBhvrCom, LPVOID lpVoid, LPDSD55001XML lpDS);
/*****************************************************************************
* Internal Function Prototypes
****************************************************************************/
#endif /* __B55001XM_H */
#include <jde.h>
#define b55001xm_c
/*****************************************************************************
* Source File: b55001xm
*
* Description: Copy Data From XML to Flat File Source File
*
* History:
* Date Programmer Email
* ---------- ---------- -------------------------------------------
* Author 11/11/2015 Lokesh Reddy - Created
*
* Copyright (c) J.D. Edwards World Source Company, 1996
*
* This unpublished material is proprietary to J.D. Edwards World Source Company.
* All rights reserved. The methods and techniques described herein are
* considered trade secrets and/or confidential. Reproduction or
* distribution, in whole or in part, is forbidden except by express
* written permission of J.D. Edwards World Source Company.
****************************************************************************/
/**************************************************************************
* Notes:
*
**************************************************************************/
#include <b55001xm.h>
/**************************************************************************
* Business Function: copyDataXMLtoFlatFile
*
* Description: Copy Data XML Data to Flat File
*
* Parameters:
* LPBHVRCOM lpBhvrCom Business Function Communications
* LPVOID lpVoid Void Parameter - DO NOT USE!
* LPDSD5500 lpDS Parameter Data Structure Pointer
*
*************************************************************************/
JDEBFRTN (ID) JDEBFWINAPI copyDataXMLtoFlatFile (LPBHVRCOM lpBhvrCom, LPVOID lpVoid, LPDSD55001XML lpDS)
{
/************************************************************************
* Variable declarations
************************************************************************/
XRCS_hParser hParser = NULL;
XRCS_Status XRCSStatus = XRCS_SUCCESS;
XRCS_hDocument hDoc = NULL;
XRCS_hElement hRootElm = NULL;
XRCS_hElement *hElm1 = NULL;
unsigned int nElmCount1 = 0;
XRCS_hElement *hElm2 = NULL;
JCHAR *elmName2 = NULL;
JCHAR *elmValue2 = NULL;
unsigned int nElmCount2 = 0;
XRCS_hElement *hElm3 = NULL;
JCHAR *elmName3 = NULL;
unsigned int nElmCount3 = 0;
XRCS_hElement *hElm4 = NULL;
unsigned int nElmCount4 = 0;
XRCS_hElement *hElm5 = NULL;
JCHAR *elmName5 = NULL;
unsigned int nElmCount5 = 0;
XRCS_hElement *hElm6 = NULL;
JCHAR *elmName6 = NULL;
JCHAR *elmValue6 = NULL;
unsigned int nElmCount6 = 0;
XRCS_hElement *hElm7 = NULL;
JCHAR *elmName7 = NULL;
JCHAR *elmValue7 = NULL;
unsigned int nElmCount7 = 0;
XRCS_hElement *hElm8 = NULL;
unsigned int nElmCount8 = 0;
XRCS_hElement *hElm9 = NULL;
JCHAR *elmName9 = NULL;
JCHAR *elmValue9 = NULL;
unsigned int nElmCount9 = 0;
XRCS_hElement *hElm10 = NULL;
JCHAR *elmName10 = NULL;
JCHAR *elmValue10 = NULL;
unsigned int nElmCount10 = 0;
XRCS_hElement *hElm11 = NULL;
unsigned int nElmCount11 = 0;
unsigned int i = 0;
unsigned int i1 = 0;
unsigned int i2 = 0;
unsigned int i3 = 0;
unsigned int i4 = 0;
unsigned int i5 = 0;
unsigned int i6 = 0;
unsigned int i7 = 0;
unsigned int i8 = 0;
unsigned int i9 = 0;
FILE *fpFlat1;
FILE *fpFlat2;
/************************************************************************
* Declare structures
************************************************************************/
/************************************************************************
* Declare pointers
************************************************************************/
/************************************************************************
* Check for NULL pointers
************************************************************************/
if ((lpBhvrCom == (LPBHVRCOM) NULL) ||
(lpVoid == (LPVOID) NULL) ||
(lpDS == (LPDSD55001XML) NULL))
{
jdeErrorSet (lpBhvrCom, lpVoid, (ID) 0, _J("4363"), (LPVOID) NULL);
return ER_ERROR;
}
/************************************************************************
* Set pointers
************************************************************************/
/************************************************************************
* Main Processing
************************************************************************/
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J(" "));
/* open flat file1 in Binary Mode*/
if( (fpFlat1 = jdeFopen(lpDS->szFlatFilePath1, _J("wb") )) == NULL )
{
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("Flat File1 open failed"));
return ER_ERROR;
}
/* open flat file2 in Binary Mode*/
if( (fpFlat2 = jdeFopen(lpDS->szFlatFilePath2, _J("wb") )) == NULL )
{
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("Flat File2 open failed"));
return ER_ERROR;
}
/* Initialize Xerces Engine */
XRCSStatus = XRCS_initEngine();
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_initEngine failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_initEngine failed"));
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
/* Get the Xerces Parser */
XRCSStatus = XRCS_getParser(&hParser);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_getParser failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_getParser failed"));
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
/* Parse the XML String */
XRCSStatus = XRCS_parseXMLFile(hParser,lpDS->szXMLPath, &hDoc);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_parseXMLFile failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_parseXMLFile failed"));
XRCS_freeParser(hParser);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
/* Get Root Element */
XRCSStatus = XRCS_getDocumentElement(hDoc,&hRootElm);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_getDocumentElement failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_getDocumentElement failed"));
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
/* Get Elements in XML Document*/
XRCSStatus = XRCS_getElementChildren(hRootElm,&hElm1,&nElmCount1);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_getElementChildren1 failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_getElementChildren1 failed"));
XRCS_freeElement(hRootElm);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
for(i=0;i<nElmCount1;i++)
{
XRCSStatus = XRCS_getElementChildren(hElm1[i],&hElm2,&nElmCount2);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_getElementChildren2 failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_getElementChildren2 failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
for(i1=0;i1<nElmCount2;i1++)
{
XRCSStatus = XRCS_getElementName(hElm2[i1],&elmName2);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_getElementName4 failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_getElementName4 failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
XRCSStatus = XRCS_getElementChildren(hElm2[i1],&hElm3,&nElmCount3);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_getElementChildren3 failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_getElementChildren3 failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElement(elmName2);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
for(i2=0;i2<nElmCount3;i2++)
{
XRCSStatus = XRCS_getElementName(hElm3[i2],&elmName3);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_getElementName4 failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_getElementName4 failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
XRCSStatus = XRCS_getElementChildren(hElm3[i2],&hElm4,&nElmCount4);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_getElementChildren4 failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_getElementChildren4 failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
for(i3=0;i3<nElmCount4;i3++)
{
XRCSStatus = XRCS_getElementChildren(hElm4[i3],&hElm5,&nElmCount5);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_getElementChildren5 failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_getElementChildren5 failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
for(i4=0;i4<nElmCount5;i4++)
{
XRCSStatus = XRCS_getElementName(hElm5[i4],&elmName5);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_getElementName4 failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_getElementName4 failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
XRCSStatus = XRCS_getElementChildren(hElm5[i4],&hElm6,&nElmCount6);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_getElementChildren6 failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_getElementChildren6 failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
for(i5=0;i5<nElmCount6;i5++)
{
XRCSStatus = XRCS_getElementName(hElm6[i5],&elmName6);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("get BuyerLineItemNum Name failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("get BuyerLineItemNum Name failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeElementArray(hElm6,nElmCount6);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
/* Code to get the value of BuyerLineItemNum--Start*/
if (jdeStricmp(elmName6,_J("BuyerLineItemNum"))==0)
{
XRCSStatus = XRCS_getElementText(hElm6[i5],&elmValue6);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("get BuyerLineItemNum Value failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("get BuyerLineItemNum Value failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeElementArray(hElm6,nElmCount6);
XRCS_freeElement(elmName7);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
if ( (JCHAR*)NULL != elmValue6)
{
jdeFputsConvert(lpBhvrCom, elmValue6, fpFlat1);
jdeFputsConvertCRLF(lpBhvrCom, _J(","), fpFlat1);
jdeFputsConvert(lpBhvrCom, elmValue6, fpFlat2);
jdeFputsConvertCRLF(lpBhvrCom, _J(","), fpFlat2);
}
}
/* Code to get the value of BuyerLineItemNum--End*/
/* Code to get the value of GeneralNote--Start*/
if (jdeStricmp(elmName6,_J("GeneralNote"))==0)
{
XRCSStatus = XRCS_getElementText(hElm6[i5],&elmValue6);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("get GeneralNote Value failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("get GeneralNote Value failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeElementArray(hElm6,nElmCount6);
XRCS_freeElement(elmName7);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
if ( (JCHAR*)NULL != elmValue6)
{
jdeFputsConvert(lpBhvrCom, elmValue6, fpFlat2);
jdeFputsConvertCRLF(lpBhvrCom, _J("\r\n"), fpFlat2);
}
}
/* Code to get the value of GeneralNote--End*/
XRCSStatus = XRCS_getElementChildren(hElm6[i5],&hElm7,&nElmCount7);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_getElementChildren7 failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_getElementChildren7 failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeElementArray(hElm6,nElmCount6);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
for(i6=0;i6<nElmCount7;i6++)
{
/* Code to get the value of Ident--Start*/
XRCSStatus = XRCS_getElementName(hElm7[i6],&elmName7);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("get Ident Name failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("get Ident Name failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeElementArray(hElm6,nElmCount6);
XRCS_freeElementArray(hElm7,nElmCount7);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
if (jdeStricmp(elmName3,_J("ShipToParty"))==0)
{
if (jdeStricmp(elmName5,_J("PartyID"))==0)
{
if (jdeStricmp(elmName7,_J("Ident"))==0)
{
XRCSStatus = XRCS_getElementText(hElm7[i6],&elmValue7);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("get Ident Value failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("get Ident Value failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeElementArray(hElm6,nElmCount6);
XRCS_freeElementArray(hElm7,nElmCount7);
XRCS_freeElement(elmName7);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
if ( (JCHAR*)NULL != elmValue7)
{
jdeFputsConvert(lpBhvrCom, elmValue7, fpFlat1);
jdeFputsConvertCRLF(lpBhvrCom, _J("\r\n"), fpFlat1);
}
}
}
}
/* Code to get the value of Ident--End*/
/* Code to get the value of QuantityValue--Start*/
if (jdeStricmp(elmName7,_J("QuantityValue"))==0)
{
XRCSStatus = XRCS_getElementText(hElm7[i6],&elmValue7);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("get QuantityValue Value failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("get QuantityValue Value failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeElementArray(hElm6,nElmCount6);
XRCS_freeElementArray(hElm7,nElmCount7);
XRCS_freeElement(elmName7);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
if ( (JCHAR*)NULL != elmValue7)
{
jdeFputsConvert(lpBhvrCom, elmValue7, fpFlat1);
jdeFputsConvertCRLF(lpBhvrCom, _J(","), fpFlat1);
}
}
/* Code to get the value of QuantityValue--End*/
/* Code to get the value of RequestedDeliveryDate--Start*/
if (jdeStricmp(elmName7,_J("RequestedDeliveryDate"))==0)
{
XRCSStatus = XRCS_getElementText(hElm7[i6],&elmValue7);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("get RequestedDeliveryDate Value failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("get RequestedDeliveryDate Value failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeElementArray(hElm6,nElmCount6);
XRCS_freeElementArray(hElm7,nElmCount7);
XRCS_freeElement(elmName7);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
if ( (JCHAR*)NULL != elmValue7)
{
jdeFputsConvert(lpBhvrCom, elmValue7, fpFlat1);
jdeFputsConvertCRLF(lpBhvrCom, _J("\r\n"), fpFlat1);
}
}
/* Code to get the value of RequestedDeliveryDate--End*/
XRCSStatus = XRCS_getElementChildren(hElm7[i6],&hElm8,&nElmCount8);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_getElementChildren8 failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_getElementChildren8 failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeElementArray(hElm6,nElmCount6);
XRCS_freeElementArray(hElm7,nElmCount7);
XRCS_freeElement(elmName7);
XRCS_freeElementArray(hElm8,nElmCount8);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
for(i7=0;i7<nElmCount8;i7++)
{
XRCSStatus = XRCS_getElementChildren(hElm8[i7],&hElm9,&nElmCount9);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_getElementChildren9 failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_getElementChildren9 failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeElementArray(hElm6,nElmCount6);
XRCS_freeElementArray(hElm7,nElmCount7);
XRCS_freeElement(elmName7);
XRCS_freeElementArray(hElm8,nElmCount8);
XRCS_freeElementArray(hElm9,nElmCount9);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
for(i8=0;i8<nElmCount9;i8++)
{
/* Code to get the value of PartID--Start*/
XRCSStatus = XRCS_getElementName(hElm9[i8],&elmName9);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("get PartID Name failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("get PartID Name failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeElementArray(hElm6,nElmCount6);
XRCS_freeElementArray(hElm7,nElmCount7);
XRCS_freeElementArray(hElm8,nElmCount8);
XRCS_freeElementArray(hElm9,nElmCount9);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
if (jdeStricmp(elmName7,_J("BuyerPartNumber"))==0)
{
if (jdeStricmp(elmName9,_J("PartID"))==0)
{
XRCSStatus = XRCS_getElementText(hElm9[i8],&elmValue9);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("get PartID Value failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("get PartID Value failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeElementArray(hElm6,nElmCount6);
XRCS_freeElementArray(hElm7,nElmCount7);
XRCS_freeElementArray(hElm8,nElmCount8);
XRCS_freeElementArray(hElm9,nElmCount9);
XRCS_freeElement(elmName7);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
if ( (JCHAR*)NULL != elmValue9)
{
jdeFputsConvert(lpBhvrCom, elmValue9, fpFlat1);
jdeFputsConvertCRLF(lpBhvrCom, _J(","), fpFlat1);
}
}
}
/* Code to get the value of PartID--End*/
XRCSStatus = XRCS_getElementChildren(hElm9[i8],&hElm10,&nElmCount10);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_getElementChildren10 failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_getElementChildren10 failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeElementArray(hElm6,nElmCount6);
XRCS_freeElementArray(hElm7,nElmCount7);
XRCS_freeElement(elmName7);
XRCS_freeElementArray(hElm8,nElmCount8);
XRCS_freeElementArray(hElm9,nElmCount9);
XRCS_freeElementArray(hElm10,nElmCount10);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
for(i9=0;i9<nElmCount10;i9++)
{
/* Code to get the value of RefNum--Start*/
XRCSStatus = XRCS_getElementName(hElm10[i9],&elmName10);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("get RefNum Name failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("get RefNum Name failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeElementArray(hElm6,nElmCount6);
XRCS_freeElementArray(hElm7,nElmCount7);
XRCS_freeElementArray(hElm8,nElmCount8);
XRCS_freeElementArray(hElm9,nElmCount9);
XRCS_freeElementArray(hElm10,nElmCount10);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
if (jdeStricmp(elmName10,_J("RefNum"))==0)
{
XRCSStatus = XRCS_getElementText(hElm10[i9],&elmValue10);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("get RefNum Value failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("get RefNum Value failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeElementArray(hElm6,nElmCount6);
XRCS_freeElementArray(hElm7,nElmCount7);
XRCS_freeElementArray(hElm8,nElmCount8);
XRCS_freeElementArray(hElm9,nElmCount9);
XRCS_freeElementArray(hElm10,nElmCount10);
XRCS_freeElement(elmName7);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
if ( (JCHAR*)NULL != elmValue10)
{
if(i6==0)
{
jdeFputsConvert(lpBhvrCom, elmValue10, fpFlat1);
jdeFputsConvertCRLF(lpBhvrCom, _J(","), fpFlat1);
}
}
}
/* Code to get the value of RefNum--End*/
XRCSStatus = XRCS_getElementChildren(hElm10[i9],&hElm11,&nElmCount11);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("XRCS_getElementChildren11 failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("XRCS_getElementChildren11 failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElement(elmName2);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeElementArray(hElm6,nElmCount6);
XRCS_freeElementArray(hElm7,nElmCount7);
XRCS_freeElement(elmName7);
XRCS_freeElementArray(hElm8,nElmCount8);
XRCS_freeElementArray(hElm9,nElmCount9);
XRCS_freeElementArray(hElm10,nElmCount10);
XRCS_freeElementArray(hElm11,nElmCount11);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
} /*end of for loop10*/
} /*end of for loop9*/
} /*end of for loop8*/
} /*end of for loop7*/
} /*end of for loop6*/
} /*end of for loop5*/
} /*end of for loop4*/
} /*end of for loop3*/
} /*end of for loop2*/
/* Code to get the value of OrderIssueDate--Start*/
if (jdeStricmp(elmName2,_J("OrderIssueDate"))==0)
{
XRCSStatus = XRCS_getElementText(hElm2[i1],&elmValue2);
if(XRCSStatus != XRCS_SUCCESS)
{
jdeVWriteLogEntry(_J("B55001XM"), __FILE__, __LINE__, 0, _J("get OrderIssueDate value failed"));
jdeStrcpy((JCHAR *)lpDS->szErrorMessage,(const JCHAR *)_J("get OrderIssueDate value failed"));
XRCS_freeElement(hRootElm);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElement(elmName2);
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_terminateEngine();
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
return ER_ERROR;
}
if ( (JCHAR*)NULL != elmValue2)
{
jdeFputsConvert(lpBhvrCom, elmValue2, fpFlat1);
jdeFputsConvertCRLF(lpBhvrCom, _J(","), fpFlat1);
}
}
/* Code to get the value of OrderIssueDate--End */
} /*end of for loop1*/
}
/************************************************************************
* Function Clean Up
************************************************************************/
XRCS_freeParser(hParser);
XRCS_freeDocument(hDoc);
XRCS_freeElementArray(hElm1,nElmCount1);
XRCS_freeElementArray(hElm2,nElmCount2);
XRCS_freeElementArray(hElm3,nElmCount3);
XRCS_freeElementArray(hElm4,nElmCount4);
XRCS_freeElementArray(hElm5,nElmCount5);
XRCS_freeElementArray(hElm6,nElmCount6);
XRCS_freeElementArray(hElm7,nElmCount7);
XRCS_freeElementArray(hElm8,nElmCount8);
XRCS_freeElementArray(hElm9,nElmCount9);
XRCS_freeElementArray(hElm10,nElmCount10);
XRCS_freeElementArray(hElm11,nElmCount11);
XRCS_freeElement(hRootElm);
jdeFclose(fpFlat1);
jdeFclose(fpFlat2);
XRCS_terminateEngine();
return (ER_SUCCESS);
}
/* Internal function comment block */
/**************************************************************************
* Function: Ixxxxxxx_a // Replace "xxxxxxx" with source file number
* // and "a" with the function name
* Notes:
*
* Returns:
*
* Parameters:
**************************************************************************/
No comments:
Post a Comment