kevinPaul
Member
Hi Guys,
I have been breaking my head trying to find out what is goin' on with "InsertTable" operation in C business function.You guys can help me out solving the issue. Here is the scenario.
When i debugged the C Business function(B0700005), there is an insert operation which writes records into the F0705 File.Here is the statement.
idJDBReturn = JDB_InsertTable(hRequestF0705, NID_F0705,(ID)0,(void *)&dsF0705);
Before executing the above line in debug mode, i see the field values belong to DataStructure dsF0705 is as follows.
CKCN = 195635 & GPA = 35
After executing the InsertTable Operation, when i run a query on the FIle F0705, i see CKCN value becomes 35 and GPA value becomes 195635.
What is causing the problem? Need help guys!!!
Here is the bunch of code from B0700005 for your reference guys.
/* Populate DS to F0705 */
MathCopy(&dsF0705.j_1an8, &lpdsWRITEDBA->mnAddressNumber);
MathCopy(&dsF0705.j_1pdba, &lpdsWRITEDBA->mnPayDeductBenAccType);
MathCopy(&dsF0705.j_1wano, &lpdsWRITEDBA->mnWaControlNumber);
MathCopy(&dsF0705.j_1dtey, &dsFourDigitYearNER.mnDateYr);
MathCopy(&dsF0705.j_1hmo, &lpdsWRITEDBA->mnMonthWorkedA);
dsF0705.j_1ppp = lpdsWRITEDBA->cPayPeriodOfTheMonth;
strncpy(dsF0705.j_1hmco, (const char *)(lpdsWRITEDBA->szCompanyHome), sizeof(dsF0705.j_1hmco));
MathCopy(&dsF0705.j_1gpa, &lpdsWRITEDBA->mnTotalGPAAfterLimitCheck);
MathCopy(&dsF0705.j_1ckcn, &lpdsWRITEDBA->mnCheckControlNumber);
MathCopy(&dsF0705.j_1rtam, &lpdsWRITEDBA->mnAmtOrRate);
strncpy(dsF0705.j_1pid, (const char *) ("B0700005"), sizeof(dsF0705.j_1pid));
strncpy(dsF0705.j_1user, (const char *) lpdsWRITEDBA->szUserId, sizeof(dsF0705.j_1user));
dsF0705.j_1upmj = lpdsWRITEDBA->jdDateUpdated;
MathCopy(&dsF0705.j_1upmt, &lpdsWRITEDBA->mnTimeLastUpdated);
strncpy(dsF0705.j_1jobn, (const char *) lpdsWRITEDBA->szWorkStationId, sizeof(dsF0705.j_1jobn));
/* Write to DBA Period Control File (F0705) */
/* SAR 3359086 - begin */
MathCopy(&dsF0705Key1.j_1an8, &lpdsWRITEDBA->mnAddressNumber);
MathCopy(&dsF0705Key1.j_1pdba, &lpdsWRITEDBA->mnPayDeductBenAccType);
MathCopy(&dsF0705Key1.j_1wano, &lpdsWRITEDBA->mnWaControlNumber);
MathCopy(&dsF0705Key1.j_1dtey, &lpdsWRITEDBA->mnEndingYearMonth);
MathCopy(&dsF0705Key1.j_1hmo, &mnZero);
dsF0705Key1.j_1ppp = lpdsWRITEDBA->cPayPeriodOfTheMonth;
strncpy(dsF0705Key1.j_1hmco, (const char *)(lpdsWRITEDBA->szCompanyHome), sizeof(dsF0705Key1.j_1hmco));
idDBReturn = JDB_FetchKeyed (hRequestF0705,
ID_F0705_AN8_PDBA_PCNO,
(void *) (&dsF0705Key1),
(short) (7),
(void *) (&dsF0705),
FALSE);
if (idDBReturn != JDEDB_PASSED)
{
idJDBReturn = JDB_InsertTable(hRequestF0705, NID_F0705,(ID)0,(void *)&dsF0705);
if (idJDBReturn != JDEDB_PASSED)
{
jdeSetGBRError(lpBhvrCom, lpVoid, (ID) 0, "3143");
}
} /* SAR 3359086 - end */
}
I have been breaking my head trying to find out what is goin' on with "InsertTable" operation in C business function.You guys can help me out solving the issue. Here is the scenario.
When i debugged the C Business function(B0700005), there is an insert operation which writes records into the F0705 File.Here is the statement.
idJDBReturn = JDB_InsertTable(hRequestF0705, NID_F0705,(ID)0,(void *)&dsF0705);
Before executing the above line in debug mode, i see the field values belong to DataStructure dsF0705 is as follows.
CKCN = 195635 & GPA = 35
After executing the InsertTable Operation, when i run a query on the FIle F0705, i see CKCN value becomes 35 and GPA value becomes 195635.
What is causing the problem? Need help guys!!!
Here is the bunch of code from B0700005 for your reference guys.
/* Populate DS to F0705 */
MathCopy(&dsF0705.j_1an8, &lpdsWRITEDBA->mnAddressNumber);
MathCopy(&dsF0705.j_1pdba, &lpdsWRITEDBA->mnPayDeductBenAccType);
MathCopy(&dsF0705.j_1wano, &lpdsWRITEDBA->mnWaControlNumber);
MathCopy(&dsF0705.j_1dtey, &dsFourDigitYearNER.mnDateYr);
MathCopy(&dsF0705.j_1hmo, &lpdsWRITEDBA->mnMonthWorkedA);
dsF0705.j_1ppp = lpdsWRITEDBA->cPayPeriodOfTheMonth;
strncpy(dsF0705.j_1hmco, (const char *)(lpdsWRITEDBA->szCompanyHome), sizeof(dsF0705.j_1hmco));
MathCopy(&dsF0705.j_1gpa, &lpdsWRITEDBA->mnTotalGPAAfterLimitCheck);
MathCopy(&dsF0705.j_1ckcn, &lpdsWRITEDBA->mnCheckControlNumber);
MathCopy(&dsF0705.j_1rtam, &lpdsWRITEDBA->mnAmtOrRate);
strncpy(dsF0705.j_1pid, (const char *) ("B0700005"), sizeof(dsF0705.j_1pid));
strncpy(dsF0705.j_1user, (const char *) lpdsWRITEDBA->szUserId, sizeof(dsF0705.j_1user));
dsF0705.j_1upmj = lpdsWRITEDBA->jdDateUpdated;
MathCopy(&dsF0705.j_1upmt, &lpdsWRITEDBA->mnTimeLastUpdated);
strncpy(dsF0705.j_1jobn, (const char *) lpdsWRITEDBA->szWorkStationId, sizeof(dsF0705.j_1jobn));
/* Write to DBA Period Control File (F0705) */
/* SAR 3359086 - begin */
MathCopy(&dsF0705Key1.j_1an8, &lpdsWRITEDBA->mnAddressNumber);
MathCopy(&dsF0705Key1.j_1pdba, &lpdsWRITEDBA->mnPayDeductBenAccType);
MathCopy(&dsF0705Key1.j_1wano, &lpdsWRITEDBA->mnWaControlNumber);
MathCopy(&dsF0705Key1.j_1dtey, &lpdsWRITEDBA->mnEndingYearMonth);
MathCopy(&dsF0705Key1.j_1hmo, &mnZero);
dsF0705Key1.j_1ppp = lpdsWRITEDBA->cPayPeriodOfTheMonth;
strncpy(dsF0705Key1.j_1hmco, (const char *)(lpdsWRITEDBA->szCompanyHome), sizeof(dsF0705Key1.j_1hmco));
idDBReturn = JDB_FetchKeyed (hRequestF0705,
ID_F0705_AN8_PDBA_PCNO,
(void *) (&dsF0705Key1),
(short) (7),
(void *) (&dsF0705),
FALSE);
if (idDBReturn != JDEDB_PASSED)
{
idJDBReturn = JDB_InsertTable(hRequestF0705, NID_F0705,(ID)0,(void *)&dsF0705);
if (idJDBReturn != JDEDB_PASSED)
{
jdeSetGBRError(lpBhvrCom, lpVoid, (ID) 0, "3143");
}
} /* SAR 3359086 - end */
}