on 09-27-2005 2:03 PM
Hallo,
I'm developing BSP which will be integrated to EP and which requires some information about current EP user. Concretly - preferably user's department or also last name. Is there way how to put this informations to BSP attributes?
Best regards,
Josef Motl
Hi Josef,
To add on what Siddhartha has suggested, if you read the SSO2 cookie from the BSP page you also need to decrypt the cookie content and get the user details from that.
Regards,
Ravikiran.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
does anybody know how to decode the SSO2 cookie?
<u><b>How to pass logged on user of portal to BSP application.</b></u>
In the BSP application start page have a page attribute with auto checked. (for example <b>username</b>)
Now in BSP iview's application parameter type in the following
<b>username=<User.UserId></b>
this will pass the portal logged on user id to BSP application which you can read it in oninitialization and do further processing.
Regards
Raja
HI,
Raja,
Are you sugeesting to HARD code the Application Parameter username in the iView or will it assign the value dynamically for logged in user,just like sy-uname ?
I could'nt get this to work ,so it would be great if you could guide.
Till now i was reading the MYSAPSSO2 cookie to get the logged in EP user.
Regards,
Siddhartha
No its not harcoding.
<User.UserId> will pass the EP logged on user.
this (<User.UserId>) will dynamically get the EP logged on user. as far as i know this works from EP6 SP2
can you share the ABAP code you used for reading and parsing the MYSAPSSO2 cookie.
<i><b>I could'nt get this to work</b></i>
What kind of iview you have? this will work for all appintegrator based iviews , like BSP iview, BW query iview, etc
Regards
Raja
Hi,
RAja, i am on EP6 SP9 and using BSP iview.when i use the application parameters as you have mentioned i get a <b>null pointer exception</b>.
For reading the MYSAPSSO2 cookie,i used javascript as it is a browser cookie,so i couldn't read it with ABAP.
After reading the cookie in a string variable via an input field,i submit the form and use the HTTP utility class to decode it (base64) and after splitting the resultant string,i get the user.
If you want i can post the entire code for reference.
Regards,
Siddhartha
Message was edited by: Siddhartha Jain
HI,
Great,it works now,Thanks,
guess now we have 2 options of getting the logged in user in EP.
As for reading the MYSAPSSO2 cookie is concerned,
The javascript would be
<script language="JavaScript" type="text/javascript">
function ReadCookie()
{
<%if flag is initial.%>
var cookiename = "MYSAPSSO2";
var cookiestring=""+document.cookie;
var index1=cookiestring.indexOf(cookiename);
if (index1==-1 || cookiename=="") return "";
var index2=cookiestring.indexOf(';',index1);
if (index2==-1) index2=cookiestring.length;
document.formAccnt.ip1.value = unescape(cookiestring.substring(index1+cookiename.length+1,index2));
document.formAccnt.submit();
<%endif.%>
}
</SCRIPT>
In Form layout
<htmlb:inputField id = "ip1"
type = "STRING"
value = "<%= mysapsso2 %>"
visible="FALSE"/>
And in onInputProcessing
mysapsso2 = request->get_form_field( 'ip1').
IF mysapsso2 IS NOT INITIAL.
DATA: utility TYPE REF TO cl_http_utility.
CREATE OBJECT utility.
CALL METHOD utility->decode_base64
EXPORTING
encoded = mysapsso2
RECEIVING
decoded = cookie.
CALL METHOD utility->escape_url
EXPORTING
unescaped = cookie
RECEIVING
escaped = cookie.
SPLIT cookie AT 'portal%3a' INTO temp3 username.
split username at '%88' into username temp3.
ENDIF.
Regards,
Siddhartha
Message was edited by: Siddhartha Jain
Hi Raja and Jain,
thank you guys for all of your responses. I recieved from your dialog more then I expected.
I found on this forum most suitable solution for my problem: <User.department>. More about this dynamic parameters can be found at:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/ep/s-u/the application integrator in ep 6.0
Best regards,
Josef
if you are using SSO using logon ticket within your BSP application if you get the sy-uanme it will be same user who logged on to portal.
if you had user mapping for BSP iviews then its like logging on to SAP system with a single user id in which case the sy-uname will not give the right name of the person who logged on to portal. to over come this you can pass portal logged on user as the application parameter for the BSP iview which you can read it in your BSP and process further.
once you have the name your could read usr* table or pa0002 table to get his other details.
Regards
Raja
Message was edited by: Durairaj Athavan Raja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.