Calcing item availablility dates w/in SOE

  • Thread starter Frosty the Coder
  • Start date

Frosty the Coder

Legendary Poster
In this never-ending implementation, now-live w/out a paddle,
they had me mod P4210 to analyze supply/demand for stock
items, and return the exact date that the end customer can expect product.

The end date (RSDJ) being today + "avail date" + pick-to-ship + shipping days.
Some of the "+values" are calendar days, others are shop-floor (F0007) days,
so it accounts for holidays and weekends.

Also returned are scheduled-pick (PDDJ) and estimated-ship (PPDJ).

As this is called from SOE, we accounted for other lines on this order for this item,
that MAY have been changed by reading F42UI11 cache.

When processing KITS, P4210 does this for all the components, finding the slowest one,
and change all other components and the parent to reflect this date.

As they were "too busy" to test DURING the implementation,
we are now finding that all this wonderful code,
being accessed by many many users at the same time,
from spots we never expected is SLOW.

NOW, we are scrambling to find a diff design to provide these "can't live w/out" dates.

The solution we are heading towards is to have the nightly redate
(which uses the same "dates-NER" as the interactive)
to retain it's worktable and to have the interactive access that worktable
w/OUT doing the supply/demand build/analyze.

This will provide them w/a "near time" date which would be current as of last night.

They have asked that I find out how other sites have addressed this need.

So I'm asking, "have you had to code for this requirement and what was your solution?".

TIA very very much.

Gene
 
Hey Gene. Love your posts man. They crack me up.

How about this: Make a NER that does all the date calculations you talked about. Call it after End Doc on Post OK Button Clicked event and check the Asych box on the NER call. Basically, this NER will update all the lines on the order you just created/updated (provided you coded it right) and, the users will not be held up on the SOE screen.

Make sense?!?
 
We'd suggested that.

The issue is that they want to see the dates "real time, RIGHT NOW" as they may have the customer on the phone,
or at the store. ("I'm sorry but that item won't be available for when you want it. I can get it on xx/yy/zz....")

Thanks for the suggestion.
 
First thing to do is to put the Date calculation routine into debug.
Then have a look at which routines are taking the time. I.e. 1 second vs 5 seconds etc.
You had the calculation as:

The end date (RSDJ) being today + "avail date" + pick-to-ship + shipping days.
Some of the "+values" are calendar days, others are shop-floor (F0007) days,
so it accounts for holidays and weekends.

Apart from the calculate number of work-days BSFN you must be using, what other routine in this calculation is "looping" (I.e. Doing I/O reads?) and see within the jdedebug.log what routine takes a while.

One Time, at a client, we had a stock calculation that read ALL current orders affecting stock, and this did not impact performance, but the select of the F4211 records had to be in c, so that the correct records where skipped.
 
Re: RE: Calcing item availablility dates w/in SOE

When calcing when it's available, I call the bsfns to build the S&D Workfile.
(The original spec said "make it work like supply and demand".)

This wrkf (F4021W) gets summarized into a custom wrkf.
The custom wrkf is compared to when/how much they want.

If the qty is NOT available, per this wrkf, we show
the workfile so they see how/much an when it's available
(just as if they'd gone to S&D and looked at the data there).

They really like this feature (which I can't get to work on HTML).

I _KNOW_ it's this chunk of S&D code that is the issue.

We already skip this code if F4102-CheckAvail = N.

We are adding a call to another bsfn that returns
Onhand, Hard Commit, Soft Commit, Quarantine.
If these net to more than the order qty, we're going to skip S&D.

I'm trying to figure out how to better work the S&D code,
or to find alternative to using it at all.

TIA

Gene
 
RE: RE: Calcing item availablility dates w/in SOE

Does sound like the S&D functions.
You may have to custom re-write/mod these, with these possible improvements:
1). use cache instead of work-file (Screen can be build of cache).
1a). Change the F4021W into a cache (instead of wf)
1b). Change your custom wf into a cache.
2). For the "summarise F4021W into custom WF", maybe do in one go - i.e. Summarise into F4021W.
3). Check the code, and "see" if it is skipping records. If so, change the select so that the database skips the records.
E.g. I've done on the F41021, select * where (HCOM <> 0 or PQOR <> 0 or FCOM <> 0). I.e. Only get records with stock.
4). Check the jdedebug log (looking at the S&D functions), and see where the time is being spent. And then focus on the areas that take the most time. You may need to get and display the system time (with milliseconds) into the debug log, so you can see potions of seconds.


lastly, why can't you get it to work on html?
 
Thanks, I will review your suggestions.

The HTML issue is that when I read/display the worktable,
they select the rows they want by keying in qty desired.
(This is in a custom appl).

Back in P4210, I read their non-zero rows and try
to INSERT GRID BUFFER ROW onto the W4210A grid.

This works in full client.
In HTML the IGBR doesn't work (in this case).

I have gotten OTHER IGBRs to work in W4210A,
but this set is being stubborn....

The HTML is a "phase II" issue.
Getting it speedy is a drop-dead, right-now task.

Thanks again.

Gene
 
Good luck with trying the suggestions.
As for the html:

Back in P4210, I read their non-zero rows and try
to INSERT GRID BUFFER ROW onto the W4210A grid.

This works in full client.
In HTML the IGBR doesn't work (in this case).

A couple of things about IGBR. It does not copy grd_ variables, you would have to sent these manually.
I would check the html rt jdedebug.log, and see what event it is trying (or not) to run.
You may need to focus off the grid (to a non-protected form control field) and then set focus back to the grid (for each grid row inserted) to force html to process the grid row.
 
Re: RE: Calcing item availablility dates w/in SOE

Cool. I'll dig in that direction if/when I ever get a chance.

Thank you very, very much.
 
Not really the answer to your immediate problem but it is worth a quick thought..... The APS system has an Order Promising Engine. It is designed to this kind of thing out of the box. Anyone implemented it?
 
Back
Top