Skip to Content
author's profile photo Former Member
Former Member

VMD_EI_API & purchasing organization

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jun 06, 2012 at 06:29 AM

    Hi, do you have any ideas ?

    Please help 😭

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.