Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Problems with update, material_maintain_dark

Hi everybody,

i have a minor Problem with the FM mentioned above.

I have to update the MBEW (ZPLP2 and ZPLD2)

in the end i get the return-code '0', but the material (price in MBEW) is still not changed.

Pleas have a look at the following code, maybe you have an answer for me

LOOP AT xl_marc INTO wa_marc WHERE nplpr GT '0.00' AND hknpr NE space.

wa_mara-matnr = wa_marc-matnr.

wa_mara-pstat = 'G'.

wa_mara-tranc = 0000000001.

wa_mara-tcode = 'MM02'.

APPEND wa_mara TO xl_mara.

wa_marc1-matnr = wa_marc-matnr.

wa_marc1-werks = xs_00002-low.

wa_marc1-tranc = 0000000001.

APPEND wa_marc1 TO xl_marc1.

wa_mbew-mandt = sy-mandt.

wa_mbew-matnr = wa_marc-matnr.

wa_mbew-zplp2 = wa_marc-nplpr.

wa_mbew-bwkey = xs_00002-low.

wa_mbew-zpld2 = sy-datum.

wa_mbew-tranc = 0000000001.

APPEND wa_mbew TO xl_mbew.

CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'

EXPORTING

flag_muss_pruefen = 'X'

  • sperrmodus = 'E'

max_errors = 9999

p_kz_no_warn = 'N'

kz_prf = ' '

  • KZ_VERW = 'X'

kz_aend = 'X'

  • KZ_DISPO = 'X'

  • KZ_TEST = ' '

NO_DATABASE_UPDATE = ' '

  • CALL_MODE = ' '

  • CALL_MODE2 = ' '

user = sy-uname

  • SUPPRESS_ARRAY_READ = ' '

  • FLG_MASS = ' '

IMPORTING

matnr_last = wa_marc-matnr

number_errors_transaction = numerror

TABLES

amara_ueb = xl_mara

amarc_ueb = xl_marc1

ambew_ueb = xl_mbew

EXCEPTIONS

kstatus_empty = 1

tkstatus_empty = 2

t130m_error = 3

internal_error = 4

too_many_errors = 5

update_error = 6

OTHERS = 7

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDLOOP.

Thanks for any help!

regards

Thomas

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question