Professional Documents
Culture Documents
Applies to:
All releases of software component SAP_APPL (Logistics and Accounting) above Release 470. For more information, visit the Enterprise Resource Planning homepage.
Summary
This article illustrates the changes to be done to enable mass maintenance transaction MM17 to update the append fields of the Material Master Tables. Author: Manoj K S
Author Bio
Manoj K S is currently working as Technology Consultant at Applexus Technologies. He has total 8 years of experience out of which more than 3 years of experience is in SAP ABAP consulting.
Table of Contents
Introduction ......................................................................................................................................................... 3 IDOC Enhancements .......................................................................................................................................... 3 Implement BAdI MG_MASS_NEWSEG ............................................................................................................. 5 Enhance Function Module EXIT_SAPLMV02_002 of Customer exit MGV00001 ............................................. 5 Customization for Mass Object: MASSOBJ Transaction. ................................................................................. 7 Customization for Field Selection Group in SPRO ............................................................................................. 7 Related Content .................................................................................................................................................. 9 Disclaimer and Liability Notice .......................................................................................................................... 10
Introduction
To illustrate the solution, we will be appending the MARA table of Material Master with two append fields ZZCOLOR and ZZPAINT. This solution can also be applied to other Material Master tables like MARC. Material master mass maintenance transaction saves the changes to the materials via ALE inbound processing. The save module of mass maintenance calls methods of BAdI MG_MASS_NEWSEG before calling ALE inbound processing. In the BAdI methods the system can transfer the field values of the Append fields to enhanced IDOC segments of IDOC type MATMAS03. To process the enhanced IDOC during its posting in ALE inbound process, customer exit EXIT_SAPLMV01_002 of enhancement MGV00001 can be used. Customization for Field selection group and addition of the append fields to the field list available for updating, through transaction MASSOBJ is also needed for integrating the fields for mass maintenance.
IDOC Enhancements
1. Create a new segment for the two append fields using transaction WE31. Lets name it ZE1MARA.
2. Create a new extension type by extending the IDOC MATMAS03 by adding the new segment ZE1MARA using transaction WE30. i. Give a name for extension type, select Extension radio button and click create.
ii.
In the following popup screen, select create new radio button and enter MATMAS03 as linked basic type. Give a description and press enter
iii. IDOC structure displaying the structure of the extension appears in the following screen. Select the first level node (E1MARAM) and add the newly created segment as child segment of E1MARAM by clicking create button.
iv. Enter the attributes of the child segment in the popup screen and press enter.
Link message type MATMAS, idoc type MATMAS03 and new extension type using transaction WE82.
Sample code:DATA: x_ze1mara TYPE ze1mara. IF f_cust_segment-segnam = 'ZE1MARA'. x_ze1mara = f_cust_segment-sdata. IF x_ze1mara-zzpaint = c_nodata. CLEAR x_ze1mara-zzpaint. ELSE. IF x_ze1mara-zzpaint IS INIITAL. res_fields-feldname = 'MARA-ZZPAINT'. APPEND res_fields. ENDIF. ENDIF. f_mara_ueb-zzpaint = x_ze1mara-zzpaint. IF x_ze1mara-zzcolor = c_nodata. CLEAR x_ze1mara-zzcolor. ELSE. IF x_ze1mara-zzcolor IS INIITAL. res_fields-feldname = 'MARA-ZZCOLOR'. APPEND res_fields. ENDIF. ENDIF. f_mara_ueb-zzcolor = x_ze1mara-zzcolor. ENDIF.
The repetitive code for each field can be simplified by using the following Macro definition and sample call for each append field. Macro definition:
DEFINE setfield. IF &2 = c_nodata. CLEAR &2. ELSE. IF &2 is initial. res_fields-feldname = &3. APPEND res_fields. ENDIF. ENDIF. &1 = &2. END-OF-DEFINITION.
ii. Add custom fields here: BUS1001, MARA, <append field name> and save
3. Add entries for each custom field (MARA-ZZfield) here and assign a selection group same as in other standard fields which have similar property (assigning sel. group is mandatory). For this you may copy the existing record of the standard field. 4. In the detail screen set the following:Propose field cont = X Maintenance status = KEDVALBQPSZXFG Select the characters depending on departments to maintain the data:-
Related Content
Mass Maintenance of Procurement Data in SAP Customer Exits Concepts and Working with BADI For more information, visit the Enterprise Resource Planning homepage.