COMPILE ROUTINE TEST_OBJ_WO_MAT(Dummy)
ROWDEF(CHARSTR)

DECLARE SUBROUTINE obj_Notes, Set_Status, Send_Info,  Send_Dyn, Btree.Extract, ErrMsg, obj_WO_Mat, obj_Tables
DECLARE FUNCTION Get_Status,obj_WO_Log, Send_Dyn, obj_WO_Mat, obj_Tables, obj_WO_Mat_Wfr

$INSERT PROD_SPEC_EQU
$INSERT PROD_VER_EQUATES
$INSERT CUST_EPI_PART_EQUATES
$INSERT WO_LOG_EQUATES
$INSERT WO_MAT_EQUATES
$INSERT SEMI_VEND_CODE_EQUATES


DEBUG
WOMatKey = '162329*51'

SigProfile = obj_WO_Mat('CassSigProfile',WOMatKey)



DEBUG


GOTO Bail

* * * * * * * * 

WONo = 159602
CassNo = 4
StepNo = 1
Stage = 'UNLOAD'
Prop = 'CRES'

owmParms = WONo:@RM:StepNo:@RM:CassNo:@RM:Stage:@RM:Prop
obj_WO_Mat('RemQAMet',owmParms)

IF Get_Status(errCode) THEN
	ErrMsg(errCode)
END


GOTO Bail

* * * * * * * 

CassID = '157954*56'

GRProps = obj_WO_Mat('GetGRProps',CassID)



GOTO Bail

FileIn = '157131.15':@VM:'M003938.15'

obj_WO_Mat('SetSAPBatch',FileIn)

GOTO Bail




DEBUG

Set_Status(0)
WONo = '155288'

WOMatKeys = ''
FOR I = 37 TO 60
	WOMatKey  = WONo:'*':I
	
	Set_Status(0)
	
	obj_WO_Mat('Delete',WONo:@RM:I)
	
	IF Get_Status(errCode) THEN DEBUG
	
	
NEXT I









GOTO Bail


FWIComp = obj_WO_Mat('MQAComp','154782*217':@RM:'1':@RM:'FWII')
QAComp = obj_WO_Mat('MQAComp','154782*217':@RM:'1':@RM:'QA')

DEBUG
IF Get_Status(errCode) THEN
	DEBUG
END

GOTO Bail
******************************************
DEBUG

CassID = '152992*7'
BatchNo = 'M000541.4'

owmParms = CassID:@VM:BatchNo
obj_WO_Mat('SetSAPBatch',owmParms)

GOTO Bail

DEBUG 

WONo = "999999"
CassNo = 1
ProdVerNo = '10222'
Parms  = WONo:@RM
Parms := CassNo:@RM
Parms := ProdVerNo:@RM
Parms := 'XYZ':@RM								;*ScanResults<COL$CASS_LOT_NO,I>:@RM
Parms := '25':@RM								;*ScanResults<COL$CASS_QTY,I>:@RM
Parms := 'WEP828480IRE':@RM						;*ScanResults<COL$CASS_CUST_PART_NO,I>:@RM		;* This is the CUSTOMER part No
Parms := '':@RM									;*ScanResults<COL$CASS_ORDER_ITEM,I>:@RM
Parms := SpecReactType:@RM
Parms := ScanResults<COL$CASS_SUB_PART_NO,I>:@RM
Parms := 'SR':@RM									;* Warehouse = 'SR' - Shipping/Receiving Area
Parms := 'RB':@RM									;* Location = 'RB' - Receiving Bench
Parms := ScanResults<COL$CASS_TIME_STAMP,I>:@RM
Parms := ScanResults<COL$CASS_SCAN_BY,I>:@RM
Parms := SubSupplyBy:@RM
Parms := MUWaferFlag:@RM
Parms := RetRejects	:@RM							;* Added 8/18/2009 JCH
Parms := Reprocessed:@RM							;* Added 12/16/2009 JCH
Parms := CassShipQty:@RM							;* Added 11/4/2009 JCH
Parms := ShipShort:@RM								;* Added 05/14/2010 JCH
Parms := ScanVendor									;* Added 07/14/2011 for SAP Project JCH


obj_WO_Mat('Create',Parms)		;* Added 10/18/2006 JCH - New Work Order material subsystem.
				



GOTO Bail
****************************************************************
CassID	= '152561*11'
Parms	= CassID:@RM:'':@RM:'VER':@RM:'QA'


GRProps = obj_WO_Mat('GetCycleTime',Parms)


DEBUG

GOTO Bail

NewRec = XLATE('WO_MAT',CassID,'','X')

ProdVerRec = XLATE('PROD_VER',NewRec<WO_MAT_PROD_VER_NO$>,'','X')
			
SubPartNo = ProdVerRec<PROD_VER_SUB_PART_NO$>

IF SubPartNo MATCHES "6N'-'1A'-'2A" THEN
     SubSuppCd = FIELD(SubPartNo,'-',3)
END ELSE
    SubSuppCd = NewRec<WO_MAT_SUB_VEND_CD$>
    SubSuppCd = XLATE('SEMI_VEND_CODE',SubSuppCd,SEMI_VEND_CODE_EPI_VEND_CD$,'X')
END

 SubSuppCd = XLATE('SEMI_VEND_CODE',SubSuppCd,SEMI_VEND_CODE_EPI_VEND_CD$,'X')

GOTO Bail




WOMatKey = ''
ShipNo = 52461

DEBUG

Parms = WOMatKey:@RM:ShipNo
obj_WO_Mat('AddShip',Parms)

IF Get_Status(errCode) THEN DEBUG


Parms = WOMatKey:@RM:52462		;* Bogus ship no
obj_WO_Mat('RemShip',Parms)

IF Get_Status(errCode) THEN DEBUG

Parms = WOMatKey:@RM:ShipNo

obj_WO_Mat('RemShip',Parms)

IF Get_Status(errCode) THEN DEBUG

DEBUG


GOTO Bail

WONo = '141792'
CassNo = '6'
NCRNo = 39879
User = 'TIFFANY_G'


* EpiPRO NCR's don't have the cassette number

oWOMParms  = WONo:@RM
oWOMParms := CassNo:@RM
oWOMParms := NCRNo:@RM
oWOMParms := uSER:@RM
oWOMParms := ICONV(OCONV(Date(),'D4/'):' ':OCONV(Time(),'MTS'),'DT')

obj_WO_Mat('SignNCR',oWOMParms)												;* Added 4/2/2008 JCH J.C. Henry & Co., Inc.

goto Bail


debug

a = obj_WO_Mat('CurrStatus','141792*6')


DEBUG


GOTO Bail

WONo	= '128636'
CassNo	= '13'
MetNo	= '166056'
SlotNo	= '1'

debug


SlotIDs = XLATE('WO_MAT',WONo:'*':CassNo,'SLOT_WAFER_ID','X')

AvailSlots = ''

SlotIDCnt = COUNT(SlotIDs,@VM) + (SlotIDs NE '')
FOR I = 1 TO SlotIDCnt
	SlotID = SlotIDs<1,I>
	IF SlotID = WONo:'.':CassNo:'.':I THEN
		AvailSlots<1,-1> = I
	END
NEXT I

SlotNo = AvailSlots<1,1>


WaferCnt = obj_WO_Mat('RemProdTW',WONo:@RM:CassNo:@RM:MetNo:@RM:SlotNo)

IF Get_Status(errCode) THEN debug


GOTO Bail

* * * * * * *
Bail:
* * * * * * *

END
