Update or Insert Email Using BAPI_ADDRESSORG_CHANGE

Hello Experts,
I am facing an issue while Updating an Email in XD02 Transaction  using BAPI_ADDRESSORG_GETDETAIL and BAPI_ADDRESSORG_CHANGE. I am able to update only the email not the notes.Can Some tell me where i had went wrong and If you can please expalin me the 3   bapiadsmtp,bapicomrem,bapiadsmtx tables used for this.
My input is LIFNR and Remark(Notes).
READ TABLE t_bapicomrem INTO f_bapicomrem
                WITH KEY comm_notes = gf_file-remarks.
        READ TABLE t_bapiadsmtp INTO f_bapiadsmtp
                   WITH KEY  consnumber = f_bapicomrem-consnumber.
        IF f_bapicomrem-comm_notes EQ  gf_file-remarks.
          f_bapiadsmtp-e_mail = gf_file-smtp_addr.
          MODIFY TABLE t_bapiadsmtp FROM f_bapiadsmtp.
          f_bapiadsmtx-e_mail     = 'X'.
          f_bapiadsmtx-updateflag = 'U'.
          APPEND f_bapiadsmtx TO t_bapiadsmtx.
        ELSE.
          f_bapiadsmtp-e_mail      = gf_file-smtp_addr.
          f_bapicomrem-comm_notes  =  gf_file-remarks.
          f_bapicomrex-comm_notes  = gf_file-remarks.
          f_bapiadsmtx-e_mail     = 'X'.
          f_bapiadsmtx-updateflag = 'I'.
          f_bapicomrex-LANGU      = 'EN'.
          f_bapicomrex-LANGU_ISO  = 'EN'.
          f_bapicomrex-updateflag = 'I'.
          APPEND f_bapiadsmtp TO t_bapiadsmtp.
          APPEND f_bapicomrem TO t_bapicomrem.
          APPEND f_bapiadsmtx TO t_bapiadsmtx.
        ENDIF.
        clear : f_bapicomrem,
                f_bapicomrem,
                f_bapiadsmtx.
      ENDLOOP.
  CALL FUNCTION 'BAPI_ADDRESSORG_CHANGE'
        EXPORTING
          obj_type       = 'LFA1'
          obj_id         = lv_objid
          save_address   = 'X'
        IMPORTING
          address_number = lv_adrnr
        TABLES
          bapiadsmtp     = t_bapiadsmtp
          bapicomrem     = t_bapicomrem
          bapiadsmt_x    = t_bapiadsmtx
          bapicomre_x    = t_bapicomrex
          return         = t_ret.
Thanks ,
Vijay

Hi Vijay,
   Make few changes in the code you have given,
The code piece given by you..
f_bapiadsmtp-e_mail      = gf_file-smtp_addr.
          f_bapicomrem-comm_notes  =  gf_file-remarks.
          f_bapicomrex-comm_notes  = gf_file-remarks.
          f_bapiadsmtx-e_mail     = 'X'.
          f_bapiadsmtx-updateflag = 'I'.
          f_bapicomrex-LANGU      = 'EN'.
          f_bapicomrex-LANGU_ISO  = 'EN'.
          f_bapicomrex-updateflag = 'I'.
Try this instead of this piece
f_bapiadsmtp-e_mail      = gf_file-smtp_addr.
          f_bapicomrem-comm_notes  =  gf_file-remarks.
          f_bapicomrex-comm_notes  = 'X'.
          f_bapiadsmtx-e_mail     = 'X'.
          f_bapiadsmtx-updateflag = 'I'.
        * f_bapicomrex-LANGU      = 'EN'. " This should be either X or ' ' set this only if you change the language.
        * f_bapicomrex-LANGU_ISO  = 'EN'. " This should be either X or ' ' set this only if you change the language.
          f_bapicomrex-updateflag = 'I'.
Hope this helps.
Regards,
Praveenkumar T.

Similar Messages

  • Creating process for multiple Date fields for update or insert in APEX

    hello there,
    could someone please help me?
    i have a form on Apex based on view that is based on three tables and updating and inserting ok using trigger instead of.
    i have a problem now as in my form i have around 75 fileds (items) incuding 30 or more date fields which could be populated or left blank or update later.
    so for each date field i have two boxs; one for date, input as dd/mm/yyyy (text field) and second for time, input as 23:45. All dates will be insert or update manually by user. so as i mentioned not all date fields could be poulated at one stage.
    so i have created some process and validations and all of them work fine but i came accross if date left blank then (:) giving me problem so i have done following further process for each date field. In real table all the date fields have data type date.
    declare
    v_my_var date; -- for first date field
    str_dy VARCHAR2(10);
    dt_indx date;
    str_tm VARCHAR2(20);
    tm_indx date;
    begin
    str_dy := :p4_first_date
    str_tm := str_dy||' '||substr(:p8_first_date_hh,1,2)||':'||substr(:p8_first_date_HH,4,2);
    dt_indx := to_date(str_tm,'DD/MM/YYYY HH24:MI');
    IF str_dy is not null then
    v_my_var :=dt_indx;
    ELSE
    v_my_var := NULL;
    END IF;
    update table 1 set my_date = v_my_var where d_id= :p4_d_id;
    end;
    above code work fine but one date field of course therefore i have to do same code for each date field with changes and initialise variable again and again for each field.
    so i like to ask is there any easy way that is more professional. i was thinking about the procedure and using collection or similar but honestly not much experience on that so could some one please help me?
    I will be very thankful.
    KRgds

    Hi,
    You can do the needful by re-using the code if you can give the item names as P8_DATE1, P8_DATE_hh1, P8_DATE2, P8_DATEhh2 etc..So your item name just differs by a sequence.
    Now you write function which will return desired date value taking above items as input. Pass item names to this function, get session state using APEX_UTIL.GET_SESSION_STATE('item_name') API.
    Now modify you code as
    FOR i IN 1..30
    LOOP
    v_date_array[i] = f_get_date('P8_DATE'||i, 'P8_DATEhh'||i);
    END LOOP;
    ....Now you have all date valus in array. Just write one update as follows
    UPDATE  TABLE1
    SET date1 = my_date_array[1], date2 = my_date_array[2]..
    WHERE ....Hope it helps :)
    Cheers,
    Hari

  • I recently updated my primary email address associated with my Apple ID account. When I go to App store on my iPad it still tries to login to the App store using the old email address I had associated with the account, and naturally my password doesn

    I recently updated my primary email address associated with my Apple ID account.
    Now when I go to App store on my iPad it still tries to login to the App store using the old email address I had associated with the account, and naturally my password doesn't work. I can't figure out how to tell my iPad to login using the updated email address.
    So in effect I'm locked out of the app store and I currently have 26 updates waiting.
    I've tried disconnecting and reconnecting my IPad to iCloud with no luck.. However I cloud happens to show the correct/updated email address.
    Does anyone know how to resolve this?
    Thanks

    Did you change the email for the Apple ID or did you create a new Apple ID? A new Apple ID cannot be used with content that was bought using a different Apple ID.
    Changing the email address you use for your Apple ID -
    http://support.apple.com/kb/HT5621

  • I don't know of there is anyone than can fix this age old Apple problem.   Does anyone know how to retrieve things under an old Apple ID when the email used for that account no longer exists? I am trying to update a number of apps that was bought under an

    I don't know of there is anyone than can fix this age old Apple problem.   Does anyone know how to retrieve apps under an old Apple ID when the email used for that account no longer exists & I can't remember the password? After speaking with Apple Acct. Security, I got the security Q right but my birthday was wrong! They wanted the serial number from my phone that was 3 iPhones ago! Seriously??!!
    Any updated way to work around this? No Apple people can correct it.
    Thanks,
    Joe

    You need to ask Apple to reset your security questions. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to call, fill out and submit this form.
    (122986)

  • We used to get a 'whooshing' noise when we sent an eMail using mac Mail. This no longer happens. We recently updated to Mountain Lion 10.8.1  Can anyone throw light  on this please?    David

    We used to get a 'whooshing' noise when we sent an eMail using mac Mail. This no longer happens. We recently updated to Mountain Lion 10.8.1  Can anyone throw light  on this please?    David

    Hi
    I am sorry to see you are having problems with your BT Service
    I suggest you contact the forum mods they should be able to get this problem sorted for you this is a link to them http://bt.custhelp.com/app/contact_email/c/4951
    They normally reply by email or phone directly to you within 3 working days they will take personal ownership of your problem until resolved and will keep you informed of progress
    They are a UK based BT specialist team who have a good record at getting problems solved
    This is a customer to customer self help forum the only BT presence here are the forum moderators
    If you want to say thanks for a helpful answer,please click on the Ratings star on the left-hand side If the reply answers your question then please mark as ’Mark as Accepted Solution’

  • Using an on update or insert trigger on a SAP table

    Hi all,
    A question for you regarding using a database trigger in and SAP system. 
    We are needing to export data for our datawarehouse.  Currently we export all the data.  That data is getting quite large tho and time is becoming an issue.
    One suggestion has been to add a custome field to an existing SAP table to hold a flag to indicate the record has changed but not been extracted.  Thenput a trigger on the table in question so that the new field is updated upon update or insert of the record.  Then when the extract runs, it will only extract those records with the flag set, then reset the flag.
    we are using ERP 6 and SQL Server 2005 (or soon to as we will be upgrading next month).
    Any suggestions regarding triggers?  Or other options for flagging changed records in large table so we don't have to extract all records every time?
    Thanks
    Laurie
    Edited by: Laurie McGinley on Oct 27, 2008 10:51 PM

    Hi Laurie,
    just really shouldn't consider to put triggers into your application.
    The problem here is the very nature of triggers to do things 'in the background'.
    If you have problems due to the trigger, you won't see it anywhere in the SAP environment.
    In a while you probably forget about the trigger at all and then nobody can see, what is happening to the database, just because something is changed "in the background".
    Besides that you don't get support for this from SAP, you will make your life a lot harder.
    Tabledefinitions may change - your trigger might break.
    Put application logic where it belongs - to the application layer!
    regards,
    Lars

  • How to use the mirrored and log shipped secondary database for update or insert operations

    Hi,
    I am doing a DR Test where I need to test the mirrored and log shipped secondary database but without stopping the mirroring or log shipping procedures. Is there a way to get the data out of mirrored and log shipped database to another database for update
    or insert operations?
    Database snapshot can be used only for mirrored database but updates cannot be done. Also the secondary database of log shipping cannot used for database snapshot. Any ideas of how this can be implemented?
    Thanks,
    Preetha

    Hmm in this case I think you need Merge Replication otherwise it breaks down the purpose of DR...again in that case.. 
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Use of the "updlock" hint with update and insert statements

    I have inherited some stored procedures and am trying to figure out why the developers decided to use the "updlock" hint on many of the update and insert statements. I have looked around everywhere and have found only one explanation of why "update...with
    (updlock)" can be useful, namely when a table has no clustered index:
    http://www.sqlnotes.info/2012/10/10/update-with-updlock/ I have found nothing yet that mentions why "insert into...with (updlock)" might be used. I understand why the hint
    might be useful on select statements in some cases, but if all of the tables have clustered indexes, is there any good reason to use it on update and insert statements?
    Thanks,
    Ron
    Ron Rice

    This form of deadlock error can occur on a table which has a clustered index.
    If you are doing updates on a table which has a clustered index and that table also has a nonclustered index and the nonclustered index is used to find the row to update you can see this type of deadlock.  For example create a table with a clustered
    primary key index and a nonclustered index by running
    Create Table Foo(PK int primary key identity, OtherKey varchar(10), OtherData int);
    go
    Insert Foo Default Values;
    go 10000
    Update Foo Set OtherKey = 'C' + Cast(PK As varchar(10))
    Create Unique Index FooIdx On Foo(OtherKey);
    That creates a table with 10000 rows, a clustered index and a nonclustered index.  Then run
    Begin Transaction
    Update Foo Set OtherData = 1 Where OtherKey = 'C5'
    That will use the FooIdx index to find the row that needs to be updated.  It will get a U lock on the index row in the FooIdx index, then an X lock on the row in the clustered index, update that row, then free the U lock on FooIdx, but keep the X lock
    on the row in the clustered index.  (There is other locking going on, but to simplify things, I'm only showing the locks that lead to the deadlock).
    Then in another window, run
    Begin Transaction
    Update Foo Set OtherData = 2 Where OtherKey = 'C5'
    This will get a U lock on the index row in the FooIdx index, then try to get an X lock on the row in the clustered index.  But that row is already exclusively locked, so this second window will wait holding a U lock on FooIdx row and is waiting for
    an X lock on the clustered index row.
    Now go back to the first window and run
    Update Foo Set OtherData = 3 Where OtherKey = 'C5'
    This will once again try to get the U lock on the FooIdx row, but it is blocked by the U lock the second window holds.  Of course the second window is blocked by the X lock on the clustered index row and you have a deadlock.
    All that said, I certainly do not routinely code my updates with UPDLOCK.  I try to design databases and write code so that deadlocks will be rare without holding excessive locks.  The more locks you hold and the longer you hold them, the more
    blocking you will get and the slower your system will run.  So I write code that if a deadlock exception occurs, it is properly handled.  Then if too many deadlocks occur, that is the time to go back to the code to see what changes are needed to
    decrease the number of deadlocks (one way to do that may be to get locks earlier and/or hold them longer. 
    But I wouldn't worry much about this form of deadlock.  It is, in my experience, vary rare.  I don't recall ever seeing it in a production environment.
    Tom

  • I want to use the SQL query IF EXIST to update or insert data in a ms access table, but it doesn´t work

    Hi,
    I want to use the SQL query IF EXIST to update or insert data in a ms access table, but it doesn´t work
    (fault number -2147217900)
    I want to search for a value in a ms access table , if it exist i want to update it, if not i want to insert a new row.
    Working with LabView 7.1, database con. toolset.
    Who can HELP?
    Thanks a lot
    Marco

    Hello,
    I think that If exist is not a standar SQL command (I know it exists I think in Oracle and SQL server), MS access doesn't support it, so I think the best way to do it is first make a Select and then either an Update or an insert, sorry...
    Paulo

  • HT5282 I my safari automatically wiped when i took update. I am using Mac 10.6.8. Can you please send me how to reinstall it. Due to this my mail email system also effected. can you please help me soon

    I my safari automatically wiped when i took update. I am using Mac 10.6.8. Can you please send me how to reinstall it. Due to this my mail email system also effected. can you please help me soon

    The reason Safari "wiped" is unknown, but try reapplying the OS X 10.6.8 Combo update here:
    Mac OS X 10.6.8 Update Combo v1.1
    Your email problems may or may not be related. A more complete explanation of the problem would help.

  • How to update and insert the records without using Table_comparison and Map_operation?

    How to update and insert the records without using Table_comparison and Map_operation?

    Use either join or MERGE see this Inserting, Updating, and Deleting Data by Using MERGE

  • Tip - delete any email address code in the Insert email link prior to use!

    I have been using the email link for a while now. I know its not secure, but in certain cases it can be used - I think.
    Today I found a strange problem.
    I have a recordset with lots of email addresses in it which are shown on an encrypted password and userlevel  protected page.
    The idea is to allow users with fully authorised access to the page to be able to email the other users by clicking on a link and opening their email client.
    The email addresses are displayed as follows on the page:
    <td>Email address:</td>
               <td><?php echo htmlentities($row_clubedit['club_chair_email'], ENT_COMPAT, 'utf-8'); ?></td>
    So after highlighting and copying  the php code, I click on the insert email link in the insert menu.
    The insert panel comes up with some code  in the email link field without me paying any attention to it.
    I paste my code into the text part of the link panel.
    It comes up with the following code:
    <td><a href="mailto:<?php echo $row_joinupset['mail']; ?>"><?php echo htmlentities($row_clubedit['club_chair_email'], ENT_COMPAT, 'utf-8'); ?></a></td>
    Note that thre are now two different recordsets in the email address.These recordsets do exist on the page, but I did not insert the  $row_joinupset['mail'] into the code - Dreamweaver did it.
    Checking further, I find that earlier on the page I had created an email link by the same method using the joinupset recordset. The insert Email Link panel had not cleared the old email address from it's cache, so all the email adresses after the first one pointed to the same email address.
    Because the page showed the correct email address, I did not notice until I tested my code, and found that every one called up the first email address.
    I do not know if this is a bug in Dreamweaver, or why it happens, but it does.
    Tip - delete any code in the email adress field of the insert panel prior to inserting the correct email address code.
    CS5.5 on a 64 bit win 7 machine.

    I have gone though this process yesterday and worked for me.
    I would suggest you to have following things handy before calling Apple
    1. Serial number of apple device which is associated with ur apple id
    2. At least one answer to your old security questions
    3. And you should be logged on to my account page of apple Id so that when customer care demands generation of 4 digit code you can do it.
    This complete process is very simple but may take some time but apple guy was very helpful in my case.
    Also remember the answers to the security questions are case sensitive.
    Good luck

  • Retrieving latest updated or inserted records without using a trigger

    I have to retrieve the latest updated/inserted records from a set of database tables. Say, if 'n' sets of different records have been updated or inserted into one or more different database tables then all the 'n' records of data should be retrieved using a java code without using a trigger.

    helpmeplz wrote:
    Thanks for your reply.
    But I don't know when or from where or what kind of data gets inserted/updated into the tables. I need a listener or a component which can handle events occured on the particular set of database tables, and get the event data. the java code should get the updated/inserted rows that have been inserted into a set of database tables by a third party.
    Please lemme know how I can do this.Realistically you can't.
    If and only if the tables have a modification timestamp then you could use that. Every table would need it.
    Other than that the only othe possibility would require that you keep an entire copy of each table in the memory, poll at a set interval and then do an entire comparison for each table. For very small data volumes (on the target tables) that is practical. For larger volumes it isn't.

  • How can we do policy updations and insertion using procedures in insurence?

    how can we do policy updations and insertion using procedures in insurence?
    please answer for this post i need faced in interview.how can we write the code for that procedure in policy details using procedures in plsql.

    997995 wrote:
    how can we do policy updations and insertion using procedures in insurence?
    please answer for this post i need faced in interview.how can we write the code for that procedure in policy details using procedures in plsql.You are asking about a specific business area (Insurance) and the nuances of that business (Insurance Policies) and providing no technical details about what is required, on a technical forum. There are many varied businesses in the world and not everyone here is going to be familiar with the area of business you are referring to.
    As a technical forum, people are here to assist with technical issues, not to try and help you answer questions in an interview for something you clearly know nothing about, so that you can get a job that you won't know how to do.
    If you have a specific technical issue, post appropriate details, including database version, table structures and indexes, example data and expected output etc. as detailed in the FAQ: {message:id=9360002}

  • HT201270 hi i wanna ask if the update carrier update could affect if i insert another sim and update it..im using softbank but soon i will go back to philippines i wanna use philippine sim,is it possible ? than you

    hi i wanna ask if the update carrier update could affect if i insert another sim and update it..im using softbank but soon i will go back to philippines i wanna use philippine sim,is it possible ? than you

    Softbank does not offer unlocking at all. You can not use that phone with another carrier. Sell it before you leave and buy one you can use in the country where you intend to use it.

Maybe you are looking for

  • Schedule a job on three of 4 databases

    How many OEM repository and Intelligent Agent do I need to have to schedule a unique job on three of the 4 databases I have? Thanks, Mirabelle

  • 0PROD_HIER_ATTR data source not found in the BI content

    Hi, we are trying to load product hierarchy data into sap bi,related to sd,but we dint find any standard data source related to 0PROD_HIER_ATTR in rsa5,but we can find the stadard business content in bi side to the same. we can only find 0PROD_HIER_T

  • Changed number online now phone wont work what do i do?

    my husband went on line and changed to a local number - now the phone wont work... i dont know whats wrong but hes stuck in flordia working third shift and im in sc and the account holder. everytim i call it it goes straight to voicemail and he has m

  • Spliting accounts while running the "Create Intercompany AP Invoices"

    Hi Guys, Need Urgent help if this customization is possible. While creating AP invoice(Intercompany), we want to spllit the account of a line into two, one for the original account and another for IP(Intellectual property), the ratio of splliting wil

  • SAP TDS Advance process

    Hi All, My client doesn't want to use the standard process for Advance TDS Process like F-48, F-54 and F-44 Etc., Can any one worked on the this kind of scenario. If yes can you please provide me the solution. I know if we deviating from standard wil