Application Development and Automation 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: 
Read only

An sample code about BAPI_INSPOPER_RECORDRESULTS

Former Member
0 Likes
2,220

Please give me an example code about BAPI BAPI_INSPOPER_RECORDRESULTS

Dai Nguyen Quang.

7 REPLIES 7
Read only

Former Member
0 Likes
1,808

I tried to use BDC for tcode qe11 but unsuccessful so I am trying to use BAPI and I meet some error.

May be my code is incorrect.

Please give me an example code.

Read only

0 Likes
1,808

Hi,

What is the error you are getting.

Regards,

Madhu.

Read only

0 Likes
1,808

My code as below:

*&---------------------------------------------------------------------*
*& Report  ZDAINQ_TEST5
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZDAINQ_TEST5.
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 = '30000000066'.

isingle_results-inspoper = '0110'.

isingle_results-inspchar = '0010'.

isingle_results-res_value = '1.65'.

isingle_results-res_no = '0001'.

APPEND isingle_results.



ichar_results-insplot = '30000000066'.

ichar_results-inspoper = '0110'.

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      = '30000000066'

     INSPOPER     = '0110'

   IMPORTING

     RETURN       = bapireturn2

   TABLES

     CHAR_RESULTS = ichar_results

     SINGLE_RESULTS = isingle_results.



CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

   EXPORTING

     WAIT   = 'X'

   IMPORTING

     RETURN = bapireturn2.

The file content is:

2    2    1    1    8

2    2    1    1    8

2    2    1    1    8

The error is:

Read only

0 Likes
1,808

Hi ,

Did you check the available wiki on this.

http://wiki.sdn.sap.com/wiki/display/Snippets/Sample+Code+BAPI_INSPOPER_RECORDRESULTS.

Just check the documentation of this bapi,check the leading zeros

Read only

0 Likes
1,808

I have checked many examples, this is one, but can not solve my problem

Read only

0 Likes
1,808

Hi,

Are you able to create manually with the same data.

Regards,

Madhu.

Read only

0 Likes
1,808

Yes, I able to create manually with the same data.