on 01-18-2018 6:28 PM
For whatever reason user parameters do not seem to work in the IW transactions. In IW37N I would like the main work center to be what the parameter value for the Parameter ID VAP in the user is. Is there a way that I can retreive this value with personas scripting?
The main work center is to represent a shift or crew. When a user/mechanic logs in they should be able to automatically see what work is assigned to their shift based on what parameter is assigned to their user account in SAP.
Any help is much appreciated!
Hi Raquel.
We retrieve user parameters using the following script (in this case we are retrieving the parameter "SWK Maintenance Plant").
I hope this helps,
Cristin
//Get User ID
var userid = session.info.user;
var rfc = session.createRFC("BAPI_USER_GET_DETAIL");
rfc.setParameter("USERNAME", userid);
rfc.requestResults (JSON.stringify(["RETURN", "PARAMETER"]));
rfc.send();
var pid = JSON.parse(rfc.getResult("PARAMETER"));
for(var i=0; i<pid.length; i++){
if ((pid[i].PARID)=="SWK"){
var userplant = pid[i].PARVA;
break;
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you so much for sharing ! This worked perfectly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.