Need Help for designing Business function

Sar

Member
Hi All,
I am very new to designing C Business Function .
I have one requirement where i need to copy B4100790 and add some more logic to that .
My requirement is :F4104.XRT = ‘MQ’
F4104.AN8 = F43211.AN8
F4104.ITM = F3411.ITM

Retrieve the value on:
F4104.CITM
For this I think i need to open the table and then fetch .
I have written some code to that but the fetch was not succesful eventhough the record exists in the table .
MathCopy(&dsF4104Key1.ivitm, &lpEnv->lpDS->mnShortItemNo);
MathCopy(&dsF4104Key1.ivan8,&dsF3450.maan8);
/*jdeStrcpy(dsF4102Key1.ibmcu, lpEnv->lpDS->szBranchPlant);*/

idJDBReturn =JDB_OpenTable((HUSER)lpEnv->hUser,
szTableIdF4104,
idIndexIdF4104,
NULL,
nColumnsF4104,
(JCHAR *) NULL,
(HREQUEST*)&hRequestF4104);

if(idJDBReturn == JDEDB_PASSED) /* if open table passed */
{

idJDBReturn = JDB_FetchKeyed(hRequestF4104,
idIndexIdF4104,
(void *)(&dsF4104Key1),
nKeyF4104,
(void *) (&dsF4104),
(int) (FALSE));

if(idJDBReturn==JDEDB_PASSED)

{
}
The fetch was not succesful ..I dont know what i am missing .
Please somebody can help me regarding this.

One more doubt .Which API we need to use to convert string to Math Numeric

Any help is appreciated.

Thanks,
Jyothi.
 
Jyothi,

I think we'll need to see more of the code ...
Where is IVXRT being set in the dsF4104Key1 structure?
What is the value of nKeyF4104, it should be 3 if you're using 3 key fields.
Turn on tracing (JDE.INI - OUTPUT=FILE in DEBUG section) and check your jdedebug.log for the actual SQL being generated.

To answer your question, ParseNumericString is an API to convert a string to a MATH_NUMERIC. You'll find it in many vanilla BSFNs

Craig
 
Back
Top