cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieving Quality Results from SAP QM

Former Member
0 Kudos

Hi,

Wondering if anybody has had to do this of yet. Basically need to get to the stage where i can loop through a returned list of LotID's to retrieve a result by initially passing in a material number etc.

I know SAP have provided an application for the transfer of data between a QM and an ERP system which gets me to a one result basis - i want to pull historical values for the test and return them to an SPC chart.

Most of the queries are there except for the actual - being able to feed a Lot List and return the individual for each to a table.

Any tips ?

Thanks,

Emmett

Accepted Solutions (1)

Accepted Solutions (1)

agentry_src
Active Contributor
0 Kudos

Hi Emmett,

You can attack this a couple of ways.

1) Build a Query in ERP that returns your dataset. Sam Castro wrote a nice SDN article about executing the queries remotely. The BAPIs all begin with RSAQ if you want to look them over in ERP. You can use the RSAQ_FieldName (not sure of the exact name) to find the actual system generated field name of the query. It will not be what you expect (the only item not covered in the SDN article). Here is the link: [SQ01Queries|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/390b889b-0e01-0010-e4af-c9a062b9b880]

2) You might be able to do a table read RFC_READ_TABLE if all the data resides in a table.

3) Search through SE37 (or BAPI) on "QM" and you may find an RFC which will retrieve the data you are looking for. It has been a couple of years since I played with QM data, so I am not sure what is out there. Your available RFCs will be determined by the version of ERP and your security. You may end up having to get the permissions changed. You may have to do something funky using BAPI_PRODORD_GET_LIST. Run the material and plant to get a list of Production Orders with associated information, including BATCH which you can then match to the Lot number to use the production order number to find the correct inspection lot results.

4) Build a custom BAPI.

Good luck,

Mike

If you need more explanation on any of these except 4 (I am just learning ABAP), post again.

agentry_src
Active Contributor
0 Kudos

You might also be able to use BAPI_MATERIAL_GETBATCHES to generate your Lot List.

Former Member
0 Kudos

Michael,

Thanks for the options, obviously the preference would be to write a custom bapi with minimum inputs to output maximum detail, but my lack of abap is going to prevent this. The BAPI_MATERIAL_GETBATCHES sounds like it could lead me on the right path though as a material input , date range would be exactly what i am looking for. Is there a subsequent bapi that can output test result values based on batch number input etc. BAPI_BATCH_GET_DETAIL doesn't give the result data etc.

Thanks,

Emmett

agentry_src
Active Contributor
0 Kudos

Hi Emmett,

You can't use BATCH_GETDETAILS for Inspection lot data. See Ajay's post which will put you in the right area. BATCH information is data relating to the lot that does not have a pass/fail criteria. Depending on what you are looking for, you may want information from both BATCH (Measurements without pass/fail or grading criteria) and INSPECTION_LOT (measurements with a quality evaluation). The characteristics associated with both Batch and Inspections are structured similarly, but accessed differently.

Also check out the templates that Jeremy mentioned. I think there are a couple which might give you what you are looking for. If nothing else, you will see how the Inspection Lot BAPIs work (in general behavioral terms). There are also some BATCH related ones out there.

If you get headed in the right direction and need further help, post again.

Good luck,

Mike

Former Member
0 Kudos

Guys,

Having investigated further and using all your input i have come up with a way i think would retrieve the data i am looking for in the following manner, but could do with advice on BAPI's etc.

1) Retrieve a Batch List using BAPI_MATERIAL_GETBATCHES (inputing a material and date range)

2) Have generated this list use the batch number to retrieve the inspection lot number etc ( Is there a BAPI to provide this using a Batch number as input ) ?

3) Using the hopefully output of 2 , input INSPLOT - INSPCHAR and INSPOPER to BAPI_INSPCHAR_GETRESULT to return the result i want (<RES_VALUE> ) to an xml document opposite the originally inputted batch number.

All help appreciated, do see any performance issues etc. - is this possible using repeat statements etc.

Thanks,

Emmett

agentry_src
Active Contributor
0 Kudos

Hi Emmett,

I do not think there is a method of getting the inspection lot from the Batch number directly. I am not sure, but I remember going down this road a couple of years ago. I think that you have to get the order number to get the inspection lot. Which was why I had that kind of convoluted method of getting the Production Order numbers and then matching the Batch numbers in an earlier post. I believe that PRODORD_GET_DETAILS will get you the inspection lot, but I will have to check that a little later today.

One other note about some BAPIs: They may list a field that you need, but sometimes they don't return the data. Test, test, test.... I think Batch is listed for the PRODORD_GET_DETAILS, but it may not populate. But when you do PRODORD_GET_LIST, I think it does.

I will do some research and testing later this morning and try to get you some better information. I need to update my own knowledge as it has been a while since I had to go this route with BAPIs.

Good luck,

Mike

Former Member
0 Kudos

Lads,

Have gotten pretty close to where i want to be retrieving results etc. thanks for all the help. I am currently authenticating to the ERP server three times to call the three seperate RFC's i am using, not ideal. I wanted to use the JCO connector start session > JCO Function > JCO Function .... > Close session to see if this would help speed wise. But the Start Session fails to connect with a wrong username or password, this isn't the case as i am using the same configured server via the ERP JCO Interface without trouble, anyone ever seen this before ?

Thanks again for all the help,

Emmett

Answers (2)

Answers (2)

jcgood25
Active Contributor
0 Kudos

Emmett,

Have you looked on the SDN Downloads area, in the for Manufacturing section? There are a bunch of sample BLS transactions (including the BAPI's Ajay mentioned) that will probably be a huge help in your efforts.

Regards,

Jeremy

Former Member
0 Kudos

You should be able to get all the data you need from the standard BAPI's.

former_member192939
Active Participant
0 Kudos

You can use the BAPI that Mike suggested...

the following BAPI might be helpful to retrieve the data

BAPI_INSPLOT_GETLIST

BAPI_INSPOPER_GETDETAIL

BAPI_INSPCHAR_GETRESULT

Regards,

Ajay.