2014 Oct 26 4:50 PM
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.
2014 Oct 26 5:21 PM
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
2014 Oct 26 5:21 PM
2014 Oct 26 5:27 PM
Hy and thanx for your reply with MM42 I do not have issue, only using the bapi.
Regards.
2014 Oct 28 2:47 PM
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |