Automate

 View Only
  • 1.  Extending Materials on a loop

    Posted 11-03-2021 12:59

    Hello 

     

    I have imported a skript concerning extending materials for different plants as a generating repeating section. 

    It works, I can fill the fields in line 1 (plant 1) and can create a new line for a new plant (plant 2).

    But I would like to preset the number of lines in the form for example 4 line for 4 plants. And I would like to fill in the value of the plant as default value.

    I would like to create the materials always for all 4 plants.

    With the default, I want to prevent a plant from being forgotten.

     

    Is that possible?

     

    Thanks for your help.

    Jana



    ------------------------------
    Jana Kuschmierz | Leitung VID
    Rigips AG | 0041628877034
    ------------------------------


  • 2.  RE: Extending Materials on a loop

    Posted 11-04-2021 04:10
    Hi Jana,

    Yes, that's possible …That's exactly what we're doing whenever a material is created or extended.

    To do so, I made a Excel-template with:

    • On one tab the fixed data for the different plants (in my template I have 72 parameters). (Like: Plant, Sales org, Sales Distribution channel, Division, BUOM, Gen item cat group, Material group, …)
    • On another tab I have the data entry with different parameters to be entered, depending on the exact material (like weight, dimensions, description, etc).
    • Using some VBA-scripts I copy & merge the parameters of both tabs into other tabs that contain the upload data. These tabs will upload to SAP with a number of chained Winshuttle scripts to cover the full pack of data I want to upload.
      • A Bapi_Material_SaveData
      • Transaction MM01 for classification (will upload for a new material, existing materials will be skipped since MM01 will error out)
      • MM01 for profitcenter (will upload for a new material, existing materials will be skipped since MM01 will error out)
      • MM02 for classification (will update or extend existing materials, new materials will be left unchanged since the data entered is exactly the same as entered in previous step)
      • MM02 for profitcenter (will update or extend existing materials, new materials will be left unchanged since the data entered is exactly the same as entered in previous step)
      • ME11 & ME01 for inforecord & sourcelist
    • The use of VBA also gives the possibility to choose which plants I want to create and even build a number of errorchecks into the data preparation .

     All thanks to the perfect marriage between Excel, VBA and Winshuttle .



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



  • 3.  RE: Extending Materials on a loop

    Posted 11-04-2021 04:56
    Hello

    I think I have not explained so good. I works with evolve and not with excel. I have create a solution in Evolve and in the form there is a part "extending material".
    The script I have create is MM02. I have imported this in the solution as generating repeating section. That allows to repeate the same script MM02 for each plant. Each line of the repeating table is one run of the script.
    I want to fix 4 lines in the form and set default values.

    Best regards
    Jana

    ------------------------------
    Jana Kuschmierz | Leitung VID
    Rigips AG | 0041628877034
    ------------------------------



  • 4.  RE: Extending Materials on a loop

    Posted 11-04-2021 05:17
    Hi Jana,
    I can't comment on Evolve solutions, we're using Studio ...
    I'm sure you'll get the answers you're hoping for.

    regards, Jan

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



  • 5.  RE: Extending Materials on a loop

    Employee
    Posted 11-04-2021 07:51
    Hi Jana

    You could query a list to pull into the table and default the values.

    In Foundation, you can use a SharePoint List
    In Evolve, you can use a reference data list

    Use a Query control to pull in the data - it can include other defaults, either on form load or based on some other trigger/rule.

    BTW, I am building out a demo and did just this with a reference data list and a Query control.  It was easy to do - same use case for plant extensions.

    HTH,
    Sigrid

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



  • 6.  RE: Extending Materials on a loop

    Posted 11-11-2021 12:03
    Hello
    thank you very much, but I did not understand. 
    I have now made a reference data list with all my plants . I have add the data connection with this reference list into the solution.

    But what are the steps that the form load automatically the reference list. Where can I define that the value in the repeating table is that reference list?

    Best regards Jana

    ------------------------------
    Jana Kuschmierz | Leitung VID
    Rigips AG | 0041628877034
    ------------------------------



  • 7.  RE: Extending Materials on a loop

    Employee
    Posted 11-11-2021 12:18
    Hi Jana

    You have to use a Query Control.  Trigger it on load or via a rule, depending on your process


    Here's mine:

    Query control definition
    use the CHOOSE button to set form field values based on the reference data list value
    for example I want to map plant from my material extensions repeating groupto the field Plant in my reference data list
    then click Add

    do this as many times as you need to map the fields from the reference list to the form fields in the table

    Then you need to decide when to run it.  I ran mine as a rule

    My rule is on form load.  I have a counter of how many rows I have (1 means it's the default 1 row so the query has not run).  I only want to run the query on form load once, so pick something that works for you.  I did this in case the process gets rejected and I have to open the form view again.  I don't want the query to run a 2nd time.  You could also set a flag or something along those lines.

    Here is the link to the doc on the Query control:  https://docs.winshuttle.com/evolve-en-20-2-online-help/solution-developer-help/form-elements/Query.htm

    Hope this gives you an idea.

    Sigrid

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



  • 8.  RE: Extending Materials on a loop

    Posted 11-12-2021 09:53
    Hello Sigrid

    many thanks for your help. I have made a query control and I have set the field plant. That's o.k. I have also decide to run it while starting the form.
    But I have some problems with the rule:

    - what do you mean with " I have a counter of how many rows I have (1 means it's the default 1 row so the query has not run)."?
    I have to have 5 rows in my repeating table when I open the form (dosn't matter if it is the first time or the form is rejected)
    - I have to make the rule on the field "plant" in the repeating table, right?
    - the if condition: ct extendrows, I cannot find, could you explain the rule?

    Thank you so much for your help!!!
    Jana



    ------------------------------
    Jana Kuschmierz | Leitung VID
    Rigips AG | 0041628877034
    ------------------------------



  • 9.  RE: Extending Materials on a loop

    Employee
    Posted 11-12-2021 10:37
    I'm glad it's working, Jana.

    The counts and rules are optional:
    • I add a few fields to have a count for number of rows and number posted - you have to create them.  I use those fields to display the number of rows processed, but I  also them in rules to hide the post  button, for example when the number of rows = number of rows posted. 
    • I used the count field I created in a rule to ensure the query control doesn't run if my input gets rejected and I have to go back to the view.  You might be able to use the plant field in your table in a rule instead - if it's blank run the query, otherwise don't.  

    example count

    i used the plant field in the table to trigger the count rule

    note it uses the field name, not the field value for count.

    If you want a count of the number posted, use the logfield in the table and apply a rule something like this

    it's another count function with the field name of the logfield.  The last part 'Material'|'created' is a regular expression.  What I have in there means if the logfield contains Material or created, then I know it's posted.  You can use whatever regex you like.    Here's the doc on the count function:  https://docs.winshuttle.com/foundation-en-12-1-x-online-help/composer/winshuttle-composer-javascript-global-helper-functions.htm#o17770 

    Hope this helps,
    Sigrid




    Again, all extra and optional.​

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