Hello Dimtri,
according to https://help.sap.com/saphelp_470/helpdata/en/9f/dba56d35c111d1829f0000e829fbfe/content.htm, the Department information is automatically taken from the user's SU01 data.
Alternatively, this information can be manually provided on the R/3 print popup, or programatically provided (some details for this are in the previous help.sap.com link).
(This is the reason why I mentioned that the Department information might be a long-term solution: it might be determined for every user, which could be a task of a larger project.)
Of course - "as usual" - this needs to be thoroughly tested before rolling out for usage.
Best regards,
Laszlo