We are getting the error "No measurement unit is assigned to ISO-Code xxx" for various units of measure when we are processing BOMMAT IDOC's at sporadic intervals. I've already gone through the various discussions on this error ( like checking CUNI ) and there are some unusual aspects to this which I think may be causing it.
I should say what environment we are in - It's SAP version 640 ( ECC 5 ) on SP 27 for ABAP and BASIS and SP 79 for the application pieces. It's a very mature system that has been around over 10+ years.
First of all, we are generating the BOMMAT IDOC itself in some cases as opposed to letting change pointers do it. We have a custom field in MARA that tells us if a material is a BOM that is to be transferred. If this field is marked as a "B", then we get the list of those materials and create BOMMAT transactions out of them and run each one at a time. The reason for doing it this way is that we don't want ALL bom's to go, just the ones we have marked - thus the reason for doing it. The other reason for doing it this way is that we are modifying the IDOC to tell the processor to send ALL parts of the BOM, not just the parts that changed because the receiver can't handle updates on just the pieces. So in essence, here is how we process BOM's in program ZRBDMIDOC:
" Get all the BOMMAT's to process
Get everything from BDCPV into an internal table for BOM's ( yes we know it's a view )
" Process each BOMMAT we want to process
Loop at the above internal table
get MAST information we need
Append a record into an internal table called lt_bom for each entry in MAST we found (
create an entry into an internal table called lt_bdcps for what we processed
ENDLOOP
Update table BDCPS from entries in internal table lt_bdcps
" Commit changes and wait for them to finish
COMMIT WORK AND WAIT
" Submit each BOMMAT to be processed separately
LOOP AT lt_bom
build table it_rspar and fill values into structure calle rspar for the BOM
SUBMIT rbdsebom WITH SELECTION-TABLE it_rspar
ENDLOOP
We also have a custom version of RBDMIDOC that processes IDOC's in chunks of 5000 IDOC's at once because it was running out of memory due to the system load. So if more changes are needed, it won't be that big a deal as we've already created custom versions of RBDMIDOC, RBDMIDOC2, and RBDMIDOX.
So most of the time this works, but sometimes we get the following messages ( and they always appears this way and in this order )
0 change poi. deleted before processing: 0 inbound events checked Message no. 6M002
No measurement unit is assigned to ISO-Code ST Message no. BM034
It's not always the same UOM, it all depends on the BOMMAT it's working on. Message 6M002 always shows up that way no matter what.
What I strongly suspect is that we are running into a timing problem where the program is trying to run an IDOC that is not yet fully built and it doesn't have the right data in it and it them bombs out. Because this is an A error, I can't trap it and our custom parent is dying because of it. I suppose I could put a TRY block on it and capture the error that way, that would work as well - the error is coming from rbdsebom.
I believe I've described this fully, but if someone needs more information let me know - this issue has been going on for 2 years.