Automate

 View Only
  • 1.  Populating multi line table into another

    Posted 12-11-2024 16:16

    Hi Community,

    I am reworking a Solution and have come across an issue I was wondering if anyone else has encountered. Currently there is a task that contains a rule on a field (Material Number) that gets populated after a webservice is ran and Material in SAP is created. It needs to be changed to no longer rely on Material number being populated, and instead pre-populate Alt UoM data in another table. I've reworked the custom code and it works if the 1st table only has 1 line item. But this needs to work for multiple line items. It just keeps plugging in the 1st line item data for each.

    Wondering if anyone has any suggestions. I will attach copied of the original JS code, edit code and screenshots. Thanks!



    ------------------------------
    Shelby Murrell
    SAP Functional Lead
    MONSTER ENERGY
    [USA]
    ------------------------------

    Attachment(s)

    txt
    New.txt   4 KB 1 version
    txt
    original.txt   4 KB 1 version


  • 2.  RE: Populating multi line table into another

    Employee
    Posted 12-12-2024 09:38

    Hey Shelby, 

    Are you trying to copy data between 2 repeating tables in a rule? 

    Have you tried the Copy Table Data option already and that did not work for your use case? 

    I might have run into something similar with rules in repeating stuff where it only works for the first line. I have found that using a incrementing helper column to trigger the rule helps run it for all rows. 



    ------------------------------
    Jayasri Varyani
    SE
    Precisely Software Inc.
    ------------------------------



  • 3.  RE: Populating multi line table into another

    Posted 12-12-2024 12:30

    Hi Jayasri,

    It's not exactly not copying data between tables. The original rule shows that once the Material number is generated in the first table that then triggers a rule to fill in specific data in the second table as well as adding in lines. I tried changing the dependency from Material Number to Material Description, but it keeps pasting the 1st Material Description in all of the added rows. Instead of the first 6, then the 2nd Material Description in the next 6 rows etc.

    The original rule works (obviously) but the workflow is changing and the rule no longer can be dependent on Material Number being generated.

    I hope that makes sense.



    ------------------------------
    Shelby Murrell
    SAP Functional Lead
    MONSTER ENERGY
    [USA]
    ------------------------------



  • 4.  RE: Populating multi line table into another

    Employee
    Posted 12-12-2024 15:25
      |   view attached

    Hi Shelby

    Long ago in the Foundation days we had an early demo to create multiple materials in a "smart table". 

    I worked on some Javascript to take all of those materials and create multiple UOM for each, leveraging the UOM from a reference material I believe. 

    IDK if it is at all helpful, but I'm uploading it here in case it helps - no guarantee's though!  I'm a very infrequent Javascript 'coder'. :)

    Best Regards,

    Sigrid



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