Vous êtes sur la page 1sur 22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

OracleApplications
KnowledgeSharingAjay
Atre

LabelPrintingwithWMS
Wednesday,November21,2012byAjayAtre

LabelPrintingwithWMS
TogetherwithMSCA(Mobilesupplychainapplication)andWMS(warehousemanagementsystem)have
capabilitiesbuiltintotoproducelabelssuringthevariouspointsofthebusinessprocess.
OracleWMSproduceslabelXMLfilesasapartoftransactionoraneventsuchasaPurchaseorder
receipt,Pickconfirmation,workordercompletionorlicenaceplatetransactionsuchasconsolidate,
generateetc.
ToprintoraclegeneratedlabelXML,youwillneedactuallabelprinter,labeldesignapplicationtodefine
thegraphicallayoutofthelabel.
Oraclesupportstwokindsoflabelprintingconfigurations
1.Printingusingthirdpartylabelsoftwareandaprintserver
2.PrintingusingXMLenableddirectlabelprinters
TheprintingstrategydependsuponfactorslikeROI,realtimelatency,volumeoflabel,network
infrastructureetc.
Printerserversolution
InthisstrategyitrequirestohaveaconfigurationofOracleWMS,thirdpartylabelprintingsoftware,
printerserverandnetworkprinters.
TheLDA(Labeldesignapplication)allowsyoutodefinedifferentlabelprintingformats.Theprinter
servermanagestheprintqueue.Finallythelabelprinterprintsthelabel.
ThelabelprinterandLDAcancomefromsamevendororyoucanhavedifferentvendorsforit.
Thisapproachisrecommendedwhenyouhavehighvolumeoflabelstoprintformeachprinter.
OracleWMSallowsyoutohavetwochoicesofintegrationwiththirdpartysoftware.
ThiscanbedonebysettingtheprofileWMSLabelPrintModeAsynchronous
1.Asynchronousmode
2.Synchronousmode
InAsynchronousmodeofarchitectureoracleWMSgeneratedthelabelXMLanddropsinitaspecified
directory.ThirdpartylabelsoftwaremonitorsthisdirectoryforanynewXMLfileandprocessesthem.
ProfileWMS:LabeloutputdirectoryspecifywheretheXMLfileneedstostored
WMS:LabelfileprefixLabelprefix.

SearchThisBlog
Search

Labels
AOL(1)
APIs(1)
ATO(1)
B2B(1)
BacktoBack(1)
BIPublisher(3)
DiscreteQuality(1)
DropShip(2)
EDI(1)
FormPersonalization(2)
INV(2)
INVORG(1)
IRISO(1)
IRISO(1)
Modifiers(1)
O2C(1)
OM(8)
OPM(3)
OPMQUALITY(1)
OrdertoCash(1)
P2P(1)
ProcuretoPay(1)
Profile(1)
R12(22)
RMA(1)
ShellScript(1)
SQLQueries(1)
UNIX(1)
ViewOutput(1)
WMS(5)

BlogArchive

Disadvantagesofasynchronouslabelprinting
IncludelatencysecurityissuestoFTPfilesacrossseversandnopossibilityforresponse/
Synchronousmode
SetprofileasWMSLabelPrintModeSynchronousGeneric
Insynchronousmodeofintegration,OracleWMSgeneratesalabelXMLandsendsitdirectlytothe
partnerviaoneoftwosynchronousmethods.Inthefirstmethod,theintegrationisviaanAPI
implementedbythethirdpartyapplicationthatreplacesanemptystubprovidedbyOracle
(INV_TXNSTUB_PUB.POSTTRANSACTION).

2015(2)
2013(1)
2012(27)
December(2)
November(12)
LabelPrintingwithWMS
OMATOSetupsinOracle
AppsR12
WMSMaterialstatuswith
OracleAppsR12
WMSInboundReceiving
withOracleAppsR12
WMSOutboundshipping
withOracleAppsR12
HandfulAOLstuffwith
OracleAppsR12
EDIswithOracleApps
R12
DiscreteQualitySetupin
OracleAppsR12
ProcessingConstraintsin
OracleOrder
Management
RMAinOM
DropShipCycle
(Explainedindetail)
OPMQualitySetupin
R12
October(6)
September(1)
August(3)
July(3)

AboutMe
AjayAtre
Viewmycompleteprofile

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

1/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

TotalPageviews

84361
Followers
Jointhissite
withGoogleFriendConnect

Members(28) More

Optionally,youcansetWMSLabelPrintModetoSynchronousTCP/IPanddefinetheIPaddressand
portonwhichtheprintserverislistening.
XMLDIRECTPRINTER
InthisstrategyOracleWMSsendstheXMLdirectlytotheprinter.Thelabelprinteriscapableof
receivingXMLthatmeetsOracleslabelspecificationandmergeswithpredefinedlabelformatstoprint
alabel.
XMLPUBLISHER
UsingXMLpublisher,youcanconfigureyourlabellayoutinMSWordandmapthedatacontentto
OracleXML.Youcanprinttheselabelsonnormalprinters.
However,youcannotdeployOracleXMLpublisherasaprintingsolutionbecauseitdoesnothaveprinter
driversforindustriallabelprinterslikeZebra,Intermecetc.
TransactionManagerStub(INV_TXNSTUB_PUB.POSTTRANSACTION)
Thetransactionmanagercallsanemptystubwheneachtransactionprocesses,regardlessofprocessing
mode.Itcanincludeanyadditionalbusinesslogictoperformforeachrecordinthetransactioninterface
tables.
Labelprinttestcase
Iamexplainingatestcasebasedonthesynchronousmode
Utilizing
INVstubINV_TXNSTUB_PUB.POSTTRANSACTION
AndWMSsynchronousstubINV_SYNC_PRINT_REQUEST.SYNC_PRINT_REQUEST

Where
INV_TXNSTUB_PUB.POSTTRANSACTIONisgettingcalledattheendofinventorytransactionslikePO
receipt,shipconfirmetc.
INV_SYNC_PRINT_REQUEST.SYNC_PRINT_REQUESTisgettingcalledwhenyousetprofileWMSLabel
PrintModeasSynchronousGeneric

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

2/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

Havingcustomlabelreprintprogrambywhichuserscanreprintthelabelsifneeded.
Prerequisites
OracleprintersetupssettinguptheIntermecprinterinoracleandonnetwork.
OracleWMSsetupforlabelformatandassigningtoaparticularbusinessflows.
Demonstration
1POreceiptlabelprinting
PurchasingNavigation:Purchaseorder
CreatethePOandapproveit.

ReceivethePObyMSCA

NoteAswearecallingora_label_print_pkg.inv_trx_label_printinside
INV_TXNSTUB_PUB.POSTTRANSACTION,thecustomprocedurecallscollectsthedataandinsertsa
recordintocustomtable(ORA_LABEL_PRINT_TAB)onwhichwehavetriggerwhichfirescustomlabel
printprogram.

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

3/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

Thisprogramprintsalabelas

2LPNTransactionslpnconsolidatelabelprint
Prerequisite
SettheWMSlabelprocessingmodeprofile(WMS:LabelPrintMode)tosynchronous

Labelformat
WarehousemanagerNavigation:Setup/WarehouseConfiguration/Definelabelformat
Youcandefineyouownformatoruseexistingformatoncedefinedmakeitdefault
ForexampleIhavedefinedcustomformatunderLPNcontentlabeltypeasCustomLPNContent
ThelabelformatcontentsminimumfieldswhichIwanted.

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

4/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

AssignlabeltypestoBusinessflows
WarehousemanagerNavigation:Setup/WarehouseConfiguration/AssignlabeltypestoBusinessflows
HereIamassigninglabeltypetobusinessflow.Businessflowisactuallytransactionslikeshipconfirm,
poreceiptorpack/unpacklpns.

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

5/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

CompletethelpnconsolidatetransactionfromMSCAasbelow

Oncesuccesscheckthelabelhistory
YouwillseethexmlgeneratedunderLPNContentwhichisessentiallysamepassedtopackage
INV_SYNC_PRINT_REQUEST.SYNC_PRINT_REQUESTparameterp_xml_content

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

6/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

7/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

Labelcontent
<?xmlversion="1.0"encoding="UTF8"standalone="no"?>
<!DOCTYPElabelsSYSTEM"label.dtd">
<labels_FORMAT="CustomLPNContent"_QUANTITY="1"_PRINTERNAME="LabelPDF"
_JOBNAME="LBL17603">
<label>
<variablename="ITEM">ORATEST_WMS_ITEM</variable>
<variablename="LOT">04MAR11</variable>
<variablename="LPN">LPN402A</variable>
<variablename="WHS">OWH</variable>
<variablename="QTY">1</variable>
<variablename="REQUEST_USER">ORATEST</variable>
</label>
</labels>
Note:Thecustompackageora_label_print_pkg.lpnsplit_consolidate_data(p_xml_content)
Processesthereceivedxmldatawithparameterp_xml_contentandloadsintocustomlabelprinttable
whichthenfiresthelabelprintprogram.
Labelgeneratedas

1LabelReprint
Consideringwehavedonetheplumbingworktogetthelabelsgeneratedduringvariouspartofprocess,
wewillstillneedthelabelreprintmechanism.
Usingthereprintingmechanismusercanreprintthelabelwheneverneedstobe.
Reprintingisneededincasewhereoriginallabelislostoranyotherreason.

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

8/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

Ihavedefinedaplsqlconcurrentprogrambasedprocedureora_label_print_pkg.reprint_label_data.
Theideabehindthereprintlabelprogramisshowallonhandlpnsavailable(youcanhavelotnumber
aswell)andletuserselectwhichlpnitneedstobereprinted.
TodothisIhavecreatedatablevaluesetbasedonbelowview

CREATEORREPLACEFORCEVIEWORA_GET_LPN_ONHNAD
as
SELECTROWIDTOCHAR(moqd.ROWID)row_id,
wlpn.license_plate_numberlpn,
msib.segment1item_number,
moqd.lot_number,
mp.organization_codewhs,
moqd.subinventory_code,
(SELECTmil.segment1LOCATION
FROMmtl_item_locationsmil
WHEREmoqd.locator_id=mil.inventory_location_id
ANDmoqd.organization_id=mil.organization_id)
LOCATOR,
moqd.transaction_quantityqty,
moqd.inventory_item_id,
moqd.organization_id,
moqd.locator_id,
moqd.lpn_id
FROMmtl_onhand_quantities_detailmoqd,
mtl_parametersmp,
mtl_system_items_bmsib,
wms_license_plate_numberswlpn
WHEREmoqd.organization_id=mp.organization_id
ANDmoqd.inventory_item_id=msib.inventory_item_id
ANDmoqd.organization_id=msib.organization_id
ANDmoqd.lpn_id=wlpn.lpn_id
Thevaluesetletsusertoselectthelpnnumberandthenpassestherowedofonhandquantitiestable.

Thereprintprogramthenpicksrequiredcolumnsfromonhandtableandtheninsertsrecordintocustom
labelprintprogramwhicheventuallyfilestheactuallabelprint.

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

9/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

Labelreprintedas

PrinterSetups
SystemadministratorNavigation:Install/Printer/Register

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

10/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

SystemadministratorNavigation:Install/Printer/types

SystemadministratorNavigation:Install/Printer/style

SystemadministratorNavigation:Install/Printer/Driver

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

11/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

Technicalinsight
Explainedasshownbelow.

Concurrentprogramscreated
ORALabelPrintProgram
MakesurethelabelprintprogramhasthestyleselectedasIntermec.

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

12/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

Concurrentprogramscreated
ORALabelPrintProgram

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

13/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

ReadtheXMLandplacethevaluesinoracletable
IhavedefinedaprocedurewhichreadstheXMLdataandinsertsthevaluesintotable
Forexampleseebelow

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

14/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

Tabledata

DROPSEQUENCEORA_LABEL_PRINT_TAB_s
CREATESEQUENCEora_label_print_tab_s
STARTWITH1
MAXVALUE9999999999999999999999999999
MINVALUE1
NOCYCLE
CACHE20
ORDER
DROPTABLEora_label_print_tab
CREATETABLEora_label_print_tab
(
TAG_PRINT_IDNUMBER,
TRANSACTION_IDNUMBER,
TRANSACTION_DATEDATE,
TRANSACTION_TYPE_IDNUMBER,
TRANSACTION_TYPE_NAMEVARCHAR2(100BYTE),
INVENTORY_ITEM_IDNUMBER,
ITEM_NUMBERVARCHAR2(100BYTE),
CASE_UPC_CODEVARCHAR2(100BYTE),
ITEM_DESCRIPTIONVARCHAR2(200BYTE),
LOT_NUMBERVARCHAR2(100BYTE),
LPN_IDNUMBER,
TRANSFER_LPN_IDNUMBER,
INNER_LPNVARCHAR2(100BYTE),
OUTER_LPNVARCHAR2(100BYTE),
TRANSACTION_QUANTITYNUMBER,
TRANSACTION_UOMVARCHAR2(100BYTE),
ORGANIZATION_IDNUMBER,
ORGANIZATION_CODEVARCHAR2(100BYTE),
SUBINVENTORY_CODEVARCHAR2(100BYTE),
LOCATOR_IDNUMBER,
LOCATORVARCHAR2(100BYTE),
LOT_EXPIRATION_DATEDATE,
TRANSACTION_SOURCE_IDNUMBER,
BATCH_NOVARCHAR2(100BYTE),
BATCH_MACHINEVARCHAR2(100BYTE),
BATCH_LINEVARCHAR2(100BYTE),
BATCH_SHIFTVARCHAR2(100BYTE),
PALLET_IDVARCHAR2(100BYTE),
ITEM_TAG_TYPEVARCHAR2(100BYTE),
REQUEST_USERVARCHAR2(2000BYTE),
PRINTER_NAMEVARCHAR2(100BYTE),
PRINT_COPIESVARCHAR2(100BYTE),
REPRINT_REQUEST_IDNUMBER,
REQUEST_IDNUMBER,
CREATION_DATEDATE,
CREATED_BYNUMBER,
LAST_UPDATE_DATEDATE,
LAST_UPDATED_BYNUMBER,
ORIG_SYS_REFERENCEVARCHAR2(200BYTE),
STATUSVARCHAR2(10BYTE),
ERROR_MESSAGEVARCHAR2(2000BYTE)
)

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

15/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

Triggercode

CREATEORREPLACETRIGGERora_label_print_tab_trg
BEFOREINSERT
ONora_label_print_tab
FOREACHROW
DECLARE
++
+VariableDeclaration+
++
g_debug_pointVARCHAR2(50)
l_resp_idNUMBER:=NULL
l_resp_appl_idNUMBER:=NULL
l_request_idNUMBER:=NULL
l_resultBOOLEAN
l_result1BOOLEAN
e_user_nullEXCEPTION
BEGIN
g_debug_point:='TRG_1000'
IF:NEW.created_byisnullthen
raisee_user_null
ENDIF
++
+GettheRespIDfor'WarehouseManager',akathe'WMS'key
++
BEGIN
g_debug_point:='TRG_1020'
l_resp_id:=NULL
l_resp_appl_id:=NULL
SELECTresponsibility_id
,application_id
INTOl_resp_id
,l_resp_appl_id
FROMapps.fnd_responsibility
WHEREresponsibility_key='WMS'
ANDROWNUM=1
EXCEPTION
WHENOTHERS
THEN
l_resp_id:=0
l_resp_appl_id:=0
END
++
+InitializeAPPSEnvironment+
++
g_debug_point:='TRG_1030'
/*
BEGIN
fnd_global.apps_initialize(:NEW.created_by,l_resp_id,l_resp_appl_id)
EXCEPTION
WHENOTHERS
THEN
NULL
END
*/
IFl_resp_idISNOTNULL
ANDl_resp_appl_idISNOTNULL
THEN
fnd_global.apps_initialize(:NEW.created_by,l_resp_id,l_resp_appl_id)
NULL
ELSE
:NEW.status:='E'
:NEW.error_message:=
'Errorat('||g_debug_point||'):'||'Errorgettingtheresponsibilityidfor
responsibilitykeyWMS'
:NEW.last_update_date:=SYSDATE
:NEW.last_updated_by:=:NEW.created_by
ENDIF
++
+Launchtheprintingprogram
++
g_debug_point:='TRG_1100'
l_result:=fnd_request.set_mode(TRUE)
l_result1:=fnd_request.set_print_options(printer=>
:NEW.printer_name
,copies=>:NEW.print_copies)
g_debug_point:='TRG_1110'
l_request_id:=
fnd_request.submit_request('WMS'application_short_name
,'ORA_LABEL_PRINT'concurrentprogramname
,NULLdescription
,NULLstarttime
,FALSEsub_request
,:NEW.tag_print_id
,CHR(0)
)
COMMIT
IFNVL(l_request_id,1)>0
THEN
g_debug_point:='TRG_1120'
:NEW.request_id:=l_request_id
:NEW.last_update_date:=SYSDATE
:NEW.last_updated_by:=:NEW.created_by
ELSE
:NEW.status:='E'
:NEW.error_message:=
SUBSTR('Errorat('
||g_debug_point
||'):'
||'1ErrorsubmittingconcprogramORA_LABEL_PRINTprinter'
||:NEW.printer_name
||'SQLMSG:'
||SQLERRM
,1
,2000
)

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

16/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

:NEW.last_update_date:=SYSDATE
:NEW.last_updated_by:=:NEW.created_by
ENDIF
EXCEPTION
WHENe_user_null
THEN
NULL
WHENOTHERS
THEN
:NEW.status:='E'
:NEW.error_message:=
SUBSTR('Errorat('||g_debug_point||'):'||'2ErrorsubmittingconcprogramORA_LABEL_PRINT'
||'SQLMSG:'||SQLERRM
,1
,2000
)
:NEW.last_update_date:=SYSDATE
:NEW.last_updated_by:=:NEW.created_by
ENDora_label_print_tab_trg
/

Packagecode

CREATEORREPLACEPACKAGEapps.ora_label_print_pkgAUTHIDCURRENT_USER
AS
++
Reprintingthelableprocedurecalledbyreprintconcprogram
++
PROCEDUREreprint_label_data(
p_errbufOUTVARCHAR2
,p_retcodeOUTNUMBER
,p_onhand_qty_rec_rowidINVARCHAR2
)
++
calledinsideINV_TXNSTUB_PUB.POSTTRANSACTIONforlabelprintslikeporeceiptWOLcompletion
++
PROCEDUREinv_trx_label_print(
p_transaction_idINNUMBER
)
++
calledinsideINV_SYNC_PRINT_REQUEST.SYNC_PRINT_REQUESTforlpntransactionslabelprint
++
PROCEDURElpnsplit_consolidate_data(
p_xml_contentINLONG
)
PROCEDUREprint_label(
p_errbufOUTVARCHAR2
,p_retcodeOUTNUMBER
,p_tag_print_idINNUMBER
)
ENDora_label_print_pkg
/
CREATEORREPLACEPACKAGEBODYapps.ora_label_print_pkg
AS
g_printer_nameCONSTANTVARCHAR2(50):='D41'
PROCEDUREwrite_line(
p_buffer_lineINVARCHAR2
)
IS
BEGIN
++
Writethebuffer.
++
WritebuffertotheConcurrentManageroutput.
fnd_file.put_line(fnd_file.output,p_buffer_line)
DBMS_OUTPUT.put_line(p_buffer_line)
ENDwrite_line
FUNCTIONget_xml_variable(
p_xmlINLONG
,p_variable_nameINVARCHAR
)
RETURNVARCHAR2
IS
x_xml_valueVARCHAR2(100):=NULL
l_sessionVARCHAR2(1000):=NULL
BEGIN
BEGIN
x_xml_value:=NULL
++
+
++
l_session:='altersessionsetevents=''31156tracenamecontextforever,
level2'''
EXECUTEIMMEDIATEl_session
SELECTTRIM(EXTRACTVALUE(VALUE(x),'//variable'))
INTOx_xml_value
FROM(SELECTXMLTYPE(p_xml)xml
FROMDUAL),TABLE(XMLSEQUENCE(EXTRACT(xml,'labels/label/variable')))x
WHEREUPPER(EXTRACTVALUE(VALUE(x),'//@name'))=UPPER(p_variable_name)
EXCEPTION
WHENOTHERS
THEN
x_xml_value:=NULL
END
RETURNx_xml_value
ENDget_xml_variable
++
|gettheextractedvaluesfromxml_content
++
PROCEDURElpnsplit_consolidate_data(
p_xml_contentINLONG

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

17/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

)
IS
r_ora_label_print_tabora_label_print_tab%ROWTYPE
BEGIN
fnd_file.put_line(fnd_file.LOG,'++')
fnd_file.put_line
(fnd_file.LOG
,'UsesLPNSPLIT_CONSOLIDATE_DATATagsprintingfrom
INV_SYNC_PRINT_REQUEST.SYNC_PRINT_REQUEST(WMSLABELPRINTING)fortrxtypesLPNsplit(89)and
LPNpack(87)')
r_ora_label_print_tab.lot_number:=get_xml_variable(p_xml_content,
'LOT')
r_ora_label_print_tab.request_user:=get_xml_variable(p_xml_content,
'REQUEST_USER')
r_ora_label_print_tab.inner_lpn:=get_xml_variable(p_xml_content,
'LPN')
r_ora_label_print_tab.item_number:=get_xml_variable(p_xml_content,
'ITEM')
r_ora_label_print_tab.organization_code:=get_xml_variable(p_xml_content,
'WHS')
r_ora_label_print_tab.transaction_quantity:=get_xml_variable(p_xml_content,
'QTY')
INSERTINTOORA_LABEL_PRINT_TAB
(tag_print_id
,item_number
,lot_number
,inner_lpn
,printer_name
,print_copies
,created_by
)
VALUES(ora_label_print_tab_s.nextval
,r_ora_label_print_tab.item_number
,r_ora_label_print_tab.lot_number
,r_ora_label_print_tab.inner_lpn
,g_printer_name
,1
,6895
)
END
++
|reprint_label_data
++
PROCEDUREreprint_label_data(
p_errbufOUTVARCHAR2
,p_retcodeOUTNUMBER
,p_onhand_qty_rec_rowidINVARCHAR2
)
IS
CURSORc_get_onhand_details
IS
SELECTmsi.segment1item_number
,(SELECTwlpn.license_plate_number
FROMwms_license_plate_numberswlpn
WHEREwlpn.lpn_id=moqd.lpn_id)inner_lpn
,(SELECTmil.segment1LOCATION
FROMmtl_item_locationsmil
WHEREmoqd.locator_id=mil.inventory_location_id
ANDmoqd.organization_id=mil.organization_id)LOCATOR
,moqd.*
FROMmtl_onhand_quantities_detailmoqd,mtl_system_itemsmsi
WHEREmoqd.inventory_item_id=msi.inventory_item_id
ANDmoqd.organization_id=msi.organization_id
ANDmoqd.ROWID=p_onhand_qty_rec_rowid
BEGIN
fnd_file.put_line(fnd_file.LOG,'++')
fnd_file.put_line(fnd_file.LOG,'Reprintingthelabel')
FORr_get_onhand_detailsINc_get_onhand_details
LOOP
INSERTINTOora_label_print_tab
(tag_print_id
,item_number
,lot_number
,inner_lpn
,printer_name
,print_copies
,created_by
)
VALUES(ora_label_print_tab_s.nextval
,r_get_onhand_details.item_number
,r_get_onhand_details.lot_number
,r_get_onhand_details.inner_lpn
,g_printer_name
,1
,6895
)
ENDLOOP
ENDreprint_label_data
++
|INVSTUBprocedure
++
PROCEDUREinv_trx_label_print(
p_transaction_idINNUMBER
)
IS
CURSORc_get_onhand_details
IS
SELECTmmt.transaction_id
,mmt.creation_datetransaction_date
,mtt.transaction_type_id
,mtt.transaction_type_name
,msi.inventory_item_id
,msi.segment1item_number
,mtln.lot_number
,ABS(mmt.transaction_quantity)transaction_quantity
,mmt.transaction_uom
,mmt.organization_id
,mp.organization_code

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

18/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

,mmt.subinventory_code
,(SELECTwlpn.license_plate_number
FROMwms_license_plate_numberswlpn
WHEREwlpn.lpn_id=NVL(NVL(mmt.lpn_id,mmt.transfer_lpn_id),mmt.content_lpn_id))
inner_lpn
,(SELECTmil.segment1LOCATION
FROMmtl_item_locationsmil
WHEREmmt.locator_id=mil.inventory_location_id
ANDmmt.organization_id=mil.organization_id)LOCATOR
,1print_copies
,fu.user_namerequest_user
,mmt.created_by
FROMmtl_system_itemsmsi
,mtl_material_transactionsmmt
,mtl_transaction_typesmtt
,mtl_parametersmp
,fnd_userfu
,mtl_transaction_lot_numbersmtln
WHEREmsi.organization_id=mmt.organization_id
ANDmsi.inventory_item_id=mmt.inventory_item_id
ANDmmt.transaction_type_id=mtt.transaction_type_id
ANDmmt.organization_id=mp.organization_id
ANDfu.user_id=mmt.created_by
ANDmmt.inventory_item_id=mtln.inventory_item_id
ANDmmt.organization_id=mtln.organization_id
ANDmmt.transaction_id=mtln.transaction_id
ANDmmt.transaction_id=p_transaction_id
BEGIN
fnd_file.put_line(fnd_file.LOG,'++')
fnd_file.put_line(fnd_file.LOG
,'TagsprintingfromINV_TXNSTUB_PUB.POSTTRANSACTIONfortrxtypeslikePO
Receipt(18)andWIPCompletion(44)')
FORr_get_onhand_detailsINc_get_onhand_details
LOOP
INSERTINTOora_label_print_tab
(tag_print_id
,item_number
,lot_number
,inner_lpn
,printer_name
,print_copies
,created_by
)
VALUES(ora_label_print_tab_s.nextval
,r_get_onhand_details.item_number
,r_get_onhand_details.lot_number
,r_get_onhand_details.inner_lpn
,g_printer_name
,1
,6895
)
ENDLOOP
ENDinv_trx_label_print
PROCEDUREprint_label(
p_errbufOUTVARCHAR2
,p_retcodeOUTNUMBER
,p_tag_print_idINNUMBER
)
IS
CURSORc_label_data
IS
SELECT*
FROMora_label_print_tab
WHEREtag_print_id=p_tag_print_id
BEGIN
FORr_label_dataINc_label_data
LOOP
fnd_file.put_line(fnd_file.LOG,'++')
fnd_file.put_line(fnd_file.LOG,'TAGPRINTINGSTARTS')
fnd_file.put_line(fnd_file.LOG,'++')
write_line('<STX><ESC>c<ETX>')Set86xxemulationmode.
write_line('<STX><ESC>P<ETX>')Enterprogrammode.
write_line('<STX>E4F4<ETX>')Erasepreviousformat#4.
write_line('<STX>H1o580,20f3c20h1w1d3,CustomLablePrintORATEST<ETX>')
write_line('<STX>B2o550,30f3c6,0,1h100w2.85i0d3,'||r_label_data.inner_lpn||'p@
<ETX>')
PrintLPNbarcode
write_line('<STX>H3o450,20f3c20h1w1d3,'||'LPNNumber:'||r_label_data.inner_lpn||'
<ETX>')
write_line('<STX>L4o425,10f3l440w2<ETX>')Linebelowbarcodeanditemnumber
write_line('<STX>B5o400,30f3c6,0,1h100w2.85i0d3,'||r_label_data.item_number||'p@
<ETX>')
Printitembarcode
write_line('<STX>H6o300,20f3c20h1w1d3,'||'ItemNumber:'||r_label_data.item_number||'
<ETX>')
write_line('<STX>B7o250,30f3c6,0,1h100w2.85i0d3,'||r_label_data.lot_number||'p@
<ETX>')
Printlotbarcode
write_line('<STX>H8o150,20f3c20h1w1d3,'||'LOTNumber:'||r_label_data.lot_number||'
<ETX>')
write_line('<STX>H16o53,20f3c30h1w1d3,'||r_label_data.inner_lpn||'<ETX>')
write_line('<STX>B17o35,20f3c6,0,1h30w1i0d3,'||r_label_data.inner_lpn||'p@<ETX>')
write_line('<STX>H18o38,225f3c30h2w1d3,'||TO_CHAR(SYSDATE,'MON/DD/RR
HH24:MI:SS')||'<ETX>')
write_line('<STX>R<ETX>')Enterdatamode
write_line('<STX><ESC>E4<CAN><ETX>')Accessformat#4/cleardata
write_line('<STX><ETB><ETX>')Printthelabel
ENDLOOP
ENDprint_label
ENDora_label_print_pkg
/

WhereascodebelowisanactualcodewhichgivesprintinginstructionstoIntermecprinter.
fnd_file.put_line(fnd_file.LOG,'++')
fnd_file.put_line(fnd_file.LOG,'TAGPRINTINGSTARTS')
fnd_file.put_line(fnd_file.LOG,'++')
write_line('<STX><ESC>c<ETX>')Set86xxemulationmode.
write_line('<STX><ESC>P<ETX>')Enterprogrammode.
write_line('<STX>E4F4<ETX>')Erasepreviousformat#4.

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

19/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

write_line('<STX>H1o580,20f3c20h1w1d3,CustomLablePrintORATEST<ETX>')
write_line('<STX>B2o550,30f3c6,0,1h100w2.85i0d3,'||r_label_data.inner_lpn||'p@
<ETX>')
PrintLPNbarcode
write_line('<STX>H3o450,20f3c20h1w1d3,'||'LPNNumber:'||r_label_data.inner_lpn||'
<ETX>')
write_line('<STX>L4o425,10f3l440w2<ETX>')Linebelowbarcodeanditemnumber
write_line('<STX>B5o400,30f3c6,0,1h100w2.85i0d3,'||r_label_data.item_number||'p@
<ETX>')
Printitembarcode
write_line('<STX>H6o300,20f3c20h1w1d3,'||'ItemNumber:'||r_label_data.item_number||'
<ETX>')
write_line('<STX>B7o250,30f3c6,0,1h100w2.85i0d3,'||r_label_data.lot_number||'p@
<ETX>')
Printlotbarcode
write_line('<STX>H8o150,20f3c20h1w1d3,'||'LOTNumber:'||r_label_data.lot_number||'
<ETX>')
write_line('<STX>H16o53,20f3c30h1w1d3,'||r_label_data.inner_lpn||'<ETX>')
write_line('<STX>B17o35,20f3c6,0,1h30w1i0d3,'||r_label_data.inner_lpn||'p@<ETX>')
write_line('<STX>H18o38,225f3c30h2w1d3,'||TO_CHAR(SYSDATE,'MON/DD/RR
HH24:MI:SS')||'<ETX>')
write_line('<STX>R<ETX>')Enterdatamode
write_line('<STX><ESC>E4<CAN><ETX>')Accessformat#4/cleardata
write_line('<STX><ETB><ETX>')Printthelabel

Triggercode(Tiggerontableora_label_print_tab)
CREATEORREPLACETRIGGERora_label_print_tab_trg
BEFOREINSERT
ONora_label_print_tab
FOREACHROW
DECLARE
++
+VariableDeclaration+
++
g_debug_pointVARCHAR2(50)
l_resp_idNUMBER:=NULL
l_resp_appl_idNUMBER:=NULL
l_request_idNUMBER:=NULL
l_resultBOOLEAN
l_result1BOOLEAN
e_user_nullEXCEPTION
BEGIN
g_debug_point:='TRG_1000'
IF:NEW.created_byisnullthen
raisee_user_null
ENDIF
++
+GettheRespIDfor'WarehouseManager',akathe'WMS'key
++
BEGIN
g_debug_point:='TRG_1020'
l_resp_id:=NULL
l_resp_appl_id:=NULL
SELECTresponsibility_id
,application_id
INTOl_resp_id
,l_resp_appl_id
FROMapps.fnd_responsibility
WHEREresponsibility_key='WMS'
ANDROWNUM=1
EXCEPTION
WHENOTHERS
THEN
l_resp_id:=0
l_resp_appl_id:=0
END
++
+InitializeAPPSEnvironment+
++
g_debug_point:='TRG_1030'
/*
BEGIN
fnd_global.apps_initialize(:NEW.created_by,l_resp_id,l_resp_appl_id)
EXCEPTION
WHENOTHERS
THEN
NULL
END
*/
IFl_resp_idISNOTNULL
ANDl_resp_appl_idISNOTNULL
THEN
fnd_global.apps_initialize(:NEW.created_by,l_resp_id,l_resp_appl_id)
NULL
ELSE
:NEW.status:='E'
:NEW.error_message:=
'Errorat('||g_debug_point||'):'||'ErrorgettingtheresponsibilityidforresponsibilitykeyWMS'
:NEW.last_update_date:=SYSDATE
:NEW.last_updated_by:=:NEW.created_by
ENDIF
++
+Launchtheprintingprogram
++
g_debug_point:='TRG_1100'
l_result:=fnd_request.set_mode(TRUE)
l_result1:=fnd_request.set_print_options(printer=>:NEW.printer_name
,copies=>:NEW.print_copies)
g_debug_point:='TRG_1110'
l_request_id:=
fnd_request.submit_request('WMS'application_short_name
,'ORA_LABEL_PRINT'concurrentprogramname
,NULLdescription
,NULLstarttime
,FALSEsub_request

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

20/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS

,:NEW.tag_print_id
,CHR(0)
)
COMMIT
IFNVL(l_request_id,1)>0
THEN
g_debug_point:='TRG_1120'
:NEW.request_id:=l_request_id
:NEW.last_update_date:=SYSDATE
:NEW.last_updated_by:=:NEW.created_by
ELSE
:NEW.status:='E'
:NEW.error_message:=
SUBSTR('Errorat('
||g_debug_point
||'):'
||'1ErrorsubmittingconcprogramORA_LABEL_PRINTprinter'
||:NEW.printer_name
||'SQLMSG:'
||SQLERRM
,1
,2000
)
:NEW.last_update_date:=SYSDATE
:NEW.last_updated_by:=:NEW.created_by
ENDIF
EXCEPTION
WHENe_user_null
THEN
NULL
WHENOTHERS
THEN
:NEW.status:='E'
:NEW.error_message:=
SUBSTR('Errorat('||g_debug_point||'):'||'2ErrorsubmittingconcprogramORA_LABEL_PRINT'||'SQLMSG:'||
SQLERRM
,1
,2000
)
:NEW.last_update_date:=SYSDATE
:NEW.last_updated_by:=:NEW.created_by
ENDora_label_print_tab_trg
/

ThisexplainsWMSLabelprintinOracleR12
Thanks,
Ajay

FiledunderR12,WMShaving
9comments:
toomsmithsaid...
Ilikeyourideaandinformationshowsthroughthesnapshots.thatisveryhelpfulforthejobof
labelprinting...manythanks
labelprinting
November29,2012at10:55PM
Anonymoussaid...
hi
Wearegoingtosetup3rdpartysoftwareloftwareforlabelpriting.IsthereanyFTPprogram
needforpublishingtheFTPfileinserverdirectoyinAsynchronousmode?
January5,2013at2:17PM
Ajaysaid...
IfyousetmodeasAsynchronousitwillwriteaXMLfileinaspecifieddirectory(whichcanbea
FTPdirectory).Specifieddirectorycanbementionedinaprofileoption.
ThewayIhaveworkedwithAsynchronousmodeishavingajavaprogramwhichwasconstantly
checkingthedirectoryandifthefilefoundthenloaditintoPLSQLtable.
AgainwithAsynchronousmodeyoulooserealtimetagsprinting.
Letmeknowifthisanswersyourquestion.
January7,2013at4:08PM
Jaydeepsaid...
HiAjay,
Theinformationonlabelprintingisreallyhelpfull.
Iamfacinganissuewithlabelprintingneedyouradvice.
iamcreatingaPOapprovingitandthenreceivingitintheMSCAapplication.
IhavewrittenatriggeronRCV_TRANSACTIONS_INTERFACE.FromthetriggerIamcallinga
customPKG.InthePKGIamtryingtocapturetheLOT_NUMfromtableRCV_LOTS_INTERFACE.
ButtheselectqueryisgivingmenulleventhoughintheRCV_LOT_TRANSACTIONStableican
seetheLOT_NUMforthetransaction.
Canyoupleasesuggestwhatisthesolutionforit.
March26,2013at9:25AM
AjayAtresaid...
Jaydeep
Sorryforlatereplyiftheissuestillpersistspleaseseeifthetransactioniscommittedornot.
April1,2013at10:53PM
VMukharasaid...
HelloAjay,
Thanksfortheinformationandtakingthetimetocompilationit.
IhaveaaquestionregardinglabelcustomizationinR12.Wehavearequirementforlabeltype:
LPNContentinR12.2.4tooverridethevalueof_QUANTITY(numberofcopiestoprint)attribute
attheLABELelementwithsomecustomlogic.Bydefault,_QUANTITYissetto1attheLABELS

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

21/22

7/5/2016

OracleApplicationsKnowledgeSharingAjayAtre:LabelPrintingwithWMS
elementorheaderlevel.R12enhancementonlyallowsforcustomsqlfortheVARIABLEelement.
Iwaswonderingifyouhaveanyinsightonhowtoachievethis.
Thanksinadvance,
Vakula

May29,2015at3:36PM
VMukharasaid...
HelloAjay,
Thanksfortheinformationandtakingthetimetocompilationit.
IhaveaaquestionregardinglabelcustomizationinR12.Wehavearequirementforlabeltype:
LPNContentinR12.2.4tooverridethevalueof_QUANTITY(numberofcopiestoprint)attribute
attheLABELelementwithsomecustomlogic.Bydefault,_QUANTITYissetto1attheLABELS
elementorheaderlevel.R12enhancementonlyallowsforcustomsqlfortheVARIABLEelement.
Iwaswonderingifyouhaveanyinsightonhowtoachievethis.
Thanksinadvance,
Vakula
May29,2015at3:38PM
saugatadassaid...
HelloAjay,
Ihavecreatedtheprint_labelproceduretohaveatestontheLablePrintinginZebra.Butthe
ConcurrentProgramgotcompletedwithoutErrorbutnoprintout.
WhatwillbetheArgumentinthePrinterDriver?
Pleasehelpmeonthis
Thanks
Saugata
September30,2015at12:37PM
AbhishekJainsaid...
HiAjay,
CanwehavelabelprintingwithoutimplementingWMS/MSCAImeanwehaveonlynormal
InventoryimplementedandwanttoprintlabelwithathirdpartysoftwareBarTender.
October7,2015at12:17AM
PostaComment

PostaComment

Enteryourcomment...

Commentas:

Publish

WalterSpinelli(Google)

Signout

Notifyme

Preview

NewerPost

Home

OlderPost

Subscribeto:PostComments(Atom)

http://ajayatre.blogspot.jp/2012/11/labelprintingwithwms.html

22/22

Vous aimerez peut-être aussi