-- WorkOrderRouting Full Query
-- Source: JDESTAGE.F3112Z1_VIEW
-- Destination: WorkOrderRouting
-- Schedule: Mass/Daily/Hourly

SELECT TRIM(woz.EDIUSERID_SZEDUS) AS UserID,
       TRIM(woz.EDIBATCHNUMBER_SZEDBT) AS BatchNumber,
       TRIM(woz.EDITRANSACTNUMBER_SZEDTN) AS TransactionNumber,
       woz.EDILINENUMBER_SZEDLN AS LineNumber,
       woz.SEQUENCENOOPERATIONS_SZOPSQ AS StepNumber,
       TRIM(woz.COSTCENTER_SZMCU) AS WorkCenterCode,
       woz.DOCUMENTORDERINVOICEE_SZDOCO AS WorkOrderNumber,
       TRIM(woz.TYPEROUTING_SZTRT) AS RoutingType,
       TRIM(woz.COSTCENTERALT_SZMMCU) AS BranchCode,
       TRIM(woz.DESCRIPTIONLINE1_SZDSC1) AS StepDescription,
       TRIM(woz.USERRESERVEDREFERENCE_SZURRF) AS FunctionCode,
       woz.DATETRANSACTIONJULIAN_SZTRDJ AS TransactionDate,
       woz.DATEUPDATED_SZUPMJ AS DateUpdated,
       woz.TIMEOFDAY_SZTDAY AS TimeUpdated
  FROM JDESTAGE.F3112Z1_VIEW woz
 WHERE woz.TYPETRANSACTION_SZTYTN = 'JDERTG' AND
       woz.DIRECTIONINDICATOR_SZDRIN = '2' AND
       woz.TRANSACTIONACTION_SZTNAC = '02' AND
       woz.PROGRAMID_SZPID = 'ER31410'
