cancel
Showing results for 
Search instead for 
Did you mean: 

How to find the relation between BNAME of USR DB tables and PERNR of PA DB tables ?

masna_7
Explorer
0 Kudos

Hi, I am trying to find and print the details of employee using his SAP Username

I am thinking of giving the input as BNAME (sap username) and I need to print this PERNR (personnel Number or Employee Id) via an ABAP report.

I searched various sources, but, I am unclear of the relation between these two fields, Can anyone please help me in this requirement ?

Thanks in Advance !

Sandra_Rossi
Active Contributor
0 Kudos
I searched various sources... in fact only one, what do you think? https://community.sap.com/t5/application-development-discussions/derive-user-name-bname-using-pernr/...
View Entire Topic
xiaosanyu
Participant

1. USE TCODE: PA20 maintain the relation between BNAME  and PERNR 

    infotype: 0105  subtype 0001

yuxiaosan_0-1710992238557.png

yuxiaosan_1-1710992549398.png

2.  Fetch data by SQL

SELECT PERNR,
       USRID
  FROM PA0105
  WHERE SUBTY = '0001' AND
        BEGDA <= @SY-datum AND
        ENDDA >= @SY-datum.