Automate

 View Only
  • 1.  CJ2B Transaction script - loop malfunction

    Posted 11-09-2023 05:38
    Edited by Francoise KOELMAN 11-09-2023 10:11

    Hello Everyone,

     

    First time here :-) I have searched through the community and can't find a similar case

     

    I have a transaction script to update CJ2B, recording mode SAP GUI.

    A loop is implemented  (see attached files)

    When running the script only the first pass in the loop is taken into account.

    The others are disregarded :-(

     I have been on this for couple of weeks

    This is my first script. So be indulgent ;-)

    Thanks for your assistance



    ------------------------------
    Francoise KOELMAN
    ------------------------------



  • 2.  RE: CJ2B Transaction script - loop malfunction

    Employee
    Posted 11-09-2023 09:36

    Bonjour Francoise,

    For your first script, this is quite complex.  GUI scripting, Loops and many IF statements.  That's a lot to take on. :)

    May I ask what you're trying to do in your script?  I'm hoping we can do it without GUI scripting, as most Project System tcodes can be done that way.

    Also you have many nested IF's that may be the cause of why things are being skipped.  Like: 

    and later it seems repeated

    What is the purpose for all of the IF's?  Is it just to upload data if a set of columns aren't blank?  And if so, the additional nested IF statements later - their purpose?

    Please advise on the above - especially an overview of what you're trying to do - screen shots would be welcome to determine which areas of the project and fields you're trying to set/update.

    Best Regards,

    Sigrid



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



  • 3.  RE: CJ2B Transaction script - loop malfunction

    Posted 11-09-2023 11:03

    Hi Sigrid,

    You're perfectly right : quiet a tough script to begin ;-)

    This script is for updating dates for milestones and activity.

    I previously extract all milestones and activity within a project(s)

    So users can choose the activity/milestone where they need to put a date as begin on, end on,...

    That's why all the if condition, in order to test if a date is present or not.

    Below some screen shot CJ2B.

    Hope it helps

    In the meantime, I openeded this afternoon a support ticket.

    It looks like loop function was not to be incremined : It's a Winshuttle bug : always stop script after the first rows ?!!

    I am awaitting to have more information tomorow.



    ------------------------------
    Francoise KOELMAN
    Safran Aircraft Engines
    ------------------------------



  • 4.  RE: CJ2B Transaction script - loop malfunction

    Employee
    Posted 11-09-2023 12:16
    Edited by Sigrid Kok 11-09-2023 15:25

    Hi Francoise

    Would it be possible for you to use CJ20?  The one you're using is a workbench tcode, and is nice to look at, but not so nice to automate.

    If you could use it, on the first screen you can enter the Project and WBS element. - check with activities:

    Then when you see the WBS element (always on the first row) - select the first row, and click the Activities tab

    On the activity tab, you can find the one you want by clicking <ctl> <f> 

    or you can navigate on the menu  - Edit - Object - Position to get the pop-up window

    Then enter the activity number, to move it to the top row.

    Then you can select the activity on row one, and click to see details

    That will bring up the details - go to dates and update whatever you want - you can use your IF statements here

    then click to go back to the first tab - so that each time it starts from the same place

    You can loop through all of the WBS activities - find and update.

    This approach doesn't require GUI scripting, which makes it much simpler to automate.  It does require a post for each WBS element and all of it's activities, but again, it's much simpler. 

    The IF statements are another aspect, but what do you think about this approach?

    Sigrid



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



  • 5.  RE: CJ2B Transaction script - loop malfunction

    Employee
    Posted 11-09-2023 13:05
    Edited by Sigrid Kok 11-09-2023 15:27

    PS @Francoise KOELMAN - Here's a quick example of the approach.  

    The IFs are if the Start or Finish date type is not empty, require the date 

    those are the only IFs I used, and it was a guess on what you were intending in your script.  

    I'm not a project systems expert, and not everything has dates in the activities, including on the WBS element, but I hope this helps give you the idea.

    Best Regards

    Sigrid



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

    Attachment(s)