Fonction SAP BAPI_ADDRESSCONTPART_CHANGE - BAPI to change contact person addresses

Paramètre Reférence Type Long. Valeur par déf. Facultatif Description
ACCEPT_ERROR BAPI4003_1-ACCEPT_ERR C 1 SPACE X Regional structure error messages as warning
CONTEXT BAPI4003_1-CONTEXT N 4 5 X Semantic meaning of the addresses (-> constants)
IV_CHECK_ADDRESS BAPI4003_1-CHECK_ADDR C 1 'X' X Indicator: Check Address?
IV_TIME_DEPENDENT_COMM_DATA BAPI4003_1-TIMEDEPCOM C 1 SPACE X Indicator: Take time validity for communication data into account
OBJ_ID_C BAPI4003_1-OBJKEY_C C 70 BOR company address owner object key
OBJ_ID_EXT BAPI4003_1-EXTENSION C 70 SPACE X BOR object key extension (GUID)
OBJ_ID_P BAPI4003_1-OBJKEY_P C 70 Person object BOR object key
OBJ_TYPE_C BAPI4003_1-OBJTYPE_C C 10 Company address owner BOR object type
OBJ_TYPE_P BAPI4003_1-OBJTYPE_P C 10 Person object BOR object type
SAVE_ADDRESS BAPI4003_1-SAVE_ADDR C 1 'X' X Indicator: Save Address?

Paramètre Reférence Type Long. Description
ADDRESS_NUMBER BAPI4003_1-ADDR_NO C 10 Address number in target system
PERSON_NUMBER BAPI4003_1-PERS_NO C 10 Person number in target system

Paramètre Reférence Long. Facultatif Description
BAPIAD3VL BAPIAD3VL 603 X BAPI structure contact person address (w/o. comm.)
BAPIAD3VL_X BAPIAD3VLX 39 X Change reference structure for BAPIAD1VL
BAPIADFAX BAPIADFAX 143 X BAPI structure fax numbers
BAPIADFAX_X BAPIADFAXX 16 X Change reference structure for BAPIADFAX
BAPIADPAG BAPIADPAG 136 X BAPI structure pager numbers
BAPIADPAG_X BAPIADPAGX 15 X Change reference structure for BAPIADPAG
BAPIADPRT BAPIADPRT 40 X BAPI structure printer addresses
BAPIADPRT_X BAPIADPRTX 9 X Change reference structure for BAPIADPRT
BAPIADRFC BAPIADRFC 69 X BAPI structure RFC addresses
BAPIADRFC_X BAPIADRFCX 10 X Change reference structure for BAPIADRFC
BAPIADRML BAPIADRML 63 X BAPI structure R/Mail addresses
BAPIADRML_X BAPIADRMLX 13 X Change reference structure for BAPIADRML
BAPIADSMTP BAPIADSMTP 300 X BAPI structure internet addresses
BAPIADSMT_X BAPIADSMTX 13 X Change reference structure for BAPIADSMTP
BAPIADSSF BAPIADSSF 2391 X BAPI structure SSF addresses
BAPIADSSF_X BAPIADSSFX 22 X Change reference structure for BAPIADSSF
BAPIADTEL BAPIADTEL 142 X BAPI structure telephone numbers
BAPIADTEL_X BAPIADTELX 15 X Change reference structure for BAPIADTEL
BAPIADTLX BAPIADTLX 72 X BAPI structure telex numbers
BAPIADTLX_X BAPIADTLXX 12 X Change reference structure for BAPIADTLX
BAPIADTTX BAPIADTTX 72 X BAPI structure teletex numbers
BAPIADTTX_X BAPIADTTXX 12 X Change reference structure for BAPIADTTX
BAPIADURI BAPIADURI 2219 X BAPI structure URI addresses
BAPIADURI_X BAPIADURIX 19 X Change reference structure for BAPIADURI
BAPIADUSE BAPIADUSE 46 X BAPI Structure for Communication Usages (BAS)
BAPIADUSE_X BAPIADUSEX 7 X Change Reference Structure for BAPIADUSE
BAPIADX400 BAPIADX400 948 X BAPI structure X400 addresses
BAPIADX40_X BAPIADX40X 36 X Change reference structure for BAPIADX400
BAPICOMREM BAPICOMREM 60 X BAPI Structure Communication Comments
BAPICOMRE_X BAPICOMREX 6 X Change reference structure for BAPICOMREM
RETURN BAPIRET2 548 X Message/error return table

Functionality
The contact person address is determined from the specified objecttypes and the object key, and is updated with the specified address andcommunication data, if required.
This module differs from a standard change BAPI in that not only canexisting entries be changed, but also telephone number, fax number,etc. address attributes, can be deleted or added.
Reference structures (checkboxes) are used to select entries to bechanged.

Example
* Change a contact person address:
* Change, delete and add a telephone number
DATA: objtype_p LIKE bapi4003_1-objtype,
obj_id_p LIKE bapi4003_1-objkey,
objtype_c LIKE bapi4003_1-objtype,
obj_id_c LIKE bapi4003_1-objkey,
obj_id_ext LIKE bapi4003_1-extension,
context LIKE bapi4003_1-context,
address_number LIKE adrc-addrnumber,
person_number LIKE adrp-persnumber,
bapiadtel LIKE bapiadtel OCCURS 0 WITH HEADER LINE,
bapiadtel_x LIKE bapiadtelx OCCURS 0 WITH HEADER LINE,
return LIKE bapiret2 OCCURS 0.
* Choose the following customer contact person address object types and
* object key:
objtype_p = 'BUS1006001'
obj_id_p =
objtype_c = 'KNA1'
obj_id_c =
obj_id_ext = ' '
context = '0005'
* Get existing data by calling, e.g. FM 'BAPI_ADDRCONTPART_GETDETAIL'
...
* Enter reference structure data
* The telephone number with serial number '002' is to be deleted and
* that with serial number '003' updated
CLEAR: bapiadtel[], bapiadtel_x[].
CLEAR: bapiadtel, bapiadtel_x.
bapiadtel-consnumber = '002'.
bapiadtel_x-updateflag = 'D'.
APPEND: bapiadtel, bapiadtel_x. "Delete entry
CLEAR: bapiadtel, bapiadtel_x.
bapiadtel-consnumber = '003'.
bapiadtel-extension = '77733'.
bapiadtel_x-extension = 'X'.
bapiadtel_x-updateflag = 'U'.
APPEND: bapiadtel, bapiadtel_x. "Update entry
CLEAR: bapiadtel, bapiadtel_x.
bapiadtel-telephone = '06227'.
bapiadtel-extension = '11111'.
bapiadtel_x-updateflag = 'I'.
APPEND: bapiadtel, bapiadtel_x. "Insert new entry
* call change module
CALL FUNCTION 'BAPI_ADDRCONTPART_CHANGE'
EXPORTING
obj_type_p = objtype
obj_id_p = obj_id
obj_type_c = objtype
obj_id_c = obj_id
obj_id_ext = obj_id_ext
context = context
IMPORTING
address_number = address_number
person_number = person_number
TABLES
bapiadtel = bapiadtel
bapiadtel_x = bapiadtel_x
return = return.
* Get errors and warnings from the RETURN table.
* If successful, the contact person address and communication data is
* now updated in the system.
* The address number is in the ADDRESS_NUMBER field and the person
* number in the PERSON_NUMBER field.

Notes
To delete, e.g. a telephone number in the table of existing telephonenumbers of an address, the 'UPDATEFLAG' field in the referencestructure must contain a 'D' in the appropriate line.
To add an entry, it must contain 'I' and the data to be inserted mustbe passed.
All lines to be inserted (I) and their reference structures must beafter all change (U) and delete (D) entries.
The change reference structure and data sequence is significant, andmust be the same as the sequence of data to be changed, sorted byserial numbers, in the system.
Change data key fields must always be filled, and are taken intoaccount as far as possible. It is not significant whether, e.g. alltelephone number change comments are followed by fax number changecomments, or vice versa; only the sequence within entries with the samekey is important, unless the communication address or comment serialnumbers are only partially or not specified, in which case the datasequence is significant.
The key fields are:
Structure | Fields
---------------------------------
BAPIAD3VL | ADDR_VERS, FROM_DATE
BAPIADTEL | CONSNUMBER
... | ...
BAPIADPAG | CONSNUMBER
BAPICOMREM | COMM_TYPE, CONSNUMBER, LANGU
You can pass the communication address and comment serial numbersempty, in which case the sequence of the data passed is significant, sofor example if you want to delete the telephone number in the secondposition in the in ascending order of serial numbers sorted existingtelephone numbers, from the database, you must pass a dummy telephonenumber with update flag (U) in the first position, without selectingfields to update, and a telephone number with delete flag (D) in thesecond position.
The communication addresses in the database are usually not sorted byserial numbers, so you must first determine the sequence of thecommunication addresses sorted by serial numbers.
This procedure is not advisable because it is easy to make mistakes inthe data sequence. Specifying the serial number as key is safer.
You should assign your own serial numbers for communication addressesand their comments to be inserted (I), so that the communicationaddress - comment assignment is clear. Ensure that the serial numbersare not already used in the database, unless you want to assign acomment explicitly to an existing communication address. If you assignno numbers, it is assumed that all comments to be inserted belong tothe communication addresses to be inserted, and they are assigned bythe sequence of the data passed. (This would be appropriate if acomment in another language than the creation language is to assignedto a communication address.)
Then the first telephone number comment in German flagged for insertion(I) is assigned to the first telephone number to be inserted. The thirdfax number comment in English to be inserted (I) is assigned to thethird fax number to be inserted specified.
You cannot assign a comment to an existing communication address inthis way. You need the correct serial number.
If one type of communication address and its comments has serialnumbers and another does not, this does not affect the overallfunctionality. All communication types are processed separately, i.e.if all addresses of a communication type have serial numbers, they areused, even if there are no serial numbers for all or some addresses ofanother communication type. The addresses of such communication typesare processed in the order of their data.
You can specify serial numbers for communication addresses to beinserted (I) and omit them for communication addresses to be updated(U) and deleted (D), and vice versa. They are processed separatelyusing serial numbers or the data sequence as appropriate. Communicationaddresses to be updated (U) or delete (D) must both be passed eithercompletely with or completely without serial numbers.
You are on the safe side if you always pass a serial number.
You must first read the data to be changed (e.g. with FMBAPI_ADDRESSCONTPART_GETDETAIL) if you also want to changecommunication data, to get the communication data serial numbers.
The address number of the organization for the object type and objectkey is returned in the export parameter ADDRESS_NUMBER, the contactperson number im the PERSON_NUMBER field.
Processing warnings and errors are in the RETURN table.
INCLUDE ADDRESS_TSADOBJ_AND_BAPIS OBJECT DOKU ID TX
INCLUDE ADDR_NO_COMMIT_IN_BAPI OBJECT DOKU ID TX
INCLUDE ADDR_RETURN_CONSNUMBERS OBJECT DOKU ID TX
INCLUDE ADDRESS_CONSNUMBERS_IN_BAPIS OBJECT DOKU ID TX

Description
If the ACCEPT_ERROR parameter is set, all regional structure checkerror messages are treated as warnings.

Value range
'X': treat all errors as warnings
' ': treat errors as errors

Default
The flag is not set, i.e. is ' '.