Here is the code.
And if the attachement doesn"t work :
#include <jde.h>
#define b5500430_c
/*****************************************************************************
* Source File: b5500430
*
* Description: SPhere Retreive Data Selection Source File
*
* History:
* Date Programmer SAR# - Description
* ---------- ---------- -------------------------------------------
* Author 5/11/2009 Unkno Unknown - 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 <b5500430.h>
/**************************************************************************
* Business Function: SphereRetreiveDataSelection
*
* Description: SPhere Retreive Data Selection for a section
*
* Parameters:
* LPBHVRCOM lpBhvrCom Business Function Communications
* LPVOID lpVoid Void Parameter - DO NOT USE!
* LPDSD550 lpDS Parameter Data Structure Pointer
*
*************************************************************************/
JDEBFRTN (ID) JDEBFWINAPI SphereRetreiveDataSelection (LPBHVRCOM lpBhvrCom, LPVOID lpVoid, LPDSD5500430 lpDS)
{
/************************************************************************
* Variable declarations
************************************************************************/
MATH_NUMERIC mnSectionID = {0};
int nSection = 0;
unsigned short uCount = (unsigned short)0;
ID idJDBReturn = JDEDB_PASSED;
int i = 0 ;
/*int j = 0 ;*/
JCHAR jnValue[10];
MATH_NUMERIC mnValue;
long lValue;
/************************************************************************
* Declare structures
************************************************************************/
/************************************************************************
* Declare pointers
************************************************************************/
HUSER hUser = (HUSER)NULL;
JCHAR* pszRptName = (JCHAR*)NULL;
JCHAR* pszVersionName = (JCHAR*)NULL;
LPGLOBALAPP pGlblApp = (LPGLOBALAPP)NULL;
LPJDEAPP lpObj = (LPJDEAPP)NULL;
LPNEWSELECTSTRUCT lpSelect = (LPNEWSELECTSTRUCT)NULL;
/* LPNEWSELECTSTRUCT lpNewSelect = (LPNEWSELECTSTRUCT)NULL; */
PJSTR lpSelectType = (PJSTR)NULL;
/* HREQUEST hRequest = NULL; */
/************************************************************************
* Check for NULL pointers
************************************************************************/
if ((lpBhvrCom == (LPBHVRCOM) NULL) ||
(lpVoid == (LPVOID) NULL) ||
(lpDS == (LPDSD5500430) NULL))
{
jdeErrorSet (lpBhvrCom, lpVoid, (ID) 0, _J("4363"), (LPVOID) NULL);
return ER_ERROR;
}
idJDBReturn = JDB_InitBhvr(lpBhvrCom, &hUser, (JCHAR *)NULL, JDEDB_COMMIT_AUTO);
if (idJDBReturn == JDEDB_FAILED)
{
jdeErrorSet(lpBhvrCom, lpVoid, (ID)0, _J("4363"), (LPVOID)NULL);
return ER_ERROR;
}
/************************************************************************
* Set pointers
************************************************************************/
/************************************************************************
* Main Processing
************************************************************************/
lpDS->cErrorCode = _J('0');
if (lpDS->cMode == _J('0'))
{
/* Get Report Name */
jdeStrcpy(lpDS->szProgramId, ubeReport_GetName(lpBhvrCom));
pszRptName = ubeReport_GetName(lpBhvrCom);
/* Get Report Version */
lpObj = lpBhvrCom->lpObj;
pGlblApp = lpObj->lpGlobalApp;
jdeStrcpy(lpDS->szVersion, pGlblApp->szVersion);
pszVersionName = pGlblApp->szVersion;
/* Get Report Section ID */
ubeSection_GetID(lpBhvrCom, &mnSectionID);
MathNumericToInt(&mnSectionID, &nSection);
lpDS->idSection = (ID)nSection;
idJDBReturn = ubeSection_GetDataSelection(lpBhvrCom, NULL, NULL, lpDS->idSection, &lpSelect,
&lpSelectType, &uCount);
if (lpSelect)
{
for(i = 0; i < (int) uCount; i++)
{
/*jdeStrcpy(lpDS->szAdditionalText , lpSelectType );*/
jdeStrncat(lpDS->szAdditionalText,lpSelect.Item1.szTable,DIM(lpDS->szAdditionalText));
jdeStrncat(lpDS->szAdditionalText,_J("."),DIM(lpDS->szAdditionalText));
jdeStrncat(lpDS->szAdditionalText,lpSelect.Item1.szDict,DIM(lpDS->szAdditionalText));
jdeStrncat(lpDS->szAdditionalText,_J("."),DIM(lpDS->szAdditionalText));
if (lpSelect .nCmp == JDEDB_CMP_EQ)
{
jdeStrncat(lpDS->szAdditionalText,_J("="),DIM(lpDS->szAdditionalText));
}
else
{
if (lpSelect .nCmp == JDEDB_CMP_GT)
{
jdeStrncat(lpDS->szAdditionalText,_J(">"),DIM(lpDS->szAdditionalText));
}
else
{
if (lpSelect .nCmp == JDEDB_CMP_LT)
{
jdeStrncat(lpDS->szAdditionalText,_J("<"),DIM(lpDS->szAdditionalText));
}
else
{
if (lpSelect .nCmp == JDEDB_CMP_GE)
{
jdeStrncat(lpDS->szAdditionalText,_J(">="),DIM(lpDS->szAdditionalText));
}
else
{
if (lpSelect .nCmp == JDEDB_CMP_LE)
{
jdeStrncat(lpDS->szAdditionalText,_J("<="),DIM(lpDS->szAdditionalText));
}
else
{
jdeStrncat(lpDS->szAdditionalText,_J("!="),DIM(lpDS->szAdditionalText));
};
};
};
};
};
jdeStrncat(lpDS->szAdditionalText,_J(" "),DIM(lpDS->szAdditionalText));
/*memset((void *)(&jnValue),(int)(lpSelect.lpValue),sizeof(jnValue));*/
jdeStrncat(lpDS->szAdditionalText,lpSelect.lpValue ,DIM(lpDS->szAdditionalText));
jdeStrncat(lpDS->szAdditionalText,_J(" "),DIM(lpDS->szAdditionalText));
jdeStrncat(lpDS->szAdditionalText,_J(" "),DIM(lpDS->szAdditionalText));
if (lpSelect.nAndOr == JDEDB_ANDOR_AND)
{
jdeStrncat(lpDS->szAdditionalText,_J(" AND"),DIM(lpDS->szAdditionalText));
}
else
{
jdeStrncat(lpDS->szAdditionalText,_J(" OR"),DIM(lpDS->szAdditionalText));
};
jdeStrncat(lpDS->szAdditionalText,_J("\n"),DIM(lpDS->szAdditionalText));
};
};
ubeSection_FreeDataSelection(lpBhvrCom, &lpSelect, &lpSelectType, uCount);
}
/************************************************************************
* Function Clean Up
************************************************************************/
JDB_FreeBhvr(hUser);
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:
**************************************************************************/