MM Function module Used the same way in S/4HANA

MATERIAL_MAINTAIN_DARK Maintain Material Master in Background

Creates or changes material master data without screens (in the background); the data is passed in transfer tables such as MARA_UEB, MARC_UEB and MBEW_UEB, with a transaction number (TRANC) in each row. It is used in older developments that must load fields not covered by the material master BAPIs and in some SAP-internal transfer processes. It is not a released interface: prefer BAPI_MATERIAL_SAVEDATA or BAPI_MATERIAL_SAVEREPLICA in new developments, and read the errors from the AMERRDAT table.

Function group
MGMD
Remote-enabled (RFC)
No
Type
Function module

ABAP Cloud and clean core status

Not to be released for ABAP Cloud LO-MD-MM

SAP does not release this object for ABAP Cloud. It keeps working in classic ABAP; in ABAP Cloud and clean core development use the successor below.

Use instead in ABAP Cloud:

  • I_PRODUCTTP_2

Source: SAP's list of released objects (S/4HANA Cloud Private Edition, latest), SAP Cloudification Repository

Importing parameters

ParameterTypeDescriptionRequired
KZ_PRFRMMG08_012-MSGTYPCheck level (message type)Yes
P_KZ_NO_WARNRMMG08_012-MSGTYPSuppress warningsYes
CALL_MODEMMDCMODE-CALL_MODECall mode—

Exporting parameters

ParameterTypeDescription
MATNR_LASTMARA-MATNRLast material processed
NUMBER_ERRORS_TRANSACTIONTBIST-NUMERRORNumber of erroneous transactions

Tables parameters

ParameterTypeDescriptionRequired
AMARA_UEBMARA_UEBGeneral material dataYes
AMAKT_UEBMAKT_UEBMaterial descriptions—
AMARC_UEBMARC_UEBPlant data—
AMARD_UEBMARD_UEBStorage location data—
AMARM_UEBMARM_UEBUnits of measure—
AMBEW_UEBMBEW_UEBValuation data—
AMVKE_UEBMVKE_UEBSales data—
AMFIELDRESMFIELDRESFields to be reset—
AMERRDATMERRDATError messages—

Exceptions

  • KSTATUS_EMPTY — Maintenance status empty
  • TKSTATUS_EMPTY — View status empty
  • T130M_ERROR — Transaction control table error
  • INTERNAL_ERROR — Internal error
  • TOO_MANY_ERRORS — Too many errors
  • UPDATE_ERROR — Update error
  • ERROR_PROPAGATE_HEADER — Error propagated to header

Call template (ABAP)

A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.

CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'
  EXPORTING
    kz_prf = lv_kz_prf
    p_kz_no_warn = lv_p_kz_no_warn
  IMPORTING
    matnr_last = lv_matnr_last
    number_errors_transaction = lv_number_errors_transaction
  TABLES
    amara_ueb = lt_amara_ueb
    amakt_ueb = lt_amakt_ueb
    amarc_ueb = lt_amarc_ueb
    amard_ueb = lt_amard_ueb
    amarm_ueb = lt_amarm_ueb
    ambew_ueb = lt_ambew_ueb
    amvke_ueb = lt_amvke_ueb
    amfieldres = lt_amfieldres
    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.

Related tables

Can't find the report you need?

We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.

Request a custom report