Badi ME_GUI_PO_CUST and ME_PROCESS_PO_CUST

Dear All,
I am implementing a customer subscreen in the PO header. I have created the screen, implemented both Badi's int following way.
Somehow, the customer data is not getting saved. It is not being passed into the Badi's, am not sur what I have missed because I have implemeted it exactly like the example implementation, only the example is for item and I am using a PO Header subscreen. This is what I have done, please suggest.
First in ME_GUI_PO_CUST
Methods :-
METHOD if_ex_me_gui_po_cust~subscribe .
  ls_subscriber-name = subscreen1.
  ls_subscriber-dynpro = lc_dynpro.
  ls_subscriber-program =  lc_repid.
  ls_subscriber-struct_name = lc_struc.
  ls_subscriber-label = text-001.
  ls_subscriber-position = 10.
  ls_subscriber-height = 7.
  APPEND ls_subscriber TO re_subscribers.
ENDMETHOD.
METHOD if_ex_me_gui_po_cust~map_dynpro_fields .
  FIELD-SYMBOLS: <mapping> LIKE LINE OF ch_mapping.
  LOOP AT ch_mapping ASSIGNING <mapping>.
    CASE <mapping>-fieldname.
      WHEN 'ZZDEPT'.
        <mapping>-metafield = mmmfd_cust_01.
    ENDCASE.
  ENDLOOP.
ENDMETHOD.
METHOD if_ex_me_gui_po_cust~transport_from_model .
  DATA: l_header       TYPE REF TO if_purchase_order_mm,
        ls_mepoheader  TYPE mepoheader,
        ls_customer  TYPE ci_ekkodb.
  CASE im_name.
    WHEN subscreen1.
      mmpur_dynamic_cast l_header im_model.
      CHECK NOT l_header IS INITIAL.
      ls_mepoheader = l_header->get_data( ).
      MOVE ls_mepoheader-zzdept TO dynp_data_pbo-zzdept.
      MOVE gs_data-zzdept TO dynp_data_pbo-zzdept.
    WHEN OTHERS.
  ENDCASE.
ENDMETHOD.
METHOD if_ex_me_gui_po_cust~transport_to_dynp .
  CASE im_name.
    WHEN subscreen1.
      CALL FUNCTION 'ZF00MM_POHEADER_PUSH'
        EXPORTING
          im_dynp_data = dynp_data_pbo.
    WHEN OTHERS.
  ENDCASE.
ENDMETHOD.
METHOD if_ex_me_gui_po_cust~transport_from_dynp .
  CASE im_name.
    WHEN subscreen1.
      CALL FUNCTION 'ZF00MM_POHEADER_POP'
        IMPORTING
          ex_dynp_data = dynp_data_pai.
      IF dynp_data_pai NE dynp_data_pbo.
        re_changed = mmpur_yes.
      ENDIF.
    WHEN OTHERS.
  ENDCASE.
ENDMETHOD.
METHOD if_ex_me_gui_po_cust~transport_to_model .
  DATA: lv_header       TYPE REF TO if_purchase_order_mm,
        lw_ekkodb       TYPE mepoheader.
  CASE im_name.
    WHEN subscreen1.
      mmpur_dynamic_cast lv_header im_model.
      CHECK NOT lv_header IS INITIAL.
      lw_ekkodb = lv_header->get_data( ).
      IF dynp_data_pbo-zzdept NE dynp_data_pai-zzdept.
        MOVE dynp_data_pai-zzdept TO lw_ekkodb-zzdept.
        gs_data-zzdept = lw_ekkodb-zzdept.
      ENDIF.
      lv_header->set_data( lw_ekkodb ).
  ENDCASE.
ENDMETHOD.
ME_PROCESS_PO_CUST
Set the field status in method IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_HEADER
METHOD if_ex_me_process_po_cust~open .
  DATA: ls_mepoheader TYPE mepoheader.
  CHECK im_trtyp EQ 'V' OR im_trtyp EQ 'A'.
  ls_mepoheader = im_header->get_data( ).
  SELECT SINGLE zzdept FROM ekko INTO gs_data_old-zzdept
                      WHERE ebeln = ls_mepoheader-zzdept.
  gs_data = gs_data_old.
ENDMETHOD.
METHOD if_ex_me_process_po_cust~post .
  DATA: ls_mepoheader  TYPE mepoheader.
  ls_mepoheader = im_header->get_data( ).
  ls_mepoheader-zzdept = gs_data-zzdept.
ENDMETHOD.
Can somebody please suggest what is going wrong ? All the methods are being called but the field ZZDEPT is not being transferred into the BADI structures and hence is not saved/changed or displayed.
Appreciate your help.
Thanks in advance.
Edited by: SAP ABAPer on Jan 25, 2010 4:55 PM

Tried very hard to improve the formatting of the post, but it doesn't seem to work for me !!

Similar Messages

  • Added custom screen in PO using BADI ME_GUI_PO_CUST and ME_PROCESS_PO_CUST

    Hi All,
    I have added custom screen with two z fields at item level using BADI ME_GUI_PO_CUST and ME_PROCESS_PO_CUST i can see my screen in tcodes ME21N , ME22N , ME23N but I am not able to save data.
    and also screen is coming in change mode even in ME23N .
    thanks.

    Hi,
    I have added two xfields at item level.
    This is the code i have added in zimplementation ZME_GUI_PO_CUST .
    IN Zimplementation ME_PROCESS_PO_CUST I have added code only in method FIELDSELECTION_ITEM . after doing this I can see only screens in ME21N, ME22N, ME23N but when enter data in zfields and trying to save it is giving me message no data has changed.
    method IF_EX_ME_GUI_PO_CUST~SUBSCRIBE.
    DATA: ls_subscriber LIKE LINE OF re_subscribers.
    we want to add a customer subscreen on the item detail tab
      CHECK im_application = 'PO'.
      CHECK im_element     = 'ITEM'.
    each line in re_subscribers generates a subscreen. We add one subscreen in this example
      CLEAR re_subscribers[].
    the name is a unique identifier for the subscreen and defined in this class definition
      ls_subscriber-name = subscreen1.
    the dynpro number to use
      ls_subscriber-dynpro = '0001'.
    the program where the dynpro can be found
      ls_subscriber-program = 'SAPLYMEPOBADIEX'.
    each subscreen needs his own DDIC-Structure
      ls_subscriber-struct_name = 'MEPO_BADI_STRUCT'.
    a label can be defined
      ls_subscriber-label = text-001.
    the position within the tabstrib can be defined
      ls_subscriber-position = 4.
    the height of the screen can be defined here. Currently we suport two screen sizes:
    value <= 7 a sevel line subscreen
    value > 7  a 16 line subscreen
      ls_subscriber-height = 7.
      APPEND ls_subscriber TO re_subscribers.
      ENDIF.
    method IF_EX_ME_GUI_PO_CUST~TRANSPORT_FROM_MODEL.
      DATA: l_item       TYPE REF TO if_purchase_order_item_mm,
            ls_mepoitem  TYPE mepoitem,
            ls_customer  TYPE mepo_badi_exampl.
    system asks to transport data from the business logic into the view
      CASE im_name.
        WHEN subscreen1.
    is it an item? im_model can be header or item.
          mmpur_dynamic_cast l_item im_model.
          CHECK NOT l_item IS INITIAL.
    transport standard fields
          ls_mepoitem = l_item->get_data( ).
    transport customer fields
          CALL FUNCTION 'YMEPOBADIEX_GET_DATA'
            EXPORTING
              im_ebeln = ls_mepoitem-ebeln
              im_ebelp = ls_mepoitem-ebelp
            IMPORTING
              ex_data  = ls_customer.
    store info for later use
          MOVE-CORRESPONDING ls_mepoitem TO dynp_data_pbo.
          MOVE ls_customer-badi_bsgru TO dynp_data_pbo-badi_bsgru.
          MOVE ls_customer-badi_afnam TO dynp_data_pbo-badi_afnam.
        WHEN OTHERS.
      ENDCASE.
    endif.
    method IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_DYNP.
      CASE im_name.
        WHEN subscreen1.
          CALL FUNCTION 'YMEPOBADIEX_PUSH'
            EXPORTING
              im_dynp_data = dynp_data_pbo.
        WHEN OTHERS.
      ENDCASE.
    ENDIF.
    endmethod.
    method IF_EX_ME_GUI_PO_CUST~TRANSPORT_FROM_DYNP.
      CASE im_name.
        WHEN subscreen1.
          CALL FUNCTION 'YMEPOBADIEX_POP'
            IMPORTING
              ex_dynp_data = dynp_data_pai.
          IF dynp_data_pai NE dynp_data_pbo.
    something has changed therefor we have to notify the framework
    to transport data to the model
            re_changed = mmpur_yes.
          ENDIF.
        WHEN OTHERS.
      ENDCASE.
    ENDIF.
    endmethod.
    method IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_MODEL.
    DATA: l_item       TYPE REF TO if_purchase_order_item_mm,
            ls_mepoitem  TYPE mepoitem,
            ls_customer  TYPE mepo_badi_exampl.
    data have to be transported to business logic
      CASE im_name.
        WHEN subscreen1.
    is it an item? im_model can be header or item.
          mmpur_dynamic_cast l_item im_model.
          CHECK NOT l_item IS INITIAL.
          ls_mepoitem = l_item->get_data( ).
    standard fields changed?
         IF dynp_data_pbo-matkl NE dynp_data_pai-matkl OR
            dynp_data_pbo-plifz NE dynp_data_pai-plifz OR
            dynp_data_pbo-webaz NE dynp_data_pai-webaz.
    update standard fields
           ls_mepoitem-matkl = dynp_data_pai-matkl.
           ls_mepoitem-plifz = dynp_data_pai-plifz.
           ls_mepoitem-webaz = dynp_data_pai-webaz.
            CALL METHOD l_item->set_data( ls_mepoitem ).
         ENDIF.
            CALL FUNCTION 'YMEPOBADIEX_GET_DATA'
              EXPORTING
                im_ebeln = ls_mepoitem-ebeln
                im_ebelp = ls_mepoitem-ebelp
              IMPORTING
                ex_data  = ls_customer.
            ls_customer-badi_bsgru = dynp_data_pai-badi_bsgru.
            ls_customer-badi_afnam = dynp_data_pai-badi_afnam.
            CALL FUNCTION 'YMEPOBADIEX_SET_DATA'
              EXPORTING
                im_data = ls_customer.
         ENDIF.
        WHEN OTHERS.
      ENDCASE.
    ENDIF.
    method IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_ITEM.
    DATA: l_persistent TYPE mmpur_bool.
    CONSTANTS:
    FIELD-SYMBOLS: <fs> LIKE LINE OF ch_fieldselection.
    l_persistent = im_item->is_persistent( ).
    *IF l_persistent EQ mmpur_yes.
    READ TABLE ch_fieldselection ASSIGNING <fs> WITH TABLE KEY
                         metafield = MMMFD_YYMAN_NUM."fd_cust_01.
    IF sy-subrc IS INITIAL.
    <fs>-fieldstatus = '*'. " Display <-- this one was as per the sample code given.
    <fs>-fieldstatus = '+'. " Input <-- this i added to make the field mandatory.
    ENDIF.
    READ TABLE ch_fieldselection ASSIGNING <fs> WITH TABLE KEY
                         metafield = MMMFD_YYMAN_DES."fd_cust_01.
    IF sy-subrc IS INITIAL.
    <fs>-fieldstatus = '*'. " Display <-- this one was as per the sample code given.
    <fs>-fieldstatus = '+'. " Input <-- this i added to make the field mandatory.
    ENDIF.
    *ENDIF.
    ENDIF.
    endmethod.

  • Purchase Order Header enhancement - ME_GUI_PO_CUST and ME_PROCESS_PO_CUST

    I have enhanced CI_EKKODB in EKKO to add 12 new fields. I've created a custom subscreen in SE80 with those fields.
    I've implemented ME_GUI_PO_CUST (ME_PROCESS_PO_CUST was already implemented previously) and put the appropriate code in SUBSCRIBE and MAP_DYNPRO_FIELDS methods. I also put code, which I thought was appropriate in the other methods in the Interface.
    I have copied function group MEPOBADIEX into ZMEPOBADIEX and changed the Function Modules to use the Z versions.
    When I run ME21N / ME22N / ME23N, I do see my new tab and the fields. I can enter data and switch back and forth through the tabs and my data stays.  However, when I try to SAVE, I get the No Data Changed popup.
    I have put breakpoints in each of the methods. The breakpoints are only stopping in SUBSCRIBE, MAP_DYNPRO_FIELDS and EXECUTE.
    Methods: TRANSPORT_FROM_MODEL, TRANSPORT_TO_DYNP,  TRANSPORT_FROM_DYNP, and TRANSPORT_TO_MODEL aren't getting called.
    And, by not getting called, it seem my data isn't being transferred back properly.
    What's going on? I see this issue over and over online, but no solutions.
    thanks,
    robert.

    Hi Robert,
    I think it is better you can debug the code and see where it went wrong.Check the fm and mapping the fields.There is a wiki available with a [Me22n Custom fields|http://wiki.sdn.sap.com/wiki/display/ABAP/DetailedexplanationaboutBADIandthewaystofindtheBADIwithanexample%28ME23n+transaction%29] from Kiran,Still if there is any issue please paste your code then it will be easy .
    Regards,
    Madhu.

  • SOLUTION: tab not showing in ME21N/ME22N with badi ME_GUI_PO_CUST

    Hi,
    I implemented BADI's ME_GUI_PO_CUST and ME_PROCESS_PO_CUST to show a custom tab in the header section of ME21N, ME22N and ME23N.
    But after implementing the BADI's, the tab showed up in ME23N, but not in ME21N and ME22N.
    So I started looking for a solution in the SDN forum, and I saw that there were a LOT of people with the same problem, but nobody ever posted a solution.
    So here is the solution:
    So, I added the fields I wanted to show in the structure CI_EKKODB, implemented the BADI ME_GUI_PO_CUST (the methods SUBSCRIBE and MAP_DYNPRO_FIELDS), and the BADI ME_PROCESS_PO_CUST.
    After that the tab showed up in ME23N, not in ME21N or ME22N.
    So I found an SAP note saying the following:
    Question:
    I implemented the 'ME_GUI_PO_CUST' Business Add-In to display customer-
    specific tab titles in the EnjoySAP purchase order. They are only shown in display mode (ME23N) however, not in create or change. Why?
    Solution:
    You may have forgotten to assign a field status to the user-defined fields on these tabs. As a result, the system automatically interprets the field status as 'hidden' in create and change modes. However if a tab contains only hidden fields, then the entire tab is set to hidden. In display mode, fields without a field status are automatically set to display. That is why the tab is displayed in this case.
    To assign a field status to the user-defined fields, use the methods provided for this purpose in the Business Add-In 'ME_PROCESS_PO_CUST' (compare sample source code in the FIELDSELECTION_ITEM method).
    So in my case, I had to add some code to the  FIELDSELECTION_HEADER method of the BADI ME_PROCESS_PO_CUST.
    This is the code:
    method IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_HEADER.
      DATA: l_persistent TYPE mmpur_bool.
      FIELD-SYMBOLS: <fs> LIKE LINE OF ch_fieldselection.
    * if the item is already on the database, we disallow to change field badi_bsgru
      l_persistent = im_header->is_persistent( ).
    *   IF l_persistent EQ mmpur_yes.
        READ TABLE ch_fieldselection ASSIGNING <fs> WITH TABLE KEY metafield = mmmfd_cust_01.
        IF sy-subrc IS INITIAL.
          <fs>-fieldstatus = '*'. " Input
        ENDIF.
    *   ENDIF.
    endmethod.
    But then, I realized that this BADI was never triggered. When I entered one of the transaction codes ME21N, ME22N or ME23N, the code in the fieldselection_header method was never executed.
    So I went to transaction SE18, and entered ME_PROCESS_PO_CUST in 'Enhancement Spot' and pushed the button display.
    And there in the tab 'Enhancement Implementations', I saw an implementation that was not mine, and that did not show up in the overview of the SE18 'BADI NAME' tab for the same BADI... which to me seems strange.
    So as you may know, there can never be more than one active implementation of the BADI ME_PROCESS_PO_CUST.
    So I disactivated my implementation and put my code in the existing implementation.
    And after that it worked!

    implement first badi :ZME_GUI_PO_CUST:
    METHOD if_ex_me_gui_po_cust~subscribe.
    DATA: ls_subscriber LIKE LINE OF re_subscribers.
    * we want to add a customer subscreen on the item detail tab
       CHECK im_application = 'PO'.
       CHECK im_element     = 'HEADER'.
    * each line in re_subscribers generates a subscreen. We add one subscreen in this example
       CLEAR re_subscribers[].
    * the name is a unique identifier for the subscreen and defined in this class definition
       ls_subscriber-name = subscreen1.
    * the dynpro number to use
       ls_subscriber-dynpro = '0001'.
    * the program where the dynpro can be found
       ls_subscriber-program = 'SAPLMEPOBADIEX'.
    * each subscreen needs his own DDIC-Structure
       ls_subscriber-struct_name = 'MEPO_BADI_STRUCT'.
    * a label can be defined
       ls_subscriber-label = text-001.
    * the position within the tabstrib can be defined
       ls_subscriber-position = 4.
    * the height of the screen can be defined here. Currently we suport two screen sizes:
    * value <= 7 a sevel line subscreen
    * value > 7  a 16 line subscreen
       ls_subscriber-height = 7.
       APPEND ls_subscriber TO re_subscribers.
    ENDMETHOD.
    implement 2nd badi : ZME_PROCESS_PO_CUST:
    method IF_EX_ME_PROCESS_PO_CUST~FIELDSELECTION_HEADER.
       DATA: l_persistent TYPE mmpur_bool.
       FIELD-SYMBOLS: <fs> LIKE LINE OF ch_fieldselection.
    * if the item is already on the database, we disallow to change field badi_bsgru
       l_persistent = im_header->is_persistent( ).
    *   IF l_persistent EQ mmpur_yes.
         READ TABLE ch_fieldselection ASSIGNING <fs> WITH TABLE KEY metafield = mmmfd_cust_01.
         IF sy-subrc IS INITIAL.
           <fs>-fieldstatus = '*'. " Input
         ENDIF.
    *   ENDIF.
    endmethod.

  • BADI - ME_GUI_PO_CUST ,can we have 10 plus cust feilds in  additional tab

    Hi Experts.....
    I have implemented a  BADI named ME_GUI_PO_CUST  and ME_PROCESS_PO_CUST in ME21N Transaction to add custom fields. With this I could get an extra custom tab in which I have included 7 Custom fields.
    Now my new req is to get add 8 more new feilds . but in the second method of the BADI -ME_GUI_PO_CUST  i.e ....MAP_DYNPRO_FIELDS we have only 10 customer feilds available to be mapped .i ,e MMMFD_CUST_01  --- MMMFD_CUST_02 -
    MMMFD_CUST_03 .....to ......MMMFD_CUST_10 .
    So the Problem is how to map my remaining 5 feilds ..
    Is it possible to add more than 10 feilds in the Customer subscreen  .If so please help me do it .
    Thank you in advance

    Hi,
    Yes you can add any no of fields in that tab.For Custom fields SAP suggested to use integer constants above 90000000, from which for mmfd_Cust_01 to mmfd_Cust_10  are just examples...But we can use any  constant above the above 90000000.
    For confirmation , check the where used list of mmfd_cust_01 and you will find 4 to 5 Fm where the logic will be like Metafield GE mmfd_cust_01 and not EQ in the standard Logic.
    Hope this helps you in closing the Thread
    Raj

  • ME21N  ~~BADI - ME_GUI_PO_CUST ,can we have more than cust feilds.

    Hi Experts.....
    I have implemented a BADI named ME_GUI_PO_CUST and ME_PROCESS_PO_CUST in ME21N Transaction to add custom fields. With this I could get an extra custom tab in which I have included 7 Custom fields.
    Now my new req is to get add 8 more new feilds . but in the second method of the BADI -ME_GUI_PO_CUST i.e ....MAP_DYNPRO_FIELDS we have only 10 customer feilds available to be mapped .i ,e MMMFD_CUST_01 --- MMMFD_CUST_02 -
    MMMFD_CUST_03 .....to ......MMMFD_CUST_10 .
    So the Problem is how to map my remaining 5 feilds ..
    Is it possible to add more than 10 feilds in the Customer subscreen .If so please help me do it .
    Thank you in advance

    Subodh ,
    Yes You can use the BADI for header area as well .
    In the BADI Implementation , the first method in the interface - IF_EX_ME_GUI_PO_CUST~SUBSCRIBE
    there is an check for wether the BADI is meant for header or item .
    Code----
    we want to add a customer subscreen on the item detail tab
      CHECK im_application = 'PO'.
      CHECK im_element     = 'ITEM'.
    Code----
    And i have debugged , it triggers for header as well.
    so just change CHECK im_element  = 'ITEM'. to CHECK im_element  =  'HEADER'.
    It will work for header as well.
    Regards ,
    Rajesh .

  • Additional tab at header level  in ME21N through BADI ME_GUI_PO_CUST

    Hi,
    I want to have additional tab at header level  in ME21n through BADI ME_GUI_PO_CUST.  But after all effort I am not getting display of  tab.  Let me explain what i did till now
    1. Appended  table EKKO with field
    2. Create one function Group -under that
    A. Created one Include u2013Paste the code given
    DATA: call_subscreen   TYPE sy-dynnr,
          call_prog        TYPE sy-repid,
          call_view        TYPE REF TO cl_screen_view_mm,
          call_view_stack  TYPE REF TO cl_screen_view_mm OCCURS 0,
          global_framework TYPE REF TO cl_framework_mm,
          global_help_view TYPE REF TO cl_screen_view_mm,
          global_help_prog TYPE sy-repid.
    FORM SET_SUBSCREEN_AND_PROG *
    --> DYNNR *
    --> PROG *
    --> VIEW *
    --> TO *
    --> CL_SCREEN_VIEW_MM *
    FORM set_subscreen_and_prog USING dynnr TYPE sy-dynnr
    prog TYPE sy-repid
    view TYPE REF TO cl_screen_view_mm.
    call_subscreen = dynnr.
    call_prog = prog.
    call_view = view.
    ENDFORM. "set_subscreen_and_prog
    B. Created one screen  (9000)
    3. Implemented BADI ME_GUI_PO_CUST and paste the code.
    data: ls_subscribe like line of re_subscribers.
    CHECK im_application = 'PO'.
    CHECK im_element = 'HEADER'.
    CLEAR re_subscribers[].
    ls_subscribe-name = ' ZMMSCR1'.
    ls_subscribe-dynpro = '9000'.
    ls_subscribe-program = ' ZMMSCR1'.
    ls_subscribe-struct_name = 'EKKO'.
    ls_subscribe-label = text-001..
    ls_subscribe-position = 15.
    ls_subscribe-height = 7.
    append ls_subscribe to re_subscribers.
    Please help me what s going wrong .and what else I will do to get success.
    Edited by: Vishal A Vijaywargia on Jul 29, 2009 2:24 AM

    Hi Prosengit,
    I am not aure about u r BADI,
    BUt last week i have custom tab in the PO header data using this enahncement 'MM06E005'.
    IN thi senhancement u have thrre screen exits.In this enhancement
    SAPMM06E        0111 CUSTSCR1 SAPLXM06        0111 Subscreen: PO item
    u can add subscreen and u can add u r own fields here .
    and u can write u r code in 'EXIT_SAPMM06E_006'.
    if u want to change the title of the program.
    Go to program SAPLXM06 then go to text element give text symbol no as '111' and u can change the title of u r tab.
    I hope this solves u r problem.

  • Error while implementing BADI ME_GUI_PO_CUST

    Hi Experts,
    My requirment is to add a new tab in ME21N screen.We have to implement the BADI ME_GUI_PO_CUST and methods SUBSCRIBE and MAP_DYNPRO_FIELDS will create a new tab.however i have got a problem in method MAP_DYNPRO_FIELDS.
    i have defined 2 z fields and i have appended it in EKKo as well.now in method MAP_DYNPRO_FIELDS i have written the code like this...
    LOOP AT ch_mapping ASSIGNING <mapping>.
        CASE <mapping>-fieldname.
          WHEN 'ZZPAYMENT_AGRE'.      <mapping>-metafield =mmmfd_cust_03.      "mmmfd_mat_grp.
          WHEN 'ZZPROJECT'.           <mapping>-metafield = mmmfd_cust_04.
        ENDCASE.
      ENDLOOP.
    if i do like that...it's not displaying the new tab but when i replace any of the custome fields(mmmfd_cust_03,mmmfd_cust_04) with  "mmmfd_mat_grp.it is displaying the new tab.
    can any one tell me what is the wrong in my code.

    solved by myself

  • BADI ME_GUI_PO_CUST-- Data not getting saved after adding tab at Header

    Hi,
    My requirement is to add an additional tab at header level  and a field in that tab. I used the BADI  ME_GUI_PO_CUST and implemented it. I can see the tab and the field in it at header level.But when i try to save it , its popping up message 'Data is not changed' and when i check in ME22N, changes are not reflected. I went through the example and copied this example into BADI and accordingly made changes for header. When i keep break-point in TRANSPORT_FROM_MODEL and other methods except SUBSCRIBE and MAP_DYNPRO_FIELDS,its not stopping. Please guide where i am going wrong.
    Regards
    K Srinivas

    HI,
    Use the perform
    perform set_header_data(saplmepo) using ekko.
    Thanks,
    Shailaja Ainala.

  • New tabs added by Badi ME_GUI_PO_CUST not seen in ME21N and ME22N

    Hi All
    I am implementing BADI ME_GUI_PO_CUST / ME_PROCESS_PO_CUST to add additional fields in Purchase Order Header.
    The implementation of the BADI ie the Subscreen of the fields to be added appears in Header of  transaction ME23N but it does not appear in the transaction ME22N and ME21N.
    Can anyone help me on this.How to make the tab appear on screen in transaction ME21N and ME22N.
    Thanx.

    Dear Friend,
    Just go to the Class CL_PO_HANDLER_MM
    This is the Super Class for the PO & PR.
    If u debug the PO u can see that PO is calling this super class.
    For this u want to create Subroutine in the Function Group calling the Screen .
    The Problem which u r facing is that the Instance are not yet created for that Cusotmer Data.
    Once u created this Subroutine u can see the fields..
    With Regards,
    Sumodh.P

  • Help needed in BADI ME_GUI_PO_CUST

    Hi experts,
    my requiremnt is to add a new subscreen to a standard transaction. I need to add some fields into the subscreen. Now the question is, some of the fields needed to be added as a drop down list. Where in the BADI can i post all the values for the drop down lists and how?
    Plzz Help, urgent.

    Hello Mallikarjun,
    and what was the solution? I face the problem that I've implemented ME_GUI_PO_CUST and a Implementation of ME_PROCESS_PO_CUST is already in place but I can't see my own tab folder.
    Do you know more about this?
    Any help is appreciated.
    Kind regards....
    ...Hans

  • Implementation Of Badi ME_GUI_PO_CUST for adding fields in Purchase Order

    Hi All
       I am implementing BADI ME_GUI_PO_CUST / ME_PROCESS_PO_CUST to add additional fields in Purchase Order.
    The implementation of the BADI ie the Subscreen of the fields to be added appears in  transaction ME23N but it does not appear in the transaction ME22N and ME21N.
    Can anyone help me on this.
    Thanx.
    Moderator message - Duplicate post locked
    Edited by: Rob Burbank on Jul 10, 2009 12:10 PM

    check the answer
    [New tabs added by Badi ME_GUI_PO_CUST not seen in ME21N and ME22N;
    bye

  • Problem on Implementing badi ME_GUI_PO_CUST

    Hi Expert,
    I have implement BADI ME_GUI_PO_CUST, to add the new tab.
    I have managed to View the tab in Both ME21N, and ME22N with implement SUBSCRIBE and MAP_DYNPRO_FIELDS.
    method IF_EX_ME_GUI_PO_CUST~SUBSCRIBE
      DATA: ls_subscriber LIKE LINE OF re_subscribers.
      CHECK im_application = 'PO'.
      CHECK im_element = 'ITEM'.
      CLEAR re_subscribers[].
      ls_subscriber-name = subscreen1.
      ls_subscriber-dynpro = '0002'.
      ls_subscriber-program = 'ZRPP_ME_GUI_PO_CUST_SCREEN'.
      ls_subscriber-struct_name = 'CI_EKPODB'.
      ls_subscriber-label = text-001.
      ls_subscriber-position = 7.
      ls_subscriber-height = 7.
      APPEND ls_subscriber TO re_subscribers.
    METHOD : IF_EX_ME_GUI_PO_CUST~MAP_DYNPRO_FIELDS
      FIELD-SYMBOLS: <mapping> LIKE LINE OF ch_mapping.
      LOOP AT ch_mapping ASSIGNING <mapping>.
        CASE <mapping>-fieldname.
          WHEN 'ZCNUM'.      <mapping>-metafield = mmmfd_cust_01.
        ENDCASE.
      ENDLOOP.
    Method IF_EX_ME_GUI_PO_CUST~MAP_DYNPRO_FIELDS
      DATA: lw_fieldselection LIKE LINE OF ch_fieldselection.
      LOOP AT ch_fieldselection INTO lw_fieldselection.
        lw_fieldselection-fieldstatus = '+'.
        MODIFY ch_fieldselection FROM lw_fieldselection.
      ENDLOOP.
    I need to store the value, and some of thread said it required methods:
    TRANSPORT_FROM_MODEL
    TRANSPORT_TO_DYNP
    TRANSPORT_FROM_DYNP
    TRANSPORT_TO_MODEL
    I have click on the subcreen, or enter at the field, but it will not able to trigger the Above Methods.
    How do I do for the to trigger above Methods? Or Should I added some additional code at screen program? I want SAVE the data actually into EKPO.
    Thanks in advance.

    Hi Sim,
    Recently we have the same reqirement.
    You can have a look at the below code..
    First method: SUBSCRIBE  
    DATA: ls_subscriber LIKE LINE OF re_subscribers.* we want to add a customer subscreen on the Header tab
        CHECK im_application = 'PO'.
        CHECK im_element     = 'HEADER'.* each line in re_subscribers generates a subscreen. We add one subscreen in this example
        CLEAR re_subscribers[].
    * the name is a unique identifier for the subscreen and defined in this class definition
        ls_subscriber-name = subscreen1.
    * the dynpro number to use
        ls_subscriber-dynpro = '0001'.
    * the program where the dynpro can be found
        ls_subscriber-program = 'SAPLZKMMM_KAU86037'.
    * each subscreen needs his own DDIC-Structure
        ls_subscriber-struct_name = 'CI_EKKODB'.
    * a label can be defined
        ls_subscriber-label = text-001.
    * the position within the tabstrib can be defined
        ls_subscriber-position = 13.
    * the height of the screen can be defined here. Currently we suport two screen sizes:
    * value <= 7 a sevel line subscreen
    * value > 7  a 16 line subscreen
        ls_subscriber-height = 7.    APPEND ls_subscriber TO re_subscribers.Here, parameter u2018im_elementu2019 is defined as u2018HEADERu2019 as we are adding new tab in header section of PO.  
    Define a function group and take the main program and define it in ls_subscriber-program.
    Also define a sub screen with the required fields and assign it to the parameter ls_subscriber-dynpro.  
    Then method MAP_DYNPRO_FIELDS  
    FIELD-SYMBOLS: <mapping> LIKE LINE OF ch_mapping.
        LOOP AT ch_mapping ASSIGNING <mapping>.    CASE <mapping>-fieldname.      WHEN 'ZZPAYMENT_AGRE'.      <mapping>-metafield = mmmfd_cust_03.
          WHEN 'ZZPROJECT'.                     <mapping>-metafield = mmmfd_cust_04.
        ENDCASE.  ENDLOOP.  TRANSPORT_FROM_MODEL:
    DATA:     l_header       TYPE REF TO if_purchase_order_mm,
                  ls_mepoheader  TYPE mepoheader,
                  ls_customer    TYPE CI_EKKODB.*--------------------------------------------------------------------*
    * system asks to transport data from the business logic into the view
    *--------------------------------------------------------------------*    CASE im_name.      WHEN subscreen1.* is it an Header? im_model can be header or item.
            mmpur_dynamic_cast l_header im_model.
            CHECK NOT l_header IS INITIAL.* transport standard fields
            ls_mepoheader = l_header->get_data( ).* store info for later use
            MOVE-CORRESPONDING ls_mepoheader TO dynp_data_pbo.
          WHEN OTHERS.
        ENDCASE.    TRANSPORT_TO_DYNP:
    Define a FM 'ZK_KAU86037_PUSH' to push the values.CASE im_name.      WHEN subscreen1.        CALL FUNCTION 'ZK_KAU86037_PUSH'
              EXPORTING
                im_dynp_data = dynp_data_pbo.      WHEN OTHERS.
        ENDCASE.    TRANSPORT_FROM_DYNP:
      Define another FM 'ZK_KAU86037_POP'.CASE im_name.      WHEN subscreen1.        CALL FUNCTION 'ZK_KAU86037_POP'
              IMPORTING
                ex_dynp_data = dynp_data_pai.        IF dynp_data_pai NE dynp_data_pbo.
    * something has changed therefore we have to notify the framework
    * to transport data to the model
              re_changed = mmpur_yes.
            ENDIF.      WHEN OTHERS.
        ENDCASE.  TRANSPORT_TO_MODEL:     
            DATA: l_header             TYPE REF TO if_purchase_order_mm,
              ls_mepoheader        TYPE mepoheader,
              ls_customer          TYPE CI_EKKODB,
              l_po_header_handle   TYPE REF TO cl_po_header_handle_mm.*--------------------------------------------------------------------*
    * data have to be transported to business logic
    *--------------------------------------------------------------------*    CASE im_name.      WHEN subscreen1.* is it an item? im_model can be header or item.
            mmpur_dynamic_cast l_header im_model.
            CHECK NOT l_header IS INITIAL.        ls_mepoheader = l_header->get_data( ).* standard fields changed?
            IF dynp_data_pbo-zzpayment_agre   NE dynp_data_pai-zzpayment_agre
            OR dynp_data_pbo-zzproject        NE dynp_data_pai-zzproject.* update standard fields
              ls_mepoheader-zzpayment_agre   = dynp_data_pai-zzpayment_agre.
              ls_mepoheader-zzproject  = dynp_data_pai-zzproject.
              CALL METHOD l_header->set_data
                EXPORTING
                  im_data = ls_mepoheader.
            ENDIF.
          WHEN OTHERS.    ENDCASE. 
    Then we have to implement one more BADI to display the tab and update the values.
    Implement the BADI ME_PROCESS_PO_CUST. This cannot be used multiple times.  
    In this, we have methods (PROCESS_HEADER,PROCESS_ITEM).if we need to any validations for the fields we can write the logic here in this methods. In my case I need to check for the document type which I implemented in the method (PROCESS_HEADER).  
    Hope it helps you.
    Thanks
    Arbind

  • BADI ME_GUI_PO_CUST

    Hi,
    Customer Screens added through the above BADI doesnt appear in ME21n or in create mode/change mode in ME23n.

    Hi,
    You have to implement BADI ME_PROCESS_PO_CUST with the ME_GUI_PO_CUST. to make your screen appear in the transaction.
    In the ME_PROCESS_PO_CUST you have to code the method,
    FIELDSELECTION_ITEM. (if you want the screen at item level)
    FIELDSELECTION_HEADER (screen at header level)
    The code should like this,
    Also you have to implement method MAP_DYNPRO_FIELDS present in ME_GUI_PO_CUST
    and it should look like
    method IF_EX_ME_GUI_PO_CUST~MAP_DYNPRO_FIELDS.
    FIELD-SYMBOLS: <mapping> LIKE LINE OF ch_mapping.
      LOOP AT ch_mapping ASSIGNING <mapping>.
        CASE <mapping>-fieldname.
         WHEN 'WEEKNO'. <mapping>-metafield = mmmfd_cust_01.
         WHEN 'HRSWKED'. <mapping>-metafield = mmmfd_cust_02.
         WHEN 'HRLYRATE'. <mapping>-metafield = mmmfd_cust_03.
          WHEN 'MATKL'.      <mapping>-metafield = mmmfd_mat_grp.
          WHEN 'PLIFZ'.      <mapping>-metafield = mmmfd_plan_del.
          WHEN 'WEBAZ'.      <mapping>-metafield = mmmfd_gr_pr_time.
          WHEN 'BADI_BSGRU'. <mapping>-metafield = mmmfd_cust_01.
          WHEN 'BADI_AFNAM'. <mapping>-metafield = mmmfd_cust_02.
        ENDCASE.
      ENDLOOP.
    endmethod.
    Reward points if you find it helpful.
    Regards,
    Prasanna

  • BAdI: ME_GUI_PO_CUST add customer field to item level

    Hi Experts,
    I want to add a customer field to PO item level, how to do that? the functional consultant told me to first implement the BAdI: ME_PROCESS_PO_CUST before I can use BAdI: ME_GUI_PO_CUST, can anyone show me the procedure on how to implement this? thanks in advance.
    Kind regards
    Dawson

    Hi Dawson,
    Those BADIs are having good documentation and sample code. Once gone through the documentation, you can refer below thread.
    Re: ME_GUI_PO_CUST & ME_PROCESS_PO_CUST   - ME21N/ME22N/ME23N
    Reddy

Maybe you are looking for

  • How do i get my new device to show up in my itunes

    I just got a new iPad mini and am trying to sync it on iTunes, but the device will not show up.  I have made sure that the latest version of iTunes is installed and I've tried rebooting the computer with the iPad connected and not.  Nothing seems to

  • ITunes 9.1 does not work with Windows 7 64-bit

    I just updated my itunes to 9.1. Now it will not start or falsely tells me someone else is already using it. That's not true. No one else is using it. When I reboot and start fresh iTunes will work. But when I close it and try to get back onto it, no

  • How can I limit the number of rows returned by a select stat

    How can I limit the number of rows returned by a select statement. I have a query where I return the number of stores that are located in a given area.. I only want to return the first twenty-five stores. In some instances there may be over 200 store

  • DataGrid rendering problem

    I have an ApplicationControlBar above a data grid.  The data grid has widths specified and is bound to a data source that is populated by a service call.  The mark up below causes the description column to disappear and the header row is about 10 tim

  • Problems display image from database

    I have set up an image upload page which allows the user to browse for a photograph and save the path of the photograph to the database. Unfortunately I can't figure out how to display the picture. I use an SQL $Get which retrieves the path correctly