Automate

Welcome to the Automate community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Here are some useful links where you can find more information:

Product Announcements  Ideas Portal

Discussions

Members

Resources

Events

 View Only
  • 1.  Looping

    Employee
    Posted 11-02-2018 11:25
    Is there away to loop until SAP field is null or loop n times based on amount in one cell.  I'm running transaction O3UBL01_WORKPLACE to delete balancing workplace statements, they have to be deleted in descending order, SAP does not allow a mass deletion so I want to delete until there are none left.

    ------------------------------
    Anita Mefford | Analyst
    Bartlesville, OK

    ------------------------------


  • 2.  RE: Looping

    Employee
    Posted 11-12-2018 10:35
    Hi Anita,

    There are two ways this can be done:

    1. If you know how many lines will need to be deleted - then you can use Standard mode. Create a loop around the fields, and enter in the exact amount of "D" rows in the data file. (Example. If you have 50 items in your table and the 51st was empty, make sure there are 50 "D" rows in the data file).

    2. If you do not know how many lines there will be, you can use an Index based loop. This would require GUI scripting mode.

    Thank you!

    ------------------------------
    Winshuttle Support |
    Winshuttle North America | [City] |
    ------------------------------



  • 3.  RE: Looping

    Employee
    Posted 11-13-2018 11:51
    Hi Anita - if this is in Excel, another way could be that you use the # in a cell you mentioned. 

    Based on that, you can use a counter column and use formulas to determine whether a "D" should be displayed in in the looping ID field.  ​  My counter is in column S and my # of values is in F2, and the D rows start in row 3 for the below example:
    Counter:
    =IF(ISBLANK(S2),1,IF(S2<VALUE($F$2),S2+1,""))
    - if the row above is blank, set to 1​ - that means I am the first row - possibly the Header row
    - if the row above is less than my counter in F2, increment by 1, otherwise set to blank
    Loop ID:
    =IF(S3 <= VALUE($F$2),"D","")
    so if my counter is less than the # of rows in F2, show a "D", otherwise set it to blank​​​

    I'm sure someone smarter than me in Excel could find another way, but this works.  I just used it to read out bom components based on a # I read out of SAP.

    Cheers,
    Sigrid​

    ------------------------------
    Sigrid Kok
    PSE | Winshuttle North America
    ------------------------------