cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot use changeProduction API to move SFC to 1st Step on Route

steve_stubbs
Participant
0 Kudos
225

SAP Digital Manufacturing Cloud.

I have this simple router defined:

I have an SFC in Queue at the ASSEMBLY Operation (Activity ID 20), and am trying to use a Production Process that calls the Change Production activity to move the SFC to Activity ID 10. When I debug the process, I get a response that says failed for the SFC. Here is the response detail:

  • [Info]Indication Color 5 Started process instance with id 36124ace-2f04-45cc-acf5-fe3b93c141cc
  • [Debug] Variable STEP_ID is created with value: 10
  • [Debug] Variable ROUTER is created with value: KGB_PRO
  • [Debug] Variable ROUTER_VER is created with value: A
  • [Debug] Variable SFC is created with value: KBG01001
  • [Debug] Variable OPERATION is created with value: WELDING
  • [Info]Indication Color 5 In StartEvent, executing NoneStartEventActivityBehavior
  • [Info]Indication Color 5 Sequence flow will be taken for 696d95b0-1b82-425f-b6a3-9cc1f5d13977 --> 28cc53a9-10cf-43af-8b7f-a736c89e21d5
  • [Info]Indication Color 5 In ScriptTask, executing SecureJavascriptTaskActivityBehavior
  • [Debug] Variable RouterType is created with value: PRODUCTION
  • [Debug] Variable SFC is updated with value: KBG01001
  • [Debug] Variable ROUTER is updated with value: KGB_PRO
  • [Debug] Variable OPERATION is updated with value: WELDING
  • [Debug] Variable RESOURCE is created with value: null
  • [Debug] Variable STEP_ID is updated with value: 10
  • [Debug] Variable ROUTER_VER is updated with value: A
  • [Info]Indication Color 5 Sequence flow will be taken for 7c182373-e5ef-48a0-be8b-ad41de67b156, 28cc53a9-10cf-43af-8b7f-a736c89e21d5 --> eb82c64c-62b3-46f1-ab28-e4808b745f22
  • [Debug] Variable Change_Production__plant is created with value: ELS01
  • [Debug] Variable Change_Production__sfcs is created with value: ["KBG01001"]
  • [Debug] Variable Change_Production__routingStepId is created with value: 10
  • [Debug] Variable Change_Production__bom is created with value: null
  • [Debug] Variable Change_Production__resource is created with value: null
  • [Debug] Variable Change_Production__operatorID is created with value: WELDING
  • [Debug] Variable Change_Production__routing is created with value: {"routing":"KGB_PRO","routingType":"PRODUCTION","version":"A"}
  • [Info]Indication Color 5 In HttpServiceTask, executing ClassDelegate
  • [Debug] Service Change_Production starts to execute with method: POST
  • [Debug] Service Change_Production starts to execute with url: /api/v1/changeProduction
  • [Debug] Service Change_Production starts to execute with body: {"plant":"ELS01","sfcs":["KBG01001"],"routingStepId":"10","resource":null,"operatorID":"WELDING","routing":{"routing":"KGB_PRO","routingType":"PRODUCTION","version":"A"}}
  • [Debug] Variable Change_ProductionResponseProtocol is created with value: null
  • [Debug] Variable Change_ProductionResponseStatusCode is created with value: 200
  • [Debug] Variable Change_ProductionResponseReason is created with value: OK
  • [Debug] Variable Change_ProductionResponseHeaders is created with value: cache-control: no-cache, no-store, max-age=0, must-revalidate content-security-policy: script-src 'self' content-type: application/json date: Thu, 17 Aug 2023 12:34:42 GMT expires: 0 pragma: no-cache server: nginx vary: accept-encoding x-content-type-options: nosniff x-correlationid: 3b044e75-b231-47f1-4548-5b6f05272d72 x-frame-options: DENY x-vcap-request-id: 7f339237-7718-4c52-6859-7ab30dc8c463 x-xss-protection: 1; mode=block transfer-encoding: chunked strict-transport-security: max-age=31536000; includeSubDomains; preload;
  • [Debug] Variable Change_ProductionResponseBody is created with value: {"success":[],"failed":["KBG01001"]}
  • [Info]Indication Color 5 Sequence flow will be taken for eb82c64c-62b3-46f1-ab28-e4808b745f22 --> cda78db3-12ad-4387-b252-f75a79d9ea21
  • [Info]Indication Color 5 In ScriptTask, executing SecureJavascriptTaskActivityBehavior
  • [Debug] Variable Change_Production__success is created with value: []
  • [Debug] Variable Change_Production__failed is created with value: ["KBG01001"]
  • [Info]Indication Color 5 Sequence flow will be taken for d29156a6-fd47-475f-8bde-07f84bff249d, cda78db3-12ad-4387-b252-f75a79d9ea21 --> dff8a915-6cd1-4d2c-ad0f-4ea52a13d1b2
  • [Info]Indication Color 5 In ScriptTask, executing SecureJavascriptTaskActivityBehavior
  • [Info]Indication Color 5 Sequence flow will be taken for dff8a915-6cd1-4d2c-ad0f-4ea52a13d1b2 --> 853a5653-c14d-4b7f-9ca1-54067f83d6a1
  • [Info]Indication Color 5 In EndEvent, executing NoneEndEventActivityBehavior
  • [Info]Indication Color 5 Completed process instance with id 36124ace-2f04-45cc-acf5-fe3b93c141cc
Any ideas as to why this call fails as shown?

Accepted Solutions (0)

Answers (4)

Answers (4)

ManoelCosta
Product and Topic Expert
Product and Topic Expert
0 Kudos
Sorry to hear, Steve! But thanks for the feedback. I would love to learn more about the issue resolution, once resolved. Thanks,

Manoel

ManoelCosta
Product and Topic Expert
Product and Topic Expert
0 Kudos

Steve,

Can you try again, without providing any routingStepId?

If it still fails, I suggest you raise a ticket so support/development colleagues can better assist you.

Br,

Manoel

steve_stubbs
Participant
0 Kudos

Hi Manoel,

Tried both the new routing and the existing routing without specifying a stepID; both failed same as before. I will have to log a support ticket.

Regards, Steve

ManoelCosta
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Steve,

I understand ME used to have this capability, but I'm afraid DM Change Production service is not yet there.

As far as I understand, Change Production currently supports replacing BOM and Routing only, as mentioned in API Reference: "Assigns a new routing or a new Bill of Materials (BOM), or both to given Shop Floor Controls (SFCs)".

That said, BOM and Routing fields are not required, as you might want to replace either/or.

You are using the input parameter Routing as KGB_PRO, but I assume that the SFC is already in KGB_PRO routing, and you are trying to change the SFC routingStepId (Operation) only, by informing 10 in routingStepId field, correct? As I wrote before, I never tried that, but I'm afraid this Service does not support that and that might be the root cause of the error.

Perhaps you can try creating a KGB_PRO2 routing as a copy of KGB_PRO and see if you can change the SFC to this different routing in routingStepId 10. I would expect that to work just fine!

By the way, you are passing "operatorID" as "WELDING", but keep in mind that operatorID is actually "The new operator who executes the Shop Floor Control (SFC). The property only takes effect when the specified SFC is in Active status. After production change, only this operator could execute the SFC from its current operation. The specified operator must have certification on the material, resource and operation.", not the Operation.

Hope it helps,

Manoel

ManoelCosta
Product and Topic Expert
Product and Topic Expert
0 Kudos

Also as mentioned in API Reference, routingStepId is used to "Specify a particular routing step ID of the new routing. It determines from which routing step the SFC should be started. Based on the original status of the Shop Floor Control (SFC), the SFC will be automatically switched to In Queue or Active status at the routing step. If the property is not set, and the original status of the SFC is New or in Queue, it will be set to In Queue at the first step".

So I assume routingStepId is only used when changing routings, not to move the SFC within the current routing.

Br,

Manoel

steve_stubbs
Participant
0 Kudos

Hi Manoel,

Ok I copied routing KGB_PRO to KGB_PRO2 and called the production Process with the new routing name, and did NOT assing a value to operatorID:

[Debug] “Change_ProductionRequestBody” created with value {"plant":"ELS01","sfcs":["KBG01001"],"routingStepId":"10","resource":null,"operatorID":null,"routing":{"routing":"KGB_PRO2","routingType":"PRODUCTION","version":"A"}}

Here is the response:

  • [Debug] “Change_ProductionResponseStatusCode” created with value 500
  • [Debug] “Change_ProductionResponseReason” created with value Internal Server Error
  • [Debug] “Change_ProductionResponseHeaders” created with value cache-control: no-cache, no-store, max-age=0, must-revalidate content-length: 173 content-security-policy: script-src 'self' content-type: application/json date: Thu, 17 Aug 2023 13:56:31 GMT expires: 0 pragma: no-cache server: nginx x-content-type-options: nosniff x-correlationid: e67138db-f1a8-45c0-413e-13bbb8bbf61e x-frame-options: DENY x-vcap-request-id: ffa3579c-b565-4312-7cd5-c71ccb3600c8 x-xss-protection: 1; mode=block strict-transport-security: max-age=31536000; includeSubDomains; preload;
  • [Debug] “Change_ProductionResponseBody” created with value {"error":{"message":"Failed to assign routing operation steps to SFCs","causeMessage":null,"code":"add.sfcStep.fail","correlationId":"e67138db-f1a8-45c0-413e-13bbb8bbf61e"}}
  • [Error]Indication Color 2 “StatusCode” created with value HTTP500
  • [Error]Indication Color 2 “DetailInfo” created with value {"error":{"message":"Failed to assign routing operation steps to SFCs","causeMessage":null,"code":"add.sfcStep.fail","correlationId":"e67138db-f1a8-45c0-413e-13bbb8bbf61e"}}
  • [Error]Indication Color 2 “ErrorMessage” created with value HTTP500
  • Note that the responses do NOT contain any causeMessage value or anything else that can help me determine why the api call failed. If the call failed, then the response should contain the detail of WHY it failed.
  • NOTE: I also tried this with the original routing name without operatorID assigned, and got the same response.

Regards, Steve

ManoelCosta
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Stephen, how your Change Production input looks like?

I assume you are trying to use routingStepId field to change the SFC from Op 20 to Op 10, while leaving other fields like BOM & Routing blank? If so, although I never tried myself, I'm afraid this will not work, as Change Production is supposed to:

"Assigns a new routing or a new Bill of Materials (BOM), or both to given Shop Floor Controls (SFCs)."

So, in my understanding, routingStepId is where the SFC will be placed in the new routing when the SFC routing is replaced and can't be used to move the SFC within the current routing.

Does it make sense?

Hope it helps,

Manoel

steve_stubbs
Participant
0 Kudos

Hi Manoel,

here is the API Model JSON:

{

"plant": "string",

"sfcs": [

"string"

],

"routing": {

"routing": "string",

"routingType": "PRODUCTION",

"version": "string"

},

"routingStepId": "string",

"bom": {

"bom": "string",

"bomType": "USERBOM",

"version": "string"

},

"resource": "string",

"operatorID": "string"

}

and here is what is being passed to the API:

{"plant":"ELS01","sfcs":["KBG01001"],"routingStepId":"10","resource":null,"operatorID":"WELDING","routing":{"routing":"KGB_PRO","routingType":"PRODUCTION","version":"A"}}

  • BOM is not a required field; however, there is not BOM attached to this routing. We do not have any connection to ERP in this TEST DMC tenant.
  • resource is not required as the SFC is not currently ACTIVE so would be placed IN_QUEUE at the requested router step ID.
  • operatorID is not required here.

NOTE: It was possible to use the old SAP ME Change Production activity or PAPI call to move an SFC to a different step on the same router. I suspect this is a requirement for most any MES production environment. Are you saying that this is NOT possible in DM Execution now?

Regards, Steve