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

marc-XMCNG not updating using bapi BAPI_MATERIAL_MAINTAINDATA_RT

Former Member
0 Likes
1,227

Hello Folks, i'm facing an issue to update the negative stock allowed flag for a material using the bapi BAPI_MATERIAL_MAINTAINDATA_RT

the bapi does not show error but the field is not updated.

Do i miss some parameters for the BAPI?

this my piece of code

   CLEAR: ls_headdata, ls_plantdata, ls_plantdatax.
REFRESH: lt_plantdata, lt_plantdatax.
*dati di testata
MOVE: '004'    TO ls_headdata-function,
wa_matnr
-matnr TO ls_headdata-material,
'X'      TO ls_headdata-logdc_view.
* dati di posizioni
MOVE: '004' TO ls_plantdata-function,
'004' TO ls_plantdatax-function,
wa_matnr
-matnr TO ls_plantdata-material,
wa_matnr
-matnr TO ls_plantdatax-material,
'D100' TO ls_plantdata-plant,
'D100' TO ls_plantdatax-plant,
'X' TO ls_plantdata-neg_stocks,
'X' TO ls_plantdatax-neg_stocks.

APPEND: ls_plantdata TO lt_plantdata,
ls_plantdatax
TO lt_plantdatax.
* Chiamata alla bapi
CALL FUNCTION 'BAPI_MATERIAL_MAINTAINDATA_RT'
EXPORTING
headdata  
= ls_headdata
IMPORTING
return     = ls_return
TABLES
plantdata 
= lt_plantdata
plantdatax
= lt_plantdatax.
IF ls_return-type NE 'E'.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ELSE.
WRITE /: 'update error for material:', wa_matnr.
ENDIF.

thanx and regards.

1 ACCEPTED SOLUTION
Read only

Prasoon
Active Contributor
0 Likes
877

Hi,

   Please check whether you are able to set the flag in MM41 or MM42 for the same article and data. If you are getting any message while setting the flag in MM41 / MM42, please share the same.

Regards,

AKPT

3 REPLIES 3
Read only

Prasoon
Active Contributor
0 Likes
878

Hi,

   Please check whether you are able to set the flag in MM41 or MM42 for the same article and data. If you are getting any message while setting the flag in MM41 / MM42, please share the same.

Regards,

AKPT

Read only

Former Member
0 Likes
877

Hy and thanx for your reply with MM42 I do not have issue, only using the bapi.

Regards.

Read only

Former Member
0 Likes
877

i solved it, the division wasn't D100 but the model.