Hi Sigrid,
It has been awhile but I am back working on this task to create a Winshuttle Direct script for our material master. Regarding the ability to add multiple EANs or UOMs in the BAPI, is a loop the only way this is possible on a line by line basis? For example, for every new material we create, we need to add a line in the Unit of Measure table in MM01 for alt UOM values EAI, CV and CVI. In transaction recording, I am able to do this using the technical field name and adding a "(01), (02), (03), etc." next to the fields in our Winshuttle mapping to specify which line I am referring to. Is something like this possible in BAPI_MATERIAL_SAVEDATA? I am trying to avoid loops as they can be messy for our end users when they are populating the data template.
Here is an example in SAP of what I am trying to accomplish in the BAPI during material creation:

Any assistance or input you have is appreciated.
Thanks!
Knavis
------------------------------
Knavis McGowan | Master Data Specialist
ABBOTT RAPID DX INTERNATIONAL LIMITED | (321) 277-1499
------------------------------
Original Message:
Sent: 03-15-2022 10:51
From: Sigrid Kok
Subject: BAPI to Add EAN in MM02
Hi Knavis
The BAPI_MATERIAL_SAVEDATA_RT is for retail, BAPI_MATERIAL_SAVEDATA is for the rest.
Please note, my SAP system doesn't have Function and Material, like I see in yours, so the below suggestions would need to be tested in your system:
You will want to also map the material number in the UOM tables, as well as the Function, which drives whether you're adding, deleting or updating a UOM.
Note in my ECC system that is not retail, I don't have those fields in the tables, but since you do, I would select and map them. It may be

You would map material number in those tables to the same material number field you have in the header.
If you map the Function, you can do a lookup for the values - ECC values below - S/4 has similar choices.

Quick example attached - none-retail ECC system. It will add or update. There are flags in the line items from the "X" table to delete or update. You can hard code them, as needed.

Hope that helps,
Sigrid
------------------------------
Sigrid Kok
PSE | Winshuttle NA
------------------------------