Example Piece Counting II
Step 1
The operator starts the processing dialog on the scale with the F3-Key
The F3-key is assigned to macro #3. Macro #3 calls macro #63.
63%^ // call macro 63
Macro #63 sends character string F3 and Carriage-Return to the Process-Engine.
F3%$ // send character string F3 13%& // special character 13 (send Carriage-Return)
Step 2
The Process-Engine searches for a matching active rule and finds rule GSEF3.
The rule clears tare and displays message put container an the screen. Then it calls macro #90.
$cmd .= 'Pa%C'; // clear screen $cmd .= 'Behaelter auflegenP1,1%C'; // display text on line 1 $cmd .= '0%t'; // clear tare $cmd .= '%z'; // reset scale $cmd .= '90%^'; // call Macro 90
Step 3
The macro #90 displays text confirm [Y/N] on the screen and waits for user input.
If the operator presses the Y-key, the scale sends message M90= followed by gross weight and Carriage-Return.
If N-key is pressed the sceen is cleared and the process ends.
bestaetigen [Y/N]P2,1A%C // display text on line 2 %Y // if Y is entered M90=%$ // output character string M90 0.0.16385P%o%$ // output gross weight and unit 13%& // output special char 13 (Carriage-Return) %N // if N is entered Pa%C // clear screen %E // end if
Step 4
The Process-Engine searches for a matching active rule and finds rule GSEM90.
The Rule displays the container weight on the screen and sets the tare. Then it calls macro #91.
$cmd .= 'Pa%C'; // clear screen $cmd .= 'Beh.gew. ' . $gew . 'P1,1%C'; // display text on line 1 $cmd .= '%t'; // set tare $cmd .= 'Materialnr. eingebenP2,1%C'; // display text on line 2 $cmd .= '91%^'; // call macro 91
Step 5
The macro #91 waits for input of a material number. If no input is made the screen is cleared and the macro ends.
If input is available is is stored in variable 61 and then sent to the Process-Engine.
Mat[ ]P3,1A%C // display text on line 3 ausgeben 3,5,13,13%K // get input %\ // if no input was made Pa%C // clear screen %B // abort macro %E // end if =80.61P%o // store input (material number) in Variable 61 M91=%$ // output character string M91= 80.61P%o%$ // output Variable 61 (material number) 13%& // output special char 13 (Carriage-Return)
Step 6
The Process-Engine searches for a matching active rule and finds rule GSEM91.
The Rule calls a Web-Service to get the piece weight and stores it in the piece weight register 34.
Then it switches to counting mode and calls macro #92.
XWEB( $wsdl, 'GetMatWeight', N, $user, $pwd, $matnr, &$error, &$weight, &$unit, &$bez ) $cmd .= 'Mat.gew. ' . $weight . ' ' . $unit . 'P2,1A%C'; // display text on line 2 $cmd .= 'Zaehlteile einfuellenP3,1A%C'; // display text on line 3 $cmd .= '34P=' . $weight . '%o'; // set piece weight $cmd .= '30%s'; // switch to counting mode $cmd .= '92%^'; // call macro 92
Step 7
The macro #92 waits for confirmation with Y- or N-key.
After confirmation with Y-key the character string M92= followed by piece count, then character string MatNr= followed by variablen 61 (material number) and special character Carriage-Return is sent.
bestaetigen [Y/N]P4,1A%C // display text on line 4 %Y // if Y is pressed M92=%$ // output character string M92= 30.0P%o%$ // output piece count MatNr=%$ // output string MatNr= 80.61P%o%$ // output variable 61 (material number) 13%& // output special char 13 (Carriage-Return) %N // if N is entered Pa%C // clear screen %E // end if
Step 8
The Process-Engine searches for a matching active rule and finds rule GSEM92.
The rule updates the piece count via Web-Service and displays a success message on the screen.
XWEB( $wsdl, 'UpdateQty', N, $user, $pwd, $stk, $matnr, &$error ) $cmd .= 'Pa%C'; // clear screen $cmd .= $stk . ' x Mat ' . $matnr . 'P1,1%C'; // display text on line 1 $cmd .= 'gebucht' . 'P2,1%C'; // display text on line 2 $cmd .= '0%s'; // switch to weighing mode $sysreply = $cmd;

scale variables
Nr | Name | data type | length decimal places Style |
---|---|---|---|
61 | MatNr | Strng | 13 |
back to Process Engine
SAP®, R/3® and ABAP™ are registered trademarks of SAP AG in Germany and other countries.