SAP Function Modules

RP_GET_PSREF SAP Function module







RP_GET_PSREF is a standard SAP function module available within R/3 SAP systems depending on your version and release level. Below is the pattern details for this FM showing its interface including any import and export parameters, exceptions etc as well as any documentation contributions (Comments) specific to the object.

See here to view full function module documentation and code listing, simply by entering the name RP_GET_PSREF into the relevant SAP transaction such as SE37 or SE80.

Associated Function Group: HRTV
Released Date: Not Released
Processing type: Normal fucntion module
Normal function module settings


Pattern for FM RP_GET_PSREF - RP GET PSREF





CALL FUNCTION 'RP_GET_PSREF' "
  EXPORTING
    pernr =                     " assob_hr-pernr  Personnel no.
    infty =                     " assob_hr-infty  Infotype
    subty =                     " assob_hr-subty  Subtype
    objps =                     " assob_hr-objps  Object identification
    sprps =                     " assob_hr-sprps  Lock indicator for HR master record
    endda =                     " assob_hr-endda  Validity end date
    begda =                     " assob_hr-begda  Valid per.start date
    seqnr =                     " assob_hr-seqnr  Infotype record no.
    refex =                     " pshd1-refex   Reference fields exist (primary/secondary costs)
    ordex =                     " pshd1-ordex   Confirmation fields exist
  IMPORTING
    opsref =                    " psref         Assignment Values for HR Objects
  EXCEPTIONS
    NOT_FOUND = 1               "               No account assignment information found
    NO_REF_OR_ACK = 2           "               No reference or confirmation fields
    REF_AND_ACK_EXIST = 3       "               Reference AND confirmation fields exist
    ARBID_NOT_FOUND = 4         "               Work center not found (orders)
    KOSTL_NOT_COMPLETE = 5      "               Cost center incomplete (orders)
    KOSTL_NOT_FOUND = 6         "               Cost center not found (orders)
    OTHERS = 7                  "               Other errors
    .  "  RP_GET_PSREF

ABAP code example for Function Module RP_GET_PSREF





The ABAP code below is a full code listing to execute function module RP_GET_PSREF including all data declarations. The code uses the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the original method of declaring data variables up front. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8).

DATA:
ld_opsref  TYPE PSREF .


SELECT single PERNR
FROM ASSOB_HR
INTO @DATA(ld_pernr).


SELECT single INFTY
FROM ASSOB_HR
INTO @DATA(ld_infty).


SELECT single SUBTY
FROM ASSOB_HR
INTO @DATA(ld_subty).


SELECT single OBJPS
FROM ASSOB_HR
INTO @DATA(ld_objps).


SELECT single SPRPS
FROM ASSOB_HR
INTO @DATA(ld_sprps).


SELECT single ENDDA
FROM ASSOB_HR
INTO @DATA(ld_endda).


SELECT single BEGDA
FROM ASSOB_HR
INTO @DATA(ld_begda).


SELECT single SEQNR
FROM ASSOB_HR
INTO @DATA(ld_seqnr).


DATA(ld_refex) = some text here

DATA(ld_ordex) = some text here . CALL FUNCTION 'RP_GET_PSREF' EXPORTING pernr = ld_pernr infty = ld_infty subty = ld_subty objps = ld_objps sprps = ld_sprps endda = ld_endda begda = ld_begda seqnr = ld_seqnr refex = ld_refex ordex = ld_ordex IMPORTING opsref = ld_opsref EXCEPTIONS NOT_FOUND = 1 NO_REF_OR_ACK = 2 REF_AND_ACK_EXIST = 3 ARBID_NOT_FOUND = 4 KOSTL_NOT_COMPLETE = 5 KOSTL_NOT_FOUND = 6 OTHERS = 7 . " RP_GET_PSREF
IF SY-SUBRC EQ 0. "All OK ELSEIF SY-SUBRC EQ 1. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 2. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 3. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 4. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 5. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 6. "Exception "Add code for exception here ELSEIF SY-SUBRC EQ 7. "Exception "Add code for exception here ENDIF.







ABAP code to compare 7.40 inline data declaration with original syntax

The below ABAP code uses the older none in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. It may also be useful if you are using an older version of SAP as some of the newer syntax above, such as the @DATA is not available until 4.70 EHP 8.

DATA:
ld_opsref  TYPE PSREF ,
ld_pernr  TYPE ASSOB_HR-PERNR ,
ld_infty  TYPE ASSOB_HR-INFTY ,
ld_subty  TYPE ASSOB_HR-SUBTY ,
ld_objps  TYPE ASSOB_HR-OBJPS ,
ld_sprps  TYPE ASSOB_HR-SPRPS ,
ld_endda  TYPE ASSOB_HR-ENDDA ,
ld_begda  TYPE ASSOB_HR-BEGDA ,
ld_seqnr  TYPE ASSOB_HR-SEQNR ,
ld_refex  TYPE PSHD1-REFEX ,
ld_ordex  TYPE PSHD1-ORDEX .


SELECT single PERNR
FROM ASSOB_HR
INTO ld_pernr.


SELECT single INFTY
FROM ASSOB_HR
INTO ld_infty.


SELECT single SUBTY
FROM ASSOB_HR
INTO ld_subty.


SELECT single OBJPS
FROM ASSOB_HR
INTO ld_objps.


SELECT single SPRPS
FROM ASSOB_HR
INTO ld_sprps.


SELECT single ENDDA
FROM ASSOB_HR
INTO ld_endda.


SELECT single BEGDA
FROM ASSOB_HR
INTO ld_begda.


SELECT single SEQNR
FROM ASSOB_HR
INTO ld_seqnr.


ld_refex = some text here

ld_ordex = some text here

Contribute (Add Comments)

Please help keep this info upto date and use the comments section below to add useful hints, tips and information specific to this SAP function. This will then be available for you and other users to easily find by simply searching on the object name RP_GET_PSREF or its description.