cancel
Showing results for 
Search instead for 
Did you mean: 

Reading PID value using Screen Personas Script in GUI for Windows

0 Kudos

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

bwills
Contributor
0 Kudos

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

tamas_hoznek
Product and Topic Expert
Product and Topic Expert
0 Kudos

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