‎2012 Feb 14 3:31 PM
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
‎2012 Feb 22 10:00 AM
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.
‎2012 Feb 14 6:30 PM
Not sure if this is really the issue, but shouldn't you say
f_bapicomrex-comm_notes = 'X'.instead of
f_bapicomrex-comm_notes = gf_file-remarks.?
If for some reason this FM doesn't work (although it really should), take a look at [this|http://forums.sdn.sap.com/thread.jspa?threadID=2124356] thread... you can probably use function module SD_CUSTOMER_MAINTAIN_ALL. The last post talks about the necessary calling details for structure KNVK where the notes are.
‎2012 Feb 15 3:46 AM
Hi Vijay,
I will suggest you try with sd_customer_maintain_all .
Regards,
Madhu.
‎2012 Feb 15 6:18 AM
Hi,
After fetching the address details, as you want to update address details, first delete the existing data by passing
updateflag = 'D'.
Then move the required data to respective fields and then pass updateflag = 'U'.
bapicomre_x-langu = 'E'.
BAPICOMREM-ERRORFLAG = 'X'
don't use these fields bapicomre_x-langu_iso
BAPICOMREM-langu_iso
Still any issues , revert to me .
Edited by: Parupelly on Feb 15, 2012 11:48 AM
‎2012 Feb 22 7:12 AM
Hi Parupally,
Can you please send me the full code if you have with you?So that i can understand clearly?
Thank you,
Vijay.
‎2012 Feb 22 8:26 AM
Hi,
Once go through function module BAPI_ADDRESSORG_CHANGE documentation
‎2012 Feb 22 10:00 AM
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.