Application Development and Automation 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: 
Read only

MARA custom fields update problem

Former Member
0 Likes
1,344

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?

4 REPLIES 4
Read only

Former Member
0 Likes
906

Any ideas? Help really needed

Read only

Private_Member_49934
Product and Topic Expert
Product and Topic Expert
0 Likes
906

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.

.

Read only

0 Likes
906

Thanks for the response.

I debugged we19, mara_ueb is being updated succefully in my loop.

Read only

0 Likes
906

After the BADI it calls  MATERIAL_MAINTAIN_DARK check this FM try to debug.