‎2016 Mar 08 1:48 PM
Hey Guys,
I tried to update some fields in the table MARA and MARC but not all changes were made. For example I tried to change the field BRGEW and had no problem it got changed to the value I want and the changedocument were created.
But If I want to update the fields PSTAT or BESKZ the changes were not made and I always get sy-subrc = 4 which means "Internal Error" which doesnt help much. The call of the function module looks like this:
CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'
EXPORTING
" flag_muss_pruefen = 'X'
* SPERRMODUS = 'E'
* MAX_ERRORS = 0
p_kz_no_warn = 'N'
kz_prf = ''
* KZ_VERW = 'X'
kz_aend = 'X'
* KZ_DISPO = 'X'
* KZ_TEST = 'X'
* NO_DATABASE_UPDATE = ' '
* CALL_MODE = ' '
* CALL_MODE2 = ' '
user = sy-uname
* SUPPRESS_ARRAY_READ = ' '
* FLG_MASS = ' '
* IV_CHANGE_DOC_TCODE = ' '
* IMPORTING
* MATNR_LAST =
* NUMBER_ERRORS_TRANSACTION =
TABLES
amara_ueb = lt_mara
* AMAKT_UEB =
amarc_ueb = lt_marc
* AMARD_UEB =
* AMFHM_UEB =
* AMARM_UEB =
* AMEA1_UEB =
* AMBEW_UEB =
* ASTEU_UEB =
* ASTMM_UEB =
* AMLGN_UEB =
* AMLGT_UEB =
* AMPGD_UEB =
* AMPOP_UEB =
* AMVEG_UEB =
* AMVEU_UEB =
* AMVKE_UEB =
* ALTX1_UEB =
* AMPRW_UEB =
* AE1CUCFG_UEB =
* AE1CUINS_UEB =
* AE1CUVAL_UEB =
* AE1CUCOM_UEB =
amfieldres = lt_fieldres
amerrdat = lt_amerrdat
EXCEPTIONS
kstatus_empty = 1
tkstatus_empty = 2
t130m_error = 3
internal_error = 4
too_many_errors = 5
update_error = 6
error_propagate_header = 7
OTHERS = 8.
Does anyone have an idea for this ?
‎2016 Mar 08 2:00 PM
‎2016 Mar 08 2:00 PM
‎2016 Mar 08 2:03 PM
Well Ok i can accept that 🙂 but what about BESKZ ?
I tried to put it back on the initial value, so I filled my mara table, my marc table and my amfieldres table. In the amfieldred table i put BESKZ so it gets back to initial value but it doesnt work.
‎2016 Mar 08 2:16 PM
What is initial value of BESKZ? Try same changes in MM02 and check for messages.
‎2016 Mar 08 2:18 PM
Have you already tried if you can do it in MM02?
The field is depending on customizing settings made in OMS2 per material type and as well based on field selection settings for material master.
‎2016 Mar 08 2:49 PM
Ok so that means I can't change a value back to its initial value if its mandatory or whatever not even through abap by tricking the sap system somehow ?
‎2016 Mar 08 3:35 PM
You can maintain anything with an own ABAP report that is updating tables, but using standard options you are bit limited. Once the data is there, any further activity is a change, and the system settings have to take care that this does not conflict with customizing settings.
On the other side I am pretty certain that I am able to overwrite certain values using the MATMAS IDoc, having message function set to replace, but it has to be consistent.
The BESKZ field is in the purchasing view, the purchasing view is represented by an E in PSTAT and VPSTAT of MARA and PSTAT of MARC
So you cannot have a blank BESKZ field if you tell your system at the same time that you have a purchasing view and the customizing for the field is set to mandatory entry.
‎2016 Mar 08 3:43 PM
Ok I see so theoretically I have to change PSTAT and VPSTAT of MARA and PSTAT of MARC first to change BESKZ. But it is not possible to change PSTAT and VPSTAT through the FM MATERIAL_MAINTAIN_DARK is that right ?
‎2016 Mar 08 4:00 PM
I am not using actively function modules in my data migrations, I use BAPIs or IDOCs generated from LSMW.
the MATMAS Idoc is posted via function module IDOC_INPUT_MATMAS01 and in this FM I can see a call for MATERIAL_MAINTAIN_DARK
From this point of view I would say that the MATERIAL_MAINTAIN_DARK should be able to do what you want.
But material master creation is a science for its own, with all its dependencies on field selection customizing and material type customizing and even with the location of the fields in the various screens and the assigned ALE maintenance status for each of the fields. (so you might automatically get a sales view if you maintain a field in the basis data screen)