BADI ME_PROCESS_PO_CUST AND BADI ME_DEFINE_CALCTYPE

Hi,
How do I change the pricing type when creating aPurchase Order using BADI ME_PROCESS_PO_CUST and ME_DEFINE_CALCTYPE.
I need to set the value  IM_DATA-Calctype = 'B'  (Calctype) on the first badi.
Please help!

hi this is the code:
method IF_EX_ME_PROCESS_PO_CUST~PROCESS_ITEM.
  DATA:   RE_DATA TYPE MEPOITEM,
          IM_DATA TYPE MEPOITEM.
     CALL METHOD IM_ITEM->get_data
     RECEIVING
        RE_DATA = RE_DATA.
MOVE 'B' TO RE_DATA-calctype.
CALL METHOD IM_ITEM->set_data
         EXPORTING
            IM_DATA  = RE_DATA.
endmethod.
Upon creation of PO error message prompt
'Data from Business Add-In ME_PROCESS_PO_CUST not adopted'

Similar Messages

  • Post Bad Bebt and Bad Debt Recovery

    Hi,
    I post a customer invoice of 2000. Then I need to post an amount of 1000 as bad debt against the invoice. Subsequently, I recieve the bad debt recovery.
    Kindly advise how to process this in SAP and what entries do I need to post.
    Regards,
    Gangs.

    Hi,
    Thanks for your suggestions.  what will be the entries generated in this process and what transaction codes can I use.
    can I set off the bad debt posting against an invoice?
    Regards,
    Gangs.

  • Bad LUN and bad target number startup problem

    Hello
    Since few time, when my laptop boots I have some strange lines just after uevent :
    bad LUN
    bad target number (1:0)
    bad target number (7:0)
    They are in the everything.log and dmesg. Here you have the relevant part of the dmesg output, lspci and lsusb (it seems to be related with some SCSI removable disk...):
    [ 16.185536] [drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on minor 0
    [ 16.369346] scsi 6:0:0:0: Direct-Access Generic- SD/MMC 1.00 PQ: 0 ANSI: 0 CCS
    [ 16.369521] sd 6:0:0:0: Attached scsi generic sg2 type 0
    [ 16.369638] scsi 6:0:0:1: Direct-Access Generic- MemoryStick 1.00 PQ: 0 ANSI: 0 CCS
    [ 16.369648] sd 6:0:0:0: [sdb] Attached SCSI removable disk
    [ 16.369757] sd 6:0:0:1: Attached scsi generic sg3 type 0
    [ 16.369825] Bad LUN (0:2)
    [ 16.369873] sd 6:0:0:1: [sdc] Attached SCSI removable disk
    [ 16.392657] Bad target number (1:0)
    [ 16.405941] Bad target number (2:0)
    [ 16.419294] Bad target number (3:0)
    [ 16.469295] Bad target number (4:0)
    [ 16.522611] Bad target number (5:0)
    [ 16.575913] Bad target number (6:0)
    [ 16.629228] Bad target number (7:0)
    lspci :
    00:00.0 Host bridge: Intel Corporation 2nd Generation Core Processor Family DRAM Controller (rev 09)
    00:01.0 PCI bridge: Intel Corporation 2nd Generation Core Processor Family PCI Express Root Port (rev 09)
    00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
    00:16.0 Communication controller: Intel Corporation 6 Series Chipset Family MEI Controller #1 (rev 04)
    00:1a.0 USB Controller: Intel Corporation 6 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
    00:1b.0 Audio device: Intel Corporation 6 Series Chipset Family High Definition Audio Controller (rev 04)
    00:1c.0 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 1 (rev b4)
    00:1c.1 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 2 (rev b4)
    00:1c.2 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 3 (rev b4)
    00:1c.3 PCI bridge: Intel Corporation 6 Series Chipset Family PCI Express Root Port 4 (rev b4)
    00:1d.0 USB Controller: Intel Corporation 6 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
    00:1f.0 ISA bridge: Intel Corporation HM65 Express Chipset Family LPC Controller (rev 04)
    00:1f.2 SATA controller: Intel Corporation 6 Series Chipset Family 6 port SATA AHCI Controller (rev 04)
    00:1f.3 SMBus: Intel Corporation 6 Series Chipset Family SMBus Controller (rev 04)
    01:00.0 VGA compatible controller: ATI Technologies Inc NI Seymour [AMD Radeon HD 6470M] (rev ff)
    02:00.0 Network controller: Intel Corporation Centrino Wireless-N 1000
    03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5209 (rev 01)
    04:00.0 USB Controller: NEC Corporation uPD720200 USB 3.0 Host Controller (rev 04)
    05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 06)
    lsusb
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
    Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
    Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
    Bus 001 Device 003: ID 0c45:64b5 Microdia
    Bus 002 Device 003: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse
    Bus 002 Device 004: ID 0b38:0010 Gear Head 107-Key Keyboard
    I can boot, but something seems to be broken or at least not very clean (and it seems that my boot is a bit longer). Is there a way to reset/reconfigure target numbers ? (no idea of what is that... I googled without success).
    All my usb seem to work with keyboard, mouse and usb key... as the SD card reader. I also have something called HG duo (sony vaio laptop) but I don't have this kind of card so I can't test it.
    The problem occured with the kernel26_mainline (3.0), but also with 2.6.39 and now with linux3.0 in core...
    Does anybody has an idea on what's going on ? (and how to fix it...)
    Merci!!

    The best I can suggest is to try with just one of them connected, and see if the errors persist.
    My laptop only has few weeks.... If it is possible to not destroy it.... (I'm not very comfortable with the hardware part, and I think that I will lost the warranty if I open this part).
    But I found an option in the bios to disable the memory card reader (both I guess... or maybe there are 2 slots but only one thing to plug), and the bad target number message disappear.
    With memory cards disabled :
    fdisk -l
    Périphérique Amorce Début Fin Blocs Id Système
    /dev/sda1 2048 25927679 12962816 27 TFS WinRE masquée
    /dev/sda2 * 25927680 26132479 102400 7 HPFS/NTFS/exFAT
    /dev/sda3 26132480 226701359 100284440 7 HPFS/NTFS/exFAT
    /dev/sda4 226705406 976771071 375032833 5 Étendue
    /dev/sda5 960688128 976771071 8041472 82 partition d'échange Linux / Solaris
    /dev/sda6 960163840 960686079 261120 83 Linux
    /dev/sda7 226705408 929204223 351249408 83 Linux
    /dev/sda8 929206272 960161791 15477760 83 Linux
    cat /proc/scsi/scsi
    Attached devices:
    Host: scsi0 Channel: 00 Id: 00 Lun: 00
    Vendor: ATA Model: TOSHIBA MK5061GS Rev: MC00
    Type: Direct-Access ANSI SCSI revision: 05
    Host: scsi4 Channel: 00 Id: 00 Lun: 00
    Vendor: Optiarc Model: DVD RW AD-7930V Rev: 1.70
    Type: CD-ROM ANSI SCSI revision: 05
    With memory card enabled (but I don't have any sd card right now to give you the output with one plugged) :
    fdisk -l
    Périphérique Amorce Début Fin Blocs Id Système
    /dev/sda1 2048 25927679 12962816 27 TFS WinRE masquée
    /dev/sda2 * 25927680 26132479 102400 7 HPFS/NTFS/exFAT
    /dev/sda3 26132480 226701359 100284440 7 HPFS/NTFS/exFAT
    /dev/sda4 226705406 976771071 375032833 5 Étendue
    /dev/sda5 960688128 976771071 8041472 82 partition d'échange Linux / Solaris
    /dev/sda6 960163840 960686079 261120 83 Linux
    /dev/sda7 226705408 929204223 351249408 83 Linux
    /dev/sda8 929206272 960161791 15477760 83 Linux
    cat /proc/scsi/scsi
    Attached devices:
    Host: scsi0 Channel: 00 Id: 00 Lun: 00
    Vendor: ATA Model: TOSHIBA MK5061GS Rev: MC00
    Type: Direct-Access ANSI SCSI revision: 05
    Host: scsi4 Channel: 00 Id: 00 Lun: 00
    Vendor: Optiarc Model: DVD RW AD-7930V Rev: 1.70
    Type: CD-ROM ANSI SCSI revision: 05
    Host: scsi6 Channel: 00 Id: 00 Lun: 00
    Vendor: Generic- Model: SD/MMC Rev: 1.00
    Type: Direct-Access ANSI SCSI revision: 02
    Host: scsi6 Channel: 00 Id: 00 Lun: 01
    Vendor: Generic- Model: MemoryStick Rev: 1.00
    Type: Direct-Access ANSI SCSI revision: 02
    Any idea ? I will try to boot on windows to see if there is any problem...
    [edit]: no problem with windows : no strange messages, no strange icon in device manager.. It may be a software problem and not a hardware one ?
    Last edited by olsman037 (2011-08-12 08:00:04)

  • BADI ME_PROCESS_PO_CUST

    hi experts,
    we are using me59n to create the stock transfer orders from stock transport requisitions. the requirement is during the creation of STO we need to stop the creation of STO for some of the STR based on custom logic. the logic needs the STR number.
    i tried "check" method  of BADI ME_PROCESS_PO_CUST and it seems working. i was able to stop the creation of PO based on some condition. but, in the actual requirement i need to to know STR ( that is purchase requisition number ) number in the method. based on the values in STR i need to stop the PO creation. i have checked the import parameters of the method but could not find anything.
    but when i went inside IM_HEADER associated type IF_PURCHASE_ORDER_MM I this is the importing parameter of the "check" method) i found a method IF_MESSAGE_OBJ_MM~GET_PARENT. I am not sure whether this will help? or is there any other way u think i can get the STR number in this method.
    or is there any other BADI / exit to meet this requirement.
    thanks

    no replies from anybody

  • How to issue warning message in BADI ME_PROCESS_PO_CUST

    Hi Guys,
    I have already checked the forum regarding this. There are lots of threads. Unfortunately none of them helped me. I must be missing some thing in my code.
    I tried issuing warning message in BADI ME_PROCESS_PO_CUST and method PROCESS_ITEM.
    First i tried with normal message statement
    MESSAGE w001(00) WITH text-001 text-002.
    Didn't worked.
    Next tried calling standard macros
      DATA:mmmfd_cust_01 TYPE mmpur_metafield VALUE 90000000.
      call method cl_contextfield_mm=>set_current_field
                                      exporting im_field = mmmfd_cust_01.
      mmpur_metafield mmmfd_cust_01.
    mmpur_message_config 'W' 'X' ' '.      "Tried all permutations here
    mmpur_message_forced 'W' '00' '001' text-001 text-002 '' ''.
    Still no solution
    Tried with macro mmpur_message also
    Can some one helpme out to solve this issue.
    Thanks,
    Vinod.

    Hi all,
    Thanks for the responce.
    Not sure whether you have looked into BADI documentation or not. Please check below.
    "Further notes
    The above-mentioned macros are defined in the program MM_MESSAGES_MAC. Please include this program in your own application.
    Never issue messages in BAdI ME_GUI_PO_CUST! This is the task of the business logic and must therefore be done via the BAdI ME_PROCESS_PO_CUST.
    "Never use the ABAP statement MESSAGE in the BAdI ME_PROCESS_PO_CUST. Please use the macro mmpur_message_forced only. This macro only writes a message in the message collector.
    If you wish to mark the business object as invalid in order to prevent posting, you must additionally use the INVALIDATE ( ) method of the relevant interface. In this connection, see also the code example in the PROCESS_ITEM method of the BAdI ME_PROCESS_PO_CUST.
    I have tried almost all macros including mmpur_message_forced 'E' 'ME' '083' l_text ' '  ' '  ' '.
    Not sure where i am missing:(
    If i give error using MESSAGE statement it is working perfectly i.e. give error and save the PO. Only wanted to know if there are any implications.
    Thanks,
    Vinod

  • Badi-- ME_PROCESS_PO_CUST, PROCESS_ACCOUNT method

    Hi,
    My requirement is that While Creating PO,if the first four characters of Cost Center and FundsCenter is not equal to Plant then an error message should be raised . For this i used
    Badi>ME_PROCESS_PO_CUST   and Method->PROCESS_ACCOUNT .
    The problem is that  in  PROCESS_ACCOUNT method the parameter IM_ACCOUNT doesn't contain Plant value.
    If I am using PROCESS_ITEM method,in this IM_ITEM is not capturing Fundscenter value.
    Please help in solving the issue. Is  there any User Exit or Badi which gives me Plant,CostCenter,FundsCenter Values.?
    Thanks
    K Srinivas

    Hi,
      You can use same Badi for getting Plant,CostCenter,FundsCenter. what are all values you are not getting for that you use field-symbols. like here for getting Plant value Try these steps.
    1. Press F1 on PO Screen Plant value. Get Program name, screen field structure from that.
    2. declare one variable as field as field-symbols, in badi.
    FIELD-SYMBOLS: <lv_var> type any.
    Assign '((SAPLMEGUI)MEPO1211-NAME1) to <lv_var>.
    Here SAPLMEGUI is Program Name And MEPO1211-NAME1 is field structure of your program screen.
    in <lv_var> you will get the value of plant.
    Same process you can try for other fields also.
    Regards
    Vishnu Gupta

  • BADI ME_PROCESS_PO_CUST Implementation is not called

    Hello,
    I have created a test implementation(local object) for BADI ME_PROCESS_PO_CUST and implemented the Process_Item method to compare item price with material master commercial price. I have also activated the implementation.
    When I create a PO using ME21N, this implemenation is not getting called. I have put a breakpoint in the implementation but processing doesn't stops here. Also I am not able to find 'Where used' of the BADI name or the interface 'IF_EX_ME_PROCESS_PO_CUST'.
    What are the reason for above behaviour? Do we maintain this BADI name in some Customizing Table?
    Please help.
    Regards,
    Shubham

    i did the same as you did and the code is clearly getting triggerred.
    Samle Code:
      DATA : l_header TYPE REF TO if_purchase_order_mm.
      DATA : l_conditions TYPE mmpur_tkomv.
      DATA : l_item LIKE LINE OF l_conditions.
      DATA : l_data TYPE mepoheader.
      CALL METHOD im_item->get_header
        RECEIVING
          re_header = l_header.
      CALL METHOD l_header->get_data
        RECEIVING
          re_data = l_data.
      CALL METHOD im_item->get_conditions
        IMPORTING
          ex_conditions = l_conditions.
      CALL METHOD im_item->set_conditions
        EXPORTING
          im_conditions = l_conditions.
    if i put break-point on any of these methods the implementation is getting trigerred.

  • BADI: ME_PROCESS_PO_CUST~PROCESS_HEADER? it is urgent

    Hi,
    I implemented BADI ME_PROCESS_PO_CUST and write some lines in the method of process_header.
    but i discover the field reswk is still no value. why.
    Thanks.
    Best regards.
      DATA: re_data TYPE mepoheader.
    get the header data
      CALL METHOD im_header->get_data
        RECEIVING
          re_data = re_data.
      re_data-reswk = 'L000'.
      CALL METHOD im_header->set_data
                EXPORTING
                  im_data = re_data.

    Hi
    First check whether this field is there or not in the table data of EKKO
    If it is there then it should come into the code of your BADi header data re_data.
    Also check after calling method whether other fields data is coming into re_data or not ? if other fields data is coming and only this particular field data is not coming then the problem with code(after it is there in EKKO)
    if in EKKO itself it is not there it is not your mistake/code mistake.
    Reward points for useful Answers
    Regards
    Anji

  • BADI : ME_PROCESS_PO_CUST Probelm

    I am using BADI
    ME_PROCESS_PO_CUST
    and want to throw error if any Z condition is not maintained , it is throwing error but also it is then existing from the transaction , showing error message , System Error ( Error in Method PO_POST )
    Can we send error message thru method POST of this BADI
    How to rectify this problem
    Ankesh Jindal
    Edited by: Ankesh Jindal on Dec 11, 2008 8:00 AM

    Display the samples provided by SAP for this BADI and manage the error messages as prescribed by SAP. (SE18 / GOTO / Sample Code / Display)
    (There are already some threads at sdn on [message management in BADI : ME_PROCESS_PO_CUS|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=me_process_po_cust+message&adv=true&sdn_author_name=&sortby=cm_rnd_rankvalue])
    Regards

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

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

  • BADI ME_PROCESS_PO_CUST for changing header data

    Hello Experts,
    I'm using Method PROCESS_HEADER in Badi ME_PROCESS_PO_CUST in order to change some header data.
    I want to change header data depending on the partner data which are on header level.
    It works fine as long as there are data changed in the header or item level and not only on the partner screen.
    The method in this Badi isn't processed if only partner data are changed. But for me it is necessary to set a special field on the header depending on the partner data.
    Regards,
    Sven

    Hi,
    Firstly, for changing Header data without any INSERT/UPDATE?MODIFY statement, badi - ME_PROCESS_PO_CUST  will not be useful.
    As method you mentioned has no header parameters under CHANGING / EXPORTING clause.
    You can use the badi which has the parametrs you want in either change/ Export mode. It can be defined under table also.
    Below is the list of important badis gettign called, however none of them contains header values in change/export clause.
    ME_CCP_ACTIVE_CHECK
    MD_STOCK_TRANSFER
    ME_DEFINE_CALCTYPE
    ME_PO_PRICING
    ME_FIELDSTATUS_STOCK
    ME_COMMITMENT_STO_CH
    ME_COMMITMNT_PARKING
    ME_INFOREC_SEND
    ME_CHECK_SOURCES
    ME_PURCHDOC_POSTED
    Instead you can use enhacement MM06E005  Customer fields in purchasing document.
    Create a project under Transaction CMOD.
    Assign enhancement as Project component.
    You'll find Exit 012. At time of save you can change header im_ekko based on you parterner data tab.
    Regards,
    Amee.

  • Custom tab data not saving in ME22N w/ BAdI ME_PROCESS_PO_CUST

    Hello all,
    I have implemented BAdis ME_PROCESS_PO_CUST & ME_GUI_PO_CUST and created a custom tab at the header level in ME21N/ME22N. I have fields such as Delivery Date and Ex Factory Date in my tab.
    We are able to put data in these fields and have that data populate their respective fields in the Purchase Order.
    Our users would like to be able to run ME22N and select certain line items and have only those items changed with the data from the custom fields. 
    So, my question is how do I handle line selection in the context of these BAdIs?  Is there a way to know which lines have been selected and then only change the data in those items?
    I have looked in Class CL_PO_ITEM_HANDLE_MM for an attribute or method that might help but I haven't found anything as of yet. 
    I have found that the field MEPO1211-TCSELFLAG is set when a line is selected in ME22N.  However, I haven't found a way to work with it.  It doesn't get passed to any of the methods in the BAdIs, as far as I know. 
    January 27, 2012  **************
    We were able to capture the lines selected by using code from method mass_change in Include LMEGUICJK, Function Group MEGUI.  The lines are in the lt_models table. 
    So, now my issue is getting data to save in ME22N.  When I put data in my custom tabs and select a line, the data gets changed on the screen but does not save.  It does work when I make a change in another field, like changing the description for instance.  I'm using the set_changed method in Process_Header from ME_PROCESS_PO_CUST but it doesn't work. 
    I'm getting the idea that I'm the first ABAP developer to try this...
    Thanks for any help.
    Kind Regards,
    Chris
    Edited by: Chris  Mowl on Jan 11, 2012 10:33 AM
    Edited by: Chris  Mowl on Jan 11, 2012 4:24 PM
    Edited by: Chris  Mowl on Jan 27, 2012 10:57 AM
    Edited by: Chris  Mowl on Jan 27, 2012 2:00 PM

    Hi,
    Checkout the below link :
    <link to blacklisted site removed by moderator>
    Shailaja Ainala.
    Edited by: Thomas Zloch on Jan 28, 2012 9:06 PM

  • How to fetch newly updated item data in BADI  ME_PROCESS_PO_CUST?

    Hi Everyone,
    While changing a PO, I have a requirement where I need to only modify fields of newly added items of a purchase order and keep the values of existing items as it is. I have implemented the BADI ME_PROCESS_PO_CUST for this. but not able to know how to achieve this requirement. please suggest a solution.
    Thanks and Regards,
         Indudhar P.G

    Hi,
    interfaces for PO header and item have method is_persistent. This method returns true if the item/header is persistent which is equal to that it has been written to DB. So new items are not be persistent and old items are persistent.
    Cheers

  • BADI - ME_PROCESS_PO_CUST - To update Condition Types at time of creation

    Hi All
    I'm relatively new to Implementing BADIs. I'm using the BADI ME_PROCESS_PO_CUST.
    I have to update certain condition types with values determined from a custom table maintained for related Vendors.
    I have created a 'Z' implementation for ME_PROCESS_PO_CUST and activated the implementation. But when I try to create a PO, the code doesn't seem to be execute!
    Following is the code bundle -
    METHOD if_ex_me_process_po_cust~process_header .
      DATA : l_items TYPE purchase_order_items.
      DATA : l_single TYPE purchase_order_item.
      DATA : l_item_cond TYPE mmpur_tkomv.
      CALL METHOD im_header->get_items
        RECEIVING
          re_items = l_items.
      LOOP AT l_items INTO l_single.
        CALL METHOD l_single-item->get_conditions
          IMPORTING
            ex_conditions = l_item_cond.
      ENDLOOP.
    ENDMETHOD.       "IF_EX_ME_PROCESS_PO_CUST~PROCESS_HEADER
    Could you please give me your inputs on this?
    Regards
    Kripal
    [email protected]

    Kripal,
           The method PROCESS_HEADER gets trigerred only when you make an entry in any of the header fields and then press ENTER or do some action.
    For a simple case of analysis put a break-point at
    CALL METHOD im_header->get_items
    RECEIVING
    re_items = l_items.
    in your code.
    Now if you execute ME21N you will see that the code will not get triggered.But make an entry for one of the fields say fpr purchasing organisation.Now if you press ENTER or click on any other tab your code will get triggered.
    Hope this helps.
    <i>Reward helpful answers</i>
    Cheers
    Nishanth

Maybe you are looking for