Need help to change user email id in table ADR6

Hi,
i want to update user email id in table adr6. i hv written following code but not working to change email in table adr6.
      DATA lo_nd_email TYPE REF TO if_wd_context_node.
      DATA lo_el_email TYPE REF TO if_wd_context_element.
      DATA ls_email TYPE wd_this->element_email.
      DATA lv_mail_id LIKE ls_email-mail_id.
    navigate from <CONTEXT> to <EMAIL> via lead selection
      lo_nd_email = wd_context->get_child_node( name = wd_this->wdctx_email ).
    get element via lead selection
      lo_el_email = lo_nd_email->get_element(  ).
    get single attribute
      lo_el_email->get_attribute(
        EXPORTING
          name =  `MAIL_ID`
        IMPORTING
          value = lv_mail_id ).
      DATA:lv_bname TYPE BAPIBNAME-BAPIBNAME.
      DATA:lt_return TYPE TABLE OF bapiret2.
      DATA:PER_NO TYPE AD_PERSNUM,
           ADDR_NO TYPE ADRC-ADDRNUMBER."AD_ADDRNUM.
      DATA:SEARCH TYPE REF TO IF_WD_CONTEXT_NODE.
      SEARCH = WD_CONTEXT->GET_CHILD_NODE( 'USER' ).
      SEARCH->GET_ATTRIBUTE( EXPORTING NAME = 'BNAME'
           IMPORTING VALUE =  lv_bname ).
      DATA:wa_address TYPE bapiaddr3.
      DATA : CONS_NO TYPE AD_CONSNUM.
    IF lv_mail_id IS INITIAL.
          get message manager
          DATA lo_api_controller TYPE REF TO if_wd_controller.
          DATA lo_message_manager TYPE REF TO if_wd_message_manager.
          lo_api_controller ?= wd_this->wd_get_api( ).
          CALL METHOD lo_api_controller->get_message_manager
            RECEIVING
              message_manager = lo_message_manager.
          report message
          CALL METHOD lo_message_manager->report_error_message
            EXPORTING
              message_text  = 'Please Enter Email Id'.
    ENDIF.
   DATA:l_addr type addr_keynr.
   DATA:C_YES(1).
        CLEAR:C_YES.
        C_YES = 'X'.
   TYPES: ty_comm_smtp TYPE  adsmtp ,             
        ty_returncode TYPE SZAD_FIELD-RETURNCODE,
        ty_error TYPE ADDR_ERROR,
        adsuse TYPE ADSUSE.
    DATA:EMAIL_ID TYPE AD_SMTPADR,
         lt_comm_smtp TYPE STANDARD TABLE OF ty_comm_smtp,    """"Data Object
         lv_returncode TYPE STANDARD TABLE OF ty_returncode,
         error_table TYPE STANDARD TABLE OF ty_error,
         lt_adsuse  TYPE STANDARD TABLE OF adsuse.
    data:ls_comm_smtp like LINE OF lt_comm_smtp,
         ls_returncode like LINE OF lv_returncode .
    CALL FUNCTION  'SUSR_USER_ADDRESSKEY_GET'
      EXPORTING  BNAME    = lv_bname
      IMPORTING  PERSNUMBER    = l_addr-persnumber
                 ADDRNUMBER    = l_addr-addrnumber
           EXCEPTIONS ADDRESS_NOT_FOUND = 1
                      OTHERS            = 2.
  IF SY-SUBRC = 0.
    REFRESH: lt_comm_smtp.
      CALL FUNCTION 'ADDR_PERS_COMP_COMM_GET'
           EXPORTING
                address_handle    = ''
                address_number    = l_addr-addrnumber
                person_handle     = ''
                person_number     = l_addr-persnumber
                DATE_FROM         = '00010101'
              LANGUAGE          = SY-LANGU
                table_type        = 'ADSMTP'
                iv_current_state  = space                       "*981i
           IMPORTING
                returncode        = ls_returncode
           TABLES
                comm_table        = lt_comm_smtp
                error_table       = error_table
                et_usage          = lt_adsuse                   "*981i
           EXCEPTIONS
                parameter_error   = 1
                address_not_exist = 2
                person_not_exist  = 3
                internal_error    = 4
                OTHERS            = 99.
      IF sy-subrc <> 0.
        IF sy-subrc = 1 OR sy-subrc = 2 OR sy-subrc = 3.
         raise_message 'AM' 'A' 885 'ADDR_PERS_COMP_COMM_GET' space
         space space internal_error.
        ELSE.
         same_message_dia_a internal_error.
        ENDIF.
      ENDIF.
  ENDIF.
    CLEAR:ls_comm_smtp, email_id.
    READ TABLE lt_comm_smtp INTO ls_comm_smtp INDEX 1.
    EMAIL_ID = ls_comm_smtp-smtp_addr.    """""""OLD EMAIL ID which we get from ADDR_PERS_COMP_COMM_GET
    CONS_NO = ls_comm_smtp-CONSNUMBER.
    CLEAR:ls_comm_smtp.
    ls_comm_smtp-CONSNUMBER = CONS_NO.
    ls_comm_smtp-FLGDEFAULT = 'X'.
    ls_comm_smtp-HOME_FLAG = 'X'.
    ls_comm_smtp-UPDATEFLAG = 'U'.
    ls_comm_smtp-smtp_addr = lv_mail_id.
    TRANSLATE email_id TO UPPER CASE.
    ls_comm_smtp-smtp_srch = email_id.
    REFRESH :lt_comm_smtp.
     append ls_comm_smtp to lt_comm_smtp.
  IF SY-SUBRC = 0.
    CALL FUNCTION 'ADDR_PERS_COMP_COMM_MAINTAIN'
         EXPORTING
              address_handle    = ' '
              address_number    = l_addr-addrnumber
              person_handle     = ' '
              person_number     = l_addr-persnumber
              table_type        = 'ADSMTP'
              iv_time_dependence = C_YES                   "*981i
        IMPORTING
             returncode        =  ls_returncode
        TABLES
             comm_table        =  lt_comm_smtp
             error_table       =  error_table
        EXCEPTIONS
             parameter_error   = 1
             address_not_exist = 2
             person_not_exist  = 3
             internal_error    = 4
             OTHERS            = 99.
      IF sy-subrc <> 0.
        EXIT.
      ENDIF.
  ENDIF.
  IF sy-subrc = 0.
      COMMIT WORK.
  ENDIF.
i hv also tried second approch available on sdn CALL FUNCTION 'ADDR_COMM_MAINTAIN'. but in this fm person number we can't pass.
please help me

Hi Abhilesh,
You can use the following FM's to update the Email ID. There are many posts ADDR* FM using for updating Email ID.  Please have a look if you have a doubt.
DATA: iadsmtp TYPE adsmtp    OCCURS 0 WITH HEADER LINE.
"Retrieving Address Details
CALL FUNCTION 'ADDR_COMM_GET'
      EXPORTING
        address_number =  addrnr
        table_type     = 'ADSMTP'
      TABLES
        comm_table     = iadsmtp
      EXCEPTIONS
        OTHERS         = 0.
READ TABLE iadsmtp index 1.
if sy-subrc is initial.
iadsmtp-SMTP_ADDR = 'new mail ID'.  " Here pass your New Email ID
Modify iadsmtp.
Endif.
  CALL FUNCTION 'ADDR_COMM_MAINTAIN'
      EXPORTING
        address_number           = addrnr
        table_type               = 'ADSMTP'
        substitute_all_comm_data = 'X'
      TABLES
        comm_table               = iadsmtp
      EXCEPTIONS
        OTHERS                   = 0.
Then call FM 'ADDR_SINGLE_SAVE'  to do the Commit.

Similar Messages

  • I need help to change user name, it does not belong to this account it belongs to my employee.

    My employee was helping me setup my Apple ID and accidently typed his username "mykizism" into the user name field when creating my apple id account..  It is now permanently attached to my Apple ID and this is not acceptable.
    My employee has also stated that his user name is private to him and wishes for it to be not publicly displayed.
    Can a moderator / host please help me with this?

    I sent your request in to the hosts.

  • Bought Used Mac Mini...need help to change email for updates

    Purchased an used Mac Mini and I want to change my defaults to my name and get rid of the sellers name, I also need help in changing the email default for getting my updates from Apple.  That's the most important to me... I've got 5 updates waiting and the message I receive is to get my updates from the sellers email address.  Thanks!!!

    What OS is on your Mini? What year/model is the Mini? The seller should have reinstalled the OS that came with the Mini instead of just selling it to you as is.
    Once you determine the OS, you can erase your Mini's Macintosh HD and reinstall the OS which will allow you to setup your own account during the Setup process.

  • HT2204 I need help to change my security questions I have forgot them

    I need help to change my security questions I have forgot them

    If you have a rescue email address (which is not the same thing as an alternate email address) set up on your account then you can try going to https://appleid.apple.com/ and click 'Manage your Apple ID' on the right-hand side of that page and log into your account. Then click on 'Password and Security' on the left-hand side of that page and on the right-hand side you might see an option to send security question reset info to your rescue email address.
    If you don't have a rescue email address (you won't be able to add one until you can answer 2 of your questions) then see if this user tip helps : https://discussions.apple.com/docs/DOC-4551
    e.g. you can try contacting iTunes Support : http://www.apple.com/support/itunes/contact/ - click on Contact iTunes Store Support on the right-hand side of the page, then Account Management , and then try Apple ID Account Security
    or try ringing Apple in your country and ask to talk to the Accounts Security Team : http://support.apple.com/kb/HE57

  • I got my mac from granddaughter.need help to change admin password

    i just got my mac from granddaughter. i need help to change the admin password. she has no clue what i am talking about when i ask for the password. please help me. i can't even install my tiger replacement cd until i change the admin password. thanks for your help. lee

    Hi, Lee. Welcome to Apple Support Communities.
    From this Apple Knowledge Base article:
    Start up from a Mac OS X Install disc (one whose version is closest to the version of Mac OS X installed).  Usually, you can start from the disc by putting it in your computer, restarting, and holding the C key. Or, put it in the computer and click the Install or Restore icon you see in the disc's main window (after which the computer will start from the disc without you needing to hold C). Or, you can use Startup Manager or the Startup Disk preference pane to select the Install disc.
    Choose a language, click the arrow button to continue,
    Mac OS X v10.6 or later: Choose Password Reset from the Utilities menu.
    Mac OS X v10.5 or v10.4: Choose Reset Password from the Utilities menu.
    Mac OS X v10.3: Choose Reset Password from the Installer menu.
    Tip: If you don't see this menu or menu choice, you're probably not started from the disc yet.
    Note: The default keyboard layout is U.S. English while started from the installation disc. If you use a keyboard layout other than U.S English, use the Input menu (the flag icon on the right side of the menu bar) to select the desired layout before typing a new password.
    Select your Mac OS X hard disk volume.
    Select the user name of your original administrator account.
    Important: Do not select "System Administrator (root)". This is actually the root user. You should not confuse it with a normal administrator account.

  • Need help in changing the langauge on the Nokia570...

    Anybody can help please. I was given a brand new Nokia 5700 by my nephew from Taiwan and the langauge set is Chinese. I do not read or write chinese. Need help to change thelangauge on the phone. Any body can help.
    Thanks in advance

    Friend, I am based in China and my secretary is chinese - but nobody can figure out how to do it. I have another engineer who has the same phone has been playing around with it for 2 days and cannot get it done also. That is the reason I am getting on this site for help.
    Thanks anyways

  • HT1212 I cannot remember my passcode and need help to change/reset my passcode.  I need this information in simple terms.  I have attempted to follow the instructions above without success

    I cannot remember my passcode and need help to change/reset my passcode.  I have tried to reset using the instructions on the website without success.  Please explain to me in simple easy terms how to access my ipod.  Thanks

    Forgotten Screen-Lock Passcode
    Connect the iOS device to your computer and try to make a backup
    iOS: How to back up
    Then restore via iTunes. The iPod will be erased. Place the iOS device in Recovery Mode if necessary to allow the restore.
    If recovery mode does not work try DFU mode.
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    For how to restore:
    iTunes: Restoring iOS software
    To restore from backup see:
    iOS: How to back up    
    If you restore from iCloud backup the apps will be automatically downloaded. If you restore from iTunes backup the apps and music have to be in the iTunes library since synced media like apps and music are not included in the backup of the iOS device that iTunes makes.
    You can redownload most iTunes purchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store    
    You can also Google for YouTube videos that show how to do it

  • Need help to change my apple store to canada

    i need help to change my app itones store to canada

    Click here and follow the instructions to change the iTunes Store country.
    (103776)

  • I need to need help with changing my app store to canada to us but i have 49cents balance can you remove it please

    I need to need help with changing my app store to canada to us but i have 49cents balance can you remove it please

    Contact iTunes Support - http://apple.com/emea/support/itunes/contact.html - and ask them to clear your balance.

  • I need help with changing my verizon vm to the system voicemail

    I need help with changing my verizon vm to the system voicemail

    Deleting the iTunes account is not the solution as you will very likely lose any and all purchases ever made with the account.
    If you cannot find the option on the site, contact iTunes support.

  • Programmatically Changing User Email Addresses

    Currently I cant change email address for a user.
    I've moved onto group memberships but if I cant sort this out,
    I'll need to delete the user and recreate each time.
    // Create a hashtable to store options that can be set
    for the new user.
    Hashtable userOptions = new Hashtable();
    userOptions.put(UserManager.HAS_EMAIL , new Boolean
    (true));
    if (aEmail != null)
    userOptions.put(UserManager.EMAIL_ADDRESS, aEmail);
    //Create the user.
    try{
    dUser = usermanager.createUser(aUserid,password,
    userOptions);
    System.out.println("New User Created : " + dUser.getName
    System.out.println(" DistinguishedName = " +
    dUser.getDistinguishedName());
    }catch (IfsException e){
    //create user failed so look up existing user and
    modify it.
    //Fetch the DirectoryUser instance to be deleted.
    duColl = mSession.getDirectoryUserCollection();
    dUser = (DirectoryUser) duColl.getItems(aUserid);
    //dUser.setAdminEnabled(false);
    /**@todo make this work!!!!!! */
    dUser.putProperty
    (UserManager.EMAIL_ADDRESS,AttributeValue.newAttributeValue
    (aEmail));
    System.out.println("Email::"+dUser.getAttribute
    (UserManager.EMAIL_ADDRESS));
         // try to change email though the pup
    PrimaryUserProfile pup=dUser.getPrimaryUserProfile();
    pup.putProperty(UserManager.EMAIL_ADDRESS,
    AttributeValue.newAttributeValue(aEmail));
    System.out.println(UserManager.EMAIL_ADDRESS);
    System.out.println(AttributeValue.newAttributeValue
    ("Modified user : ") + dUser.getName());
    Any ideas?

    Check the table HZ_PARTIES.

  • HT4528 I have an Iphone currently that I need to replace with another Iphone same as my 4s.  I need help to change device what do I do?

    Hello,
    I need help changing my Ipone 4s to another Iphone s device.  Currently the new phone has the ITunes logo and USB connection and I can't get it cleared to connect to my wireless phone
    Help!

    First, this forum has questions answered by your fellow users
    who volunteer their time. You need to wait more than 6 minutes
    for an answer.
    Connect the old iPhone to iTunes and back it up, also transfer purchases
    and pictures and videos. Connect the new iPhone to the same iTunes
    and restore from the backup of the old iPhone that you just made.
    Or am I misreading your question?

  • Need help to change line item text for 220 Line items

    Hi Specialists,
    The user has posted a reversal entry ( doc type : Manual Accrual) using TCODE FBS1.
    It has 220 line items.
    Is there a way in SAP he can change the text of All Line Items for a particular document number in one shot ( Mass Change).
    Pls note : Header text remains same . Only the line item text needs to be changed in one shot .
    For Eg :
      1 50 2758000047 Accruals for CAS               Accrl - Dec 08 / Nalini Marketing(Door Mats) - Oth
      2 50 2758000047 Accruals for CAS               Accrl - Dec 08 / SKC - M&E Repair
    Changed Description:
      1 50 2758000047 Accruals for CAS               Accrl - Jan 09 / Nalini Marketing(Door Mats) - Oth
      2 50 2758000047 Accruals for CAS               Accrl - Jan 09 / SKC - M&E Repair
    Thanks,
    Abhinav.

    Hi
    This is possible, please follow as below:
    If it is GL (FBL3N), Customer (FBL5N), Vendor (FBL1N) line item use the TCODE' mentioned.
    In the selection screen, if possible give all the document numbers (it is possible with addition selection).
    Once you get the output with the line item, select all line items and go to the menu options  there you can see the mass change option, it will give one popup screen give the new value in the text field and proceed further.
    VVR

  • I need help backing up my emails so as not to loose them in order to create a new imap account.  Anyone????

    I need help to back up my current emails.  I am trying to create an imap email account and i dont want to loose my emails in the process. Anyone???

    Hi ricknz,
    I suggest using Header and Footer rows, which are very useful in Numbers.
    Say you start with this table:
    Convert the first row to a header row:
    Convert the last row to a Footer Row:
    Add a sum formula in the Footer Row:
    Then when you add values in the following rows the sum will adjust automatically and the table will expand as you add more data:
    SG

  • HT201320 PLEASE HELP - I changed my email password on my computer...the email is also on my iPad...I can log on the computer with the 'new' password, however, the iPad is not allowing me to log in.  I continue to get the incorrect password message.  Pleas

    PLEASE HELP - I recently changed my email password on my computer...the email is also on my iPad. I can log on the computer with the 'new' password, however, the iPad is not allowing me to log in.  I continue to get the 'incorrect password' message.  Please advise.

    I'm sorry you're having issues with your e-mail account on your phone Rusty1112. Let's figure out what's going on. First, please try deleting account/information again and then restart phone. When phone is back on, try adding e-mail account again, and be sure you're entering exactly as you set up, meaning its case-sensitive. If you're still getting same error, please let us know and let us know what e-mail account it is, Yahoo, AOL, MSN, etc.
    Thank you,
    VanessaS_VZW
    Follow us on Twitter @VZWSupport

Maybe you are looking for

  • Macbook Retina Disk Problems?

    I received a MacBook as a gift a while ago. It was used before it was given to me and using everymac I determined it to be the 2012 15 inch core i7 MacBookPro retina. Recently my Windows OS on macbook, installed a la bootcamp, started crashing (no bl

  • UTF-8 and *.jsp, *.jspf files with NitorX 419

    Hello I hava a problem for setting the encoding of the JSP files in eclipse 3.1rc3 and NitroX 419. I am using tiles (but i am not sure that they are properly recognized). And I want to create one fragment file eg. one for body element in tiles. I am

  • GMS and Windows Phones error 80072F7D

    Hello, after expiration of old SSL certificates we added wildcard certificate from RapidSSL. iPhones and Android phones are happy with that, but all MS Phones getting 80072F7D error, when trying to sync with GMS. We imported SSL certificate from GMS

  • Calendar entries in "Sleep window"

    When playing songs in iPod in the iPhone, the song name is visibel when the phone is in sleep mode, but does anyone know if there is a possibility to make Calendar entries visibel in the sleep mode view?

  • E52 Unable to install Python 2.0

    I am having this problem. When I enter Software Update from the phone the only update that appear is Python for S60 2.0 Optionan (2030kb). When I mark it and push start update it beggins. Downloading finished... Installing ... and then 1 Update Faile