PO BPM - Best Practice for Mapping User Department to GL Segment 3

I’m building a BPM to prevent users from charging PO Release expenses to another department’s GL account. We have departmental GL accounts where Segment 3 represents the department:

example:
3XYZ | 10 | 20 - Admin department

3XYZ | 10 | 30 - Finance Department

For now what I’m doing is, in a PO.Update Method Directive, I determine the current user’s department and store it in CallContextBpmData.Character02.

I then fix the segment 3 value based on a hardcoded variable. If an admin department user entered 3XYZ | 10 | 30 it should be corrected to 3XYZ | 10 | 20.

callContextBpmData.Character02 == “ADMIN” ? “20” :
callContextBpmData.Character02 == “FINANCE” ? “30” :

But I know this is not the best, because if new departments are added in the future, I need to update the BPM every time. One possible solution would be to Store mappings in a UD table and look them up from the BPM. Is there another effective way to achieve this?

Thanks In advance for your time and effort! :blush:

What about putting a UD Column on the JCDept table that is the GL Segment? Then just do a lookup in the BPM. When new departments are added you just need to add the GL Segment.

It doesn’t need to be a UD column on JCDept - there’s already a GL Control that can be assigned to each department which you could use for the lookup. What you may need to do is add a department UD column to the User (or User Company) table so you can assign department codes to each user. That completes the link from the user to the department and GL segment value.

If you already assign employee IDs under User Account Security Maintenance > Authorized Companies, you could use the link from User → EmpBasic → JCDept → GL Control.