[56346] in SAPr3-news
Help with function mocule BAPI_ADDRESSCONTPART_CHANGE
daemon@ATHENA.MIT.EDU (yokie_joe@hotmail.com)
Wed Dec 28 10:55:00 2005
To: sapr3-news@mit.edu
Date: 28 Dec 2005 07:54:47 -0800
From: "yokie_joe@hotmail.com" <yokie_joe@hotmail.com>
Message-ID: <1135785287.771540.314150@g14g2000cwa.googlegroups.com>
Hello all
I am working on a BAPI to receive info from an external system and
either create or maintain Customer data (KNA1, KNVK) on SAP.
I am having a problem with the functionality of the BAPI
BAPI_ADDRESSCONTPART_CHANGE which I call from within my own BAPI.
The problem occurs when I attempt to insert a telephone number and a
mobile number for the contact person.
I create the customer and then attempt to insert the telephone
information using the tables BAPIADTEL and BAPIADTEL_X.
***landline data
IF NOT personal_data-tel1_numbr IS INITIAL.
MOVE: personal_data-tel1_numbr TO BAPIADTEL-telephone,
'X' TO bapiadtel_x-telephone,
'X' TO bapiadtel_x-std_no,
'X' TO bapiadtel_x-r_3_user,
'I' TO bapiadtel_x-updateflag,
'X' TO BAPIADTEL-std_no,
'1' TO BAPIADTEL-r_3_user.
ENDIF.
IF NOT personal_data-tel1_ext IS INITIAL.
MOVE: personal_data-tel1_ext TO BAPIADTEL-extension,
'X' TO bapiadtel_x-extension,
'I' TO bapiadtel_x-updateflag.
ENDIF.
APPEND: bapiadtelx, bapiadtel.
CLEAR: bapiadtelx, bapiadtel.
**mobile number data
MOVE: personal_data-mob_number TO bapiadtel-telephone,
'X' TO bapiadtel_x-telephone,
'X' TO bapiadtel_x-std_no,
'X' TO bapiadtel_x-r_3_user,
'I' TO bapiadtel_x-updateflag,
space TO bapiadtel-std_no,
'3' TO bapiadtel-r_3_user.
APPEND: bapiadtelx, bapiadtel.
CLEAR: bapiadtelx, bapiadtel.
***call Change BAPI
DATA: gobj_type_p LIKE bapi4003_1-objtype_p,
gobj_id_p LIKE bapi4003_1-objkey_p,
gobj_type_c LIKE bapi4003_1-objtype_c,
gobj_id_c LIKE bapi4003_1-objkey_c,
gobj_id_ext LIKE bapi4003_1-extension,
gcontext LIKE bapi4003_1-context,
MOVE: 'BUS1006001' TO gobj_type_p,
knvk-parnr TO gobj_id_p,
'KNA1' TO gobj_type_c,
kunnr TO gobj_id_c,
'0005' TO gcontext.
CALL FUNCTION 'BAPI_ADDRESSCONTPART_CHANGE'
EXPORTING
obj_type_p = gobj_type_p
obj_id_p = gobj_id_p
obj_type_c = gobj_type_c
obj_id_c = gobj_id_c
context = gcontext
TABLES
bapiadtel = bapiadtel
bapiadtel_x = bapiadtelx
return = gt_return.
Prior to calling this code, the customer and contact person have
already been created.
When I use this code, the above BAPI creates the mobile number twice in
the contact person data, and inserts the landline number in the company
contact details. I have tried various combination (example creating the
landline number first and then creating the mobile number) but nothing
seems to work.
Has anyone had this problem and if so, can you tell me the solution
please!!
Thanks and best regards
Kevin