Manufacturing

Get Involved. Join the Conversation.

Topic

    Shravan Kumar Chelika
    REST Webservice to perform Work Order CompletionAnswered
    Topic posted September 6, 2018 by Shravan Kumar ChelikaRed Ribbon: 250+ Points, tagged Manufacturing MDM, Manufacturing Analytics, Production Execution, Work Execution, Work Request Management 
    251 Views, 5 Comments
    Title:
    REST Webservice to perform Work Order Completion
    Summary:
    Looking for sample payload REST Service to perform Work Order Completion
    Content:

    Hi All,

    I am trying to do Work Order completion using REST Webservices similar to the Oracle Cloud UI (please see image-Oracle Cloud - Review Dispatch List).

    Following the REST API documentation from Oracle :

    /fscmRestApi/resources/11.13.18.05/materialTransactions

    The sample payload provided works fine for WIP Issue.

    TransactionTypeCode: string

     Title: Transaction Type Code

    Maximum Length: 30
    Abbreviation that determines the material transaction type. Valid values are MATERIAL_ISSUE, MATERIAL_NEGATIVE_ISSUE, MATERIAL_RETURN, MATERIAL_NEGATIVE_RETURN, ORDERLESS_COMPLETION, ORDERLESS_RETURN, ORDERLESS_RETURN_SCRAP, and ORDERLESS_SCRAP. A list of accepted values is defined in the lookup type ORA_WIE_MTL_TXN_TYPE.

     

    From the FND_LOOKUPS table :

    select *
    from fnd_lookups
    where lookup_type='ORA_WIE_MTL_TXN_TYPE'

    Shows that for Product completion the code is -

    LOOKUP_TYPE LOOKUP_CODE MEANING DESCRIPTION
    ORA_WIE_MTL_TXN_TYPE PRODUCT_COMPLETION Product completion

    Completion of product from work order to inventory

     

    I have tried to use the same payload to do WorkOrder Completion:

          {
             "OrganizationCode" : "M1",
             "SubinventoryCode" : "STORES",
             "Locator" : "",
             "TransactionDate" : "2018-09-06 08:56:00-07:00",
             "TransactionQuantity" : 10,
             "TransactionTypeCode" : "PRODUCT_COMPLETION",
             "WoOperationSequenceNumber" : 20,
             "WorkOrderNumber" : "DSI_WO_1004",
             "InventoryItemNumber" : "DSI_TABLET5000"
          }
       ]
    }

    The error received is :

                "ErrorMessages": "The value PRODUCT_COMPLETION provided for the Transaction Type attribute is invalid.",
                "ErrorMessageNames": "WIE_WOMT_TXT_INVALID",

     

    What am I missing here? Am I using the right REST API?

     

    Thanks,

    Shravan

    Version:
    R13 18 B
    Image:

    Best Comment

    Ted Chappell

    Oracle's answer is similar to what we did as well. In general, once you complete all the operations referenced in the Work Order it automatically goes to complete. Here is an example to update a Work Order:

    Note: The digit at the end is the Work Order ID.
     
    {
        "WorkOrderNumber": "1028",
        "WorkOrderId": 300000001696019,
        "WorkOrderDescription": null,
        "OrganizationCode": null,
        "OrganizationId": 300000001068976,
        "ItemNumber": "Test Item 3",
        "InventoryItemId": 300000001070045,
        "AssetNumber": "STRDEVTESTASSET",
        "AssetId": 300000001679012,
        "WoAssetId": 300000001696020,
        "WorkOrderTypeCode": "PREVENTIVE",
        "WorkOrderSubTypeCode": "ORA_PLANNED",
        "MntWorkDefinitionCode": "AD02",
        "WorkDefinitionId": 300000001320127,
        "WorkDefinitionVersionId": 300000001320128,
        "WorkDefinitionAsOfDateMnt": "2018-09-10T16:37:46.620+00:00",
        "WorkOrderStatusCode": "ORA_RELEASED",
        "WorkOrderStatusId": 10004,
        "Status": "SUCCESS",
        "PlannedStartDate": "2018-09-10T16:37:00+00:00",
        "PlannedCompletionDate": "2018-09-10T17:37:00+00:00",
        "ActualStartDate": "2018-09-10T16:39:37+00:00",
        "ActualCompletionDate": null,
        "WorkOrderPriority": null,
        "WorkMethodCode": "MAINTENANCE",
        "CanceledReason": null,
        "links": [
            {
                "rel": "self",
                "href": "https://einf-test.fa.us6.oraclecloud.com:443/fscmRestApi/resources/11.13.18.05/maintenanceWorkOrders/300000001696019",
                "name": "maintenanceWorkOrders",
                "kind": "item",
                "properties": {
                    "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000278"
                }
            },
            {
                "rel": "canonical",
                "href": "https://einf-test.fa.us6.oraclecloud.com:443/fscmRestApi/resources/11.13.18.05/maintenanceWorkOrders/300000001696019",
                "name": "maintenanceWorkOrders",
                "kind": "item"
            },
            {
                "rel": "child",
                "href": "https://einf-test.fa.us6.oraclecloud.com:443/fscmRestApi/resources/11.13.18.05/maintenanceWorkOrders/300000001696019/child/WorkOrderOperation",
                "name": "WorkOrderOperation",
                "kind": "collection"
            }
        ]
    }

    Comment

     

    • Ted Chappell

      Hi Shravan,

      Your REST call looks correct based on my experience so far. If you’re looking for a solution that can do this natively (plus much more) I’d be happy to chat with you.

    • Shravan Kumar Chelika

      Thank you for the response...Yes, I am actively looking for a solution , please let me know how I can reach you via chat...appreciate your help..

    • Shravan Kumar Chelika

      FYI...Received an update from Oracle with the solution :

      There is no direct REST API call to Complete the work order in 1 REST API Call. Instead, you need to drive this through Dispatch list, operation by operation. 

      Webservice to be used : Operation Transactions - Create Operation transactions -  /fscmRestApi/resources/11.13.18.05/operationTransactions

      Here is the sample payload :

      {
        "SourceSystemCode" : "FUSION_MOBILE",
        "SourceSystemType" : "EXTERNAL",
        "OperationTransactionDetail" : [ 
        {
           "SourceSystemCode" : "FUSION_MOBILE",
           "OrganizationCode" : "M1",
           "TransactionDate" : "2018-09-10 08:56:00-07:00",
           "TransactionQuantity" : 10,
           "WoOperationSequenceNumber" : 20,
           "WorkOrderNumber" : "DSI_WO_1004",
           "FromDispatchState" : "READY",
           "ToDispatchState" : "COMPLETE"
        } 
        ]
      }

    • Ted Chappell

      Oracle's answer is similar to what we did as well. In general, once you complete all the operations referenced in the Work Order it automatically goes to complete. Here is an example to update a Work Order:

      Note: The digit at the end is the Work Order ID.
       
      {
          "WorkOrderNumber": "1028",
          "WorkOrderId": 300000001696019,
          "WorkOrderDescription": null,
          "OrganizationCode": null,
          "OrganizationId": 300000001068976,
          "ItemNumber": "Test Item 3",
          "InventoryItemId": 300000001070045,
          "AssetNumber": "STRDEVTESTASSET",
          "AssetId": 300000001679012,
          "WoAssetId": 300000001696020,
          "WorkOrderTypeCode": "PREVENTIVE",
          "WorkOrderSubTypeCode": "ORA_PLANNED",
          "MntWorkDefinitionCode": "AD02",
          "WorkDefinitionId": 300000001320127,
          "WorkDefinitionVersionId": 300000001320128,
          "WorkDefinitionAsOfDateMnt": "2018-09-10T16:37:46.620+00:00",
          "WorkOrderStatusCode": "ORA_RELEASED",
          "WorkOrderStatusId": 10004,
          "Status": "SUCCESS",
          "PlannedStartDate": "2018-09-10T16:37:00+00:00",
          "PlannedCompletionDate": "2018-09-10T17:37:00+00:00",
          "ActualStartDate": "2018-09-10T16:39:37+00:00",
          "ActualCompletionDate": null,
          "WorkOrderPriority": null,
          "WorkMethodCode": "MAINTENANCE",
          "CanceledReason": null,
          "links": [
              {
                  "rel": "self",
                  "href": "https://einf-test.fa.us6.oraclecloud.com:443/fscmRestApi/resources/11.13.18.05/maintenanceWorkOrders/300000001696019",
                  "name": "maintenanceWorkOrders",
                  "kind": "item",
                  "properties": {
                      "changeIndicator": "ACED0005737200136A6176612E7574696C2E41727261794C6973747881D21D99C7619D03000149000473697A65787000000001770400000001737200116A6176612E6C616E672E496E746567657212E2A0A4F781873802000149000576616C7565787200106A6176612E6C616E672E4E756D62657286AC951D0B94E08B02000078700000000278"
                  }
              },
              {
                  "rel": "canonical",
                  "href": "https://einf-test.fa.us6.oraclecloud.com:443/fscmRestApi/resources/11.13.18.05/maintenanceWorkOrders/300000001696019",
                  "name": "maintenanceWorkOrders",
                  "kind": "item"
              },
              {
                  "rel": "child",
                  "href": "https://einf-test.fa.us6.oraclecloud.com:443/fscmRestApi/resources/11.13.18.05/maintenanceWorkOrders/300000001696019/child/WorkOrderOperation",
                  "name": "WorkOrderOperation",
                  "kind": "collection"
              }
          ]
      }