Automate

 View Only
  • 1.  VA01 not looping correctly

    Posted 06-24-2024 17:00
      |   view attached

    I wrote the attached script and having issues with the looping I created, I can't get it create a new line. What am i missing?



    ------------------------------
    Javier Santiago
    Continuous Improvement Analyst
    The Mosaic Company
    FL
    ------------------------------

    Attachment(s)

    Txr
    VA01_Master.Txr   212 KB 1 version


  • 2.  RE: VA01 not looping correctly

    Employee
    Posted 06-24-2024 21:15

    Hi Javier

    Thanks for posting your script. 

    I see you are using GUI scripting.  May I ask why?  Can you share what isn't working in a standard recording mode - perhaps with screenshots? We have an example sales order template in the SAP Module Templates community, that you can see here if you join it:  https://community.precisely.com/viewdocument/create-a-sales-order?CommunityKey=e1f0c200-ca7e-46e7-b5c7-01855e5120c7&tab=librarydocuments

    In any case it looks like you have your header fields recorded, and then hit enter, so that it's separate from the loop.

    Then I think you're hitting insert row while entering on row 1?  Is that right?  Typcially we recommend entering in row 2, since that row will always be empty if you click insert.  If you have to go into the line details, we recommend finding that row with the filter and then selecting it and going into details.  Then back out.  That would be the loop.

    Can you also share what is happening?  You state it's not working. What is happening? What happens in you run in debug mode?

    Sorry I have to many questions - while you shared your script, there's a lot that can go right and wrong in script creation for sales orders.

    Best Regards,

    Sigrid



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



  • 3.  RE: VA01 not looping correctly

    Posted 06-25-2024 11:12

    thank you for the reply- at the moment we are only able to record in gui because of missing rfc objects (this should be resolved in a week or so). Right now i can only record in Gui so i need this script to work if possible, it runs great with one line item but once i add the looping its not creating second line. Please see video and the new script attached at 1:05 where it should be adding a new line.

    Any help is appreciated, thank you!



    ------------------------------
    Javier Santiago
    Continuous Improvement Analyst
    The Mosaic Company
    FL
    ------------------------------

    Attachment(s)

    Txr
    VA01_6.25.Txr   264 KB 1 version


  • 4.  RE: VA01 not looping correctly

    Employee
    Posted 06-25-2024 16:05

    Hi Javier

    Please try entering the first item in row 2.  If you were to fill the line items in a sales order and hit insert, it's always row 2 in a sales order that becomes empty to enter it, so it's a best practice to enter it there.  then do the find row and open the details.  

    When you get to the 2nd line item, it will also go in row 2 after you click insert, and so on.

    Please give that a try and see if it works for you. 

    I hope you can get the function module installed so that you can skip GUI scripting mode, if at all possible.

    Best Regards,

    Sigrid



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



  • 5.  RE: VA01 not looping correctly

    Posted 06-26-2024 08:45

    Thank you, Sigrid!

    Entering the first item in row 2 worked, I knew it was something simple. Thank you so much!!



    ------------------------------
    Javier Santiago
    Continuous Improvement Analyst
    The Mosaic Company
    FL
    ------------------------------



  • 6.  RE: VA01 not looping correctly

    Employee
    Posted 06-27-2024 11:05

    Great  news Javier, and well done!

    It's always good to go into the tcode and add a few lines and then click insert row. You will see SAP's behavior for that tcode, and in the case of VA01, it's row 2.

    Thanks for letting us know!

    Sigrid



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