We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

[sap-dev] Update Phone Number of a Customer by BAPI_CUSTOMER_CHANGEFROMDATA1

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Question from apicaud on Jul 3 at 9:08 AM
Hello,
I use the bapi BAPI_CUSTOMER_CHANGEFROMDATA1 to change the fax and phone number
The code is :
CALL FUNCTION 'BAPI_CUSTOMER_GETDETAIL1'
EXPORTING
customerno = l_code_client
pi_salesorg = l_salesorg
pi_distr_chan = l_vtweg
pi_division = l_spart
IMPORTING
pe_personaldata = l_st_personaldata
pe_personaldata_new = l_st_personaldatanew
return = g_return1.
IF g_return1-type = 'E'.
<fs_adresse>-type_erreur = 'E'.
<fs_adresse>-message_erreur = g_return1-message.
CONTINUE.
ENDIF.

l_st_personaldata-currency = l_waers.

IF <fs_adresse>-num_tel IS NOT INITIAL.
l_st_personaldatax-tel1_numbr = 'X'.
TRANSLATE <fs_adresse>-num_tel USING l_changetel.
l_st_personaldata-tel1_numbr = <fs_adresse>-num_tel.
ENDIF.
IF <fs_adresse>-num_fax IS NOT INITIAL.
l_st_personaldatax-fax_number = 'X'.
TRANSLATE <fs_adresse>-num_fax USING l_changetel.
l_st_personaldata-fax_number = <fs_adresse>-num_fax.
l_courriel = l_st_personaldata-e_mail.
TRANSLATE l_courriel TO LOWER CASE.
SEARCH l_courriel FOR '@fax'.
IF sy-subrc = 0 OR l_st_personaldata-e_mail IS INITIAL.
CONDENSE <fs_adresse>-num_fax NO-GAPS.
CONCATENATE <fs_adresse>-num_fax c_fax_suffix INTO l_st_personaldata-e_mail.
l_st_personaldatax-e_mail = 'X'.
ENDIF.
ENDIF.
CALL FUNCTION 'BAPI_CUSTOMER_CHANGEFROMDATA1'
EXPORTING
pi_personaldata = l_st_personaldata
pi_personaldatax = l_st_personaldatax
pi_salesorg = l_salesorg
pi_distr_chan = l_vtweg
pi_division = l_spart
customerno = l_code_client
IMPORTING
return = g_return1.


The BAPI update the customer but the final resul is not correct.
Name1, Name2 and sort1 are also modified.
Why ?
When I tried the same bapi why companydata, I have other issues.
Have you and idea to update only fax and phone number of a customer.
For email, we change directly in adr6 table.
Regards,
Antoine
 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2012 Toolbox.com and message author.
Toolbox.com 4343 N. Scottsdale Road Suite 280, Scottsdale, AZ 85251
apicaud  
Project Leader
 
View this online
Ask a new question
 
In the Spotlight
Earn Recognition for Your Contributions at Toolbox for IT. Gain Points for Community Achievements

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language