Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the mail-addy of sy-uname?

Former Member
0 Kudos

Hi there,

is there any function module that brings me the mail adress of a the user logged in. I mean the mailaddy in his profile.

How can I get it?

Thanks a lot.

.

Markus

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

Use the Function

BAPI_USER_GET_DETAIL

pass the user name and you can find the Email address from the table parameter

ADDSMTP

5 REPLIES 5

former_member188685
Active Contributor
0 Kudos

Use the Function

BAPI_USER_GET_DETAIL

pass the user name and you can find the Email address from the table parameter

ADDSMTP

vinod_vemuru2
Active Contributor
0 Kudos

Hi Markus,

Use this BAPI BAPI_USER_GET_DETAIL.

Check below sample code.


            MOVE sy-uname TO w_username.
            CLEAR wa_address.
            CALL FUNCTION 'BAPI_USER_GET_DETAIL'
              EXPORTING
                username             = w_username
             IMPORTING
*             LOGONDATA            =
*             DEFAULTS             =
               address              = wa_address
*             COMPANY              =
*             SNC                  =
*             REF_USER             =
*             ALIAS                =
              TABLES
*             PARAMETER            =
*             PROFILES             =
*             ACTIVITYGROUPS       =
                return               = i_return
*             ADDTEL               =
*             ADDFAX               =
*             ADDTTX               =
*             ADDTLX               =
*             ADDSMTP              =
*             ADDRML               =
*             ADDX400              =
*             ADDRFC               =
*             ADDPRT               =
*             ADDSSF               =
*             ADDURI               =
*             ADDPAG               =
*             ADDCOMREM            =
*             GROUPS               =
                      .

mailid = wa_address-e_mail.

This will return the mail ID only if it is maintained in user master.

If ur functionality is to send the mail then after calling this FM if mail ID exists then send mail to this ID else send mail to SAP account.

Thanks,

Vinod.

Edited by: Vinod Reddy Vemuru on Jul 16, 2008 12:55 PM

Former Member
0 Kudos

Former Member
0 Kudos

hiii

you can use

BAPI_USER_GETLIST Search for Users

BAPI_USER_GET_DETAIL Read User Details

FM for getting user and his detail like mail address

regards

twinkal

Former Member
0 Kudos

Use FM : BAPI_USER_GET_DETAIL

or write select on PA0105 passing USRID = sy-uname

subty = '0010' and get USRID_LONG