01-18-2008 6:33 AM
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
01-18-2008 6:38 AM
Try the following code:
call function 'BAPI_USER_GET_DETAIL'
exporting
username = i_user-bapibname
importing
address = wa_address
tables
return = i_return.
move wa_address-e_mail to wa_recipients-recipient.
Reward points if useful.
01-18-2008 6:38 AM
Try the following code:
call function 'BAPI_USER_GET_DETAIL'
exporting
username = i_user-bapibname
importing
address = wa_address
tables
return = i_return.
move wa_address-e_mail to wa_recipients-recipient.
Reward points if useful.
01-18-2008 6:38 AM
hi,
check this func module
BAPI_USER_GET_DETAIL
you can also check ADRC AND USR21 TABLE
REPORT Z_EMAILADDRESS .
DATA T_ID_ADDRESS LIKE STANDARD TABLE OF USR21 WITH HEADER LINE.
DATA: T_ADRC LIKE STANDARD TABLE OF ADRC.
SELECT * FROM USR21 INTO TABLE T_ID_ADDRESS.
IF SY-SUBRC = 0.
SELECT * FROM ADRC INTO TABLE T_ADRC
FOR ALL ENTRIES IN T_ID_ADDRESS
WHERE ADDRNUMBER = T_ID_ADDRESS-ADDRNUMBER
AND COUNTRY = <LAND>.
LOOP AT T_ID_ADDRESS.
READ TABLE T_ADRC TRANSPORTING NO FIELDS
WITH KEY ADDRNUMBER = T_ID_ADDRESS-ADDRNUMBER.
IF SY-SUBRC 0.
DELETE T_ID_ADDRESS.
ELSE.
WRITE: / T_ID_ADDRESS-BNAME.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDIF.
01-18-2008 6:48 AM
01-18-2008 6:49 AM
Hi all,
Thanks for response.
But my requirement is how to get mail id from user name and not
from login id.
like my user name is vikas maurya but my login user id is AOVIKAS.
OR
In other way how to get email id when first name and last name is given.
- Vikas
Edited by: vikas maurya on Jan 18, 2008 7:55 AM
01-18-2008 6:57 AM
use dis fm to get ur name from login ID
FKK_GET_USER_NAME
den use the other
Edited by: Will smith on Jan 18, 2008 7:57 AM
01-18-2008 7:03 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
01-18-2008 7:29 AM
Hi Vikas,
Try this function Module.
EFG_GET_USER_EMAIL
Reward points if helpful.
Kiran Kumar.G.A