Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

MATERIAL_MAINTAIN_DARK no mara append table update

Former Member
0 Kudos

Hello,

I've a little problem using MATERIAL_MAINTAIN_DARK to modify some materials.

I have to update fields in two append structures (one in mara, one in marm)

when I use this function module, the update is ok on marm but not on mara

if anyone have an idea ??

Thanks in advance

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hai Fabrice

check the following Code

DATA: h_anzfehler LIKE tbist-numerror.

DATA: BEGIN OF t_mara_ueb OCCURS 1.

INCLUDE STRUCTURE mara_ueb.

DATA: END OF t_mara_ueb.

DATA: BEGIN OF t_mbew_ueb OCCURS 1.

INCLUDE STRUCTURE mbew_ueb.

DATA: END OF t_mbew_ueb.

DATA: t_merrdat TYPE merrdat OCCURS 0 WITH HEADER LINE.

  • aufbauen T_MARA_UEB

CLEAR: t_mara_ueb.

REFRESH: t_mara_ueb.

t_mara_ueb-mandt = sy-mandt.

t_mara_ueb-matnr = t_mbew-matnr.

t_mara_ueb-tcode = 'MM02'.

t_mara_ueb-tranc = h_tranc. "Transaktionszähler

APPEND t_mara_ueb.

  • aufbauen T_MBEW_UEB

CLEAR: t_mbew_ueb.

REFRESH: t_mbew_ueb.

t_mbew_ueb-mandt = sy-mandt.

t_mbew_ueb-matnr = t_mbew-matnr.

t_mbew_ueb-bwkey = t_mbew-bwkey.

t_mbew_ueb-bwtar = t_mbew-bwtar.

t_mbew_ueb-tranc = h_tranc. "Transaktionszähler

  • Änderung der Preissteuerung in der lfd. Periode

IF t_mbew-vprsv NE p_vprsvn.

t_mbew_ueb-vprsv = p_vprsvn. "neue Preissteuerung->lfd.Per.

ENDIF.

  • Änderung der Preissteuerung in der Vorperiode

IF t_mbew-vmvpr NE p_vprsvn.

t_mbew_ueb-vmvpr = p_vprsvn. "neue Preissteuerung-> Vorper.

ENDIF.

  • Änderung der Preissteuerung in der letzten Periode des Vorjahres

IF flag_vm_eq_vj = 'X'. "Vorperiode = Vorjahr

IF t_mbew-vjvpr NE p_vprsvn.

t_mbew_ueb-vjvpr = p_vprsvn. "neue Preissteuerung-> Vorjahr

ENDIF.

ENDIF.

APPEND t_mbew_ueb.

CLEAR: t_merrdat.

REFRESH: t_merrdat.

CLEAR: h_anzfehler.

CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'

EXPORTING

  • FLAG_MUSS_PRUEFEN = 'X'

  • SPERRMODUS = 'E'

  • MAX_ERRORS = 0

p_kz_no_warn = 'N'

kz_prf = 'E'

kz_aend = 'X'

kz_dispo = ' '

IMPORTING

number_errors_transaction = h_anzfehler

TABLES

amara_ueb = t_mara_ueb

ambew_ueb = t_mbew_ueb

amerrdat = t_merrdat

EXCEPTIONS

kstatus_empty = 1

tkstatus_empty = 2

t130m_error = 3

internal_error = 4

too_many_errors = 5

update_error = 6

OTHERS = 7.

IF NOT h_anzfehler IS INITIAL.

PERFORM build_message.

EXIT. "Abbruch Form-Verarbeitung

ELSE.

flag_vprsv_upd = 'X'.

ENDIF.

Thanks & Regards

Sreenivasulu P

18 REPLIES 18

Former Member
0 Kudos

have u given the tcode 'MM02'. for mara table

Former Member
0 Kudos

Hai Fabrice

check the following Code

DATA: h_anzfehler LIKE tbist-numerror.

DATA: BEGIN OF t_mara_ueb OCCURS 1.

INCLUDE STRUCTURE mara_ueb.

DATA: END OF t_mara_ueb.

DATA: BEGIN OF t_mbew_ueb OCCURS 1.

INCLUDE STRUCTURE mbew_ueb.

DATA: END OF t_mbew_ueb.

DATA: t_merrdat TYPE merrdat OCCURS 0 WITH HEADER LINE.

  • aufbauen T_MARA_UEB

CLEAR: t_mara_ueb.

REFRESH: t_mara_ueb.

t_mara_ueb-mandt = sy-mandt.

t_mara_ueb-matnr = t_mbew-matnr.

t_mara_ueb-tcode = 'MM02'.

t_mara_ueb-tranc = h_tranc. "Transaktionszähler

APPEND t_mara_ueb.

  • aufbauen T_MBEW_UEB

CLEAR: t_mbew_ueb.

REFRESH: t_mbew_ueb.

t_mbew_ueb-mandt = sy-mandt.

t_mbew_ueb-matnr = t_mbew-matnr.

t_mbew_ueb-bwkey = t_mbew-bwkey.

t_mbew_ueb-bwtar = t_mbew-bwtar.

t_mbew_ueb-tranc = h_tranc. "Transaktionszähler

  • Änderung der Preissteuerung in der lfd. Periode

IF t_mbew-vprsv NE p_vprsvn.

t_mbew_ueb-vprsv = p_vprsvn. "neue Preissteuerung->lfd.Per.

ENDIF.

  • Änderung der Preissteuerung in der Vorperiode

IF t_mbew-vmvpr NE p_vprsvn.

t_mbew_ueb-vmvpr = p_vprsvn. "neue Preissteuerung-> Vorper.

ENDIF.

  • Änderung der Preissteuerung in der letzten Periode des Vorjahres

IF flag_vm_eq_vj = 'X'. "Vorperiode = Vorjahr

IF t_mbew-vjvpr NE p_vprsvn.

t_mbew_ueb-vjvpr = p_vprsvn. "neue Preissteuerung-> Vorjahr

ENDIF.

ENDIF.

APPEND t_mbew_ueb.

CLEAR: t_merrdat.

REFRESH: t_merrdat.

CLEAR: h_anzfehler.

CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'

EXPORTING

  • FLAG_MUSS_PRUEFEN = 'X'

  • SPERRMODUS = 'E'

  • MAX_ERRORS = 0

p_kz_no_warn = 'N'

kz_prf = 'E'

kz_aend = 'X'

kz_dispo = ' '

IMPORTING

number_errors_transaction = h_anzfehler

TABLES

amara_ueb = t_mara_ueb

ambew_ueb = t_mbew_ueb

amerrdat = t_merrdat

EXCEPTIONS

kstatus_empty = 1

tkstatus_empty = 2

t130m_error = 3

internal_error = 4

too_many_errors = 5

update_error = 6

OTHERS = 7.

IF NOT h_anzfehler IS INITIAL.

PERFORM build_message.

EXIT. "Abbruch Form-Verarbeitung

ELSE.

flag_vprsv_upd = 'X'.

ENDIF.

Thanks & Regards

Sreenivasulu P

0 Kudos

Thanks for your help, I filled the transaction code ,

here's the code :

DATA: t_amara_ueb LIKE mara_ueb OCCURS 0 WITH HEADER LINE.

DATA: t_amarm_ueb LIKE marm_ueb OCCURS 0 WITH HEADER LINE.

t_amara_ueb-matnr = 'T20204'.

t_amara_ueb-tcode = 'MM02'.

t_amara_ueb-zznomix = 'X'.

t_amara_ueb-zzheavy = 'X'.

t_amara_ueb-zzscan_mat = 'X'.

w_count = w_count + 1.

t_amara_ueb-tranc = w_count.

APPEND t_amara_ueb.

CLEAR t_amara_ueb.

t_amarm_ueb-matnr = 'T20204'.

t_amarm_ueb-meinh = 'KAR'.

t_amarm_ueb-zzhiepos = 2.

t_amarm_ueb-zzvrkme = 'X'.

t_amarm_ueb-zzpacked = ' '.

t_amarm_ueb-zzmatnr_e = ' '.

APPEND t_amarm_ueb.

CLEAR t_amarm_ueb.

CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'

EXPORTING

sperrmodus = ' '

kz_prf = 'W'

max_errors = ' '

p_kz_no_warn = 'X'

kz_verw = 'X'

kz_aend = 'X'

kz_dispo = 'X'

kz_test = ' '

flag_muss_pruefen = ' '

call_mode = 'ACT'

IMPORTING

matnr_last = w_matnr_last

number_errors_transaction = w_nb_errors

TABLES

amara_ueb = t_amara_ueb

amarm_ueb = t_amarm_ueb

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.

ELSE.

COMMIT WORK.

ENDIF.

Former Member
0 Kudos

Hello Fabrice,

u also need to have t_amarm_ueb-tranc filled with w_count. I am assuming that the z fields are also appended in mara_ueb and marm_ueb.

0 Kudos

Sorry, it's a simplified copy and I ommit this part but it's done in the real program.

Yes z fields are appended in mara and marm

Thanks

0 Kudos

Standard material master data from mara are ok too.

the problem only concerns my mara append table

no idea ?

0 Kudos

As this function is used by the Direct Input program RMDATIND, have you checked the documentation for that, (or even the code).

When I looked at that (3.0b/d) you had to run a generate program to use the new 'z' input structure (ZMMH1?) for the append fields.

MattG.

0 Kudos

Thanks matthew, I'am going to check this.

Rmdatind is using structures which are not including my append structures but the function module MATERIAL_MAINTAIN_DARK uses mara and marm structures so, it includes my appends;

Former Member
0 Kudos

Did u extend the structure mara_ueb also?

0 Kudos

Hello, MARA_UEB includes MARA then it includes my mara append table too.

Former Member
0 Kudos

Hi Fabrice,

There are a couple of things:

1. In your append structure if you are trying to clear any fields then you must ensure that the table parameter "AMFIELDRES" is also populated with the field that needs to be cleared.

2. Also in my experience I think you need to populate the D_IND field of all the tables as well.

Urmila

0 Kudos

Thanks Urmila,

AMFIELDRES help me to clear the fields in my MARM append structure.

I populated D_IND in my 2 tables but my append fields in table mara are not maintained !!!!

0 Kudos

I populated d_ind with the same thing as tranc (with a counter) is it ok ?

0 Kudos

Hi Fabrice.

When you add custom fields to MARA, in order to

update them with MATERIAL_MAINTAIN_DARK you (or more

precisely MM application consultant) shoud maintain assignment of these fields to 'field group'. this should be done in customization :

LogisticGeneral->MaterialMaster->Field Selection->Assign fields to field selection group.

Cheers,

Yan

Former Member
0 Kudos

Hi,

I have some z-fields in MARA table and they already have values. I want to clear all those fields. I could clear date and time fields but i am not able to clear flag fields. I am able to add a 'X' to a empty field but I cant do the reverse i.e am not able to clear the fields which already have X. I am also unable to clear some fields with numbers. PLEASE GUIDE. Iam using MATERIAL_MAINTAIN_DARK.

Former Member
0 Kudos

Hi Fabrice Petetin ,

I am facing the same problem with 'MATERIAL_MAINTAIN_DARK ' FM. i have extended the mara structure with custom fields and i am trying to create/change material through MATMAS05 IDOC, this is using the FM IDOC_INPUT_MATMAS01. My entire data of custom fields are getting passed to the 'MATERIAL_MAINTAIN_DARK' FM which is being called inside the FM IDOC_INPUT_MATMAS01.

Its creating the material but the custom fields are not getting updated with any data. Could you please help me if you have any solution for this.

Thanks in advance.

SK.

Edited by: s k on Nov 25, 2009 5:15 PM

0 Kudos

Hi s k,

Did you fixed it? I have the same problems.

Thanks

Former Member
0 Kudos

Hi all,

Please dont give me any sdn links. i have searched all the links and tried.

Thanks in advance.

SK.

Edited by: s k on Nov 25, 2009 5:19 PM

Edited by: s k on Nov 25, 2009 5:20 PM

Edited by: s k on Nov 25, 2009 5:21 PM