2012 May 09 7:07 AM
Hi gurus,
I am trying to update custom fields in MARA sending IDOC MATMAS05.
Outbound and inbound IDOC is OK, both have no errors in BD87.
I added my code in BADI_MATMAS_ALE_IN:
DATA: ls_data TYPE LINE OF edidd_tt,
ls_mara TYPE mara_ueb,
ls_gen_data TYPE zmm_general_data.
READ TABLE idoc_data WITH KEY segnam = 'ZMM_MARA_FIELDS' INTO ls_data.
CHECK sy-subrc IS INITIAL.
ls_gen_data = ls_data-sdata.
LOOP AT mara_ueb INTO ls_mara.
ls_mara-zzwbs_type = ls_gen_data-zzwbs_type .
ls_mara-zzwbs_type_des = ls_gen_data-zzwbs_type_des .
ls_mara-zzstatus_code = ls_gen_data-zzstatus_code .
ls_mara-zzmeasured_byfin = ls_gen_data-zzmeasured_byfin.
ls_mara-zzprodstc = ls_gen_data-zzprodstc .
ls_mara-zzprodmofc = ls_gen_data-zzprodmofc .
ls_mara-zzprodmdc = ls_gen_data-zzprodmdc .
ls_mara-zzownedbyc = ls_gen_data-zzownedbyc .
ls_mara-zzsellab_prod = ls_gen_data-zzsellab_prod .
ls_mara-zzlisensable = ls_gen_data-zzlisensable .
MODIFY mara_ueb FROM ls_mara.
CLEAR:ls_mara.
ENDLOOP.
Unfortunately nothing happens and custom fields in MM03 are empty.
Whats wrong?
2012 May 09 8:22 AM
2012 May 09 9:32 AM
Few Sugeestions
1) Put break point in your badi. Use we19 ->existing Idoc ->enter your idoc number -> Test using inbound function module(IDOC_INPUT_MATMAS01) -> run in foreground. Please post if you find the mara_ueb is getting updated inside your code loop.
2) ls_gen_data TYPE zmm_general_data. should better be
ls_gen_data TYPE ZMM_MARA_FIELDS. " it should be the segment name.
.
2012 May 09 9:36 AM
Thanks for the response.
I debugged we19, mara_ueb is being updated succefully in my loop.
2012 May 09 9:36 AM
After the BADI it calls MATERIAL_MAINTAIN_DARK check this FM try to debug.