With this BAPI you can change the specific address for a certainbusiness partner. The system checks that the business partner and theaddress exist, and then checks the new data for consistency andCustomizing settings. Any errors that occur are logged and output 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 youhave entered, either the address of a person or that of an organization is changed.
This function module differs from the standard change BAPIs in that youare not only able to change existing entries, but you can also deleteor 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 other entries that you want to change.
If you do not state an address GUID when you call this function 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 telephone
numbers for a certain address, for example, the UPDATEFLAG field in thereference 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 areference structure bar is flagged with "I", you must also provide
corresponding data for insertion. All new line-type entries that youwant to add, including the related reference structure bars, must beplaced 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, forexample, whether all comments on a telephone number are listed as change data before the comments on the fax number, or vice-versa,unless you completely omit the sequence numbers for communication
addresses or comments, 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:
BAPIAD1VL ADDR_VERS, FROM_DATE
BAPIAD_REM ADDR_VERS, LANGU
BAPICOMREM COMM_TYPE, CONSNUMBER, LANGU
It is possible to transfer blank sequence numbers for communicationaddresses and comments. 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 existingtelephone numbers whose sequence numbers are sorted in ascending order,with this function module you firstly have to transfer a dummytelephone 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 thedatabase are not usually sorted according to sequence numbers. Youtherefore 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 easyto 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 communicationaddresses that you want to create (I), and with the related addresses,
so that the assignment of the communication address to a comment isclear. You only have to make sure that the sequence numbers are not yetin use in the database, unless you explicitly want to assign a comment to an existing communication address. If you omit the number
assignment, the system assumes that all comments to be inserted belongto the communication addresses to be added, and not to existingcommunication addresses. (This would only make sense if you want to adda comment 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 datatransferred. The first German language comment entered on a telephonenumber, that has been flagged for creation (I), is assigned to thefirst telephone number you have said you want to add. The third English
language comment 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 comment to a communicationaddress that already exists. Here you always require the correct sequence number.
If the sequence numbers are filled in the case of one category ofcommunication addresses and their comments, but not with another category, this has no effect on the overall functionality. Allcommunication types are processed separately. In other words, if
complete sequence numbers are stated with a communication type, theyare considered, even if the sequence numbers with another communicationtype 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 youwant to update (U) and delete (D), and vice-versa. Separate processingthen takes place per case (sequence numbers or sequence of data). Onlycommunication addresses that you want to update or delete have to be
transferred together, whereby the sequence numbers have to be completeor 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 function module BAPI_ADDRESSORG_GETDETAIL), in case communication
data should also be changed. This provides you with information on the sequence numbers of communication data.