Skip to Content
0

Reading PID value using Screen Personas Script in GUI for Windows

Oct 16, 2016 at 07:05 PM

104

avatar image
Former Member

Hi,

Is there a way of reading PID value from SU3, when I have tried to record a script in ITS, it doesn't record any of the steps I take to filter and copy value, so I would like to directly read it,

This is for a GUI for Windows user.

Many Thanks,

Daniel.

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

2 Answers

Tamas Hoznek
Oct 17, 2016 at 05:25 PM
0

You could use the function module BAPI_USER_GET_DETAIL via RFC, it returns the parameter values for a user.

Share
10 |10000 characters needed characters left characters exceeded
Brian Wills Oct 19, 2016 at 05:06 PM
0

Create a RFC function module similar to the following:

FUNCTION ZRHP0_GET_USER_PARAMETER.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(PARAMETER_ID) LIKE USR05-PARID
*" EXPORTING
*" VALUE(PARAMETER_VALUE) LIKE USR05-PARVA
*" VALUE(RC) LIKE SY-SUBRC
*"----------------------------------------------------------------------
 CLEAR parameter_value.
 SELECT SINGLE parva FROM usr05 INTO parameter_value
 WHERE bname = sy-uname
 AND parid = parameter_id.
 rc = syst-subrc.
ENDFUNCTION.

In your Personas script you can create a method like the following:

function getUserParameter(z_param_id)
{
  var rfc = session.createRFC("ZRHP0_GET_USER_PARAMETER");
  //Input
  rfc.setParameter("PARAMETER_ID", z_param_id);
  //Return
  rfc.requestResults('["PARAMETER_VALUE", "RC"]');   rfc.send();
  return rfc.getResult("PARAMETER_VALUE");
}

It can be called in the same script like the following. In the I get the IFL pid returned (Function Location).

var z_func_loc = getUserParameter('IFL');

Hope this helps!

Thanks, Brian

Share
10 |10000 characters needed characters left characters exceeded