Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Unpacking Handling Units - Locks and Performances

SimoneMilesi
Active Contributor

Hi gurus,

i'm looking for some support/ideas about a performance and lock issue while processing the Unpacking of a certain number of HU.

The scenario

My service (invoked from a Radio Frequency Terminal ) receives a certain number of HUs to unpack and then it has to move the packaging materials into a specific warehouse.

Nothing fantascientific or too much complicated, indeed.

What i did

I already found out BAPI_HU_UNPACK and the good old BAPI_GOODSMVT_CREATE and in my test enviroment, with a dozen of HU, all works smooth and nice, despite some slow down due the checks i applied to process records only when all the data is unlocked (i try for some seconds to see if the objects are locked, 20 attempts with 1 second delay between them, then i try to process data anyway), but all acceptable.

The real life (AKA the problem)

Now, in production enviroment, i discover the users process something like from 60 to 120 HUs each time (yes, you read it correctly 1-2-0) and the problems are starting to emerge:

  1. Unpacking item per item for 120 HU means about 240-300 calls of BAPI_HU_UNPACK, each call followed by a check on locks on the HU and the material unpacked, performance are killing for RFT
  2. Despite my checks, the amount of data seems to turn the system slow and, after a first 20% of HU succesfully unpacked, locks become longer and block the elaboration (the 20 attemps are not enough)

What i'm looking for

Since RFT means realtime, i cannot manage the unpacking as background report/procedure, so i've to find a way to handle all of this.

First step would be the unpack of the whole HU like HU02 transaction does, maybe even with more HUs at time.

I'd prefer to avoid a bdc and call transaction because i fear it would be even worst: any bapi or FM?

Second step is a possible solution to my flow, a fault i don't see, something i'm missing.

Thanks for all the support!

5 REPLIES 5

SimoneMilesi
Active Contributor
0 Kudos

Another little breadcrumb: after 19 HUs i start to have problems....

larshp
Active Contributor

Good question, however I'm afraid that it is too specific. On SDN we seem to dislike the basic questions, however there are no good answers for the good questions :o(

pokrakam
Active Contributor
0 Kudos

Interesting question. Without knowing too much about your setup, I am guessing your threshold is a point at which your processes start to lock each other out, causing exponentially longer waits as you add more.

Use DB50 during one of the slowdowns, check under Performance>Threads and Active Statements to see if there is 'real' DB activity. If not then it's the locking merry-go-round. Also look under Diagnostics>Locks

You talk about items per HU, which makes me wonder if locking mechanisms are too high-level. If, for example, they lock too big a dataset (this could be in SAP or even at DB level), and you have multiple related processes at a finer granularity then you may end up with excessive locking which hits a wall at a certain threshold.

So for example each item might try to lock the entire HU, and when you process 10 items for the same HU in separate BAPI calls they will all be competing for the same lock, even though they could in theory be processes within the same lock/session. They have their internal wait mechanisms which then only get compounded by yours, and when you goods-movement the first unpacked item it blocks the other unpackings; that sort of thing. I don't have the answers if this is the case, but it might be a starting point.

Definitely also involve Basis, as you cannot always see everything they can. I've had issues which were down to Oracle block-level locking which affected adjacent records. Solution: Physically fragment the table across DB blocks. Yes, really!

Once you know a little more it may be worth raising it with OSS, as they can be quite receptive to these type of problems.

0 Kudos

Hi Mike,

i put a patch running a report in background to elaborate all the pending HU to unpack and everything worked fine.

i fear it's a gateway setup as per this link which "kills" the process if the response time is too long.

i involved our Basis consultants and cross my fingers

SimoneMilesi
Active Contributor
0 Kudos

Funny uh?

Sometimes i hope i have ONLY basic question a quick search on google can solve...