Automate

 View Only
  • 1.  BAPI to Add EAN in MM02

    Posted 03-14-2022 17:01
    Hi all,

    I am looking to create a BAPI (Winshuttle Direct) script to Add EANs to materials in MM02. I was not able to find this specific example in this Winshuttle community forums. I am also not very well versed in creating the Winshuttle Direct scripts. My first question is which BAPI should I use - BAPI_MATERIAL_SAVEREPLICA or BAPI_MATERIAL_MAINTAINDATA_RT? It is my understanding that BAPI_MATERIAL_SAVEDATA cannot have the data validated or tested before running so I would not like to use this one. My second question would be the structure of the BAPI. I have created one (attached) but cannot seem to get it to run without receiving an error with it. I included the fields from the Head Data, Material Desc. Table, UOM Table and UOMX Table.

    Any advice or assistance is much appreciated.

    Thanks,
    Knavis

    ------------------------------
    Knavis McGowan | Master Data Specialist
    ABBOTT RAPID DX INTERNATIONAL LIMITED | 3212771499
    ------------------------------


  • 2.  RE: BAPI to Add EAN in MM02

    Posted 03-15-2022 05:39
    Hi Knavis,
    Not sure what exactly you want to achieve with this script, our SAP system is setup differently so I can't test this script, but you may want to upload the UNITSOFMEASUREX from your column C too, introducing the same value as UNITSOFMEASURE. I'm running Studio 12.1, so that will be different from your Studio 20.1 but running these BAPI's never can have data tested before running. So I'm using BAPI_MATERIAL_SAVEDATA for all MM uploads.
    best regards, jan


    ------------------------------
    jan ketele | Sr engineer release mgt
    Xeikon Manufacturing NV | +3234431875
    ------------------------------



  • 3.  RE: BAPI to Add EAN in MM02

    Employee
    Posted 03-15-2022 10:52
    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
    ------------------------------



  • 4.  RE: BAPI to Add EAN in MM02

    Posted 08-30-2022 12:46
    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
    ------------------------------



  • 5.  RE: BAPI to Add EAN in MM02

    Employee
    Posted 08-31-2022 09:30
    Hi Knavis
    You can copy and paste the group/table name in expert mode in the BAPI and create additional input fields going across instead of in a loop.  You'd have to choose a maximum number to support and should likely use IF logic in case it's blank.

    Also please address your questions to the community.  There are a lot of great people on here who have a vast set of knowledge and may be able to address your question more quickly.
    Hope that helps,
    Sigrid

    ------------------------------
    Sigrid Kok
    PSE | Winshuttle NA
    ------------------------------



  • 6.  RE: BAPI to Add EAN in MM02

    Posted 08-31-2022 15:49
    Here is a BAPI we use for Alt UOM creation in material master. 
    I think it can be adjusted to meet you needs.

    ------------------------------
    Dave Kelly | Sr Data Analyst/ Winshuttle Developer
    Dorman Products Inc. | (215) 712-5256dkelly@dormanproducts.com
    ------------------------------

    Attachment(s)

    xlsx
    Alt_UOM_template.xlsx   30 KB 1 version


  • 7.  RE: BAPI to Add EAN in MM02

    Posted 09-08-2022 13:40
    Thank you both, I used a combination of both chunks of information provided and was able to successfully create a material script that lists out multiple rows of alt. UOMs. 

    Thanks!
    Knavis

    ------------------------------
    Knavis McGowan | Master Data Specialist
    ABBOTT RAPID DX INTERNATIONAL LIMITED | (321) 277-1499
    ------------------------------