Automate

 View Only
  • 1.  Changing material characteristics

    Posted 04-08-2023 10:44

    Hi everyone,

    I'm trying to automate our material creation process, but i'm running into some issues uploading material classifications from a template. Everything works well, except for 2 characteristics: 'Brand type' and 'Brand'.

    When the script is searching for the characteristic 'Brand', he places the value in characteristic 'brand type' (I think it's the first 'hit'). I would prefer not to change the character names. Is there any way to solve this? 










    ------------------------------
    Nick De Cock
    milcobel
    ------------------------------


  • 2.  RE: Changing material characteristics

    Employee
    Posted 04-11-2023 10:08
    Edited by Sigrid Kok 04-11-2023 10:11

    Nick
    Would use a BAPI instead, especially if you cannot change the characteristic description to be unique.  It would use the field name instead of the description, which is always unique.
    You could use an OOTB BAPI like BAPI_OBJCL_CHANGE or the one embedded in the Function Module /WINSHTLQ/TRN_MT_CLASIFICATION which allows you to work with multiple classes doing gets, creates and updates - description in the doc:  https://help.precisely.com/r/Automate-Function-Module/20.3/en-US/Automate-Function-Module/Admin-Guide/Content/concepts/AutomateFM_v20.3_Admin_Guide_Winshuttle-Function-module-admin-guide.html/Specific-use-case-AFM-and-Wrapper-AFMs?tocId=wS73gd5ke7OqotgXcmEP6w 
    Best Regards,
    Sigrid



    ------------------------------
    Sigrid Kok
    Precisely Software Inc.
    ------------------------------



  • 3.  RE: Changing material characteristics

    Posted 28 days ago

    hi Sigrid, the link to this documentation isn't valid anymore. Can you update or share it?

    I am specifically looking for adding a value to a characteristic which can have multiple values.

    just a fictive example:

    characteristic ABC

    possible values:

    TDK

    HUM

    PLM

    XYZ

    for example, HUM is already assigned and I want to add XYZ.

    If you have any tips/ideas (BAPI) please let me know!

    Thanks



    ------------------------------
    Ed Meiners
    Consultant
    Wessanen Nederland Holding BV
    Amsterdam
    ------------------------------



  • 4.  RE: Changing material characteristics

    Employee
    Posted 22 days ago
    Edited by Sigrid Kok 22 days ago

    Hi Ed

    Here is one link in the doc: https://help.precisely.com/r/Automate-Function-Module/Main/en-US/Automate-Function-Module/Admin-Guide/Automate-Function-Module-Admin-Guide/Specific-use-case-AFM-and-Wrapper-AFMs?tocId=USIQscl6cjyP_mCG4fKdDA

    Nick & Ed - My colleague Maria did  webinar a while back where she showed this tip:

    You go into the Extra -> User settings on the classification tab:

    go to General settings & select lang-ind. char.

    make the above part of your recording, then you will see the Field names in the Transaction, which is always unique and can be found. 

    default is the description, which is language dependent, like below:

    with the above user setting, you will get the language independent field names, like this:

    Field names are always unique, as opposed to the Description, which is not.   It does mean you have to use the Field Name in your input data.

    FWIW,

    Sigrid



    ------------------------------
    Sigrid Kok
    Precisely Software Inc.
    ------------------------------



  • 5.  RE: Changing material characteristics

    Employee
    Posted 04-11-2023 11:58
    Edited by Jayasri Varyani 04-11-2023 11:59

    I think I have heard this before and like always, Sigrid probably has the best advice to use the BAPI to get around this :)
    I tried to test this but instead of defaulting to the first hit, the system gave me popup to confirm. Are you not getting the same?

    Sorry no solution just yet, just curious how others have dealt with this. 



    ------------------------------
    Jayasri Varyani
    Winshuttle North America
    ------------------------------



  • 6.  RE: Changing material characteristics

    Employee
    Posted 04-12-2023 12:57
    Edited by Sigrid Kok 04-12-2023 17:03

    Hi Nick,

    Here's an example with the standard BAPI: BAPI_OBJCL_CHANGE.  Please ensure you check the notes in the excel template as well as the tips below.

    This BAPI will work with characteristics for more than materials, so we set object table to MARA for materials, and Class type to 001 for material classes. Change if you're using variant classes or other types.

    BAPIs separate uploads by data types.  You can use Numeric for numbers or dates, and character for everything else.  In my example I have an additional column that specifies N for numeric and C for character.

    The other part is that the Object key is 100 characters in length because it's handling all sorts of objects in SAP of differing lengths.  You'll want to zero pad numeric material numbers to the right length.  In ECC is 18, so I use a formula, which gets executed before it tries to post to SAP to zero pad the numeric material number, like:

    I have an example of the FM version.  If you want that, I can share it.  It behaves similarly to the standard BAPI, but allows you to do gets and updates for multiple classes.

    Hope it's helpful.
    Sigrid



    ------------------------------
    Sigrid Kok
    Precisely Software Inc.
    ------------------------------