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

    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
    ------------------------------



  • 4.  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.
    ------------------------------