AW: way to convert P + personnel number type of agent to US+UserID
Dart, Jocelyn
jocelyn.dart at sap.com
Fri May 20 02:08:52 EDT 2005
Hi Sushil,
FindUserFromAgentStructure is a strip-the-first-two-chars routine - so you could use this as an example for your strip routine if you wish.
By the way use object USR01DOHR not USR01 when you are working with personnel numbers.
USR01DOHR is the user master linked into HR information. When you are using BUS1065 with a HR system, USR01 delegates to USR01DOHR automatically at runtime (very curious but true).
USR01DOHR includes a method GetEmployee that takes you in the other direction - i.e. from user id to personnel number
If you want to go in the other direction use function module BAPI_EMPLOYEE_GETDATA (possibly the most useful function module in HR for workflowers) - but yes you still have to strip off the "P ".
Jocelyn
________________________________
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of Sushil Guragain
Sent: Friday,20 May 2005 12:00 AM
To: SAP Workflow Users' Group
Subject: RE: AW: way to convert P + personnel number type of agent to US+UserID
Thanks Richard and Nate for the suggestion and info.
Looks like no matter which option I choose I need to build a custom method that calls one of these methods (or function module) and use it. The options (so far) are:
1. Build a method that will separate the P from personnel number and send the personnel number to create an instance of BUS1065 and get the BUS1065.User.NameWithLeadingUS to return back to the workflow container. I tried this and it seems to work. We would need to add the code in method to cover this
2. Build a method that will have the same code as FindUserFromAgentStructure except it will export the US+Username back to the container. I tried this and it gave me error " Exception 7837 triggered
Message ID: OL
Message number: 837
Parameter 'Agent' has invalid value 'P 10000031' ". So I am guessing Richard's suggestion is to make the change in the method to accept P + personnel number as well, I assume.
3. Build a method that will first separate the P from personnel number and use personnel number to get User ID, then add US to build US+UserID to return back to container. (based on Tami's suggestion) I tried this and it seems to work and if we put additional code in the method we should be fine.
Let me evaluate these alternatives and I will use whatever requires less coding fits most for our business case.
Thanks all for your suggestions!
Sushil
________________________________
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of Workflow
Sent: Thursday, May 19, 2005 7:36 AM
To: SAP Workflow Users' Group
Subject: AW: way to convert P + personnel number type of agent to US+User ID
Hi
The attribute BUS1065.User.NameWithLeadingUS would link you to the 'US' user starting from the HR number unfortunately without the leading 'P'.
cheers
Nate
-----Ursprüngliche Nachricht-----
Von: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu]Im Auftrag von Sushil Guragain
Gesendet: Mittwoch, 18. Mai 2005 18:59
An: SAP Workflow Users' Group
Betreff: way to convert P + personnel number type of agent to US+User ID
Hi WF Gurus,
I have another question for you: Is there a standard method in SAP that will convert P+personnel number type of agent to US+UserID type? If yes, what object and method would it be? I looked up the object USR01 and did not find the method.
Thanks,
Sushil
This message contains information which may be confidential and privileged.
Unless you are the intended recipient (or authorized to receive this message
for the intended recipient), you may not use, copy, disseminate or disclose to
anyone the message or any information contained in the message. If you have
received the message in error, please advise the sender by reply e-mail, and
delete the message. Thank you very much.
(A)
This message contains information which may be confidential and privileged.
Unless you are the intended recipient (or authorized to receive this message
for the intended recipient), you may not use, copy, disseminate or disclose to
anyone the message or any information contained in the message. If you have
received the message in error, please advise the sender by reply e-mail, and
delete the message. Thank you very much.
(A)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20050520/83115590/attachment.htm
More information about the SAP-WUG
mailing list