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.
Original Message:
Sent: 11-09-2023 12:15
From: Sigrid Kok
Subject: CJ2B Transaction script - loop malfunction
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, however, 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.
Original Message:
Sent: 11-09-2023 11:02
From: Francoise KOELMAN
Subject: CJ2B Transaction script - loop malfunction
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
Original Message:
Sent: 11-09-2023 09:36
From: Sigrid Kok
Subject: CJ2B Transaction script - loop malfunction
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.
Original Message:
Sent: 11-09-2023 05:37
From: Francoise KOELMAN
Subject: CJ2B Transaction script - loop malfunction
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
Safran Aircraft Engines
------------------------------