cancel
Showing results for 
Search instead for 
Did you mean: 

SFC Srapping using SAP ME PAPI service

Former Member
0 Kudos

Hi,

We are having one requirement to scrap an SFC after logging an NC against that SFC so that the SFC report can show the details about the reason as to why the SFC ha been scrapped. Now from the SAP ME standard POD we are able to achieve the same using the Add-Done button after applying the NC code against the selected SFC. We are also maintaining the NC Code in SAP ME where the SCRAP Disposition function is already applied against the NC Code.

However we need to achieve the same using a SAP ME PAPI service. I have found one PAPI service NCProductionService and the corresponding createNC method which is successfully applying the NC code against the SFC, however not scrapping the same at one shot. Please let me know if there is any PAPI service that will apply the NC code and then scrap the SFC.

Or else do we need to take the two way approach like first apply the NC code using the createNC method and then use some other PAPI service for scrapping the SFC.

Thanks

Anirban

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi,

Have you tried disposition() method of the same service?

Regards,

Sergiy

Former Member
0 Kudos

Hi Sergiy,

I tried to use the disposition method but I am facing one problem in the same. I provided the SFC Reference and the Operation. However there is a field ncs which as I checked in the API refers to the The pending NC records and this is a mandatory field in the service. The NC code that we are using is newly created and for the selected SFC, no other NC has been logged. The service is throwing error for what ever is the value for the ncs that we are giving. Could you please let me know what shall we give as an input for the ncs field.

Thanks

Anirban

0 Kudos

Anirban,

createNC() creates a record in NC_DATA table. Please try to pass HANDLE value (which is ref) of this record to ncs parameter.

Regards,

Sergiy

Former Member
0 Kudos

Hi Sergiy,

Thanks for the help. I have overcome the problem of executing the PAPI service with your help but not getting the desired result after service calling. This is what I did.

  • I created two Resource (RS1 & RS2) and assigned them to a resource type
  • I created two operations (OP1 & OP2) and assigned them to the respective resources.
  • I also created the routing (two step) with the two operations
  • I then created a shop order with the planned routing and released it to get the SFC.
  • I then executed the PAPI service createNC method and passed the NC Code reference and the SFC reference and executed the service. Checked in the SFC report NC Log and found that the NC code has been logged against the SFC.
  • Then I did a query against the standard table NC_DATA and retrieved the Handle value for the selected SFC
  • Then I executed the PAPI service Disposition method and passed the values for SFC Reference, NC Code, Operation ID, Resource reference and the handle value for ncs.

After the service was executed, I checked the SFC report and found that the SFC state is showing as Done for operation OP1, where as my expectation was that it will be scrapped. Please let me know if I am missing any step here or it is the right procedure to scrap and SFC using SAP ME PAPI service.

Former Member
0 Kudos

Hi Sergiy,

I am stuck a bit with this one. Help will be very much appreciated.

Thanks

Anirban

0 Kudos

Hi Anirban,

Missed your previous reply.

Please clarify what exactly is in "Done" status. See SAP Note 1484774 for example.

Regards,

Sergiy

Former Member
0 Kudos

Hi Sergiy,

The SFC is in Done status. When I checked in the SFC Report against the selected SFC, I found that the report is showing SFC in Done. I executed the NCProductionService Disposition() method and passed the values for SFC Reference, NC Code, Operation ID, Resource reference and the handle value for ncs in SOA WSNavigator. When the service got executed, I checked the status for the SFC and it is showing as Done. I want the status of the SFC as Scrapped. Please let me know where exactly I am missing.

Thanks

Anirban

0 Kudos

I have tested this in 15.0.3.26 and it works absolutely fine.

0 Kudos

Please see attached my requests for createNC() and disposition() which moved the SFC to SCRAPPED status.

Former Member
0 Kudos

Hi Sergiy,

Thanks for the detailed reply. I have one doubt though in the input data for the disposition() method. In the input XML you have given the value for <scrapOption> tag as follows

<non:dispositionSelection>

     <!--Optional:-->

     <non:dispositionGroupMemberRef>DispositionGroupMemberBO:DispositionGroupBO:KV01,SCRAP_DISP,10</non:dispositionGroupMemberRef>

     <!--Optional:-->

     <non:scrapOption>SCRAP_ALL</non:scrapOption>

</non:dispositionSelection>

However we are already applying the NC Code previously and against the NC Code Scrap disposition function is already configured in the NC Code maintenance, so ideally the system will be able to take the decision from the applied NC Code that the SFC needs to be scrapped.

If we need to provide the value of SCRAP_ALL for scrapOption, then we could also directly use the Scrap() method to scrap the SFC after applying the NC Code against the SFC.

Thanks

Anirban

Message was edited by: Anirban Banerjee

0 Kudos

I had not played with this option but just took the first one which seemed logical in that case. And I doubt that this option controls whether scrap should be executed or not: I would expect it to only define a strategy for scrap when scrap is triggered. But the actual decision on whether the system should trigger scrap or not should come from the definition of the NC code.

To check my theory, you can simply replace SCRAP disposition function in the disposition group with LOCAL_REWORK for example, but leave scrapOption as is. If this change makes the system leave the SFC at the operation instead of scrapping the SFC, then my theory is right.