Davide
Member
Hi,
I've written a BSFN to submit a UBE (R43500).
When tested locally the ube is submitted correctly and processes the data nicely.
When the same test is done on the server the ube is submitted with status 'W' (waiting) indefinitely.
I've tried several changes to the parameters to try and resolve the issue, unsuccessfully.
Server logs doesn't show any errors.
The only difference I can think of: Fatclient is windows, server is AS/400, but what should be done differently to make it work on the server.
Below is my code:
/*===== Set up PUBEVar data structure =====*/
dsUbeStructure.bPreview = FALSE;
/*===== PrintImmediate=TRUE =====*/
dsUbeStructure.zReportFlags |= eDRRPTPrintImmediate;
/*===== SaveOutput=TRUE =====*/
dsUbeStructure.zReportFlags |= eDRRPTSaveOutput;
dsUbeStructure.idRunTime = (GLRTID)lpI->sys.lpBhvrCom->hDlg << 16;
/*===== Run the UBE Synchronously with this Bs Fn (i.e. wait until UBE is complete before executing next line of code). =====*/
dsUbeStructure.bSynchFlag = FALSE;
/*===== Run the UBE Without Any Prompting (i.e. Batch Mode). =====*/
dsUbeStructure.bBatchFlag = TRUE;
jdeGetHostName(dsUbeStructure.szMachineKey, DIM(dsUbeStructure.szMachineKey), 1);
GetLocalEnvironmentName(dsUbeStructure.szEnhv, DIM(dsUbeStructure.szEnhv));
/*===== Get Report PO =====*/
jdeStrcpy(dsF983051Keys.vrpid , lpI->ube.szBatchProgram);
jdeStrcpy(dsF983051Keys.vrvers , lpI->ube.szBatchVersion);
lpI->var.cErrorCode = i5643E82_TableSelect(lpI, AUTO_FETCH, NID_F983051, ID_F983051_PRIMARY, &dsF983051Keys, 2, &dsF983051Cols);
if (lpI->var.cErrorCode != _J('1')) {
jdeStrcpy(dsUbeStructure.szPOTemplateName, lpI->ube.szPOTemplate);
/*===== Populate Keyfields for RD fetch =====*/
jdeStrcpy(dsF983052Keys.vtpid , lpI->ube.szBatchProgram);
jdeStrcpy(dsF983052Keys.vtvers , lpI->ube.szBatchVersion);
dsF983052Keys.vtrisflg = _J('2');
lpI->ube.cVersionIndicator = _J('2');
lpI->var.cErrorCode = i5643E82_TableSelect(lpI, AUTO_FETCH, NID_F983052, ID_F983052_PID_VERS_RISFLG_FUSZ2, &dsF983052Keys, 3, &dsF983052Cols);
/*===== Call Launch UBE API =====*/
if (IS_VALID(lpI->var.cErrorCode)){
if (!jdeIsBlankOrNull(lpI->ube.szDefaultReportDefName)){
jdeNIDcpy(dsUbeStructure.szReport , lpI->ube.szBatchProgram);
jdeNIDcpy(dsUbeStructure.szVersion , lpI->ube.szBatchVersion);
idJDBReturn = jdeLaunchUBEEx2(lpI->sys.hUserManual, &dsUbeStructure, &dsReportInterconnect, lpI->sys.lpBhvrCom, _J('1'), _J('0'), lpI->ube.szDefaultReportDefName);
}
}
Any assistance would be greatly appreciated.
kind regards,
David T.
E9.10
Tools: 9.2.1.9
I've written a BSFN to submit a UBE (R43500).
When tested locally the ube is submitted correctly and processes the data nicely.
When the same test is done on the server the ube is submitted with status 'W' (waiting) indefinitely.
I've tried several changes to the parameters to try and resolve the issue, unsuccessfully.
Server logs doesn't show any errors.
The only difference I can think of: Fatclient is windows, server is AS/400, but what should be done differently to make it work on the server.
Below is my code:
/*===== Set up PUBEVar data structure =====*/
dsUbeStructure.bPreview = FALSE;
/*===== PrintImmediate=TRUE =====*/
dsUbeStructure.zReportFlags |= eDRRPTPrintImmediate;
/*===== SaveOutput=TRUE =====*/
dsUbeStructure.zReportFlags |= eDRRPTSaveOutput;
dsUbeStructure.idRunTime = (GLRTID)lpI->sys.lpBhvrCom->hDlg << 16;
/*===== Run the UBE Synchronously with this Bs Fn (i.e. wait until UBE is complete before executing next line of code). =====*/
dsUbeStructure.bSynchFlag = FALSE;
/*===== Run the UBE Without Any Prompting (i.e. Batch Mode). =====*/
dsUbeStructure.bBatchFlag = TRUE;
jdeGetHostName(dsUbeStructure.szMachineKey, DIM(dsUbeStructure.szMachineKey), 1);
GetLocalEnvironmentName(dsUbeStructure.szEnhv, DIM(dsUbeStructure.szEnhv));
/*===== Get Report PO =====*/
jdeStrcpy(dsF983051Keys.vrpid , lpI->ube.szBatchProgram);
jdeStrcpy(dsF983051Keys.vrvers , lpI->ube.szBatchVersion);
lpI->var.cErrorCode = i5643E82_TableSelect(lpI, AUTO_FETCH, NID_F983051, ID_F983051_PRIMARY, &dsF983051Keys, 2, &dsF983051Cols);
if (lpI->var.cErrorCode != _J('1')) {
jdeStrcpy(dsUbeStructure.szPOTemplateName, lpI->ube.szPOTemplate);
/*===== Populate Keyfields for RD fetch =====*/
jdeStrcpy(dsF983052Keys.vtpid , lpI->ube.szBatchProgram);
jdeStrcpy(dsF983052Keys.vtvers , lpI->ube.szBatchVersion);
dsF983052Keys.vtrisflg = _J('2');
lpI->ube.cVersionIndicator = _J('2');
lpI->var.cErrorCode = i5643E82_TableSelect(lpI, AUTO_FETCH, NID_F983052, ID_F983052_PID_VERS_RISFLG_FUSZ2, &dsF983052Keys, 3, &dsF983052Cols);
/*===== Call Launch UBE API =====*/
if (IS_VALID(lpI->var.cErrorCode)){
if (!jdeIsBlankOrNull(lpI->ube.szDefaultReportDefName)){
jdeNIDcpy(dsUbeStructure.szReport , lpI->ube.szBatchProgram);
jdeNIDcpy(dsUbeStructure.szVersion , lpI->ube.szBatchVersion);
idJDBReturn = jdeLaunchUBEEx2(lpI->sys.hUserManual, &dsUbeStructure, &dsReportInterconnect, lpI->sys.lpBhvrCom, _J('1'), _J('0'), lpI->ube.szDefaultReportDefName);
}
}
Any assistance would be greatly appreciated.
kind regards,
David T.
E9.10
Tools: 9.2.1.9