Skip to Content
0

Personas 3.0 SP 4 - Get user name in JavaScript.

Jan 23, 2017 at 06:15 PM

72

avatar image

Hi,

I'm creating a flavor for IW21, and I need to load the user's name into a Reported By field using JavaScript.

I've searched for an answer in numerous posts, and I keep seeing a reference to SY-UNAME. However, this appears to be a system variable available for ABAP, but not JavaScript.

I would also like to be able to use the user name for a remote function call to BAPI_USER_GET_DETAIL, but the examples I've found, like the one below, use a hard-coded user name and don't explain how to get that dynamically.

var rfc = session.createRFC("BAPI_USER_GET_DETAIL");
rfc.setParameter("USERNAME", "PRIYADARSHIS");
rfc.requestResults(JSON.stringify(["ADDRESS", "RETURN"]));
rfc.send();

Can someone provide a JavaScript example on how I can get the user name?

Thank you very much for your help!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Tamas Hoznek
Jan 23, 2017 at 10:23 PM
0

session.info.user will give you the current user name.

Share
10 |10000 characters needed characters left characters exceeded