<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1498" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=608574205-20052005><FONT face=Arial 
color=#0000ff size=2>Hi Sushil, </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=608574205-20052005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=608574205-20052005><FONT face=Arial 
color=#0000ff size=2>FindUserFromAgentStructure is a strip-the-first-two-chars 
routine - so you could use this as an example for your strip routine if you 
wish.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=608574205-20052005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=608574205-20052005><FONT face=Arial 
color=#0000ff size=2>By the way&nbsp;use object USR01DOHR not USR01 when you are 
working with personnel numbers. </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=608574205-20052005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=608574205-20052005><FONT face=Arial 
color=#0000ff size=2>USR01DOHR is the user master linked into HR 
information.&nbsp;&nbsp; When you are using BUS1065 with a HR system, 
USR01&nbsp;delegates to USR01DOHR automatically at runtime (very curious but 
true).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=608574205-20052005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=608574205-20052005><FONT face=Arial 
color=#0000ff size=2>USR01DOHR includes a method GetEmployee that takes you in 
the other direction - i.e. from user id to personnel number </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=608574205-20052005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=608574205-20052005><FONT face=Arial 
color=#0000ff size=2>If you want to go in the other 
direction&nbsp;</FONT></SPAN><SPAN class=608574205-20052005><FONT face=Arial 
color=#0000ff size=2>use function module BAPI_EMPLOYEE_GETDATA&nbsp; (possibly 
the most useful function module in HR for workflowers) - but yes you still have 
to strip off the "P ". </FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=608574205-20052005><FONT face=Arial 
color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
<DIV dir=ltr align=left><SPAN class=608574205-20052005><FONT face=Arial 
color=#0000ff size=2>Jocelyn </FONT></SPAN></DIV><BR>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> sap-wug-bounces@mit.edu 
  [mailto:sap-wug-bounces@mit.edu] <B>On Behalf Of </B>Sushil 
  Guragain<BR><B>Sent:</B> Friday,20 May 2005 12:00 AM<BR><B>To:</B> SAP 
  Workflow Users' Group<BR><B>Subject:</B> RE: AW: way to convert P + personnel 
  number type of agent to US+UserID<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV dir=ltr align=left><SPAN class=762064813-19052005><FONT face=Arial 
  color=#0000ff size=2>Thanks Richard and Nate for the suggestion and 
  info.&nbsp;</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=762064813-19052005><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><FONT color=#0000ff><SPAN 
  class=762064813-19052005><FONT face=Arial size=2>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. T</FONT></SPAN><SPAN 
  class=762064813-19052005><FONT face=Arial size=2>he options (so 
  far)&nbsp;are:</FONT></SPAN></FONT></DIV>
  <DIV dir=ltr align=left><SPAN class=762064813-19052005><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=762064813-19052005><FONT face=Arial 
  color=#0000ff size=2>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</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=762064813-19052005><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=762064813-19052005><FONT face=Arial 
  color=#0000ff size=2>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 " &nbsp;&nbsp;&nbsp;&nbsp; 
  Exception&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  7837 triggered</FONT></SPAN></DIV>
  <DIV><FONT color=#0000ff></FONT>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=762064813-19052005><FONT face=Arial 
  color=#0000ff size=2>Message 
  ID:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OL<BR>Message 
  number:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 837<BR>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.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=762064813-19052005><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=762064813-19052005><FONT face=Arial 
  color=#0000ff size=2>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.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=762064813-19052005><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=762064813-19052005><FONT face=Arial 
  color=#0000ff size=2>Let me evaluate these alternatives and I will use 
  whatever requires less coding fits most for our business 
  case.</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=762064813-19052005><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=762064813-19052005><FONT face=Arial 
  color=#0000ff size=2>Thanks all for your suggestions!</FONT></SPAN></DIV>
  <DIV dir=ltr align=left><SPAN class=762064813-19052005><FONT face=Arial 
  color=#0000ff size=2></FONT></SPAN>&nbsp;</DIV>
  <DIV dir=ltr align=left><SPAN class=762064813-19052005><FONT face=Arial 
  color=#0000ff size=2>Sushil</FONT></SPAN></DIV><BR>
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
  <HR tabIndex=-1>
  <FONT face=Tahoma size=2><B>From:</B> sap-wug-bounces@mit.edu 
  [mailto:sap-wug-bounces@mit.edu] <B>On Behalf Of </B>Workflow<BR><B>Sent:</B> 
  Thursday, May 19, 2005 7:36 AM<BR><B>To:</B> SAP Workflow Users' 
  Group<BR><B>Subject:</B> AW: way to convert P + personnel number type of agent 
  to US+User ID<BR></FONT><BR></DIV>
  <DIV></DIV>
  <DIV><SPAN class=576043312-19052005><FONT face=Arial color=#0000ff 
  size=2>Hi</FONT></SPAN></DIV>
  <DIV><SPAN class=576043312-19052005><FONT face=Arial color=#0000ff size=2>The 
  attribute BUS1065.User.NameWithLeadingUS would link you to the 'US' user 
  starting from the HR number unfortunately&nbsp;without the leading 
  'P'.</FONT></SPAN></DIV>
  <DIV><SPAN class=576043312-19052005><FONT face=Arial color=#0000ff 
  size=2>cheers</FONT></SPAN></DIV>
  <DIV><SPAN class=576043312-19052005><FONT face=Arial color=#0000ff 
  size=2>Nate</FONT></SPAN></DIV>
  <DIV><SPAN class=576043312-19052005><FONT face=Arial color=#0000ff 
  size=2></FONT></SPAN>&nbsp;</DIV>
  <BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
    <DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma 
    size=2>-----Ursprüngliche Nachricht-----<BR><B>Von:</B> 
    sap-wug-bounces@mit.edu [mailto:sap-wug-bounces@mit.edu]<B>Im Auftrag von 
    </B>Sushil Guragain<BR><B>Gesendet:</B> Mittwoch, 18. Mai 2005 
    18:59<BR><B>An:</B> SAP Workflow Users' Group<BR><B>Betreff:</B> way to 
    convert P + personnel number type of agent to US+User 
ID<BR><BR></FONT></DIV>
    <DIV><FONT face=Arial size=2><SPAN class=567405616-18052005>Hi WF 
    Gurus,</SPAN></FONT></DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=567405616-18052005></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2><SPAN class=567405616-18052005>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. </SPAN></FONT></DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=567405616-18052005></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=567405616-18052005>Thanks,</SPAN></FONT></DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=567405616-18052005></SPAN></FONT>&nbsp;</DIV>
    <DIV><FONT face=Arial size=2><SPAN 
    class=567405616-18052005>Sushil</SPAN></FONT></DIV><PRE>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)
</PRE></BLOCKQUOTE><PRE>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)
</PRE></BLOCKQUOTE></BODY></HTML>