To update custom fields on mara with BAPI_MATERIAL_MAINTAINDATA_RT, EXIT_SAPL1001_003 must be activated
and custom fields must be mapped in user exit but writing code in user exit is not enough. Also a customization is neeeded.
Go to t-code SPRO press F5.
Logistic general-material master-field selection
and click to assign fields to field selection groups.
add your custom fields here and assign a number for them. Check note 568513 for details.
Try to update fields again and enjoy the result.