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: 

Error when using BAPI_INSPOPER_RECORDRESULTS

Former Member
0 Kudos

Hi,

I need to set char results for an inspection lot with one operation and one physical sample.

I populated the structure INSPPOINTDATA with relevant data and the fields SEL_SET, CODE_GRP, CODE were empty.

I populated the table SAMPLE_RESULTS with the relevant details as well.

When I call the BAPI to record results, I got the following error:

The selected set in the transfer record deviates from TQSS1/TQ79 (msgID:QT msgNo:408)

So I populate the field INSPPOINTDATA-SEL_SET with 'TW40UD' and run the BAPI again. However, this time I got another error:

Error in the transferred usage decision (selected set, code, code group) (msgID:QT msgNo:404)

I have no idea whats wrong with my program. Please help me.

Thanks.

Regards,

Chelsea

1 REPLY 1

Former Member
0 Kudos

Solution:

******TOP*********

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

DATA: BEGIN OF idata OCCURS 0.

INCLUDE STRUCTURE bapi2045l4.

DATA: END OF idata.

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.

DATA: BEGIN OF ireturntable OCCURS 0.

INCLUDE STRUCTURE bapiret2.

DATA: END OF ireturntable.

DATA: BEGIN OF isample_results OCCURS 0.

INCLUDE STRUCTURE bapi2045d3.

DATA: END OF isample_results.

*******END TOP*************************

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

ichar_results-insplot = '050000001514'.

ichar_results-inspoper = '0010'.

ichar_results-inspchar = '0070'.

ichar_results-closed = 'X'.

ichar_results-evaluated = 'X'.

ichar_results-evaluation = 'A'.

ichar_results-mean_value = '2.65'.

ichar_results-diff_dec_places = '02'.

APPEND ichar_results.

idata-insplot = '050000001514'.

idata-inspoper = '0010'.

idata-insppoint = '0005'.

idata-phys_smpl = '000100000826'.

idata-unit = 'KG'. "This is Very Very very important

isample_results-insplot = '050000001514'.

isample_results-inspoper = '0010'.

isample_results-inspchar = '0070'.

isample_results-inspsample = '000005'.

isample_results-closed = 'X'.

isample_results-evaluated = 'X'.

isample_results-evaluation = 'A'.

isample_results-mean_value = '2.65'.

isample_results-diff_dec_places = '02'.

APPEND isample_results.

CALL FUNCTION 'BAPI_INSPOPER_RECORDRESULTS'

EXPORTING

insplot = '050000001514'

inspoper = '0010'

insppointdata = idata

IMPORTING

return = bapireturn2

TABLES

char_results = ichar_results

sample_results = isample_results

  • single_results = isingle_results

returntable = ireturntable.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'

IMPORTING

return = bapireturn2.

LOOP AT ireturntable.

WRITE:/ ireturntable-message.

ENDLOOP.