F4801 End Document

neff

Member
I'm trying to use the F4801 BSFNs from X4801 to update some Work Orders. After much guessing to fill in the gaps in the documentation (it lists the dat types but why doesn't it tell you allowed values and what they actually do?)

I'm reading a work table and for I've called:

F4801 Begin Document (once before processing)
F4801 Clear Work File (once after Begin Document)
F4801 Edit Line (for each WO in work file)

Which appear to have worked (i.e. not returning any errors).

I then make a final call to F4801 End Document to finish it all off and update the tables and I get an error code of 2 with no error message returned.

I believe 2 is just a general error code and all I get in the log file is
"JDB4200003 - OPEN TABLE NOT CLOSED = F4801"
(repeated the same number of times as there are records in my work table).

How can I track down what I've go wrong? I suspect I have mis-specified some parameters in one or all of my BSFN calls but I am really struggling to find out what.
 
Neff,

The enddoc is returning the 2 somewhere. You're only option is to debug the enddoc at everpoint idReturnCode gets set to see which one is causing the error

/ Ian

if (idReturnCode == ER_SUCCESS)
{
/* Load output only if processing one record */
if (lpDS->cInteractiveBatchFlag != 'B')
{
IX4801C_EndDocLoadOutput(lpDS, &dsCache);
}
}
else if (idReturnCode == ER_WARNING)
{
/* Warning = Process */
lpDS->cErrorCode = '1';
}
else
{
strcpy((char*)lpDS->szErrorMessageID,
(const char*)(dsInternal.szErrorMessageID));
if ((lpDS->cSuppressErrorMessages != '1') && (dsInternal.cSystemError != '1'))
{
jdeErrorSet (dsInternal.lpBhvrCom, dsInternal.lpVoid,
(ID) 0, lpDS->szErrorMessageID,
(LPVOID) NULL);
}
lpDS->cErrorCode = '2';
}
 
Thought it might be something like that that was required... unfortuantly I have no access to a C debugger.

What risks would I run if I simply modify the F4801 directly? I would guess that the BSFNs do more that just update F4801: audit info? linked tables? etc?
 
I know its a very old thread but just to provide an answer.
Remove
F4801 Clear Work File (once after Begin Document) and error is gone.
 
Back
Top