cancel
Showing results for 
Search instead for 
Did you mean: 

Update operation labor time according to the selected options

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hello Michael,

Your answer is helpful.

Also we did a mistake in using MDATA.

Now it works.

Thanks

Answers (0)