cancel
Showing results for 
Search instead for 
Did you mean: 

modify business partner address

Former Member
0 Kudos

Hi guy

i need to modify an exist business partner address, i tried to use BUPA_ADDRESS_CHANGE but i don't know ho to use this function, i try to do this:

CALL FUNCTION 'BUPA_ADDRESS_CHANGE'

EXPORTING

IV_PARTNER = businesspartner

  • IV_PARTNER_GUID =

  • IV_ADDRNUMBER = EXTADDRESSNUMBER

  • IV_ADDRGUID =

IS_ADDRESS = gs_addressdata

  • IS_ADDRESS_X =

  • IV_DUPLICATE_MESSAGE_TYPE =

  • IV_ACCEPT_ERROR = ' '

  • IV_X_SAVE = 'X'

  • IV_CHECK_ADDRESS = 'X'

TABLES

IT_ADUSE = gt_addressusage

ET_RETURN = return

can you help me? thanks

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Luca,

the definition of the fields are:

DATA: ls_addressdata TYPE bapibus1006_address.

DATA: ls_addressdata_x TYPE bapibus1006_address_x.

Example for changing the field LANGE:

ls_addressdata-langu = lv_langu.

ls_addressdata_x-langu = 'X'.

Hope it helps.

Regards,

André

former_member188685
Active Contributor
0 Kudos

Hi,

You can try the above suggested BAPI also.any way in your example you have to pass these..

CALL FUNCTION 'BUPA_ADDRESS_CHANGE'
EXPORTING
IV_PARTNER = businesspartner
<b>IS_ADDRESS = gs_addressdata
IS_ADDRESS_X = gs_addressdataX</b>
TABLES
<b>IT_ADUSE = gt_addressusage
IT_ADUSE_X  = gt_addressusageX</b>
ET_RETURN = return

in this gs_addressdataX you need to mark with the 'X' for the fields which you are updating the address.

similarly for this table parmeter IT_ADUSE_X also.

i hope it is clear.

Regards

vijay

former_member188685
Active Contributor
0 Kudos

Hi,

if you have say 5 records in gt_addressusage table then

for all the records you need to mark the other fields as 'X' and BU_UPDFLAG as 'U' in gt_addressusageX table.

gt_addressusageX-BU_UPDFLAG = 'U' ." if you are updating

Regards

vijay

Former Member
0 Kudos

thanks Vijay now this bapi work fine!!!!

former_member188685
Active Contributor
0 Kudos

Hi LUca,

Please Reward the points for helpful answers, if your Problem solved completely, Choose the Radio Button Against the Post.

Thansks and Regards

vijay

Former Member
0 Kudos

Hi Luca,

in our project we always use the following BAPI:

CALL FUNCTION 'BAPI_BUPA_ADDRESS_CHANGE'

EXPORTING

businesspartner = lv_partner

addressdata = l_str_adresse

addressdata_x = l_str_adresse_x

TABLES

return = lt_return.

It works without any problems.

I hope it will help you.

Kind regards,

André

Former Member
0 Kudos

Thanks Oliver and Andrè,

Oliver i don't have any documentation about this bapi on my system, may you send me this documentation? thanks.

Andrè, how is valued addessdata_x?

former_member188685
Active Contributor

Hi Luca,

Check my Previous reply to fill the addressdata_x

suppose if you are changing the address of these fields..

then

i assume these fields only you are updating, using the <b>gs_addressdata</b> then

addressdata_x-C_O_NAME = 'X'.

addressdata_x-CITY = 'X'.

addressdata_x-DISTRICT = 'X'.

addressdata_x-REGIOGROUP = 'X'.

addressdata_x-POSTL_COD1 = 'X'.

addressdata_x-POSTL_COD2 = 'X'.

addressdata_x-PO_BOX = 'X'.

and now pass this ...

CALL FUNCTION 'BUPA_ADDRESS_CHANGE'
EXPORTING
IV_PARTNER = businesspartner
<b>IS_ADDRESS = gs_addressdata
IS_ADDRESS_X = addressdata_X</b>
TABLES
<b>IT_ADUSE = gt_addressusage
IT_ADUSE_X  = gt_addressusageX</b>
ET_RETURN = return

similarly the gt_addressusage and gt_addressusageX you need to mark against for each record loop that and mark gt_addressusageX fields as 'X'.

FU BAPI_BUPA_ADDRESS_CHANGE

____________________________________________________

Text

SAP BP, BAPI: Change Address

Functionality

With this BAPI you can change the relevant address for the business partner in question.

The system checks that the business partner and the address exist, and then checks the new data for consistency and Customizing settings. Any errors that occur are logged and issued in the RETURN table. If any of the checks run across errors, the address changes are not carried out.

Depending on the business partner category of the business partner you have entered, either the address of a person or that of an organization is changed.

This module differs from the standard change BAPIs in that you are not only able to change existing entries, but you can also delete or add telephone numbers and fax numbers, and so on, that are appended to an address as attributes.

Use reference structure bars (check bars) to select entries that you want to change.

If the appropriate settings have been made in the system, a duplicate check is carried out when an address is changed. If a record that is to be created is recognized as already existing in the system, the addresses that are similar to this record are stated in the table ADDRESSDUPLICATES. If the tool used for the duplicate check offers the possibility, the probability in percent of the current record being a duplicate is stated in the table ADDRESSDUPLICATES.

In order to maintain international address versions, use the tables BAPIADVERSORG, BAPIADVERSORG_X and BAPIADVERSPERS or BAPIADVERSPERS_X. You can maintain international address versions for organizations and groups with the tables BAPIADVERSORG and BAPIADVERSORG_X. You maintain international address versions for persons with the tables BAPIADVERSPERS and BAPIADVERSPERS_X.

At present you only extend existing addresses by way of address versions. Address versions are inserted (I), changed (U) or deleted (D) using the change indicator (BAPIADVERSORG_X-UPDATEFLAG or BAPIADVERSPERS_X-UPDATEFLAG).

Notes

If you do not state an address GUID when you call this module, the system assumes that you want to change the standard address of this business partner.

If you want to delete a telephone number in the table of existing telephone numbers for a certain address, for example, the UPDATEFLAG field in the reference structure bar of the corresponding line must contain a "D". If you want to add an entry, this field has to contain an "I". When a reference structure bar is flagged with "I", you must also provide corresponding data for insertion. All new line-type entries that you want to add, including the related reference structure bars, must be placed after all the entries you want to change (U) and delete (D).

With change data, the key fields must always be filled with data, and will be considered as far as possible. It is thus of no importance, for example, whether all remarks for a telephone number are listed as change data before the remarks for the fax number, or vice-versa, unless you completely omit the sequence numbers for communication addresses or remarks, or only state them in part. In this case, the sequence of data plays a major role.

The following fields are regarded as being key fields:

Structure Fields

BAPIAD1VL ADDR_VERS, FROM_DATE

BAPIAD_REM ADDR_VERS, LANGU

BAPIADTEL CONSNUMBER

... ...

BAPIADPAG CONSNUMBER

BAPICOMREM COMM_TYPE, CONSNUMBER, LANGU

It is possible to transfer blank sequence numbers for communication addresses and remarks. In this case, the sequence in which the data was transferred counts. For example, if you want to delete the telephone number that is in second position in the list of existing telephone numbers whose sequence numbers are sorted in ascending order, with this function module you firstly have to transfer a dummy telephone number line with the update flag (U), without marking fields for updating, and then you have to transfer a telephone number line with the deletion flag (D).

You should be aware that the communication addresses stored in the database are not usually sorted according to sequence numbers. You therefore first have to determine the sequence of the communication addresses sorted according to sequence numbers. You are advised not to follow the above procedure, as it is very easy to make mistakes when assigning data. It is much safer to enter the sequence numbers as the key.

You should assign your own sequence numbers with communication addresses that you want to create (I), and with the related addresses, so that the assignment of the communication address to a remark is clear. You only have to make sure that the sequence numbers are not yet in use in the database, unless you explicitly want to assign a remark to an existing communication address. If you omit the number assignment, the system assumes that all remarks to be inserted belong to the communication addresses to be added, and not to existing communication addresses. (This would only make sense if you want to add a remark in a different language to the one in which a communication address was created).

Assignment takes place exclusively by way of the sequence of the data transferred. The first German language remark entered for a telephone number, that has been flagged for creation (I), is assigned to the first telephone number you have said you want to add. The third English language remark on a fax number with the insertion flag (I) is assigned to the third fax number you have said you want to add.

In this case, it is not possible to add a remark to a communication address that already exists. Here you always require the correct sequence number.

If the sequence numbers are filled in the case of one category of communication addresses and their remarks, but not with another category, this has no effect on the overall functionality. All communication types are processed separately. In other words, if complete sequence numbers are stated with a communication type, they are considered, even if the sequence numbers with another communication type are missing in full or part. In the latter two cases, the sequence of data to be processed is used.

You can state the sequence numbers with the communication addresses you want to insert (I), and omit them with the communication addresses you want to update (U) and delete (D), and vice-versa. Separate processing then takes place per case (sequence numbers or sequence of data). Only communication addresses that you want to update or delete have to be transferred together, whereby the sequence numbers have to be complete or not exist at all. To be on the safe side you should always state complete sequence numbers with all data.

Data that you want to change should be read in advance (for example, with FM BAPI_ADDRESSORG_GETDETAIL), in case communication data should also be changed. This provides you with information on the sequence numbers of communication data.

Parameters

BUSINESSPARTNER

ADDRESSGUID

ADDRESSDATA

ADDRESSDATA_X

DUPLICATE_MESSAGE_TYPE

ACCEPT_ERROR

BAPIADTEL

BAPIADFAX

BAPIADTTX

BAPIADTLX

BAPIADSMTP

BAPIADRML

BAPIADX400

BAPIADRFC

BAPIADPRT

BAPIADSSF

BAPIADURI

BAPIADPAG

BAPIAD_REM

BAPICOMREM

ADDRESSUSAGE

BAPIADVERSORG

BAPIADVERSPERS

BAPIADTEL_X

BAPIADFAX_X

BAPIADTTX_X

BAPIADTLX_X

BAPIADSMT_X

BAPIADRML_X

BAPIADX40_X

BAPIADRFC_X

BAPIADPRT_X

BAPIADSSF_X

BAPIADURI_X

BAPIADPAG_X

BAPIAD_RE_X

BAPICOMRE_X

ADDRESSUSAGE_X

BAPIADVERSORG_X

BAPIADVERSPERS_X

RETURN

ADDRESSDUPLICATES

Exceptions

Function Group

BUBA_3

Regards

vijay

oliver
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Luca,

maybe you should try its remote brother called

BAPI_BUPA_ADDRESS_CHANGE.

It's much better documentated, at least in the ECC 6.0 that i 've in front of me. Just press on the button "Function Module Documentation" and you get a very detailed explanaition on how this works. If you don't have the documentation in your system, i can also send it to you by mail.

Regards,

Oliver