Yes, I agree that it's pretty stupid to have HDR and DTL hard coded, especially since many other things are configurable. That's why I thought there must be a system code where we can adjust that if we wanted to, but I haven't been able to find one. We used to have a customer function referenced in one of our UOM calculations, but had to remove it because it was causing a full table scan every time it was called, which was making the messages take sometimes hours to transfer from WM to LM. I'm assuming it was someone within my company who wrote the function though, so admittedly that's not Manhattan's fault. It was just a poorly written function. I didn't write it. :)
We think we figured out how to reference the criteria, but it is absolutely NOT intuitive. We had it set up within WMS to add the string "CARTON_TYPE" to the WORKINFO_Q_DTL_015 (or 016) table in the CRIT_TYPE field, and the actual carton type in the CRIT_VAL field, but there's some config within LM to do as well. We found the Criteria Maintenance screen in LM, and added CARTON_TYPE as a criteria code. That seemed to create a temporary table T_TEMP_159241, with five fields - ELS_TRAN_ID, TRAN_NBR, TRAN_SEQ_NBR, CARTON_TYPE, and TESTCRIT. It was the TESTCRIT thing that originally put us onto this idea, because we knew we had come across that somewhere before. Once we had that, we were able to do this in our UOM's free-form text field:
(CRT.CARTON_TYPE = 'TOT')
So far, it seems to be working, but we noticed that there's 45 tables named something like T_TEMP_000000, each with a different number at the end. I don't know how the system knows which one of those to reference, and I don't know why it doesn't clean up the obsolete ones when new criteria is added.