Skip to Content
author's profile photo Former Member
Former Member

Unable to pass record results through BAPI_INSPOPER_RECORDRESULTS

Dear SDN Experts,

I am facing issues related to recording characteristics (QA32) through the BAPI BAPI_INSPOPER_RECORDRESULTS.

I am unable to record results through this BAPI .

I have attached the issue in the attachment.

Any help over this will be greatly appreciated.

Regards,

Sudhish

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 27, 2013 at 10:13 AM

    Hi,

    Refer this thread. Hope this helps you.

    http://scn.sap.com/thread/462076

    https://scn.sap.com/thread/1703960

    Thanks

    KH

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Dear after struggling for many days i found a solution to record results with this BAPI :BAPI_INSPOPER_RECORDRESULTS

      I am pasting my code at the bottom : it might help some one who is in need:-

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

      DATA : L_INSPLOT TYPE BAPI2045L2-INSPLOT,

      L_INSPOPER TYPE BAPI2045L2-INSPOPER.

      DATA : WA_INSPPOINT TYPE BAPI2045L4,

      WA_RET TYPE BAPIRET2.

      DATA : T_CHAR TYPE STANDARD TABLE OF BAPI2045D2,

      WA_CHAR TYPE BAPI2045D2,

      T_SAMP TYPE STANDARD TABLE OF BAPI2045D3,

      WA_SAMP TYPE BAPI2045D3,

      T_SRES TYPE STANDARD TABLE OF BAPI2045D4,

      WA_SRES TYPE BAPI2045D4.

      DATA : T_INSP TYPE STANDARD TABLE OF ZQMT_RES_UPD,

      WA_INSP TYPE ZQMT_RES_UPD.

      DATA : T_RES TYPE STANDARD TABLE OF ZQMT_RES_UPD,

      WA_RES TYPE ZQMT_RES_UPD.

      DATA : T_RET TYPE STANDARD TABLE OF BAPIRET2.

      DATA : COUNTER TYPE BAPI2045D4-RES_NO.

      START-OF-SELECTION.

      PERFORM GET_DATA.

      PERFORM POST_DATA.

      *&---------------------------------------------------------------------*

      *& Form GET_DATA

      *&---------------------------------------------------------------------*

      * text

      *----------------------------------------------------------------------*

      * --> p1 text

      * <-- p2 text

      *----------------------------------------------------------------------*

      FORM GET_DATA .

      REFRESH : T_CHAR , T_SAMP , T_SRES , T_RES , T_INSP.

      SELECT * FROM ZQMT_RES_UPD INTO TABLE T_INSP

      WHERE YSTATUS EQ ''.

      sort T_INSP by PRUEFLOS VORNR CONTAINER_NO REC_SURR_TIME descending.

      T_RES = T_INSP.

      delete adjacent duplicates from T_INSP comparing PRUEFLOS VORNR CONTAINER_NO.

      ENDFORM. " GET_DATA

      *&---------------------------------------------------------------------*

      *& Form POST_DATA

      *&---------------------------------------------------------------------*

      * text

      *----------------------------------------------------------------------*

      * --> p1 text

      * <-- p2 text

      *----------------------------------------------------------------------*

      FORM POST_DATA .

      LOOP AT T_INSP INTO WA_INSP.

      REFRESH : T_CHAR , T_SAMP , T_SRES.

      CLEAR : WA_INSPPOINT, COUNTER..

      WA_INSPPOINT-INSPLOT = WA_INSP-PRUEFLOS.

      WA_INSPPOINT-INSPOPER = WA_INSP-VORNR.

      WA_INSPPOINT-INSPPOINT = '000130'. " To be passed hard coded

      WA_INSPPOINT-USERC2 = WA_INSP-CONTAINER_NO.

      LOOP AT T_RES INTO WA_RES WHERE PRUEFLOS = WA_INSP-PRUEFLOS

      AND VORNR = WA_INSP-VORNR.

      COUNTER = COUNTER + 0001.

      WA_CHAR-INSPLOT = WA_RES-PRUEFLOS.

      WA_CHAR-INSPOPER = WA_RES-VORNR.

      WA_CHAR-INSPCHAR = WA_RES-MERKNR.

      WA_CHAR-CLOSED = 'X'.

      WA_CHAR-EVALUATED = 'X'.

      WA_CHAR-EVALUATION = WA_RES-EVALUATION.

      APPEND WA_CHAR TO T_CHAR.

      WA_SAMP-INSPLOT = WA_RES-PRUEFLOS.

      WA_SAMP-INSPOPER = WA_RES-VORNR.

      WA_SAMP-INSPCHAR = WA_RES-MERKNR.

      WA_SAMP-CLOSED = 'X'.

      WA_SAMP-EVALUATED = 'X'.

      WA_SAMP-EVALUATION = WA_RES-EVALUATION.

      APPEND WA_SAMP TO T_SAMP.

      WA_SRES-INSPLOT = WA_RES-PRUEFLOS.

      WA_SRES-INSPOPER = WA_RES-VORNR.

      WA_SRES-INSPCHAR = WA_RES-MERKNR.

      WA_SRES-RES_NO = COUNTER.

      WA_SRES-RES_VALUE = WA_RES-TEST_RESULT.

      APPEND WA_SRES TO T_SRES.

      ENDLOOP.

      CALL FUNCTION 'BAPI_INSPOPER_RECORDRESULTS'

      EXPORTING

      INSPLOT = WA_INSP-PRUEFLOS

      INSPOPER = WA_INSP-VORNR

      INSPPOINTDATA = WA_INSPPOINT

      IMPORTING

      RETURN = WA_RET

      TABLES

      CHAR_RESULTS = T_CHAR

      SAMPLE_RESULTS = T_SAMP

      SINGLE_RESULTS = T_SRES

      RETURNTABLE = T_RET.

      READ TABLE T_RET INTO WA_RET WITH KEY TYPE = 'E'.

      IF SY-SUBRC = 0.

      WA_INSP-STATUS_DESC = WA_RET-MESSAGE.

      WA_INSP-YSTATUS = 'E'.

      ELSE.

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

      EXPORTING

      WAIT = 'X'.

      WA_INSP-STATUS_DESC = 'Results Recorded.'.

      WA_INSP-YSTATUS = 'S'.

      ENDIF.

      MODIFY ZQMT_RES_UPD FROM WA_INSP.

      ENDLOOP.

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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.