Creating Vendor using VMD_EI_API not possible
We are developing a portal application so users can create vendors in a more friendly way.
Some users submit the request through the portal, the request is then validated using a workflow in ERP, and if accepted, using VMD_EI_API we create the vendor.
We are facing two issues, related to each other: after the approver approve the vendor, we use the VMD_EI_API class to create the vendor, the immediately return from this call is success (not true), the workflow approver stays confident everything worked fine, but later receive a message from the system with an error saying it was not possible to insert into table LFM1, and the work item already disappeared.
After analyzing the class VMD_EI_API, we found that the class uses BAPI VENDOR_CREATE in update task, meaning the creation process is not synchronous, the error is not explicit about the cause and is not also possible to recover the work item in order to correct the problem and retry.
there is no BAPI to maintain vendors. Therefore, BAPI VENDOR_CREATE does not exists. I guess you talked about VENDOR_INSERT which is an update task function module.
Yes it is true the updates are done in update task.
You may have a look at the following statements, this may help with your current trouble.
COMMIT WORK AND WAIT
SET UPDATE TASK LOCAL
An other remark, if VENDOR_INSERT is failing on LFA1, this usually means that an other records is already existing for the same key (LIFNR)
Hope this helped