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

Similar Messages

  • BADI   ME_GUI_PO_CUST  Data Updation Query

    Hi
    I am adding Subscreen in PO at item level by using BADI ME_GUI_PO_CUST , subscreen is successfully implemented and
    visible at item level and the table which i have made for collecting the customer data but Z table is not populated.
    I have made changes to following interfaces
    SUBSCRIBE
    MAP_DYNPRO_FIELDS
    TRANSPORT_FROM_MODEL
    TRANSPORT_TO_DYNP
    TRANSPORT_FROM_DYNP
    TRANSPORT_TO_MODEL
    EXECUTE
    So what steps i will follow to update the data in Z table.
    Ankesh Jindal
    Edited by: Ankesh Jindal on Aug 20, 2009 12:28 PM
    Edited by: Ankesh Jindal on Aug 20, 2009 12:29 PM

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

  • Implementing badi ME_GUI_PO_CUST

    Hi,
    I created implementation for the badi ME_GUI_PO_CUST.
    In the method IF_EX_ME_GUI_PO_CUST~SUBSCRIBE
    I've written the below code
    DATA: ls_subscriber LIKE LINE OF re_subscribers.
      CHECK im_application = 'PO'.
      CHECK im_element     = 'HEADER'.
      CLEAR re_subscribers[].
      ls_subscriber-name = subscreen1.
      ls_subscriber-dynpro = '9000'.
      ls_subscriber-program = 'SAPMZTEST'.
      ls_subscriber-struct_name = 'MEPO_BADI_STRUCT'.
      ls_subscriber-label = 'New'.
      ls_subscriber-position = 5.
      ls_subscriber-height = 7.
      APPEND ls_subscriber TO re_subscribers.
    I've created one module pool program SAPMZTEST and a sub screen 9000 for that program .
    If it is not the correct procedure pls guide me.
    I could not see  a new tab in PO header. Could anyone pls let me know what should I do to get a new tab?
    Thanks,
    Poornima

    Hi,
    I have added tab in the header of the purchase oder and it is displaying in me21n, me22n and me23n.
    this tab contains three fields buyer name,buyer id,buyer phone no, this fields are appended in the ci_ekkodb structure of ekko.
    now the data is not saving in the database.
    i have created a table ci_ekkodb in function group zmepobadix in top include and created two function modules
    zdata_push and zdat_pop
    the code what i had return in methods of me_gui_po_cust is
    transport_from_model:----
    DATA: l_item       TYPE REF TO if_purchase_order_item_mm,
            ls_header type ref to if_purchase_order_mm,
            ls_mepoheader type mepoheader,
            ls_mepoitem  TYPE mepoitem,
            ls_customer  TYPE CI_EKKODB,
            DYNP_DATA_PBO type CI_EKKODB.
      case im_name.
        when subscreen1.
          mmpur_dynamic_cast ls_header im_model.
          check not ls_header is INITIAL.
         ls_mepoheader = ls_header->get_data( ).
    MOVE-CORRESPONDING ls_mepoheader TO dynp_data_pbo.
    WHEN OTHERS.
    ENDCASE.
    transport_to_dynp----
    DATA : DYNP_DATA_PBO TYPE CI_EKKODB.
       CASE im_name.
        WHEN subscreen1.
         CALL FUNCTION 'ZMEPOBADIEX_PUSH'
           EXPORTING
             im_dynp_data = dynp_data_pbo.
    CALL FUNCTION 'ZDATA_PUSH'
      EXPORTING
        im_dynp_data       = dynp_data_pbo.
        WHEN OTHERS.
      ENDCASE.
    transport_from_dynp----
    CONSTANTS :mmpur_yes                 TYPE c VALUE 'X'.
      DATA : DYNP_DATA_PAI TYPE CI_EKKODB,
             DYNP_DATA_PBO TYPE CI_EKKODB.
      CASE im_name.
        WHEN subscreen1.
    CALL FUNCTION 'ZDATA_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.
    transport_to_model----
    DATA: l_item       TYPE REF TO if_purchase_order_item_mm,
             ls_header type REF TO if_purchase_order_mm,
             ls_mepoheader type mepoheader,
             ls_mepoitem  TYPE mepoitem,
             ls_customer  TYPE CI_EKKODB,
             dynp_data_pai TYPE CI_EKKODB,
             dynp_data_pbo TYPE CI_EKKODB.
       CASE im_name.
        WHEN subscreen1.
    mmpur_dynamic_cast ls_header im_model.
    check not ls_header is INITIAL.
         ls_mepoheader = ls_header->get_data( ).
      IF dynp_data_pbo-zzbuyer NE dynp_data_pai-zzbuyer OR
         ls_mepoheader-zzbuyer = dynp_data_pai-zzbuyer.
                 ls_header->set_data( ls_mepoheader ).
      endif .
    IF dynp_data_pbo-zzmail NE dynp_data_pai-zzmail OR
         ls_mepoheader-zzmail = dynp_data_pai-zzmail.
                 ls_header->set_data( ls_mepoheader ).
    endif.
    IF dynp_data_pbo-zzphone NE dynp_data_pai-zzphone OR
         ls_mepoheader-zzphone = dynp_data_pai-zzphone.
                 ls_header->set_data( ls_mepoheader ).
    endif.
    IF dynp_data_pbo-zzextno NE dynp_data_pai-zzextno OR
         ls_mepoheader-zzextno = dynp_data_pai-zzextno.
                 ls_header->set_data( ls_mepoheader ).
    ENDIF.
    WHEN OTHERS.
      ENDCASE.
    I'm not undustanding y the data is not saving in the database.
    Please help.
    Thanks in advance.
    Regards,
    Archana.

  • Could not get Custom screen in me21n after implementing Badi ME_GUI_PO_CUST

    Hi.,
    I created implementation for the badi ME_GUI_PO_CUST... but i could not get the Tab and screen in header tab.
    also used below  link in the  forum to correct the issue ....but dint help me .
    Custom screen not displaying using BADI ME_GUI_PO_CUST
    Pls help me how to go abt...
    Thanks,
    Ranjitha.

    Hi ....
    Now the tab is reflecting in me22n & me23n but not in me21n ......can anybody tell what could be the reason?
    thanks
    ranjitha

  • 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.

  • Need help on implementing the BADI ME_GUI_PO_CUST

    Hi All,
    As per my requirement I need to do Enhancement for Unloading point field on PO.This filed will get all the department numbers applicable for the site on the line item.
    For this I need to Implement the BADI BADI ME_GUI_PO_CUST.
    The Method which needs to be Implemented is : TRANSPORT_TO_DYNP.
    Instructions have been given for the Screen design.
    Can anyone help me (with the sample code how) to Implement this method of the BADI in SE19.
    This BADI method is taking a view as an Input and I am not understanding how to proceed.
    Thanks and Regards,
    Smriti Singh

    Hi,
    my suggestion is to check the standard documentation of the interface IF_EX_ME_GUI_PO_CUST.
    After that you can check the method IF_EX_ME_GUI_PO_CUST~TRANSPORT_TO_DYNP in the example implementation class CL_EXM_IM_ME_GUI_PO_CUST.
    Usefull links:
    [Re: Implementing badi ME_GUI_PO_CUST;
    [Re: ME21N - PO Enhancement using BADI;
    Kind Regards.
    Andrea

  • 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.

  • 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.

  • Add new screen in ME23N with BADI ME_GUI_PO_CUST

    Hi folks, I have used the BADI ME_GUI_PO_CUST to add a custom tab in transaction ME23N.
    So good, sor far, I know how to used BADI and it works very well. I had to subscribe my own subscreen in the method subscribe of the interface, but something is boring me and I don't know if it's possible.
    Let's say I want to display my new tab according to the purchasing document type. Right now, my custom tab is always display. There is no method to unsubscribe a screen in the interface. What I could do is to used the get parameter id 'BES' in the subscribe method to get the current purchasing document display, then from there I could decide if I subscribe or not my own screen. The thing with the subscribe method is that it's only called once, when you enter in the transaction, if you stay in the transaction and select another purchasing document, this method will not be called.
    thanks
    Alex

    Hi Alexandre,
    First get the current Purchase Order Number using parameter ID 'BES' in the PBO of the custom subscreen.
    Then based on validation checks set SCREEN-INVISIBLE = 1 and SCREEN-ACTIVE = 0 and MODIFY SCREEN for all the screen fields.
    This will hide all the fields and eventually the tab may also disappear. This works for Screen Exits (i.e., if all the fields of a tab are made to disppear then the tab also disapears if is the tab is defined using Screen Exit). But I have never tried it out in a BADI.
    Try this, it might work.
    Hope it helps.
    Regards,
    Abhisek.

  • 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

  • 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

  • ME21N badi ME_GUI_PO_CUST - not working in PO creation

    Hi All,
    I am working on badi ME_GUI_PO_CUST to create a custom tab on PO header. I have implemented the BADI with custom fields in the custom screen. However, in ME21N, this new tab is not appearing. At the same time, it is appearing in ME23N. If i take a PO in display mode, the tab appears and then switch to chaneg mode, the tab disappears.
    Any solution for this pleas.??
    Regards,
    Arun.

    Hi Arun,
    You can use MM06E005 exit for adding the tab for item level in ME21n transaction. In general, you go to smod and you give this exit there and then press on documentation then you will find all the information regarding function module exits.
    Give this exit in SMOD and then press Attributes--> click on Components, then you will find all the function module exits and subscreen areas where you can add your custom field on the subscreens.
    I am giving you the subscreen :
    SAPMM06E 0111 CUSTSCR1 SAPLXM06 0111 Subscreen: PO item
    Function module exit:
    EXIT_SAPMM06E_018 Import Data from Customer Subscreen for purchasing document
    Then you start adding the custom field in Custom include of EKPO table and then you go to SE51 and then you import I mean ( Get from dictionary ) that particular Z field and then activate it. These all the thing you need to create a project and implement in CMOD transaction.
    Then you write the respective code in Functionmodule exit to populate the data to the database.
    Thanks,
    Swamy Kunche
    Edited by: Swamy Kunche on Dec 7, 2009 10:58 AM

  • Customer screen using BADI :  ME_GUI_PO_CUST

    Hi
    I am implementing BADI : ME_GUI_PO_CUST to create custom screen at item level.
    Pls tell me the steps to be followed to get custom screen using BADI
    Thanks
    Vinay.

    Hi Vinay,
    go to transaction SE18, then enter your BADI.The in menu go to Goto -> Sample Code -> Display. You will see example of implementation of this BADI. All these examples are very well commented. Basically you will have to create your own function group with your new screen and call this screen from methods of BADI.
    Cheers

  • 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

  • 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 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

  • Convert spool to xls and send the attachment through email

    Hello, I have a requirement to convert spool to xls and then send the xls as an attachment through email,how sould i go about it,which fm can i use please advice.. Thanks.

  • Keeps asking for Dual layer DVD

    I made a slideshow in iMovie and shared to iDVD8. The media windows shows the file as 2.7 gig. But when I go to burn it says to insert a Dual Layer DVD because the project to large. I dont have anything else in the project other then the menu which i

  • [Help] Unable to find component with absolute reference

    I've deployed my project files to server and registered in Application. Class Files under myclasses goes to -> /disk2/app/applmgr/comntop/java/ldc/oracle/apps/sla/calnet/xref/phone Page XML under myprojects goes to -> /disk2/app/applmgr/appltop/xx_cu

  • Displaying metadata on Mobile Me Web Galleries

    Is there way to control what meta data is shown in Mobile ME Galleries. For example I would like to have captions shown in the galleries, but currently only shows master file name.

  • Can't save itunes library -error (-54)

    I get the following error when I am importing from a retail CD:the itunes music library file cannot be saved. an unknown error occurred (-54) Although all info appears in iTunes fields (name, title, artist,etc, when I attempt to burn, it only burnes