Sunday, March 9, 2014
When you use RH_INSERT_INFTY/RH_READ_INFTY/RH_UPDATE_INFTY function module to create/read/update Personnel Development (PD) objects, System checks whether the person accessing object has structural authorization. If the user does not have access and need to access object, system will throw authorization errors.


1.       Use RH_AUTHORITY_CHECK_OFF function module to switch off structural authorization.
2.       Use RH_AUTHORITY_CHECK_ON function module to switch on structural authorization.

" Switch off Standard authorization
CALL FUNCTION 'RH_AUTHORITY_CHECK_OFF'.

" Insert new row into Infotype 1000 for position with new name
CALL FUNCTION 'RH_INSERT_INFTY'
  EXPORTING
*   FCODE                     = 'INSE'
    VTASK                     = 'S'
*   ORDER_FLG                 = 'X'
*   COMMIT_FLG                = 'X'
*   AUTHY                     = 'X'
*   PPPAR_IMP                 =
*   OLD_TABNR                 = ' '
*   REPID                     = ' '
*   FORM                      = ' '
*   KEEP_LUPD                 =
*   WORKF_ACTV                = 'X'
  TABLES
    INNNN                     = X1000
*   ILFCODE                   =
* EXCEPTIONS
*   NO_AUTHORIZATION          = 1
*   ERROR_DURING_INSERT       = 2
*   REPID_FORM_INITIAL        = 3
*   CORR_EXIT                 = 4
*   BEGDA_GREATER_ENDDA       = 5
*   OTHERS                    = 6
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

COMMIT WORK.
"Switch on Standard Authorization
CALL FUNCTION 'RH_AUTHORITY_CHECK_ON' .

0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.