Add custom fields in MM01 under basic data1 tab.

Step 1: Add custom fields in table MARA by using append structure.

                * Goto SE11.

                * Give table name as MARA, click on display.

                * Click on append structure and click on create.

                * Save and activate.


Step 2: Goto SPRO -> click on IMG -> logistics general -> material master - Configuring the material master ->Execute: Create Program for Customized Sub screens.

            * Provide custom Function group name (ZFG_AB_MM01) and click on SAVE.

           * Check the Function group in SE80(ZFG_AB_MM01).

Step 3: Goto SPRO -> click on IMG -> logistics general -> material master - Configuring the material master -> Execute: Define Structure of Data Screens for Each Screen Sequence.

            * Select screen sequence number 21 and double click data screens.


            * Select basic data1 and double click on sub screens.


Step 4: Change the 8th record to SAPLZFG_AB_MM01(SAPL+FG) and save.



Step 5:  Design screen layout.

                * Goto SE80.

                * Double clicks on screen 0001 and click on layout.

                * Select box and double click on box. Give name and text.

                * Select Dictionary/program fields. Give table name as MARA and select custom fields drag into box.


            * Give group1 as Z1 for input fields.

Step 6: Add logic for custom fields.

            * Give modules and create modules.

            * Double clicks on each module, create and write logic.

MODULE modify_screen OUTPUT.
  IF sy-tcode EQ 'MM03'.
    LOOP AT SCREEN.
      IF screen-group1 'Z1'.
        screen-input 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
ENDMODULE.

MODULE get_data OUTPUT.
  CALL FUNCTION 'MARA_GET_SUB'
    IMPORTING
      wmara mara
      xmara *mara
      ymara lmara.
ENDMODULE.

MODULE modify_data INPUT.
  DATAlv_veh_type TYPE mara-zz_veh_type,
        lv_sale_ord TYPE mara-zz_sale_ord,
        lv_body_num TYPE mara-zz_body_num.
  lv_veh_type  mara-zz_veh_type.
  lv_sale_ord mara-zz_sale_ord.
  lv_body_num mara-zz_body_num.
  CALL FUNCTION 'MARA_GET_SUB'
    IMPORTING
      wmara mara
      xmara *mara
      ymara lmara.
  mara-zz_veh_type lv_veh_type.
  mara-zz_sale_ord lv_sale_ord.
  mara-zz_body_num lv_body_num.
  CALL FUNCTION 'MARA_SET_SUB'
    EXPORTING
      wmara mara.
ENDMODULE.

Step 7: Check and activate all the objects.

Testing: 

        * Goto MM01.

          * Give required fields and create.


             * Click on save. Material is created.

             * Check in table level data is saved.

        



             * Check in MM03 T-code whether the fields are editable or not.



******************************Thank you*******************************

Comments

Popular posts from this blog

New syntax for append- VALUE (new syntax 7.4+) in ABAP

Read statement new syntax in ABAP. (7.4+).

Concatenation new syntax( 7.4+ ).