PROCESS_HEADER not fired in BADI ME_PROCESS_PO_CUST

Dear experts,
I face the problem, that the method PROCESS_HEADER of BADI ME_PROCESS_PO_CUST is not fired, when I am changing po header text. My requirement is to set a customer po header field, whenever a po header text is existent.
Does anybody know, if this is the standard behaviour and how I can work around it?
Thanxs

Hi Aparna,
actually I tried this, too.
In the methods Check and Post (which both are fired normally) I coded my requirements, but in this methods I faced the problem that I was not able to save my programatic header field changes. (Even with the trick to cast the IM_HEADER to CL_PO_HEADER_HANDLE_MM to allow changes of internal attributes, used in method set_data(), any changes of po header fields were not saved.) But maybe I am wrong with my implementation? You may have a look:
  DATA: lv_val_id TYPE thead-tdid.
  DATA: lv_val_name TYPE thead-tdname.
  DATA: lv_val_object TYPE thead-tdobject.
  DATA: p_mepo_header TYPE MEPOHEADER.
  DATA: it_tline TYPE TABLE OF TLINE.
  DATA: lv_cl_po_header_handle_mm TYPE REF TO CL_PO_HEADER_HANDLE_MM.
check existents of po header text
  lv_val_id = 'F09'.
  p_mepo_header = im_header->get_Data( ).
  lv_val_name = p_mepo_header-ebeln.
  lv_val_object = 'EKKO'.
  CALL FUNCTION 'READ_TEXT'
  EXPORTING
      client = sy-mandt
      id = lv_val_id
      language = sy-langu
      name = lv_val_name
      object = lv_val_object
    TABLES
      lines = it_tline
    EXCEPTIONS
      ID = 1
      LANGUAGE = 2
      NAME = 3
      NOT_FOUND = 4
      OBJECT = 5
      REFERENCE_CHECK = 6
      WRONG_ACCESS_TO_ARCHIVE = 7.
any text there, then update customer po header field
  IF sy-subrc = 0.
    p_mepo_header-zzfield = 'X'.
  else.
    p_mepo_header-zzfield = ' '.
  endif.
QD
  lv_cl_po_header_handle_mm ?= im_header.
  lv_cl_po_header_handle_mm->my_cust_firewall_on = 'X'.
  im_header->set_Data( p_mepo_header ).
  im_header->set_changed( ).
po is still same as before and field zzfield was not updated.

Similar Messages

  • 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

  • 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 - DOES NOT CLEAR OUT ERROR

    In ME21N I want to validate the field Commodity Code - STAWN. I have used the BADI ME_PROCESS_PO_CUST*
    . Have used get_foreign_trade() in the PROCESS_ITEM method . I am able to throw an error . It is doing it but*
    after throwing error then when we give a valid Commoditycode too it is still showing the error and not clearing the error  .*
    As suggested by Dean Q I used   INCLUDE mm_messages_mac,
    tried im_item->set_foreign_trade( ls_mepo_eipo)  still when a valid Commodity code is entered after an invalid one  it does not clear out the error. In fact on checking using break-point I found that the second time it does not enter into the method  PROCESS_ITEM.    Any help is welcome
    Nivedita

    Hi,
    In SE18 give ME_PROCESS_PO_CUST as the enhancement spot and display. At the left side of the screen you can see the badi definition ME_PROCESS_PO_CUST. Expand the tree and double click on implementations. You can see the enhance implementations created. Double click on the enhancement implementation and in that screen there is a check box 'Implementation is active' and field 'Effect in current client'.
    If you know the enhancement implementation name(not the badi implementation name), you can check it directly from se19.
    Regards,
    Poornima

  • BADI ME_PROCESS_PO_CUST is not triggering while creating/changing PO

    Hi,
    I am new to BADIs,
    I am trying to implement BADI ME_PROCESS_PO_CUST in ECC 6.0. I have done the implementation and activated. I kept a break point in PROCESS_ITEM method, but the BADI is not triggering while creating or changing the PO. Please advice me what could be the reason behind this?
    I used the SQL trace but i couldn't get the BADI ME_PROCESS_PO_CUST in the list.
    thanks in advance
    Regards
    Jagadish

    hello jagdish,
    implement   this user exit.....
    MM06E005...
    go to     EXIT_SAPMM06E_017   in that   then you can put a break point in the user defined function module.....
    or use
    BREAK  'C5133392'  (use your user in place of C5133392)....it will stop here while creating PO or changing PO...
    now you can do whatever you want to do in create or change PO using this function exit......
    perform the validations on import parameters.....to create  or change ....and activate the project....
    hope this will give you some idea and help

  • 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 not getting triggered

    Hello Experts,
    i implemeted BADI ME_PROCESS_PO_CUST to ZME_PROCESS_PO_CUST.
    there is only one badi implemented for this.
    And it is working fine in development and transported to Quality system.
    in Quality system this badi itself is not getting triggered.
    Please help me any body have any idea about this.
    Thanks in advance
    Mahammad Farooq

    Hi,
      check the below thread:
    LINK[BAdi - ME_PROCESS_PO_CUST  not trigger.;
    if every thing is active then the only issue could be multiple implementatins
    check in table SXC_EXIT to check the status .
    if there are any inactive implementations delete all and put in a request and transport to you QA system.
    Regards,
    Himanshu

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

  • 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

  • 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

    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

  • Urgent Help Needed in BAdI ME_PROCESS_PO_CUST

    Hello friends,
    I m workin on BAdI ME_PROCESS_PO_CUST , my requirement is to store header level text in po if it is left blank by user , for this i have creadted standard text for every po header text , and implemeted method POST of the badi. so when user is saving the po , i m checking whether all header text is filled by user or not , for this i have called method GET_TEXT , if the text is blank i m reading data from standard text using READ_TEXT function module and setting in perticular text by using method SET_TEXT , every thing is working fine , the respective text ifrom standard text  getting filled to the perticular text of the po , if left blank by the user .  But the actual problem is that when i m going to display the same po again , the text that i was supplied by standard text is not showing in po.
    is there is anything that i missed out , i also done coomit work , but its not working ,
    so please suggest.......
    dont worry abt points

    Dear Mr Mahesh
    I also face similar problem . But my limitation is that I am new to BADI . Sir it will be great help if you can please mail me the steps / procedure and code to be written for implementing the above BADI .
    Sir , I look forward for your kind help please .
    Regards
    B V Mittal
    [email protected]

  • Many threads on application.onDisconnect not firing but seemingly no solution

    I've dug some threads up and included links at the end of this post. Have some more work to do researching it but figured I'd get the ball rolling.
    Essentially one can't depend on application.onDisconnect() firing at the close of a client's browser.  It happens sometimes.  But with some apps, it just doesn't happen at all.  I've watched the FMS management console as I've repeatedly opened and closed a particular app I'm developing.  Connections don't die with each browser close.  The net result is a piling up of connections.  My app has a "connected users" list in it.  It gets packed with multiple connections from the same client.
    Eventually, after 5-10 mins, the connections disappear on their own.  Not good though.  One of the functions in my app lets someone select a user in the list and send a direct chat.  This feature isn't working because disconnections are not registering real time.  Some of the people in the user list are not really there anymore.
    I get the problem in both IE8 and FireFox 3.5.3 on FMS 3.52.  Others have reported the problem in various browsers and FMS versions going way back. Problem's been around for some time.
    This guy has the same problem and a nice description, although he experienced only in IE:
    onDisconnect Errors in Internet Explorer: (http://www.flashnewz.com/ondisconnect-errors-in-internet-explorer/)
    After reading the accounts at the links gathered below, I get the feeling it might not necessarily be an FMS problem alone, but rather some combo of browser, SWFObject implementation, and perhaps particular features used (or not used) in the client ActionScript.  Nobody's seemed to nail down the precise combination though.
    Pretty much a show stopper.  Has anyone developed viable work arounds?
    Thread: onDisconnect() IE7 problem: (http://fmsguru.com/forum/messages.cfm?threadid=EEC6D52A-BAB2-526D-5CD9FF490332B8D8)
    onDisconnect Not Firing in IE6/7 With SWFObject 2: (http://www.flashcomguru.com/index.cfm/2008/8/7/swfobject-problem-ie-fms)
    Do not call onDisconnect when closing browser: (http://www.wowzamedia.com/forums/showthread.php?t=5521)
    BUG -Flash Media Interactive Server 3: (http://www.justskins.com/forums/bug-flash-media-interactive-server-3-a-141282.html)
    onDisconnect Event in FMS 2.0: (http://forums.adobe.com/thread/98366)
    Topic: Detecting ungraceful disconnects? (http://www.flashcomguru.com/forum/forum_posts.asp?TID=2848&PN=0&TPN=2)
    Why Flash Media Server does not call application.onDisconnect handler: (http://stackoverflow.com/questions/359727/why-flash-media-server-does-not-call-application -ondisconnect-handler)

    ////////////////////////////////////////////////////////////////////////////////////client side///////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////
    var nc = new NetConnection()
    nc.onStatus = function (o)
    trace(o.code);
    nc.connect("rtmp://YourAccount.rtmphost.com/AppDirectory");
    nc.imHere = function(p_b)
    trace("imHere");
    return (true)
    ////////////////////////////////////////////////////////////////server side///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////
    load("Delegate.asc");
    application.onConnect = function(p_o)
    this.acceptConnection(p_o);
    p_o.clientIsBad= function()
      trace ("is bad")
      clearInterval(this.resultInt);
      clearInterval(this.checkInt);
      application.disconnect(this);
    p_o.clientIsGood = function()
      trace ("is good")
      clearInterval(this.resultInt);
    p_o.checkValid = function()
      trace("watcha!");
      clearInterval(this.resultInt)
      this.resultInt = setInterval( p_o, "clientIsBad", 2000 );
      this.call("imHere",{onResult:Delegate.create(p_o, this.clientIsGood),onStatus:Delegate.create()} );;
    p_o.checkInt = setInterval( p_o, "checkValid", 120000 );

  • 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

Maybe you are looking for

  • Error in transaction KPF6

    Hi All, I am facing an issue with transaction KPF6. In a particular scenario (with correct data) it is showing problem of "Too many elements in the overview screen". Though this particular scenrio works correctly if I try in some other system say tes

  • Windows 8.1 freezes while booting up with discrete graphic card T520

    Hi all, Hoping someone can help me here. If I use my discrete video card (nvs 42000m) to boot into windows, it will freeze on the sign in page or sometimes on the metro page however when Optimus is enabled it works just fine. So I thought it was a dr

  • Error the class for ABAP mapping doesnt exist

    hi PI gurus, i faced a probleme when i was trying to call a second Mapping which type is ABAp after another one which type is Message Mapping, why i m doing that because i was trying to folow the step by step of michal : http://www.sdn.sap.com/irj/sc

  • How to create a video carousel component

    Hi , I have a doubt. For images we have one component carousel. Like Carousel component ,Can we develop a component for videos and it should suppport all formats (FLV,MP4,WMV) Can u guys pls help me out. Thanks & Regards, Prasad.

  • Problem in back to back interface calls using JDBC adpater

    Hi, I am facing a problem while using the JDBC adapter from XI to oracle for back to back iterface calls. as my scenario is as follows i am doing synchronus call with the first interface which is working fine, immediately after the synchronus call i