FM to get mail id from user name

Hi
I need a Function module which will give me the mail id for the
user name .
Regards
Vikas
Edited by: vikas maurya on Jan 18, 2008 7:33 AM

Hi vikas,
better use the below Bapi s.
BAPI_USER_GET_DETAIL (4.6C) use both.
Here is the code from 4.6C
CALL FUNCTION 'SUSR_USER_READ'
     EXPORTING
          USER_NAME            = USERNAME_
        WITH_TEXT            =
    IMPORTING
         USER_LOGONDATA       = LOGONDATA_
         USER_DEFAULTS        = DEFAULTS_
         USER_ADDRESS         = USER_ADDRESS
    TABLES
         USER_PARAMETERS      = PARAMETER
     EXCEPTIONS
          USER_NAME_NOT_EXISTS = 1
          INTERNAL_ERROR       = 2
          OTHERS               = 3.
and them
CALL FUNCTION 'ADDR_PERS_COMP_GET_COMPLETE'
      EXPORTING
           ADDRNUMBER        = USER_ADDRESS-ADDRNUMBER
        ADDRHANDLE        =
           PERSNUMBER        = USER_ADDRESS-PERSNUMBER
          pershandle        =
      IMPORTING
           ADDR3_COMPLETE    = ADDR3_COMPLETE
       EXCEPTIONS
            PARAMETER_ERROR   = 1
            ADDRESS_NOT_EXIST = 2
            PERSON_NOT_EXIST  = 3
            INTERNAL_ERROR    = 4
            OTHERS            = 5.
ADDR3_COMPLETE contains e-mail address.
kindly reward me if it's ok

Similar Messages

Maybe you are looking for

  • AirDrop has stopped working after upgrading to Yosemite

    Hi , We have recently upgraded OS to Yosemite and after that our AirDrop stopped working .. could some one please help us to get this fixed . So far we have enabled/checked the Bluetooth sharing , file sharing etc but that did not help . Any help is

  • Dates getting wiped from Service Plan line item

    Hi All, We are currently facing an issue in the dates management on the service contracts. When we create a service contract and without saving if we change start date at the header we come across the following issues 1) Date rule gets wipes out from

  • Add/Delete elements from viewcontaineruielement in web dynpro abap

    Dear all, Please let me know how to Add/Delete elements from viewcontaineruielement in web dynpro abap? I have copied a viewcontaineruielement from another program and now i dont want few elements from that viewcontaineruielement in my view. Please g

  • Storing scanned documents in 10g

    Dear Colleagues I have 2 questions:- (1) I want to know how to configure webutility to retrieve a scanned document in an Oracle 10g Form (what is the the format of this scanned document). (2) What will be the data type of the field in the database th

  • Connected to wifi but no internet connection

    I have a very peculiar issue: since today at noon, my ipad stopped to work on the wireless network. lauching safari will result in a connection error, same for mail or for any other app that uses internet, but the wifi is alive and kicking, i have an