Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_INSPOPER_RECORDRESULTS, Record Insp Lot Results

Former Member
0 Kudos

I posted the following message back in June. I did not have alot of success with it and dropped it for a while. I have picked it up again and am still struggling with the exact same thing.

Can anyone help? If anyone has successfully used this BAPI before, would you be able to send me some sample code?

***************************************************

I have been trying to figure out how to use this BAPI to record Test Results against an Inspection Lot. The BAPI appears to work - sort of. There are no errors in the Return Table. The Inspection Lot though does not get updated with the result for inspection characteristic 0030. It does however evaluate and close it. I am absolutely stumped. I have attached a simplified version of my code. I cannot figure out how come the test result itself is not getting updated (mean_value of 2.17) Can anyone help me out? thx in advance.

DATA: BEGIN OF ichar_results OCCURS 0.

INCLUDE STRUCTURE BAPI2045D2.

DATA: END OF ichar_results.

DATA: BEGIN OF bapireturn2 OCCURS 0.

INCLUDE STRUCTURE bapiret2.

DATA: END OF bapireturn2.

ichar_results-insplot = '70000009065'.

ichar_results-inspoper = '0010'.

char_results-inspchar = '0030'.

ichar_results-mean_value = '2.17'.

ichar_results-closed = 'X'.

ichar_results-evaluated = 'X'.

ichar_results-evaluation = 'A'.

APPEND ichar_results.

CALL FUNCTION 'BAPI_INSPOPER_RECORDRESULTS'

EXPORTING

INSPLOT = '70000009065'

INSPOPER = '0010'

IMPORTING

RETURN = bapireturn2

TABLES

CHAR_RESULTS = ichar_results.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

IMPORTING

RETURN = bapireturn2.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Check OSS 420824 . there are many other notes.

Check if they are valid on your release /patch level.

Cheers

6 REPLIES 6

Former Member
0 Kudos

Check OSS 420824 . there are many other notes.

Check if they are valid on your release /patch level.

Cheers

0 Kudos

thx for your response. I checked the note and it is a bit confusing because we are using SAP ERP5.0 and the BAPI_INSPOPER_RECORDRESULTS is not marked as being obsolete. The BAPI_INSPOPER_GETDETAIL only looks up the info from SAP, it does not allow you to record new results (from what I understand anyways). I did a search on the other notes and could not find anything as well. I had logged a call with SAP a few months ago but they refused to help -- they indicated this problem was a consulting issue.

0 Kudos

I finally figured out. A very important lesson learned in all this is that when you are using a bapi to load data into SAP, it would be a really good idea to run the applicable "get" bapi to see what is actually there. In this case, I ran the BAPI_INSPOPER_GETDETAIL bapi. In order to use the BAPI_INSOPER_RECORDRESULTS I had to use the SINGLE_RESULTS to write the result value and CHAR_RESULTS to do the valuations etc. Here is the code ..

DATA: BEGIN OF ichar_results OCCURS 0.

INCLUDE STRUCTURE BAPI2045D2.

DATA: END OF ichar_results.

DATA: BEGIN OF isingle_results OCCURS 0.

INCLUDE STRUCTURE BAPI2045D4.

DATA: END OF isingle_results.

DATA: BEGIN OF bapireturn2 OCCURS 0.

INCLUDE STRUCTURE bapiret2.

DATA: END OF bapireturn2.

isingle_results-insplot = '70000009550'.

isingle_results-inspoper = '0010'.

isingle_results-inspchar = '0010'.

isingle_results-res_value = '1.65'.

isingle_results-res_no = '0001'.

APPEND isingle_results.

ichar_results-insplot = '70000009550'.

ichar_results-inspoper = '0010'.

ichar_results-inspchar = '0010'.

ichar_results-closed = 'X'.

ichar_results-evaluated = 'X'.

ichar_results-evaluation = 'A'.

APPEND ichar_results.

CALL FUNCTION 'BAPI_INSPOPER_RECORDRESULTS'

EXPORTING

INSPLOT = '70000009550'

INSPOPER = '0010'

IMPORTING

RETURN = bapireturn2

TABLES

CHAR_RESULTS = ichar_results

SINGLE_RESULTS = isingle_results.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'

IMPORTING

RETURN = bapireturn2.

0 Kudos

Hi,

Thanks for the above tips, was quite helpful in creating inspection meter result.

Still i am stuck on on thing here. We have requirement to create meter result and i think most appropritate BAPI for this functionality is BAPI_INSPOPER_RECORDRESULTS only.

Only thing is we want to record results for particular serial number of equipement number(sernr fields in EQUI ). When we fill online QE01 we get pop up for serial number and then meter result for this number.

When crerating same meter result through BAPI how and where can i mention this serial number and create serial number specific meter result for inspection lot.

There is field EXT_NO in single result table parameter of BAPI

which desribes serial number, but when i try passing serail number BAPI fails.

Please can anyone tell me how to record meter result based on device no using BAPI.

0 Kudos

Hi,

Thanks for the above tips, was quite helpful in creating inspection meter result.

Still i am stuck on on thing here. We have requirement to create meter result and i think most appropritate BAPI for this functionality is BAPI_INSPOPER_RECORDRESULTS only.

Only thing is we want to record results for particular serial number of equipement number(sernr fields in EQUI ). When we fill online QE01 we get pop up for serial number and then meter result for this number.

When crerating same meter result through BAPI how and where can i mention this serial number and create serial number specific meter result for inspection lot.

There is field EXT_NO in single result table parameter of BAPI

which desribes serial number, but when i try passing serail number BAPI fails.

Please can anyone tell me how to record meter result based on device no using BAPI.

0 Kudos

Hi,

.

I created a MIC "QC12345" from bapi BAPI_QPMK_SAVEREPLICA in se37, now I want to attach this MIC to Inspection lot "10000082317" in QE51N Transaction.

Is there any standard Bapi available in QM for attaching MIC to inspection lot in QE51N?

Please help me if you know how to do it.

Shilpa