Pass Parameter using Launch Batch Application.

jdecoder

jdecoder

Well Known Member
I had a sales report which was scheduled and mailed to a single email ID, now I have a requirement to run the report for each customer separately and mail it to different internal mail ID’s set up in customer master.
Now since I am using Launch Batch Application Business Function I am not able to pass customer no. through data structure. I am looking for a work around for this!!!!!
 
Well, not a great solution, but, maybe the only one you have....... create a version for each customer? An maybe the customer number could be part of the version.....

Ben again,
 
Time to write your own C function to start the batch program.

Look at B31B9030: it's small and demonstrates how to pass RI values.

Copy that thing and you're in business.


Please forward your mailing address and I'll send my invoice.
grin.gif


P.S. Be prepared. . .because my rate is reasonably outrageous (and by 'reasonably' I mean 'simply').
 
I was just thinking if I update a temporary table from my primary report based on the customer master and call my secondary report which is to be mailed and in its initialize I fetch and filter and flush it.
May be this is not the best practice even I would like to customize the Launch Batch Application (B91300C) to take RI since the API used i.e jdeLaunchUBEEx allows you to do that, but unfortunately C is not my area of expertise…
 
try B3700490 or b4900460 to see how to use RI's parameters

hoe this help
 
in case you cant find any examples, here is a snippet of code where I pretty much did what whipping boy is talking about.


lpDS->cErrorStatus = '0';

if( JDB_InitBhvr(lpBhvrCom, &hUser, (char *) NULL, JDEDB_COMMIT_AUTO) != JDEDB_PASSED ) {
jdeErrorSet(lpBhvrCom, lpVoid, (ID) 0, "139F", (LPVOID) NULL);
idReturn = ER_ERROR;
goto FunctionCleanUp;
}

jdeNIDcpy(dsUbeStructure.szReport, "R5641EX1A");
jdeNIDcpy(dsUbeStructure.szVersion, "ACME0001");

if( (jdeGetHostName(dsUbeStructure.szMachineKey,16,1) != 0) ||
(!GetLocalEnvironmentName(dsUbeStructure.szEnhv,11)) ) {
idReturn = ER_ERROR;
jdeSetGBRError(lpBhvrCom, lpVoid, (ID)0, "0002");
goto FunctionCleanUp;
}

/* changes 16 bit value to 32 bit value*/
dsUbeStructure.idRunTime = (GLRTID)lpBhvrCom->hDlg << 16; /* no longer needed ????? */
dsUbeStructure.bSynchFlag = TRUE;
dsUbeStructure.bPreview = FALSE;
dsUbeStructure.bBatchFlag = TRUE;

/* set ube inter-connect */
strcpy( dsUbeInterCon.szCompany, lpDS->szCompany );
strcpy( dsUbeInterCon.szShippingBP, lpDS->szShippingBP );
strcpy( dsUbeInterCon.szRegion, lpDS->szRegion );
strcpy( dsUbeInterCon.szGlGroup, lpDS->szGlGroup );
strcpy( dsUbeInterCon.szGroup, lpDS->szGroup );
strcpy( dsUbeInterCon.szSubGroup, lpDS->szSubGroup );
MathCopy( &dsUbeInterCon.mnPlantOfMfg, &lpDS->mnPlantOfMfg );
dsUbeInterCon.cOrderPolicyCode = lpDS->cOrderPolicyCode;
MathCopy( &dsUbeInterCon.mnSortSelectionSequence, &lpDS->mnSortSelectionSequence );
strcpy( dsUbeInterCon.szEdiBatchNumber, lpDS->szEdiBatchNumber );

/* launch ube */
idJDEDBReturn = jdeLaunchUBEEx(hUser, &dsUbeStructure, (void *)&dsUbeInterCon, lpBhvrCom);
if(idJDEDBReturn != JDEDB_PASSED) {
idReturn = ER_ERROR;
jdeSetGBRError(lpBhvrCom, lpVoid, (ID)0, "0002");
goto FunctionCleanUp;
}
 
jdecoder,

Serge's original question about whether the called UBE is standard or custom is important because modification of the called UBE would be simpler for someone who is not very "C" literate (like myself) and it is not advisable to modify standard UBEs. From your comments it would appear that it is a custom UBE and there is no problem with modifying it.

Your idea of using a temporary table to pass the customer number(s) to the called UBE is an example of probably the only method, other than writing you own "C" business function, available. Rather than creating a new temporary table (unless you already have one that you can use) you could use a custom UDC to accomplish the same task.

All the best with a solution.
 
Hey guys,
Thanks for all the help especially WhippingBoy & BOster I have decided to do it via C it took some time but I succeeded (I had to start with writing C BF some day in my career). The C solution seems to the best practice compared to temp table idea.

Thanks again.
 
Back
Top