Wednesday, April 9, 2014

We have one custom r/3 report which uses logical database PNP and this report displays ALV output. When we press back button on ALV output, the following output is displayed by PNP program.

Personnel numbers skipped by the database driver
Reason 1: insufficient authorization, no. skipped personnel nos.: 1
 This could happen when user who is executing the report does not have authorization to infotype defined using INFOTYPES statement for the employee who is being skipped by logical database driver program.
So user will wonder who is the missed personnel number due to authorization.

We use macro PNP_GET_AUTH_SKIPPED_PERNRS to get list of personnel numbers into internal table in the event END-OF-SELECTION.

Sample code
REPORT ztest_program.

TABLES: pernr.
INFOTYPES: 0000,
           0001,
           0008,
           0019,
           0041,
           0185,
           2001.
"Internal table to hold skipped pernrs into internal table
DATA   lt_skipped_pernrs TYPE hrahq_pernr_table.
DATA   ls_skipped_pernrs LIKE LINE OF lt_skipped_pernrs.

START-OF-SELECTION.

GET pernr.
  WRITE:/ pernr-pernr, pernr-ename.

END-OF-SELECTION.
  "Macro PNP_GET_AUTH_SKIPPED_PERNRS
  pnp_get_auth_skipped_pernrs lt_skipped_pernrs.

  IF lt_skipped_pernrs IS NOT INITIAL.
    WRITE:/ 'List of skipped personnel no:'.
    LOOP AT lt_skipped_pernrs INTO ls_skipped_pernrs.
      WRITE:/30 ls_skipped_pernrs-pernr.
    ENDLOOP.
  ENDIF.


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.