METHOD PROCESS_ACCOUNT OF BADI ME_PROCESS_PO_CUST.

HI,
I need to implement the method PROCESS_ACCOUNT of badi ME_PROCESS_PO_CUST.
can anyone suugest me the samolw code for the same.
i know i can get the account assignment data in the mathod IM_ACCOUNT->get_data.
But how to declare the variable to store the data of im_account->getdata.
so that i can use it in the progra?
i mean for ex for header we will declare
ls_header type mepoheader
and then
ls_header  = im_header->get-data.
similarly can you plese tell me the declaration for storing the account assinment data.
which table that variable will refer to.
Smriti

hai smriti
u can call the method
data: it_data type MEPOACCOUNTING
im_accoutn->get_data  importing re_data  = it_data.
just click the method type of parameter IM_ACCOUNT which is IF_PURCHASE_ORDER_ACCOUNT_MM  an interface
u will get all the methods fro the same  u have ur mehtod get_data just click on it and click parameters and u get the paramter type  which is MEPOACCOUNTING
regards
m.a
Edited by: mohammad afzal on Jul 9, 2009 7:11 AM

Similar Messages

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

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

  • 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 Method: IF_EX_ME_PROCESS_PO_CUST~PROCESS_SCHEDULE

    Hi,
    in method: IF_EX_ME_PROCESS_PO_CUST~PROCESS_SCHEDULE of Badi ME_PROCESS_PO_CUST
    i will get schedule-data and item data.
    I try this:
    METHOD IF_EX_ME_PROCESS_PO_CUST~PROCESS_SCHEDULE.
      DATA: LS_ITEM TYPE MEPOITEM.
      LS_ITEM = IM_ITEM->GET_ITEM( ).
      DATA: LS_SCHEDULE TYPE MEPOSCHEDULE.
      LS_SCHEDULE = IM_SCHEDULE->GET_DATA( ).
      BREAK-POINT.
    ENDMETHOD.
    LS-SCHEDULE are filled correct.
    in Line   LS_ITEM = IM_ITEM->GET_ITEM( ). i get an syntax error -> IM_ITEM are unknown.
    Has anyone an idea how i can get the ITEM Data?
    Thanks.
    Regards, Dieter

    Hi Vinod,
    thanks, it solved my Problem.
    I have another thread for ME_PROCESS_PO_CUST.
    Question to Z_ME_PROCESS_PO_CUST with item catagory L
    Do you have an idea for this problem?
    Thanks.
    Regards, Dieter

  • BADI ME_PROCESS_PO_CUST Method Post

    Hi, how can we know in the method post of the BADI ME_PROCESS_PO_CUST if we are in creation mode (me21n) or change mode (me22n), I need to do some coding only at the creation of the PO but this method is call anytime we click save!
    thanks!

    Hello Alexandre
    It would be possible to check the transaction. However, if the BAPI BAPI_PO_CREATE is used the BAdI is also processed yet the transaction is most likely wrong.
    An <u>unambigous </u>approach is to check IMPORTING parameter IM_TRTYP in method IF_EX_ME_PROCESS_PO_CUST~OPEN:
    METHOD if_ex_me_process_po_cust~open.
    * define local data
      DATA:
        lo_po          TYPE REF TO cl_po_header_handle_mm,
        ls_header      TYPE mepoheader.
      me->md_trtyp = im_trtyp.  " save transaction type
      IF ( im_trtyp = 'H' ).  " add new purchase order
    I would add an instance attribute MD_TRTYP to the BAdI implementing class and save the transaction type in method IF_EX_ME_PROCESS_PO_CUST~OPEN (see above).
    Now you can simply add the following IF condition to your POST method:
    METHOD if_ex_me_process_po_cust~open.
      CASE me->md_trtyp. 
        WHEN 'H'.    " add new purchase order
      ...  " do required action for CREATE
        WHEN ... .
        WHEN others.
      ENDCASE.
    The possible transaction types can be found at: im_trtyp -> data element -> <b>domain </b>(fixed values).
    Regards
      Uwe

  • BADI ME_PROCESS_PO_CUST Method:PROCESS_ITEM

    Hi,
    I have to update the vendor material field through BADI ME_PROCESS_PO_CUST.
    I have created an implementation for this BADI.Can anyone help me find the solution for the same.
    Thanks.

    DATA: wa_ekko TYPE ekko,
            wa_ekkn TYPE ekkn,
            wa_ekpo TYPE ekpo,
            wa_vbap           TYPE vbap.
      DATA : lt_item TYPE mepoitem.
      IF im_item->is_persistent( ) EQ mmpur_no. "Only check for new items
    * Retrieve item data into BADI buffer
    *get data
        CALL METHOD im_item->get_data
          RECEIVING
            re_data = lt_item.
        ENDIF.
        SELECT SINGLE * FROM ekko
          INTO wa_ekko
          WHERE reswk NE ''.
        IF sy-subrc EQ 0.
          SELECT SINGLE * FROM ekkn
              INTO wa_ekkn
              WHERE ebeln = wa_ekko-ebeln.
          IF wa_ekkn-vbeln <> ''.
            SELECT SINGLE * FROM ekpo
              INTO wa_ekpo
              WHERE ebeln = wa_ekko-ebeln
              AND   idnlf = ''.
            IF sy-subrc EQ 0.
            SELECT SINGLE * FROM vbap
              INTO wa_vbap
              WHERE vbeln = wa_ekkn-vbeln
              AND   posnr = wa_ekkn-ebelp.
            IF sy-subrc EQ 0.
              lt_item-idnlf = wa_vbap-kdmat.
            ENDIF.
          ENDIF.
        ENDIF.
            ENDIF.
    * Update changes
        CALL METHOD im_item->set_data
          EXPORTING
            im_data = lt_item.

  • 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

    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

  • 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

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

  • Rollback BAPI in BADI ME_PROCESS_PO_CUST

    hi guys,
    I used BADI ME_PROCESS_PO_CUST to implement a code before saving the purchase order (Method POST).
    This code contains a BAPI to create a delivery BAPI_OUTB_DELIVERY_CREATENOREF. If this BAPI fails (this is when Return parameter contains 'E' message), I execute function BAPI_TRANSACTION_ROLLBACK.
    Guess what is happening?
    There is no purchase order created even when screen shows message "Standard PO created under the number 45#######".
    What do I want to do?
    - Rollback the bapi executed and let the system continue saving the purchase order.
    - If possible show a message to the user that there is an error, but command MESSAGE doesn't seem to work in this BADI
    Could you share your insights with this wannabe-abapper?
    PD: it says in documentation that it is required ABAP OO to implement this BADI and I think I used it correctly for gathering all data I needed. But I just don't understand why MESSAGE statement and FM POPUP_TO_CONFIRM don't work.

    Hello
    You may try an approach like this:
      IF ( 1 = 1 ).
        MESSAGE 'Creation of outbound delivery failed'  type 'I'.
        data: ld_dummy  type string,
              ls_msg    type SMESG,
              lt_msg    type tsmesg.
          message id '00' type 'E' number '398' with 'Creation of outbound delivery failed'
                                                      space space space into gl_dummy.
        move-CORRESPONDING syst to ls_msg.
        APPEND ls_msg to lt_msg.
        CALL FUNCTION 'FB_MESSAGES_DISPLAY_POPUP'
          EXPORTING
            IT_SMESG              = lt_msg
    *       ID_SMESG_ZEILE        =
    *       IT_RETURN             =
    *       ID_SEND_IF_ONE        =
          EXCEPTIONS
            NO_MESSAGES           = 1
            POPUP_CANCELLED       = 2
            OTHERS                = 3.
        IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      endif.
    Regards
      Uwe

  • 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

Maybe you are looking for

  • Switching ipod from a pc to a powerbook

    I had my ipod and itunes in my pc but now i have a powerbook and I want to transfer everything to the powerbook. I followed the directions but my powerbook says nothing on my ipod can be transferred. Any ideas?

  • What's with the blow dryer fan...?

    Just wondering...I've been running a Perl script that max's the CPU (well...half of it anyway), and the fan just ramps up like crazy. Fine...but the weird thing is that after running it for a few hours in another room with the door shut, I come back

  • WLSE not reporting rogue AP

    Does anyone know of circumstances why WLSE (2.7) would not detect a non registered AP. We connected a non Cisco AP (Microsoft MN700 router/wireless base station) to our LAN yet WLSE is not sending out Faultnotifiers.It seems to be selectively ignorin

  • Component Portal:portal is down in OAS 9.0.4.1.1

    Hello, i think i know why is down but i don't know how and where can i repair this. Inside the component Portal:portal is almost at the bottom Related link and beside is "Portal End User Default Homepage" which URL show me to http://http//server.doma

  • Re:How can we save the values in drafts

    Hi all, I am using jdev 11.1.2.3.0 My requirement is I have one table as jobsheet.In jobsheet table some fields are mandatory.In this jspx page I have 2 buttons as save and draft.if i entered some data without entering mandatory fields and click the