‎2011 Feb 15 2:07 PM
Hi Community,
right now im trying to use the BAPI_BUPA_CENTRAL_CHANGE . Unfortunately it just works partly.
It just works for the information stored in centraldata and centraldataperson.
The information stored in the tables fax, email, uri, etc isnt changed at all although i dont have any entrys in the error tab after the function call!
to mark the x tables i use the following code
DO.
ASSIGN COMPONENT sy-index OF STRUCTURE l_bapifax_x TO <fld>.
IF sy-subrc NE 0.
EXIT.
ENDIF.
<fld> = 'X'.
ENDDO.I although do check wether the updateflag should be set to U for update or I for insert in the next step!
FC looks like this:
CALL FUNCTION 'BAPI_BUPA_CENTRAL_CHANGE'
EXPORTING
businesspartner = im_centraldata_ma-partner
centraldata = l_str_centraldata
centraldataperson = l_str_centraldataperson
centraldata_x = l_centraldata_x
centraldataperson_x = l_centralpers_x
TABLES
faxdatanonaddress = l_tab_fax
uriaddressdatanonaddressx = lt_bapiuri_x
e_maildatanonaddressx = lt_bapiemail_x
faxdatanonaddressx = lt_bapifax_x
e_maildatanonaddress = l_tab_email
uriaddressdatanonaddress = l_tab_uri
return = l_tab_return.To change the address of a specific businessparter i use the bapi BAPI_BUPA_ADDRESS_CHANGE
Here i have the same problem as in the bapi above... the change of adressdata works, the tables except bapiadtel didn't work at all.
CALL FUNCTION 'BAPI_BUPA_ADDRESS_CHANGE'
EXPORTING
businesspartner = im_centraldata_ma-partner
ADDRESSDATA = l_str_addressdata
ADDRESSDATA_X = l_address_x
TABLES
BAPIADTEL = l_tab_phone
* BAPIADFAX = l_tab_fax
* BAPIADSMTP = l_tab_email
* BAPIADURI = l_tab_uri
BAPIADTEL_X = lt_bapitel_x
* BAPIADFAX_X = lt_bapifax_x
* BAPIADSMT_X = lt_bapiemail_x
* BAPIADURI_X = lt_bapiuri_x
RETURN = l_tab_return
.It would be very nice if somebody could help me out. Is there any other / better BAPI for changing E-Mail, URI and FAX of a Businespartner?
Best Regards,
Matthias
‎2011 Feb 15 4:14 PM
Hi Matthias
This is probably the best BAPI to change those fields... Could you please indicate what are you changing with regards to BAPIADTEL (insert or update or delete) and also how you are filling this table?
As per the documentation, the sequence number that does not exist in database must be provided for new entries (are you doing that?)...
‎2011 Feb 15 4:39 PM
Well i do check if there is already a entry for tel number, email , fax of that specific businesspartner in database.
If not i set the updateflag to I that the bapi should insert a new telnumber.
if there is already a telnumber i set the updateflag to U that the bapi changes the existing number.
same for e-mail, uri and fax
the data which should be changed comes from a web dynpro context node to the modify method which im editing.
so all the data is available in import parameters.
the following fields are filled with data:
TYPES l_tab_phone_type TYPE STANDARD TABLE OF bapiadtel.
TYPES l_tab_fax_type TYPE STANDARD TABLE OF bapiadfax.
TYPES l_tab_email_type TYPE STANDARD TABLE OF bapiadsmtp.
TYPES l_tab_uri_type TYPE STANDARD TABLE OF bapiaduri.
DATA: l_sav_msg TYPE bapi_msg,
l_str_centraldata TYPE bapibus1006_central,
l_str_centraldataperson TYPE bapibus1006_central_person,
l_str_addressdata TYPE bapibus1006_address,
l_tab_phone TYPE l_tab_phone_type,
l_tab_fax TYPE l_tab_fax_type,
l_tab_email TYPE l_tab_email_type,
l_tab_uri TYPE l_tab_uri_type,
l_str_phone TYPE bapiadtel,
l_str_fax TYPE bapiadfax,
l_str_email TYPE bapiadsmtp,
l_str_uri TYPE bapiaduri,
l_tab_return TYPE /rsa/c1_tab_return,
l_sav_partner TYPE bu_partner,
l_sav_success TYPE xfeld,
l_str_return TYPE bapiret2.
l_str_phone-r_3_user = im_centraldata_ma-r3_user.
l_str_phone-std_no = 'X'.
l_str_phone-telephone = im_centraldata_ma-tel_number.
l_str_phone-extension = im_centraldata_ma-tel_extens.
APPEND l_str_phone TO l_tab_phone.
l_str_centraldata-searchterm1 = im_centraldata_ma-name_last.
l_str_centraldata-searchterm2 = im_centraldata_ma-name_first.
l_str_centraldata-title_key = im_centraldata_ma-title.
l_str_centraldataperson-title_aca1 = im_centraldata_ma-title_aca1.
l_str_centraldataperson-firstname = im_centraldata_ma-name_first.
l_str_centraldataperson-lastname = im_centraldata_ma-name_last.
l_str_centraldataperson-initials = im_centraldata_ma-initials.
l_str_centraldataperson-correspondlanguage = im_centraldata_ma-langu_corr.
l_str_centraldataperson-nationality = im_centraldata_ma-nationality.
l_str_addressdata-standardaddress = 'X'.
l_str_addressdata-street = im_centraldata_ma-street.
l_str_addressdata-house_no = im_centraldata_ma-house_num1.
l_str_addressdata-postl_cod1 = im_centraldata_ma-post_code1.
l_str_addressdata-city = im_centraldata_ma-city1.
l_str_addressdata-district = im_centraldata_ma-city2.
l_str_addressdata-country = im_centraldata_ma-land1.
l_str_addressdata-region = im_centraldata_ma-region.
l_str_addressdata-comm_type = im_centraldata_ma-deflt_comm.
l_str_phone-r_3_user = im_centraldata_ma-r3_user.
l_str_phone-std_no = 'X'.
l_str_phone-telephone = im_centraldata_ma-tel_number.
l_str_phone-extension = im_centraldata_ma-tel_extens.
APPEND l_str_phone TO l_tab_phone.
l_str_fax-std_no = 'X'.
l_str_fax-fax = im_centraldata_ma-fax_number.
l_str_fax-extension = im_centraldata_ma-fax_extens.
l_str_fax-country = im_centraldata_ma-land1.
l_str_fax-countryiso = l_str_t005-intca.
APPEND l_str_fax TO l_tab_fax.
l_str_email-std_no = 'X'.
l_str_email-e_mail = im_centraldata_ma-smtp_addr.
APPEND l_str_email TO l_tab_email.
l_str_uri-std_no = 'X'.
l_str_uri-uri_type = im_centraldata_ma-uri_type.
l_str_uri-uri = im_centraldata_ma-uri_addr.
APPEND l_str_uri TO l_tab_uri.The Telephone number change isnt working with BAPI_BUPA_CENTRAL_CHANGE
but if i use BAPI_BUPA_ADDRESS_CHANGE it works!
email uri fax isnt working at all...
And i hand over exactly the same data as in central change... so i guess the data is correct?!?
which sequence number?
thanks for your reply!
Edited by: VesperMa on Feb 15, 2011 5:42 PM
‎2011 Feb 15 4:59 PM
If you look at the BAPI documentation for BAPI_BUPA_ADDRESS_CHANGE , you will note that CONSNUMBER is a key field (sequence number)... and it states that you have to enter the sequence number that does not exist in Database...
Also BAPI_BUPA_CENTRAL_CHANGE can update the address-independent telephone data of the business partner. Is your purpose to change the address independent telephone data?
‎2011 Feb 16 12:07 PM
At first thaks for your help!
As far as i know in this case it doesnt matter if the telephone number is address independend or not.
it just works to change the number with BAPI_BUPA_ADDRESS_CHANGE so its fine.
I tried to insert, modify address independend numbers with BAPI_BUPA_CENTRAL_CHANGE but it didnt work even though i entered the CONSNUMBER.
As address dependened telephone number works for me, i might try to fix the e-mail, uri and mail address problem at first.
Do you have any hints to this?