/scripts/ahub.form.attachments.js
1

Error: Material numbers provided in equivalent fields differ in BAPI_MATPHYSINV_POSTDIFF

Apr 01, 2017 at 09:03 AM

337

avatar image
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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

avatar image
Former Member Apr 01, 2017 at 05:17 PM
0

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.

Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

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.

0
Former Member

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.

0
avatar image
Former Member Feb 09 at 11:07 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Skip to Content