cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Material numbers provided in equivalent fields differ in BAPI_MATPHYSINV_POSTDIFF

Former Member

Hi,

I am trying to post physical inventory document using BAPI_MATPHYSINV_POSTDIFF and in alternative call for the bapi i am getting Error : "Material numbers provided in equivalent fields differ".

If i go and post same documents separately through my code it got posted. but in loop the same BAPI gives above error in alternative call.

CL_MATNR_CHK_MAPPER

METHOD : TABLES_CONV_TAB_INTERNAL

* Now do all the assigns of the primary table
IF NOT <lsf_fnames>-seg_fields-long IS INITIAL.
ASSIGN COMPONENT <lsf_fnames>-seg_fields-long OF STRUCTURE <lsf_line> TO <lvf_long>.
ENDIF.

In above code <lvf_long> populated by previous BAPI Call material and due to diff in current BAPI material call it gives me that error.

We are using SAP S/4HANA

I have also cleared buffer data using

CALL FUNCTION 'ISSR_BAPI_BUFFER_REFRESH_ALL'.

Please suggest how to overcome with this error.

Thanks in Advance

Pratik

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member296785
Participant
0 Kudos

Dear Pratik Patel,

Got any solution for this?

We are facing the same issue for Sales order creation BAPI BAPI_SALESORDER_CREATEFROMDAT2 (HANA 1511).

Please share the solution for this error.

Former Member
0 Kudos

Hi Pratik,

I think you have debugged the scenario and know the root cause. Just to add, you can try using <lvf_long> as a workarea, rather than a field symbol. Then, you can clear that up after every iteration.

Former Member
0 Kudos

Hi Shubhamoy,

As I mentioned its in standard class CL_MATNR_CHK_MAPPER.

I want to know how can i clear history from that without changing standard code. because in alternative call it works fine without any problem.

Former Member
0 Kudos

Hi Pratik,

Ok... You are trying something like this,

LOOP

CL_MATNR_CHK_MAPPER->TABLES_CONV_TAB_INTERNAL // and you are getting the error from this Method right?

(

//

)

CALL FUNCTION 'ISSR_BAPI_BUFFER_REFRESH_ALL'.

ENDLOOP.

If the above flow is right, then , you may try using the FM - BAPI_TRANSACTION_COMMIT. This FM also works to refresh the buffer.