Skip to Content

Reading PID value using Screen Personas Script in GUI for Windows

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Oct 17, 2016 at 05:25 PM

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

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 19, 2016 at 05:06 PM

    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

    Add comment
    10|10000 characters needed characters exceeded