06-04-2012 2:43 PM
Hello Everyone,
I'm trying to extend the vendor to another purchasing organization using vmd_ei_api=>maintain_bapi.
The problem is that it cannot be done, because some partner functions are missing,
which is actually not true as they have been supplied to BAPI.
I have no problem creating vendor (it works well) - even at this point I can add purchasing organization.
It is not possible to add one AFTER vendor has been created.
Please Help!
Here is the sample of code :
REPORT /abbmdwf/ztestwk.
DATA : vendor TYPE vmds_ei_main,
simulation TYPE char1,
vendor_ok TYPE vmds_ei_main,
vendor_err TYPE vmds_ei_main,
vendor_ok_message TYPE cvis_message,
vendor_err_message TYPE cvis_message.
DATA v TYPE vmds_ei_extern.
DATA postal TYPE cvis_ei_1vl.
DATA p TYPE vmds_ei_purchasing.
DATA f TYPE vmds_ei_functions.
v-header-object_task = 'U'.
v-header-object_instance-lifnr = '0000000405'.
v-central_data-central-data-ktokk = '0001'.
p-task = 'I'.
p-data_key-ekorg = '3000'.
p-data-verkf = 'qq verk'.
f-task = 'I'.
f-data_key-parvw = 'LF'.
f-data-partner = '0000000405'.
APPEND f TO p-functions-functions.
APPEND p TO v-purchasing_data-purchasing.
APPEND v TO vendor-vendors.
SET UPDATE TASK LOCAL.
CALL METHOD vmd_ei_api=>maintain_bapi
EXPORTING
iv_test_run = simulation
iv_collect_messages = 'X'
is_master_data = vendor
IMPORTING
es_master_data_correct = vendor_ok
es_message_correct = vendor_ok_message
es_master_data_defective = vendor_err
es_message_defective = vendor_err_message.
IF vendor_err_message-is_error IS INITIAL.
COMMIT WORK.
ENDIF.
REPORT /abbmdwf/ztestwk.
DATA : vendor TYPE vmds_ei_main,
simulation TYPE char1,
vendor_ok TYPE vmds_ei_main,
vendor_err TYPE vmds_ei_main,
vendor_ok_message TYPE cvis_message,
vendor_err_message TYPE cvis_message.
DATA v TYPE vmds_ei_extern.
DATA postal TYPE cvis_ei_1vl.
DATA p TYPE vmds_ei_purchasing.
DATA f TYPE vmds_ei_functions.
v-header-object_task = 'U'.
v-header-object_instance-lifnr = '0000000405'.
v-central_data-central-data-ktokk = '0001'.
p-task = 'I'.
p-data_key-ekorg = '3000'.
p-data-verkf = 'qq verk'.
f-task = 'I'.
f-data_key-parvw = 'LF'.
f-data-partner = '0000000405'.
APPEND f TO p-functions-functions.
APPEND p TO v-purchasing_data-purchasing.
APPEND v TO vendor-vendors.
SET UPDATE TASK LOCAL.
CALL METHOD vmd_ei_api=>maintain_bapi
EXPORTING
iv_test_run = simulation
iv_collect_messages = 'X'
is_master_data = vendor
IMPORTING
es_master_data_correct = vendor_ok
es_message_correct = vendor_ok_message
es_master_data_defective = vendor_err
es_message_defective = vendor_err_message.
IF vendor_err_message-is_error IS INITIAL.
COMMIT WORK.
ENDIF.
06-06-2012 7:29 AM
06-06-2012 7:29 AM
06-06-2012 10:29 AM
Finally I did it.
CURRENT_STATE flag is needed to set it to X if you are inserting a new records for partner functions
The path for the flag :
VENDOR-PURCHASING_DATA-PURCHASING-CURRENT_STATE
09-28-2023 6:21 PM
Hi,
Using VENDOR-PURCHASING_DATA-CURRENT_STATE = "X' is not working. Not able to extend the Purchase Organization.
Can you help please?
Thanks.