Print Immediate

GuitarMan

GuitarMan

Well Known Member
I've written a BSFN that calls jdeLaunchUBEEx to launch the UBE. In looking at the Data Struct for tagUBEVAR, I don't see any parameter that will allow me to tell the printer to Print Immediate. This is a requiremnt because this UBE sends our Order Confirmations to our customers.
My question is: Is there any way to dynamically set the Print Immediate option beyond setting the JDE.INI value to true?
Hopefully I'm being clear in my request. Any advice is welcome

Mike Kissel
XE or EntOne AS400
 
Mike,

I think "pUbeVar->zReportFlags |= eDRRPTPrintImmediate;" should do it.

Barry
 
BARRY!!!
You are the MAN!!! Thank you very very much.
It worked like a charm.

Mike Kissel
XE AS400
 
Hi mike,

i have to print some reports immediately to the printer without setting the JDE.INI parameter to TRUE. if possible can you plz share your BSFN?


Thanks and Regards

Shams
 
Not to be difficult, but rather than give you a fish, I'll give you a hint on how to fish... The Whipping Boy taught me that you'll get a lot more out it than me just giving you the answer...

Take a look in B4200310 and do a search on jdeLaunchUBEEx.
There's a few examples there on how to call it. I "borrowed" one of them and modified it slightly, adding in Barry's little helper for the print immediate stuff and I was done.
Take a look there and if you have any specific questions about this, feel free to contact me offline.
Mike Kissel XE AS400
 
Thanks Mike,
I will try to fish as u said, if there is any problem i will get back to you

Thanks and Regards
Shams
 
I'd again like to thank Barry for his response.
Now I have another question...
When launching a UBE in queue 'A', that calls a version of a second ube that's supposed to run in queue 'B', it appears the the UBE that is called form the original UBE is run in queue 'A' instead of queue 'B'.
I've told jdeLaunchUBEEx to run in a designated queue by setting this code:
strcpy((char *)pUbeVar->szJobQueue, (const char*)"B");
And it works when the UBE is called form an interactive app. When called form a UBE, it appears to inherit the queue the original job runs in.
Has anyone seen this before or have a possible hint as to how to get the secondary UBE to run in the queue I tell it to? Is it due to the AS400 only assigning one job number and therefore assumes that all jobs under that number run in the same queue?
Thanks for any help. I've looked for examples of this but have come up empty. I'm more than happy to fish, I just need help finding a good spot to throw in my line...
Thanks,
Mike Kissel XE AS400 SP20
 
Hi,

I've had my run on LauchUBEEx last year and the posts I've found here saved me from lots of troubles.

I think you're right, I've had the same problem with the queues and, if I'm not mistaken, there was a post here stating that the child UBE inherits its parent's queue and overrides the mapped queue.

What I had to do was split my code through several levels: an application calling a NER that called a BSFN that called the UBEs.

No UBE calling other UBE directly. I had to make several different calls of the BSFN from the NER, in order to avoid the inherit issue.

And I had to synchronize the calls myself, because the synch flag would not work, ie, when my BSFN called the UBE, it didn't wait for the UBE to finish before going on with the processing. This lead to the BSFN finishing before the UBE and then the NER called the BSFN to call another UBE that was only due processing AFTER the first UBE was finished, so I now had the 2 UBEs running (or enqueued) and it was not producing the appropriate behavior.

I could have probably used workflow to synch them or some other methods, but I decided to avoid any possible pitfalls (I've had my share of them with workflow, also), so I just checked for the Job Server queue (again, wonderful posts here to help) and waited for my first UBE to finish before calling the BSFN again.

Another thing to pay attention to: since I was calling my UBEs from the BSFN, I was using Report Data Structure on the UBE to get parameters to the data selection and I was setting them up in the BSFN through Data Structures that were copies of the UBE Data Structure. If you happen to change the data structures, all hell breaks loose. Be sure to build the data structure and assign it in the BSFN in a way that the right sequence of the data itens will match in both sides, or you'll get parameters switching and many weird behavior.

All in all, I had a lot of problems, but I've learned a lot. I hope that my tips help you.

Best luck.

Everson
 
Hi,

I'm having a similar problem with printer inheritance instead of job queue inheritance.

However, for your job queue inheritance there is a jde.ini setting that (I suspect) will fix it that you can find on the Knowledge Garden as Document ID ott-03-0034 that I've attached to this post.

Regards.
 

Attachments

  • 76241-jobqueueinheritance.htm
    8.2 KB · Views: 1,064
I wasn't aware of that new jde.ini setting, which will probably solve his issue. In my case, the job was done before JD Edwards released this new setting and my customer is not on service pack 21, so it won't make a difference.

Regarding your issue, I undertand that it's the same inheritance pattern for the printer, ie, the child UBE inherits the parent UBE printer.

Did you try calling both UBEs from a BSFN using the jdeLauchUBEEx API? Does it happen when you do so?

I know a developer from my former company that has created (along with a CNC guy) some code (not sure if it was an application or a service for Windows 2000) that uses some setups of printers according to users and workstation the user is logged into to switch to the closest printer instantly. He used the LauchUbe API function to do it, so it probably might help you.

Best luck,
 
I preface this by saying that I would not want this forum to degenerate into a listing where consultants shamelessly hawk their products or services, taking away from what should be the main focus of the website.

That being said, I just want to report that I have just installed and tested the Print Immediate solution that Alexander Pastuhov has mentioned on the site, and I wish to report that it works, really well. Easy to install, easy to use. If anyone needs more information on the solution, send me a PM.
 
Hi,
Is there anyway to set the printer to print to when using jdeLaunchUBEEx to print immediate. As I don't want it to print to the default JDE printer for the user
I have been searching unsuccessfully.
Any help would be much appreciated.
 
Alison,

1. Please include system config info when you post
2. From a posting by OWHELL 2+ years ago:

LaunchUBEEx is defined as

JDERTN(BOOL) JDEWINAPI jdeLaunchUBEEx(HUSER, PUBEVAR, LPVOID, LPBHVRCOM);

where PUBEVAR has following structure.

struct tagUBEVAR {
NID szReport; /* Report Template Name - Key to F983051 */
NID szVersion; /* Version Name - Key to F983051 */
char szMachineKey[16]; /* To be used for install*/
NID szEnhv; /* Client Environment Name - will be used for install */
char szUser[21]; /* User unsigned long. */
char szPwd[21]; /* Password. */
char szHostName[BLC_MAXLEN_SERVERNAME]; /* Remote Server name if running remotely */
ID idRunTime; /* Runtime ID comes from HWND, gets the user name */
BOOL bSynchFlag; /* synch/asynch flag */
BOOL bPreview; /* print/preview flag */
BOOL bBatchFlag; /* Report_To_Report flag -for prompting in UBE */
UBE_RESULT nStatusFlag1;
UBE_RESULT nStatusFlag2;
char szError[25];
char szLogFileName[126];
ushort nDebugLevel;
BOOL bRDAUBEFlag;
FILE * fp;
HUSER hUser;
char cProcOptFlag; /* Processing Option Flag */
ulong nPageCount; /* Total Pages processed by UBE */
MATH_NUMERIC mnJobNum; /* Job Num for SERVER Subsystems */
long zReportFlags; /* report level flags from DR_REPORT spec record */
NID szPOTemplateName; /* Processing Option Template Name */
NID szJobQueue; /* Remote Server Job Queue */
long nLimitRowsValue; /* max # of primary table rows to be printed when called from RDA */
BOOL bJDELog;
BOOL bJDEDebugLog;
char szMenuSysCode[5]; /* system code of menu selection, passed through from oexplore */
char szPrinter[31]; /* New entry to pass printer name from szPrintInfo struct to this entry on client mc */
};

I don't know if the last entry - szPrinter - actually allows you to change printer or not - it may just be passing the value back to the caller. Try it and let us know.
 
Back
Top