P. 1
Oracle WMS Label Customization

Oracle WMS Label Customization

|Views: 1,049|Likes:
Published by spat87506

More info:

Published by: spat87506 on Apr 25, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

07/16/2013

pdf

text

original

Oracle Warehouse Management Label Customization

An Oracle Topical Essay October 2002

while a manufacturing label is generally not printed during a shipment transaction. Only some of the label types are applicable to each business flow. are identical for several different transactions. For instance. These business flows are then associated with label types. and places it in a specific directory. and furthermore. while a shipping label includes details about the sales order and customer for which an order is being shipped. or license plate generation. Oftentimes. A printer is also specified in the . The different label types have hundreds of different fields that can be selected for inclusion in each label. pick confirmation. customization is often necessary to get exactly the label required. While the label type identifies the type of data that is available to each label. However. WMS allows the user to assign any of the label types to any of the business flows within those restrictions. the information to print a shipping label is not available during a purchase order receipt. several additional features often available in the third party label printing software and the label printing hardware will also be described.Oracle Warehouse Management Label Customization LABEL CUSTOMIZATION Oracle Warehouse Management System has a complete label printing solution where any number of different label types can be printed as part of any number of different business flows. sometimes the data that must be included on a particular label is not available as one of the standard fields provided by Oracle WMS. WMS produces an XML file (or an XML stream to a API) with the label format name. or made at several other levels. The type of data that included in each label differentiates the label types. This document assumes knowledge of standard label printing provided by Oracle WMS. As customization should be avoided as much as possible. WMS uses the Rules Engine to determine which label format among several to print when a particular label type is required. the types of labels that might be required during certain transactions. such as a purchase order receipt. work order completion. such as item description and weight. the material label type includes all the attributes about an item. This document outlines several customization options with full examples. a label format identifies the exact fields that are included in each label. however. In these cases. For instance. the assignments can be specific to a user or responsibility. Transactions and events for which the labeling requirements are similar are grouped into business flows. and the source of the data for those labels. as well as the name to assign to each of those fields that the third-party label integration software will identify. the data and variable names indicated on the label format. Labeling Overview Oracle WMS produces xml files as part of a transaction or event.

including text font. and media size. Note that each software package and printer hardware is different. In addition. can be found in the WMS Implementation Guide. Manual print requests can also be made to get additional copies of a particular label. and common variable names that define each individual field.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE labels SYSTEM "label. and thus you should refer to the users guides of the respective components to understand if the feature is available. and converts the XML to a printer-readable format. barcode and barcode symbology. However. The third-party label integration software monitors that label directory (or by way of a synchronous API) for XML files. label types. In addition.XML file. the links between transactions. are not available without WMS. The following sample XML file shows the formatting Oracle WMS produces. and is specified in WMS by way of an assignment to one of several levels such as the user or subinventory. as well as additional examples and information about label formats. The sections below discuss several business requirements that can be met by features that are often available in the third party label printing software or the printing hardware. A common business requirement is for multiple copies of a particular label format to be printed. The complete XML DTD. Alternatives to Customization While customization may sometimes be the only approach available to provide precisely the label required for a given business scenario. or using features available in the thirdparty label printing software. Customization has many hidden costs. remains the same. WMS does not have a facility for controlling the number of copies of a label to print when printing is triggered automatically during a business flow. such as additional support and the difficultly in keeping current with the latest Oracle upgrades. and label formats. This can often be controlled by configuration of the actual printer hardware. and thus should be considered only if all other options are exhausted. some of the label formats. so that the number of copies can be controlled by a set of conditions specified in the software. some software allows the quantity to be manipulated. so that each request sent to the printer produces multiple identical labels. business flows. and some of the fields on other label formats. The actual layout of each format. are all defined in this third-party software. The label formats are linked to the XML data by way of common label format names.dtd"> <labels _FORMAT ="Material" _QUANTITY="1" _PRINTERNAME="Printer 1" _JOBNAME="LBL101"> <label> <variable name= "ITEM">AS54888</variable> <variable name= "ITEMDESC">Desktop</variable> <variable name= "LOT">10292</variable> <variable name= "QTY">2</variable> <variable name= "UOM">Ea</variable> </label> </labels> Mobile Supply Chain Applications provides identical labeling support with several exceptions. Multiple Copies Although Oracle WMS allows the user to enter the label quantity during manual label printing requests. there may often be alternatives to customization by either changing the business processes surrounding the label printing. Instead of using the Rules Engine to select among the many different label formats of a given label type. a default label format is indicated and MSCA always selects this default format. <?xml version="1. .

In addition. it may prove less onerous then customizing the application. merging quantity and unit-of-measure. or other non-text object to be included in label formats. with more dense barcodes such as PDF417. A common requirement is to concatenate multiple fields into a single barcode. Then the format selection logic can be encoded in the third-party software. the data that must be printed on the label is not a single data element or field available in WMS. Because WMS associates a set of label types with a business flow. based off of any of the attributes provided in the XML. while a new complete label could be printed later. but rather. while MSCA always selects the same default label format for a given label type. a customer-specific label that includes details such as the customer name.Field Manipulation Often. However. For instance. Images and Icons The label format layout tools allow an image. Multiple Formats for MSCA The primary difference between labeling support for MSCA and for WMS is that WMS provides the Rules Engine to select the appropriate label format among many. a product of several component fields. and the Rules Engine can be leveraged to select among the various formats. customer purchase order. for instance. Mathematical manipulation of the data may also be required. trademark. one label format can be defined as the default in Oracle that includes all the superset of all the fields the “real” label formats will require. a “dummy” label format with no label fields can be defined for the label type. However. Most label printing packages offer these basic field manipulation tools as part of the label format design. but the data that may be required on the label is the area (width multiplied by length) instead. The Rules Engine can be used to select this dummy format whenever no label should be printed. For instance. an LPN Summary label may always be required. an organization may require that all shipping labels be printed with the company’s trademark in one corner. While this requires reprinting and re-labeling. all of the labels will be printed each time that business flow is triggered. Often. multiple formats with different images can be defined. many MSCA customers still have the requirement to print various formats without requiring the additional features a full-blown WMS solution entails. a temporary label with a subset of the required data could be printed. but a Material label may only be required if the material is hazardous. and customer item number. for instance. the data that is required for a label is not available at the first moment a label could be printed. In this way. the width and length of an item may be stored as item or lot attributes. dozens of fields can be concatenated into a single barcode with certain characters delimiting where each data element ends and the next one begins. Or. Selectively Printing Labels A certain label type may be only occasionally required as part of a business flow. may be required for a pallet of material that is . For instance. In these cases. complex logic can be defined to control exactly when a given label type associated with a business flow should be printed. the third-party software includes logic that can make label format decisions based on the data included in the source XML. In this way. during a purchase order receipt. Change Business Processes Sometimes. but may be available at a later point.

the label printing API can be called by custom code. However. the customer specific data is not available as standard functionality in any of the labels that can be produced at completion. This approach can split one label into many. as an independent program. In this way. The pre-processor can perform more complex data manipulation than may be available in the third-party software. The customization can be made as part of a database trigger or a custom PL/SQL package. This is the best approach when the structure of the standard labels meets the requirements. While direct customizations to the application require careful maintenance to ensure that patches do not overwrite the custom code. this approach allows the flexfield data to be easily used in label format selection rules. any label can be printed at any time with any data. or aggregate many labels into one. via an additional labeling operation. and thus is subject to the same patching and maintenance issues as the flexfield customizations. with a combination of the three approaches above. and can also be used in concert with the features described above. or via a manual reprint request after an LPN has been loaded if Direct Ship is being used. but additional data is required. In addition. Note that this requires direct customization to the application. but that label is only available as part of the pick confirmation or ship confirmation business flow. All those fields are available on the Shipping Contents label type. Customization Strategies If the alternatives to customization discussed above still are not enough to support the label printing needs. if labels are required during business flows or events that do not already support label printing. However. However. The label printing solution allows many of the flexfields to be included in the labels. A temporary label to identify the LPN can be used for the pallet and printed as part of the manufacturing completion business flow. and is the best customization approach when the general structure of the standard labels provided by WMS cannot meet the labeling requirements. Note that this customization does not involve modifying the Oracle application at all and so patching and upgrading concerns become less of an issue. seeding additional fields. Populating Flexfields . while the more complete Shipping Contents label could be printed automatically as part of the pick confirmation business flow. it must still be maintained and monitored to ensure that the process is kept running. and the label structure can be drastically different from the original label produced by Oracle WMS. such as modifying the queries used to gather the data. so the application can be customized to populate these flexfields prior to printing. then there are three main avenues for customization that can be used independently or in combination. The original business process may call for that label to be produced as part of the manufacturing completion process. customization can be completely avoided. or adding an additional label type. is not recommended. Finally. as well as making the data in the flexfield available for other business processes.manufactured specifically for that customer. Another approach is to use a light-weight “pre-processor” to intercept the XML files before they are picked up by the label printing software. database queries can be embedded in the pre-processor so that data not initially included in the XML can be added. Note that direct customization of the label printing code.

and future releases may require re-engineering of the customization in that the business flows surrounding a particular form may change. external to the Oracle application. or via a trigger that is dependent on other sections of code. it carries the standard risks that patches may overwrite the customizations. These attributes can then be referred to in the label format definitions without any customizations to the label printing routines. Then. The label preprocessor must be monitored. however. By labeling the license plates while they are still in inventory. for instance) can also be included on the label without customizing the label code. An extension to the Item Reservations form could be written that does the following whenever a reservation is manually created to the LPN detail level: • • Populate Attribute1 on the LPN Flexfield with the customer name Populate Attribute2 on the LPN Flexfield with order number Additional attributes could be populated as necessary to capture the shipping address. However. These license plates are then labeled with the customer specific labels that include the customer name and order number. from the . potentially aggregating different labels into one label. order line. adding new fields that could not be made available even in flexfields as described above. ship to address. either the new customer specific license plate labels can be printed either via a user-initiated manual label reprint request. the Shipping Content label includes information about the sales order. This job would monitor the directory into which Oracle drops the XML files.All of the flexfields on tables for which data is available for the labels have also been included for use as label fields. the picking and shipping process can be simplified because no additional labeling steps may be required as part of the outbound flows. This process introduces an additional layer of complexity to the label printing process. Label Pre-Processor Oracle WMS drops an XML file in a pre-specified directory. or automatically if the customization directly calls the label printing APIs. prior to pick confirmation. or any other programming language. so any of the flexfields related to the sales order (order header. or performing operations on the data included in the label that the label integration software is not capable of performing. the customer purchase order number. This pre-processor could be written in Java. Because an XML file is simply a plain-text file with a special formatting structure. the Rules Engine can also be leveraged to select the correct label format based on the customer. The examples developed below. conditionally change the XML file. For instance. or any other data populated in the flexfields. and then move it to another directory that the label integration software is monitoring. to ensure that it is running. suppose particular license plates are manually reserved to specific customers via the Item Reservations form. pricing attributes. and the third-party label printing software picks up this file from the same directory and produces a label. and so forth. show how the text manipulation utilities available in Unix can be built into a shell script to do the pre-processing. For instance. an additional processing step could be inserted between Oracle dropping off the file and the printing software picking up the file. any text manipulation tools be used to monitor a pre-specified directory. This step could modify the structure of the label in complex ways. and increases the latency between when the request is made and when the final label is produced. But the customer data is not available on any labels prior to pick confirmation. As this type of customization requires directly modifying the forms to populate additional data into particular flexfields. Note that by populating the flexfields with this additional data. Data can be populated in flexfields directly by a user. C.

The following scenario models the case where the quantity of a particular label to print depends on attributes of the item. ################################################# # Enter source / destination directories here. #!/bin/sh ################################################# # This shell script has been created to # demonstrate the extensibility of Oracle WMS # labeling solution. each starting from the basic business requirement and ending with the shell script that will modify the XML. It is not delivered as a # standard Oracle product. However. performance considerations will be described.DestDir must be the directory in which the # third party label integration software # expects to find the xml files. if the length of an item is four or more feet. this type of customization can be incredibly flexible and powerful in modeling complex requirements that WMS does not currently support. However. A fourth example. Specifically. Setting up the scripts to monitor a directory will be discussed.WMS perspective. they are to be used as guidelines for a full design. and no guarantee is made as to the completeness. If the file does # not contain the text LG_MATERIAL. if the item is less than four feet long. replacing _QUANTITY="1" # with _QUANTITY="2" if the file includes the # text LG_MATERIAL and moving the new file to # the destination directory. and several different approaches to tackle it. # # Author: David Wertheimer ################################################# # This script iterates through each xml file in # the source directory. In addition. or performance. this section does not intend to be a programming guide for shell scripts. a static setting of the number of copies to print may still not meet the business requirements. Three examples will be developed below. or via a setting in the third party integration software. Note that the decision criteria of item length could have simply been included in the label format. However. Oracle upgrades and patches do not interfere with the customization. after the label is dropped in the initial directory. and testing process. it is moved # to the destination directory unchanged. one copy of the label will suffice. error handling.xml for file in ${SrcDir}*. but only if the item exceeds a certain size limit. and finally. then two copies of the label should be printed. An organization that deals with large items may require multiple label copies. These examples illustrate the flexibility this method of customization provides and the design process that needs to precede the customization. and place it into the Oracle-supported Rules Engine.xml do # The new file will have the same file name in the dest directory . development. Please feel free to # edit or modify as needed. this example illustrates how the Rules Engine can be used to extract some of the potentially complex logic from the custom pre-processor. However. identified by the # profile option WMS: Label Output Directory # . the work is complete. # . The Rules Engine will be used to select a different label format of the Material label type if the item is greater than four feet. The pre-processor will change the quantity of labels to print to 2 if the label format is LG_MATERIAL. ################################################# SrcDir=/home/dlwerthe/work/labels/test_in/ DestDir=/home/dlwerthe/work/labels/test_out/ ################################################# # For each file in the source directory ending with *. Simple Field Modification Two options by which to print multiple copies of a label were discussed above: either via a setting on the printer hardware. However.SrcDir must be the directory where Oracle # drops the xml files. will also be discussed. and then the pre-processor could base the label quantity directly from that length.

Each bobbin needs one label. should be triggered. 99-99. The roll is much wider than the bobbin. and so the roll is slit as it is wrapped around several bobbins at a time. #!/bin/sh ################################################# # This shell script has been created to # demonstrate the extensibility of Oracle WMS # labeling solution. Each of these slits. The following scenario illustrates how one xml file produced by WMS can be used to create many related labels. for only the roll component. as bobbins are being wound. as well as the job quantity. The label produced during the taskbased material issue is. even on flexfields. As the roll is wound on to the bobbins. the roll width populated in an item flexfield (ROLL_WIDTH). move the label to the destination unchanged mv $file $ofile fi done Creating Labels with Custom Data There are often very specific requirements for manufacturing labels to help ensure that the finished product can be traced back to exact job that created the material. so the required data to calculate the set and cut could not be available. is called a “cut”. A particular consumer packaging plant cuts many small rolls. and numbering the sections to be cut from 1-1 to. A special format of the WIP Contents label must be defined. starting with 1. while the number of sets is determined by the number of cuts required and the quantity on the job. BOBBIN. and is similarly numbered from 1. The format must include the job quantity (JOB_QTY). need to be included in the original label produced by WMS so that the pre-processor knows how to number the bobbin labels. replacing the quantity sed s/'_QUANTITY="1"'/'_QUANTITY="2"'/g < $file > $ofile # Remove the original label file rm $file else # Otherwise. and even more specifically. or “bobbins” of aluminum foil from a single large roll. perhaps. Both of these widths. and the bobbin width populated in a job flexfield (BOBBIN_WIDTH). none of these labels would have the set and cut data printed on it automatically. The number of cuts to print is determined by the width of the bobbin in comparison to the width of the component roll. Neither the completion label nor the label printed during prepack have details about the job. and during a component issue if the component pick release process is used. the sequence in which the material was finished. as a separate user-initiated “prepack” process. Specifically. and thus all the bobbin labels. The Rules Engine can be used to selectively determine when this format.ofile=$DestDir/`basename $file` # If the text LG_MATERIAL is found in the label if [ `grep '"LG_MATERIAL"' $file|wc -l` -eq 1 ] then # Copy the label to the destination. the label will be printed. however. it should print this format. These flexfields could be populated manually by a user. so that whenever a manufacturing task has been completed and material issued to the job. and its also printed automatically before the job begins. named. The flow labels are not available for discrete jobs. so that option is discarded. but one of these manufacturing-related labels must be selected for customization. This label can be tied to the WIP Pick Drop business flow. so the labels will also be available at the right time. from left to right. Of course. available for discrete jobs. Standard label printing features provide for printing manufacturing labels at several points: as part of the completion transaction. say. It is not delivered as a . Each of these cuts is numbered sequentially with a number called the “set”. or automatically as part of a flexfield customization as documented above. this could be thought of as drawing a grid on the foil. integrated to move transactions for flow manufacturing. it is cut every 30 feet. If the roll were completely unwound and laying on a flat surface. and that label must include the set and cut in the format SET-CUT.

tmp>>$ofile # Append the SET and CUT to the label file printf "<variable name=\"SET\">$SET</variable>\n">>$ofile printf "<variable name=\"CUT\">$CUT</variable>\n">>$ofile printf "</label>\n">>$ofile .tmp|sed /DOCTYPE/d|sed /labels/d|sed /'<\/label>'/d>body. the </labels> line # and the three header lines at the top of the label LABEL=`sed /JOB_QTY/d $file|sed /ROLL_WIDTH/d|sed /BOBBIN_WIDTH/d>label. BOBBIN_WIDTH. ################################################# SrcDir=/home/dlwerthe/work/labels/test_in/ DestDir=/home/dlwerthe/work/labels/test_out/ ################################################# for file in ${SrcDir}*.SrcDir must be the directory where Oracle # drops the xml files.JOB_QTY will be removed # .SET will be added # . # it is moved to the destination directory # unchanged.tmp # by removing the quantity and width variables. ################################################# # Enter source / destination directories here.ROLL_WIDTH will be removed # .tmp # Place the three header lines in the top of the new label sed 3q $file>$ofile # Repeat for each bobbin to print while [ $LBLCTR -le $QTY ] do # Concatenate the label body onto the new label file cat body.xml do # The new file will have the same file name in the dest directory ofile=$DestDir/`basename $file` # If the text BOBBIN is found in the label if [ `grep '"BOBBIN"' $file|wc -l` -eq 1 ] then # Extract QTY=`grep BOB=`grep ROL=`grep the three fields (QTY.BOBBIN_WIDTH will be removed # . identified by the # profile option WMS: Label Output Directory # . Please feel free to # edit or modify as needed. the single label in the file will # be replaced with QTY labels (where QTY is # indicated in the xml) in a single xml file in # the destination directory. If the label includes the # text BOBBIN.tmp` sed /xml/d label. # .CUT will be added # # * CUT will iterate from 1 to # floor(ROLL_WIDTH / BOBBIN_WIDTH) and be # incremented with each consecutive label # * SET will increase from 1 to # ceil(JOB_QTY/floor(ROLL_WIDTH / BOBBIN_WIDTH)) # and be incremented after each # floor(ROLL_WIDTH / BOBBIN_WIDTH) labels # # # If the file does not contain the text BOBBIN.DestDir must be the directory in which the # third party label integration software # expects to find the xml files.# standard Oracle product. # # Author: David Wertheimer ################################################# # This script iterates through each xml file in # the source directory. ROLL_WIDTH) from xml '"JOB_QTY"' $file|sed 's/<\/variable>//g'|sed 's/<variable name= "JOB_QTY">//g'` '"BOBBIN_WIDTH"' $file|sed 's/<\/variable>//g'|sed 's/<variable name= "BOBBIN_WIDTH">//g'` '"ROLL_WIDTH"' $file|sed 's/<\/variable>//g'|sed 's/<variable name= "ROLL_WIDTH">//g'` # Calculate the maximum cut and maximum set based on the widths and quantity MAX_CUT=`expr $ROL / $BOB` MAX_SET=`expr $QTY / $MAX_CUT` if [ `expr $MAX_CUT \* $MAX_SET` -lt $QTY ] then MAX_SET=`expr $MAX_SET + 1` fi # Initialize counters LBLCTR=1 SET=1 CUT=1 # Extract the part of the label to be repeated into body. modifying only labels # of format BOBBIN. All the fields in # the original source label will be carried # unchanged to the destination label with the # following exceptions: # # .

bobbin width. It is not delivered as a # standard Oracle product.FG_ITEM will be added # # * CUT will iterate from 1 to # floor(ROLL_WIDTH / BOBBIN_WIDTH) and be # incremented with each consecutive label # * SET will increase from 1 to # ceil(JOB_QTY/floor(ROLL_WIDTH / BOBBIN_WIDTH)) # and be incremented after each # floor(ROLL_WIDTH / BOBBIN_WIDTH) labels # # ROLL_WIDTH will be directly queried as the # UNIT_WIDTH on the COMP_ITEM. or if the data that needs to be populated on the label via the flexfields can be modified via many different forms so that it would be more complex to modify all these areas than just simply querying for the required data as an extension to the printing process. The same WIP Contents label will be customized so that the set.SET will be added # . the single label in the file will # be replaced with QTY labels (where QTY is # indicated in the xml) in a single xml file in # the destination directory. the bobbins are manufactured for a particular customer. Please feel free to # edit or modify as needed. However. BOBBIN_WIDTH # will be directly queried as the UNIT_WIDTH on # the finished good associated with the job.JOB_NAME will be removed # . # . The Rules Engine will be used to ensure that the label format that is linked to the customization is selected only when the customer tied to the work order is Acme Industries. modifying only labels # of format BOBBIN.COMP_ITEM will be removed # . # # Author: David Wertheimer ################################################# # This script iterates through each xml file in # the source directory.tmp rm $file # Otherwise. direct queries to the database will be used to get this data. Acme Industries. rather than relying on flexfields to be populated to get the roll width. if available. and customer item fields are included. Continuing with the example above for the bobbin labels.# Determine the new SET and CUT LBLCTR=`expr $LBLCTR + 1` CUT=`expr $CUT + 1` if [ $CUT -gt $MAX_CUT ] then CUT=1 SET=`expr $SET + 1` fi done # Close the label file with the </labels> tag printf "</labels>\n">>$ofile # Remove the . the customer part number should be printed. #!/bin/sh ################################################# # This shell script has been created to # demonstrate the extensibility of Oracle WMS # labeling solution. move the label to the destination unchanged else mv $file $ofile fi done Including Additional Data Sources Populating the flexfields may not be feasible if there are more fields that must be added than there are flexfields available. The job is tied to that customer by way of a material reservation. no customizations need be made directly to the application. and customer item. Instead of printing the manufacturer’s part number of each bobbin.tmp rm body. Therefore.tmp files and the old label file rm label. cut.CUT will be added # . If the label includes the # text BOBBIN. All the fields in # the original source label will be carried # unchanged to the destination label with the # following exceptions: # # .

supply_source_type_id = 5 and mr. # Note that this script must be run in an envt # that has access to sqlplus and the database # so that environment variables may need to be # set.tmp . & customer item into SQLOUT=`sqlplus $User/$Pswd@$Instance << EOF set verify on set feedback on set serveroutput on size 200000 select '|'. identified by the # profile option WMS: Label Output Directory # .header_id and ool. wip_discrete_jobs wdj. mtl_sales_orders mso. rather than the # internal item number.organization_id = msi. wip_discrete_jobs wdj where wip_entity_name = '$JOB' and wdj. mtl_customer_items mci where wip_entity_name = '$JOB' and wdj. select '|'.tmp|tail -1|sed 1q|sed s/" "//g|tr -d '\011'` rm label_sql.wip_entity_id and we.DestDir must be the directory in which the # third party label integration software # .reservation_quantity and wdj. # .segment1) as item.Assumption: the order must have been entered # with the customer item. then FG_ITEM will be # populated with the customer item.start_quantity = mr. nvl(customer_item_number.unit_width as bobbin_width.tmp BOB=`cut -f2 -s -d"|" label_sql.wip_entity_name = '$JOB'.msifg.demand_source_type_id = 2 and mr.wip_entity_id = mr. wip_entities we where segment1 = '$COMP' and we.Instance is the database name to which # sqlplus should connect # . # # If the file does not contain the text BOBBIN.inventory_item_id and wdj.User/Pswd are the user name and password # to the instance.ordered_item_id = mci. and the sales order # indicates the customer item.wip_entity_id = we. mtl_reservations mr.organization_id = msifg.start_quantity as job_qty.# In addition.msifg. # .organization_id and ool.segment1 = ooh.header_id = ooh.supply_source_header_id and mr. roll width.tmp|tail -2| head -1|sed 1q|sed s/" "//g|tr -d '\011'` ROL=`cut -f2 -s -d"|" label_sql.wip_entity_id.xml do # The new file will have the same file name in the dest directory ofile=$DestDir/`basename $file` # If the text BOBBIN is found in the label if [ `grep '"BOBBIN"' $file|wc -l` -eq 1 ] then # Extract two fields (JOB_NAME.Assumption: job must be entirely reserved to # single customer. ################################################# SrcDir=/home/dlwerthe/work/labels/test_in/ DestDir=/home/dlwerthe/work/labels/test_out/ User=apps Pswd=apps Instance=wmsdev ################################################# for file in ${SrcDir}*. '|' from wip_entities we. # it is moved to the destination directory # unchanged. '|'. '|' from wip_entities we.wip_entity_id = we.primary_item_id = msifg.order_number and wdj. if the job is entirely reserved # to a single customer. COMP_ITEM) from xml JOB=`grep '"JOB_NAME"' $file|sed 's/<\/variable>//g'|sed 's/<variable name= "JOB_NAME">//g'` COMP=`grep '"COMP_ITEM"' $file|sed 's/<\/variable>//g'|sed 's/<variable name= "COMP_ITEM">//g'` # Extract the bobbin width.tmp|sed 1q|sed s/" "//g|tr -d '\011'` QTY=`cut -f2 -s -d"|" label_sql.wdj. select '|'.unit_width as roll_width. oe_order_lines_all ool.'|' from mtl_system_items msi.organization_id and we.demand_source_header_id = mso. EOF` echo "$SQLOUT" > label_sql. ################################################# # Configure script here.tmp|sed 1q|sed 1q|sed s/" "//g|tr -d '\011'` FG_ITEM=`cut -f3 -s -d"|" label_sql.sales_order_id and mso. # . otherwise customer specific # data will not be included in label.customer_item_id (+). mtl_system_items msifg.SrcDir must be the directory where Oracle # drops the xml files. oe_order_headers_all ooh.

the Shipping Content and LPN Summary label types can print one label for multiple items and item lots contained in a single license plate. or some other field Providing some types of aggregate statistics about the license plate.tmp # by removing the JOB_NAME & COMP_ITEM variables.tmp rm $file # Otherwise.tmp # Place the three header lines in the top of the new label sed 3q $file>$ofile # Repeat for each bobbin to print while [ $LBLCTR -le $QTY ] do # Concatenate the label body onto the new label file cat body. such as the following: • • • • Printing multiple serials on a single label Sorting the records on a multi-record label by the lot expiration date. There are several business requirements for several records of data on a single label that cannot be easily produced by these two multi-record labels. rather than a fixed maximum number of records per label . quantity.tmp` sed /xml/d label.# Calculate the maximum cut and maximum set based on the widths and quantity MAX_CUT=`expr $ROL / $BOB` MAX_SET=`expr $QTY / $MAX_CUT` if [ `expr $MAX_CUT \* $MAX_SET` -lt $QTY ] then MAX_SET=`expr $MAX_SET + 1` fi # Initialize counters LBLCTR=1 SET=1 CUT=1 # Extract the part of the label to be repeated into body. Specifically. such as the number of items or lots Producing a label of dynamic length. in that a single label may be produced for potentially many items. however. the </labels> line # and the three header lines at the top of the label LABEL=`sed /JOB_QTY/d $file|sed /JOB_NAME/d|sed /COMP_ITEM/d>label.tmp rm body. move the label to the destination unchanged else mv $file $ofile fi done Working with Multi-Record Formats Two of the label types produced by WMS are potentially multi-record labels.tmp>>$ofile # Append the SET and CUT to the label file printf "<variable name=\"SET\">$SET</variable>\n">>$ofile printf "<variable name=\"CUT\">$CUT</variable>\n">>$ofile printf "<variable name=\"FG_ITEM\">$FG_ITEM</variable>\n">>$ofile printf "</label>\n">>$ofile # Determine the new SET and CUT LBLCTR=`expr $LBLCTR + 1` CUT=`expr $CUT + 1` if [ $CUT -gt $MAX_CUT ] then CUT=1 SET=`expr $SET + 1` fi done # Close the label file with the </labels> tag printf "</labels>\n">>$ofile # Remove the .tmp|sed /DOCTYPE/d|sed /labels/d|sed /'<\/label>'/d>body.tmp files and the old label file rm label.

a pre-processor can rely on the multiple records of data. they typically require that the maximum number of fields on that label be defined in advance. The pre-processor would then directly query the serials and any other information to include on the label. at the # time that it runs. but rather includes a reference from which all the data can be gathered. rather than being combined into one multi-record label. the maximum number of records to be included in that label format must also be defined. While an LPN Summary label format can be defined for multiple records. a label that lists all the serials of a single item in an LPN is required. then the set will be split into two separate labels. Please feel free to # edit or modify as needed. That label would include the LPN. the Rules Engine can be used to select a special label format whenever an LPN Summary label is printed. without querying the database. # Files that do not include the string identified . but no serial information (because serial data is not available to the LPN Content label). a label aggregation approach is documented in the shell script below.xml. The database query approach may be slower because it requires that a database session be instantiated. # # Author: Aditya Agarkar ################################################# # This shell script scans the label output # directory and merges multiple LPN summary # label XML files for the same LPN into a # single XML document. #!/bin/sh ################################################# # This shell script has been created to # demonstrate the extensibility of Oracle WMS # labeling solution. and revision. That format should be a single-record format. It deletes the # individual files that were merged. It assumes that. However. Specifically. and the label pre-processor would then aggregate all the labels with the same format and license plate. The pre-processor can then aggregate these multiple labels into a single label by modifying the XML. The Rules Engine can be used to select a special label format whenever an LPN Content label for a serialized item is printed. However. lot. if the pre-processor runs in the middle of when a set of single-record labels that are associated together are dropped to the XML directory. all the files that should # be merged are present. all labels that are of the format identified by the variable LblFrmt will be merged into a single XML file in the destination directory. Note that most third-party label printing solutions do not support labels of dynamic length. it avoids some timing issues that are introduced in converting single-record labels to multirecord labels. Then the pre-processor can directly query the database to get all the data. to be produced as single-record labels. For instance. suppose a single multi-record label is required that lists all the contents of a license plate. The second. such as printing only the top three lots by quantity There are two types of label pre-processors that can address these types of requirements. It is not delivered as a # standard Oracle product. However. this script is demonstrative of how file merging can be used to build more complex label files. so that the labels ultimately produced by the third-party software from this merged XML file should be identical to that produced by multiple individual files. such as the multiple serials or multiple items in an LPN. Rather. item.• Including only a subset of all the items of lots that are in a license plate. and creates # a new merged XML file in the destination # directory with the file name <LPN>. For instance. The XML included in those files is unchanged. The first approach is for the system to produce only a single label that does not include all the data to be included in the label. no matter how many items or lots are in that license plate. Specifically. The database query approach is similar to another example provided above.

Label printing transactions will be performed throughout the day so the label preprocessor should be set up to monitor the directory.SrcDir must be the directory where Oracle # drops the xml files.1` head -$HeaderLines $file>$DestDir/$lpn.. mv $file $DestDir if [ $lastlpn != NULL ] then echo "</labels>" >>$DestDir/$lastlpn.'` if [ $lbl = $LblFrmt ] then # Check if XML file is for LPN Summary label lpn=`grep "HLPN" $file| cut -f2 -d'>'|cut -f1 -d'<'` # If this is the first LPN Summary file in the iteration.xml lpn=NULL lastlpn=NULL fi fi done else # No XML file with prefix found.xml then # Now look for files in Source Directory with the Prefix for file in `ls -rt ${SrcDir}/*.DestDir must be the directory in which the # third party label integration software # expects to find the xml files..xml rm $file fi fi else # This is not an LPN Summary Label. modify the xml. if [ $lastlpn = NULL ] then lastlpn=$lpn # Extract XML data without the </labels> tag TotLines=`wc -l $file|cut -c1-9` HeaderLines=`expr $TotLines .... . ################################################# SrcDir=/home/dlwerthe/work/labels/test_in/ DestDir=/home/dlwerthe/work/labels/test_out/ ################################################# LblFrmt=LPNSUM lastlpn=NULL lpn=NULL CtDate='date|cut -c1-3' if test -f ${SrcDir}/*. ################################################# # Enter source / destination directories here. when run.4` HeaderLines=`expr $TotLines .xml rm $file echo "</labels>" >>$DestDir/$lastlpn.1` head -$HeaderLines $file|tail -$RelevantLines>>$DestDir/$lpn. There are two methods by which the script can be set to iterate frequently.xml rm $file else # Is it a new LPN Summary Label file if [ $lastlpn != $lpn ] then # Extract XML data without the </labels> tag TotLines=`wc -l $file|cut -c1-9` HeaderLines=`expr $TotLines . if [ $lastlpn != NULL ] then echo "</labels>" >>$DestDir/$lastlpn.1` head -$HeaderLines $file>$DestDir/$lpn. identified by the # profile option WMS: Label Output Directory # .xml lpn=NULL lastlpn=NULL fi fi Directory Monitoring The label processing scripts above.# by $LblFrmt are moved unchanged.xml` do lbl=`grep "labels _FORMAT =" $file|cut -f2 -d'"'|cut -f1 -d'.xml lastlpn=$lpn lpn=NULL else # XML file found for last LPN. Now consolidating with earlier file # Extract XML data without the header and </labels> tag TotLines=`wc -l $file|cut -c1-9` RelevantLines=`expr $TotLines .. # . will go through all xml files in a given source directory. Close earlier label. and move the files to the destination directory. periodically checking for new files.

# # Author: David Wertheimer ################################################# # This script iterates through each xml file in # the source directory. many operating systems do not support scheduling a cron job to run any more frequently than every minute.DestDir must be the directory in which the # third party label integration software # expects to find the xml files. ################################################# # Enter source / destination directories here. potentially integrated with database queries and file management chores. but note that this latency is introduced on top of the latency of the label printing software picking up the xml file from the destination directory. if particularly slow.." sleep $WaitTime done Performance & Other Issues The label preprocessing is primary a text processor. If the file does # not contain the text LG_MATERIAL. ################################################# SrcDir=/home/dlwerthe/work/labels/test_in/ DestDir=/home/dlwerthe/work/labels/test_out/ WaitTime=5 ################################################# # Start infinite loop here while [ Date –eq Date] do # For each file in the source directory ending with *. A more direct approach is to add a while loop surrounding the entire logic in the script.xml for file in ${SrcDir}*. The first script above that modifies the label quantity for certain label formats has been modified below to poll the source directory every five seconds. A poorly written preprocessor can unnecessarily consume system resources. identified by the # profile option WMS: Label Output Directory # .Press ctrl+c to abort. #!/bin/sh ################################################# # This shell script has been created to # demonstrate the extensibility of Oracle WMS # labeling solution. # . the script can be set up as a cron job by adding a timing entry to the crontab file. # . While this approach allows the operating system to manage the process.SrcDir must be the directory where Oracle # drops the xml files. and. The latency in label printing that this will introduce is typically unacceptable in an interactive warehousing environment. introducing additional latency beyond the two directory monitoring latencies. in seconds. move the label to the destination unchanged mv $file $ofile fi done echo "Waiting for files in $SrcDir. The desire for a smaller latencies. that this # script waits between polling the SrcDir for # new files.WaitTime is the time. . and thus a smaller sleep time must be balanced with the load the process may place on system resources. replacing the quantity sed s/'_QUANTITY="1"'/'_QUANTITY="2"'/g < $file > $ofile # Remove the original label file rm $file else # Otherwise. It is not delivered as a # standard Oracle product. # # This script iterates in an infinite loop so # that the source directory is continually # monitored. replacing _QUANTITY="1" # with _QUANTITY="2" if the file includes the # text LG_MATERIAL and moving the new file to # the destination directory. it is moved # to the destination directory unchanged. A typical wait time may be five or ten seconds.. Please feel free to # edit or modify as needed.xml do # The new file will have the same file name in the dest directory ofile=$DestDir/`basename $file` # If the text LG_MATERIAL is found in the label if [ `grep '"LG_MATERIAL"' $file|wc -l` -eq 1 ] then # Copy the label to the destination. and to place a sleep command at the end of the loop.First.

a label with some error condition or text could also be printed out. in order to calculate the set and cut. If there are many different customization requirements. each of which requires separate logic to convert the original file to the required format. or during the ship confirmation flow. Sometimes. unless this error was captured. a label is required during a business flow that does not yet support label printing. the transaction or flow can call the same APIs used by label printing. it may not be possible to use the mobile forms to either perform the transaction or to perform a manual print request afterwards. For instance. The scripts above were written for clarity and accuracy. may be null or populated as zero. then a more modular approach should be taken. none of the desktop material receipt transactions print a label. for certain business reasons. ordinarily available when an LPN is either loaded or dropped. avoid using temporary files. immediately moving files that do not require modifications to the destination directory. for which the shell script would ungracefully terminate. Combine all database queries into a single session if possible. the roll width is divided by the bobbin width. the pre-processor should continue to move other label files to the destination directory. any pre-processing scripts must be made robust. such as the WIP Contents label being used in examples above to produce the manufacturing labels with the required set and cut. stopping all label printing. there just may not any printing close to what is required. or at least not error out. the following issues should be considered when building a custom solution: • • Minimize access to the file system. For these requirements.Like any other customization effort. yet desktop receipts may be used commonly and. The transaction or flow during which a label is required can be customized to call the label printing code directly. For instance. or during a custom business flow that was built to support some specific business requirement. where a parent script could cycle through all the XML files. handling common error conditions gracefully. Custom Label Printing Call Oracle WMS can automatically generate labels for several label types during about two-dozen different business flows. The bobbin width. This would cause a division by zero. and a different customization approach may then be necessary. The following API can be used when label printing is called from Java: PROCEDURE PRINT_LABEL_MANUAL_WRAP ( x_return_status OUT VARCHAR2 . Perhaps the existing label types and an XML pre-processor can be leveraged to produce a label close to when the labels are required. whether populated in a flexfield or queried directly from the database. However. the user may be far from that printer. At the very least. but rather write once to the destination once the label is completely built in memory. But the user must also be informed that the required bobbin labels cannot be printed. but kicking off background processes for the other files that do require changes. Or a shipping content label. particularly because of the potentially large volume of labels that may be produced by the system. the pre-processor should be designed with performance in mind. because instantiating a session may be slow even if the individual queries to run are fast. but often use inefficient processes. This may be because the users get their labels from a centrally located label printer and by the time the user loads (or drops) the task. in the examples above. Also. may be required as soon as the task is initially presented to the user. In particular. however.

p_no_of_copies . Summary Oracle WMS provides a flexible way to print any number of different labels during almost every transaction or event supported on the mobile device. . For instance. not all of the parameters are necessary for each label type. . p_transaction_id . . while the label format and printer name can either be passed in explicitly. To see exactly which parameters are required for each label type. As this type of customization requires directly modifying the code to change the process by which labels are called. p_commit . . p_transaction_identifier . it carries the standard risks that patches may overwrite the customizations. ) x_msg_count x_msg_data x_label_status p_business_flow_code p_label_type_id p_organization_id p_inventory_item_id p_revision p_lot_number p_fm_serial_number p_to_serial_number p_lpn_id p_subinventory_code p_locator_id p_delivery_id p_quantity p_uom p_no_of_copies p_fm_schedule_number p_to_schedule_number p_format_id p_printer_name OUT NUMBER OUT VARCHAR2 OUT VARCHAR2 IN NUMBER IN NUMBER IN NUMBER IN NUMBER IN VARCHAR2 IN VARCHAR2 IN VARCHAR2 IN VARCHAR2 IN NUMBER IN VARCHAR2 IN NUMBER IN NUMBER IN NUMBER IN VARCHAR2 IN NUMBER IN VARCHAR2 IN VARCHAR2 IN NUMBER IN VARCHAR2 The proper label type can be selected from the lookup codes defined in MFG_LOOKUPS: select lookup_code. otherwise the calls are identical. as well as the quantity and UOM of the item. Similarly. p_label_type_id . or left for the Rules Engine and printer assignments to determine. p_init_msg_list . . while the LPN Summary label type requires only a license plate. . . combined with the flexibility of the WMS Rules Engine and the third-party label printing software. . and future releases may require re-engineering of the customization in that the specification of the manual label print API or other APIs may change. the following call should be used instead: PROCEDURE PRINT_LABEL ( x_return_status . meaning from mfg_lookups where lookup_type = 'WMS_LABEL_TYPE' The business flow code should be passed in as null for a manual label request. . . p_format_id . .pls. . . and as applicable. x_msg_data . . schedule. The flexibility of the label printing solution. so when a Material label type is being printed. . p_input_param_rec . . p_business_flow_code . x_label_status . observe the behavior of the Manual Print page on the mobile. For instance. . . those parameters should be passed as null. x_msg_count . p_api_version . the Material label has no references to job. a Material label is driven by the item. or serial number. should remove many of the needs to customize label printing. p_printer_name ) OUT VARCHAR2 OUT NUMBER OUT VARCHAR2 OUT VARCHAR2 IN NUMBER IN VARCHAR2 IN VARCHAR2 IN NUMBER IN NUMBER IN transaction_id_rec_type IN input_parameter_rec_type IN NUMBER IN NUMBER IN NUMBER IN NUMBER IN VARCHAR2 PRINT_LABEL_MANUAL_WRAP is a wrapper for PRINT_LABEL that avoids the use of structures. p_print_mode . and lot numbers. . . revision.. . . If label printing is called from PL/SQL. Both can be found in INVLABPB.

As Oracle WMS expands the features available as standard functionality. so that additional data can be made available for the labels. changing the structure of the label. including any data. and combined with the flexibility offered by both Oracle and the third-party label software. . adding additional data from direct database queries. or just performing basic manipulations not available in the third-party software. additional calls to the label printing APIs can be made so that labels are printed during flows that do not already print labels. Custom triggers can populate flexfields that can be easily included on the labels. if the business requirements cannot be modeled by standard functionality. should be able to meet all requirements. Finally. the need for many of these may disappear. These three approaches to requirements allow any label to be printed at any time. but there may always be some industry-specific or company-specific requirements that WMS just can not meet out of the box. then three approaches to customization are available that should make label printing much more flexible. An XML pre-processor can directly modify the XML produced by WMS prior to the third-party label software picking it up. and cannot be altered.However.

This document is provided for informational purposes only and the information herein is subject to change without notice. Oracle is a registered trademark.S. Worldwide Inquiries: 415. Oracle Corporation World Headquarters 500 Oracle Parkway Redwood Shores.A.506. CA 94065 U. Oracle Corporation does not provide any warranties covering and specifically disclaims any liability in connection with this document.October 2002 Author: David Wertheimer Copyright © Oracle Corporation 2002 All Rights Reserved Printed in the U.A. Please report any errors herein to Oracle Corporation.506.7200 Copyright © Oracle Corporation 2002 All Rights Reserved .S.7000 Fax 415.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->