How to extact a list of users with their email address?
To solve this problem you will need to join tables ADR6 and USR21. Both tables share the column PERSNUMBER.
When usign the table ADR6, you need to use SE16N to see the email address and not SE16.
The query to fetch users with email address is:
SELECT U~BNAME U~PERSNUMBER U~ADDRNUMBER A~SMTP_ADDR INTO CORRESPONDING FIELDS OF TABLE ITAB FROM ( USR21 AS U INNER JOIN ADR6 AS A ON A~PERSNUMBER = U~PERSNUMBER AND A~ADDRNUMBER = U~ADDRNUMBER ) WHERE U~BNAME IN UNAME.
Solution 2: Just email and user id
If you only need email address with user id (not the name) just follow this steps: 1) Open se16n TCODE 2) Enter ADR6 as Table name 3) Press Excute(F8)
Solution 3: custom t-code
First, check if there is a custom t-code to solve this issue. Sometimes ZEMAIL solves this problem.