on 06-20-2013 2:09 PM
Dear all,
I have the following issue :
In a routing, we want to adjust the labor time for an operation according to the selected options.
Example =
IF OPTION A IS SELECTED ADD 1 HOUR TO THE LABOR TIME
IF OPTION B IS SELECTED ADD 2 HOURS TO THE LABOR TIME
IF OPTION C IS SELECTED ADD 3 HOURS TO THE LABOR TIME
So, if A, B and C are selected, we have to add 6 hours.
In the procedure we did that :
$Self.GE0000ROLBTIME = MDATA $Self.GE0000ROLBTIME,
$Self.GE0000ROLBTIME = $Self.GE0000ROLBTIME + 1 IF GE0000WSIR EQ 'B054',
$Self.GE0000ROLBTIME = $Self.GE0000ROLBTIME + 2 IF GE0000CTWT EQ 'H024A',
$Self.GE0000ROLBTIME = $Self.GE0000ROLBTIME + 3 IF GE0000MCOP EQ 'R048'.
If we select the 3 options, in the result, only the last line is taken into account = 3 HOURS
How can I fix this issue ?
Thanks for your help
Grégory
Hi Grégory,
Try writing like the below:
$Self.GE0000ROLBTIME = MDATA $Self.GE0000ROLBTIME,
$Self.GE0000ROLBTIME = $Self.GE0000ROLBTIME + 1 IF $Root.GE0000WSIR EQ 'B054',
$Self.GE0000ROLBTIME = $Self.GE0000ROLBTIME + 2 IF $Root.GE0000CTWT EQ 'H024A',
$Self.GE0000ROLBTIME = $Self.GE0000ROLBTIME + 3 IF $Root.GE0000MCOP EQ 'R048'.
It seems you had most of the code right, but i've found in my own procedures that the "$ROOT." prefix helps when trying to do lower level manipulation in routings and/or BOMs, and actually seems to be required for routings.
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.