Using Next Numbers external to OW

jpsst34

Well Known Member
Hey list! Been a while since my last post...

Curious if anyone knows of a way to use JDE next numbers from applications other than JDE. That is, could I somehow grab a next number from JDE for use in another program and at the same time be sure the NN value get's incremented?

Thanks in advance,

Jack Smith
 
Well for me an easy way would be using VB do a connection to the database with ADO, then select the table F0002.
After that use a Update SQL statement to the table with the key.
 
Let's say I wanted to select the next Address Number. Are you suggesting that I:

1. Select NNN0001 from F0002 where NNSY='01', storing it to a variable
2. Increment my variable by 1
3. Update F0002 set NNN001=myVariable where NNSY='01'
4. Use the value returned in (1) in my app

If so, I can see a race condition here. Imagine if after (1), but before (3), another app uses NN to grab an Address Number. NNN001 will be incremented by that other app. Now imagine NNN001 gets incremented 30 times before my app gets to (3). When my app finally updates the table, it will be setting NNN001 back to a value that's already been used.


-OR-

Are you suggesting that I update, say, NNSY with the value it originally had, thus forcing NNN001 to be incremented? In any event, I'd have to say that I'm wary about directly writing to a control table from an external app.
 
What I would do is place the update just on the event when I am ready to save whatever your are thinking.
The other way You can increase de value by default, and keep that old sequence value on your program.
 
Hi,
another way is to generate com object of Get Next Number Business Function. After you have generated it you can use this COM object in programs write with JAVA, VB, VC.......
You can find documentation about this way on Interoperability guide.
Good Luck
GigiOW XE Oracle/SQLServer...
 
Thanks! This is the kind of thing I was looking for. I was hoping that JDE provided a way to expose their components through COM, but didn't know if they actually did. Thanks again,
 
Hi,
you can generate Java wrapper or CORBA Object from Business Function.

Good Luck Gigi
 
Jack,

yes I/we do this.

Select for Update
increment value
Update
Commit

Its that simple.
 
I've read through the Interoperability Guide sections on GenCom and iJDEScript and find myself asking, "Is there any _good_ documentation on this stuff?" Seems as if these were written by someone who knows these things inside and out and can't be understood by someone who's never used these tools. That said, is there any _good_ documentation on GenCOM and iJDEScript? Perhaps some with some working examples, from start to finish, of how to generate COM components?
 
Jack,

Yes, there is definitely a lack of good documentation. However, if you go to your deployment server and look under JDEdwardsOneWorld\B7333\Interoperability\com you will find some examples of using com wrappers in VB. These helped me kinda/sorta understand what needs to be done.

Barry
 
Hello, yes, I used quite a lot the NN system and I can tell you that you has to worry about NN incrementation, so if you are using the VB or a stored procedure make sure you increment the needed value which is specific to a z-table (module) you are using, the JDE does exactly the same thing, they do not use database generated values.

Arthur Zubarev
 
Thanks for pointing me to those examples. They seem to have some info, but like the eGuide documentation, they aren't complete. For instance, the eGuide Interoperability section on GenCOM mentions that you must write an iJDEScript to tell GenCOM what to do. These examples don't mention iJDEScript - they just use scipts without explaining them. As for the iJDEScript section of the eGuide, they give a high level idea of what iJDEScript is, but don't describe really how to use it.

To anyone who's used GenCOM to expose JDE functionality to other apps, if you documented what you did, would you mind sharing said documentation?

Thanks,
 
Jack,

I am not experienced with Java, COM, COBRA etc. but I have a really-silly OneWorld solution.

1.) Define a table in OneWorld with a unique ID field (e.g. UKID) and with a NextNum field (e.g. N001)
2.) Generate the table in OW and apply with TER on the Before Record is Inserted (or what) event where you call the X0010 Get Next Number to fill the NN field in the table.
3.) Insert record into the table in your external application and re-fetch the record untill you get the NN value in the field.

What's your oppinion, could it work for you?

Of course, you can develope a more general and sophisticated solution based on this idea.

Regards,

Zoltán
 
Hey, that's not a half-bad idea, Zoltan. I think I've decided to go with GenCOM for my purpose to allow me to access other bsfn's externally, but should anyone *only* need next number functionality, your idea is a good one.

Thanks.
 
Back
Top Bottom