Inspection Results Automation
Update Inspection results from the data which is receive from the external systems.
The following are the details we get from the external system in my case.
- INSPECTION LOT NUMBER
- OPERATION NUMBER
- CHARACTERISTIC NUMBER
- ACTUAL VALUE
- CATALOG GROUPCODE
- CODE VALUE
First get the inspection lot existing values by using the FM “QG01_LOT_READ_WITH_RESULTS”.
In our scenario, we need QAMR, QAMV and QAPP existing values.
So, we are fetching those values alone.
There are 3 levels of inspection results.
- CHAR_RESULTS
- SAMPLE_RESULTS
- SINGLE_RESULTS
In my scenario, we have only Char results and Sample results.
When we manually update Sample level inspection results, we need to pass physical sample number in a POP UP.
So, to find whether the received inspection lot is Sample or Char we need to fetch QAPP table which contains PHYNNR i.e. Physical sample number. If the table contains PHYNNR then it is Sample results and fill the Sample Char table and pass it in the BAPI along with all other parameters.
Pass the inspection lot number and operation number to the FM “QIBP_GET_VORGLFNR” and fetch the Current Node Number from Order Counter APLZL, which is the mandatory field to be passed while updating the inspection results.
We are using the BAPI “BAPI_INSPOPER_RECORDRESULTS” to update the results.
So, pass the values which we get from the interface to the importing parameters, like.
Inspection lot number, inspection characteristics number, MIC, Actual values.
The following are the 2-important status which need to be passed.
CLOSED or EVALUATED along with inspection results.
We can pass the evaluation value to either Accepted or Rejected based on the Arithmetic value or code value we get.
After updating the records in successful case we have to commit the values using BAPI_TRANSACTION_COMMIT else use BAPI_TRANSACTION_ROLLBACK.
Before updating results
We are updating the characteristics 40 and 50 on the following inspection lot.
The following are the screen shots of Inspection results.
Test data we use to update inspection results: transaction “SPROXY”
Values received from external systems.
After Updating results
We can see the results are updated for the characteristics 40 and 50.
Values are updated the status is 5 means that the evaluation is set to be closed.
Hence we have updated the inspection results.
Hi,
I've created similar solution in a program, I'm using BAPI_INSPOPER_GETDETAIL and BAPI_INSPOPER_RECORDRESULTS and it works fine, but only in this program. I am struggling to implement the same code in user-exit in this thread. Could you please take a look at it, maybe you'll have some ideas about it. Thanks!
Thanks for the Solution,
It worked for me too