Automate

 View Only
  • 1.  Material BAPI - Plant Extension

    Posted 11-15-2022 11:15
    Hello all,

    I am attempting to create a script for material plant extension. I began this process using Winshuttle Direct custom FM ZMM_BAPI_MAT_SAVE_DATA (this FM is very similar to BAPI_MATERIAL_SAVEDATA) and was able to successfully extend a material type that utilized external numbering but am unable to do the same with material types with internal numbering. It looks like the script is trying to recreate the material and is asking for required basic data fields such as material group, language, base UOM, etc. but this information is already filled in during the initial creation.

    Has anyone dealt with this issue before? Any tips or assistance would be appreciated.

    I am attaching my script for reference.

    Thanks,
    Knavis

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

    Attachment(s)

    xlsx
    MM01 Extend Plant.xlsx   6 KB 1 version


  • 2.  RE: Material BAPI - Plant Extension

    Employee
    Posted 11-15-2022 17:02
    Hi Knavis,

    Don't believe that BAPI will work with internal numbering. 

    I did a search, and the suggestion was to use BAPI_MATERIAL_GETINTNUMBER to get the next free internal number for material master, and then run the BAPI_MATERIAL_SAVEDATA.  The bapi takes 3 simple inputs:
    1. material type
    2. industry
    3. the number of internal numbers you want to generate

    Result structure holds the new material number


    If you run it first, row by row, you can hard code 1 as the number you want to generate.  Then chain the material create afterwards.

    HTH,
    Sigrid

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



  • 3.  RE: Material BAPI - Plant Extension

    Posted 11-16-2022 05:33
    I obviously agree with the procedure Sigrid wrote down, I use another BAPI to generate a set of free internal numbers: BAPI_STDMATERIAL_GETINTNUMBER
    That BAPI needs the same 3 inputs.
    this is the script and excel:


    ------------------------------
    jan ketele | release expert
    Xeikon Manufacturing NV | 003234431875
    ------------------------------



  • 4.  RE: Material BAPI - Plant Extension

    Posted 11-18-2022 11:13

    Thank you Jan/Sigrid for the replies! My custom FM ZMM_BAPI_MAT_SAVE_DATA is supposed to utilize BAPI_MATERIAL_GETINTNUMBER and complete this process for me. It does work for internal numbering during initial material creation but it errors during extending the material to the plant. I have decided to use a transaction recording instead for this process.

    Sigrid – You mentioned you did a search regarding my request. Do you have any specific searching method or sites you use when doing this research? I go through tons of websites/forums before coming to the community and often times I find myself spinning in circles.

    Thanks again!

    Regards,

    Knavis



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



  • 5.  RE: Material BAPI - Plant Extension

    Employee
    Posted 11-18-2022 16:49
    Hi Knavis

    Glad you found an approach that works for you.

    I usually start off searching something like this


    I focus on the SAP sites for developers.  Don't always get a hit, but I usually get something.

    I can relate to the circles...sometimes it takes a long time, and sometimes I get no help and then it's trial and error.

    HTH,
    Sigrid

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