BADI ME_PROCESS_PO

Hi
Methods PROCESS_ITEM getting triggered more than once for each line item and warning / error messages are getting displayed twice.
can anybody throw light on this

one way:
I am trying to remove message using mmpur_remove_msg_by_context
Hi,
as i was facing almost the same problem (all messages / warnings - even SAP standard - were dropped using method mmpur_remove_messages_by_id)
i searched SDN and found this question.
So i tried mmpur_remove_msg_by_context (and checked details during debugging):
--> important: calling this method, you need 2 parameters to be filled (ID + CONTEXT)
mmpur_remove_msg_by_context 'IM_ID'  'IM_CONTEXT'.
clue: you can leave 2nd parameter (IM_CONTEXT) empty as I did, because this will be handled inside the method (search for... READ TABLE events INTO l_events ...)
For all who like examples - check this:
IF_EX_ME_PROCESS_PO_CUST~PROCESS_ACCOUNT
* DATA
  DATA: ls_mepoitem TYPE mepoitem,
        item_obj TYPE REF TO if_purchase_order_item_mm. "Interfacereferenz
  DATA: ls_mepoaccounting TYPE mepoaccounting.
* Methods
* Positionsdaten
  item_obj = im_account->get_item( ).
  ls_mepoitem = item_obj->get_data( ).
* Daten Kontierung
  ls_mepoaccounting = im_account->get_data( ).
* Example ABAP
IF ls_mepoitem-knttp = 'P' AND NOT
       ls_mepoaccounting-psp_pnr IS INITIAL AND     "PSP-Element
       ls_mepoaccounting-kokrs IS INITIAL.          "Kostenrechnungskreis
* create message
   mmpur_message_forced 'E' 'ME' '303' 'SAP:' text-322 '(BADI 322)' ''.
ELSE.
   mmpur_remove_msg_by_context ls_mepoaccounting-id ' '.
ENDIF.
regards
Jörg

Similar Messages

  • Badi / Exits while Saving  a PO

    Hi Experts ,
    Is there any BADI / User Exits exits while Saving a PO  from External System.
    Thanx in Advance
    pradipta

    Pradipta,
    Check BADIs:
    ME_PROCESS_PO, ME_PROCESS_PO_CUST
    Thanks

  • How to deactivate the fields in a table control of a standard screen

    Hi,
       I have an requirement to deactivate the fields in a table control of a standard screen in ME22n transaction.I am using a BADI "ME_PROCESS_PO" and in item mathod i am looping at screen for the screen field name in the table control.But it is not working. Can anyone give me the possible solution . Thanx in advance.
    With Regards,
    Ajit.

    >
    Vivek Joshi wrote:
    > Hello Router ,
    >                      I do not want to set the focus , I want to get focus . User can click on any cell in the table and then press a button in the toolbar . Now in the event handler of the button i want to under which column User has set the focus .
    > I hope , I am clear now .
    > Thanks for your help
    > Regards
    > Vivek
    An yet you keep getting suggestions of how to set the focus.   I looked through the API documentation and I don't see anything that would suggest you can request to see where the current focus is.  Perhaps someone might still come along with a solution, but my hopes wouldn't be too high at this point.  I can pass the requirement onto Product Definition, as the use case does seem interesting.  Perhaps it is something we have even considered in the past. 
    But for now, there might be a better way to solve your problem.  It will probably mean redesign the interaction.  What exactly are your requirements?  Do you need to be able to get the data in a particular cell of table when a button is clicked?  Just throwing out some ideas here, but maybe just use the lead selection to select the row, but then have a button choice to choose the action associated with the column you want. A hack for sure - but it might work.  Also it doesn't help you right now, but in the near future update to NetWeaver 7.0, WDA does have a onColSelect event for the table.

  • How can i send an error message at EXIT_SAPMM06E_013 ?

    Hi
    I'm making some validations to Vendor and Partner Functions (table control in 'Partners' Strip) in Creting/Changing Purchase Orders (ME21N/ME22N). 
    I know the suitable user exit is EXIT_SAPMM06E_012 for making validation before saving, but this exit does not has (receive) the table with Partner Functions so i could validate them.
    Then I use the Exit _013, wich executes when saving the PO, because this exit has the captured Partners table (XEKPA).
    But, when i make the validations and try to send a error mesage,  the system shows other message type info (window) like 'The requested object is locked by another transaction' and then another like 'System error (error in method PO_POST)'.
    I think this it's because the exit _013 is better suitable to make customer updates and not validations, that it's because just passing by MESSAGE Ennn(cc) command makes the methods catch my error and send other errors and close the transaction.
    Does somebody can help me ??
    How can i send error messages in exit _013 ??
    Or is this incorrect ??
    Or in wich User Exit can i validate the Partner Functions ??
    I really will aprettiate if somebody can help me, because i'm delayed with my development !!
    Regards

    Hi Frank,
    The eror message you are getting seems to be coming from somewgere else and may be due to the same PO being cahnged in another transaction or have you put some code in BADI ME_PROCESS_PO ( Method POST) .
    You can try by commenting out the code in EXIT 13 .
    If this does not work then use EXIT 12 only and below is the code you can use to access XEKPA in exit 12.
    DATA IT_EKPA LIKE EKPA OCCURS 0 WITH HEADER LINE.
    DATA NAME(50) VALUE '(SAPLMEPO)XEKPA[]'.
    DATA NAME1(50) VALUE '(SAPMM06E)XEKPA[]'.
    FIELD-SYMBOLS <F1> TYPE ANY .
    IF SY-TCODE+4(1) = 'N'.
    ASSIGN (NAME) TO <F1>.
    ELSE.
    ASSIGN (NAME1) TO <F1>.
    ENDIF.
    IT_EKPA[] = <F1>.
    ( Now you have the data in IT_EKPA table which you can use to validate )
    Cheers

  • Duplicate material entry at the time of PO creation based order type

    How Restrict duplicate material entry at the time of PO creation based on define order type.
    Moderator message: please do some research before asking.
    Edited by: Thomas Zloch on Mar 11, 2011 1:45 PM

    Hi Rahul,
    try with This Badi  ME_PROCESS_PO , Method Open or Process item,
    Implemente it and use a break-point to test it i.e it is triggred or nt , before processing it.
    Regards,
    Abhisek

  • Changing the Material at the time of PO Creation

    Hi All,
    We have a scenario where user enter the Material-01 in ME21N and while posting the document ,we have to replace the material with Material-02.
    We tried to do so in BADI ME_PROCESS_PO_CUST method PROCESS_ITEM.
    But it is not displaying/changing.
    In the Badi while making the changes and Set_data  ..we are not getting any error...but it is not showing on the screen and data base.
    Please suggest.
    Thanks
    RK

    Hi Rahul,
    try with This Badi  ME_PROCESS_PO , Method Open or Process item,
    Implemente it and use a break-point to test it i.e it is triggred or nt , before processing it.
    Regards,
    Abhisek

  • How can i block PO adopt from PR with no release tab

    Dear Experts,
    I need to block PO creation ( by adoptation of PR) from PR which has no release tab active. Kindly help me how can i do this.
    From unreleased PR , PO can not be created and it is standard SAP function. But if PR has no release tab then PO can be created from that PR and no error or warning is there. But i need to block PO creaation from the PR which as no released tab active.
    Please help.
    Kind regards,
    Zusen

    Hi Zusen,
    Would not be good idea to place those PRs in release strategy? In this way PO(s) will not be created until PR(s) is released. Have a look at release strategy of PR under the path; IMG-Materials Management-Purchasing-Purchase Requisition-Release Procedure
    Otherwise you have to develop some coding. You can use BADI: ME_PROCESS_PO in order to control unreleased PR. If EBAN-FRGRL is NULL in PO then you can place an error message as you want.
    Kind regards

  • I am not getting the upload poin and recipient feilds in the PO.

    Hi Friends,
    When i am converting a  Purchase Order with reference to Purchase Requisition with account assignment cat = network  and uploading point field data and recipient data  and the item type D ,we are not getting uploading point data and recipient data.
    for this i used BADI ME_PROCESS_PO
    and the INTERFACE    IF_EX_ME_PROCESS_REQ
    I REALLY DONT NO HOW TO USE METHODS AND HOW TO WRITE A CODE IN THAT PLEASE HELP ME TO GET THE VALUES OF UPLOADING POINT AND RECIPIENT FIELDS DATA SHOULD POPULATE IN PURCHASE ORDER WITH RESPECT TO THA PURCHASE REQUISITION.
    HELP ME WITH SUITABLE CODE FOR THE METHOD...
    THANKS IN ADVANCE ........
    UPENDAR G

    I would just like to add to Billy's remarks: PL/SQL exception management is not just a language function, it also affects the database itself.
    If you "swallow" exceptions, you have defeated the language and you have probably also corrupted data.
    Why do I say this? Because PL/SQL exceptions cause changes in the data to roll back. If you "swallow" the exception, whatever changes you made before the error happened will not be rolled back. This is a huge threat to transactional integrity.
    Here is a demonstration:SQL> create table t(k number);
    table T created.
    SQL> begin
    insert into t values(1);
    insert into t values('a');
    end;
    Error starting at line 6 in command:
    begin
    insert into t values(1);
    insert into t values('a');
    end;
    Error report:
    ORA-01722: invalid number
    ORA-06512: at line 3
    01722. 00000 -  "invalid number"
    *Cause:   
    *Action:
    SQL> select * from t;
    NO ROWS SELECTEDYou see, the "correct" insert into table t was rolled back automatically. This ensures the "all or nothing" property of transactions called "atomicity".
    Now look what happens if you "swallow" the exception:SQL> begin
    insert into t values(1);
    insert into t values('a');
    EXCEPTION WHEN OTHERS THEN NULL;
    end;
    anonymous block completed
    SQL> select * from t;
    K
    1The first insert is not rolled back, so if the calling program commits you will have changed data without respecting transaction boundaries.

  • PO Document date filed editable

    hi all,
    can I make the PO Document date field editable?
    if so, is it possuible to make it editable for a particular document type?
    i have checked the field selsection in SPRO, but could not find the Document date field,
    please help.
    regards,
    kumar

    hi,
    thanks for your quick replies.
    in T.Code ME21N,
    In our sandbox client, the field Document date is editable.
    but in QA, and PRD clients it is in display mode.
    so, wanted to understand why it is editable in DEV client?
    I have checked, the Badi ME_Process_PO ;
    I think, we have not implemented any thing for document date.
    do we have to implement it to make that field editable or is is any standard setting?
    awaiting your replies....
    regards,
    kumar

  • Auto triggering of IDOC after PO creation

    Hi,
    Currently after creation of PO, the PO will get triggered automatically to other system in the form of IDOC.
    For this we have assign the condition record for the PO vendor and used the standard SAP function module 'IDOC_OUTPUT_ORDERS' to create the IDOC.
    But now we have a requirement like for some POs the IDOC should not get auto triggered to other system.
    Do we have any user exit available to not to call the SAP standard FM used to create the IDOC??
    or Is there any way we can stop auto triggering of POs
    Thanks
    Nishad Shimpi

    Hi,
    try using  the Badi : ME_PROCESS_PO--method-POST. where you check the condition and  trigger the IDOCs.
    OR else restrict using the conditions records,
    Regards,
    Aditya

  • Output withholding tax in Purchase Order

    Dear,
    We are now going to start using withholding tax function but meet some problems;
    Withholding Tax Code is now set on vendor master, but seems not be able to output on purchase order.
    Is there any way  to output withholding tax code and withholding tax value for purchase order ?
    [FYR]
    Now we are not using withholdig tax code in R/3 function but using condition type to output the value to purcase order.
    We want to start using withholding tax code in R/3 function instead of condition type.
    Thanks,

    Thanks for your response.
    Now we have searched for BAdi "ME_PROCESS_PO" in SE18 but I couldn't find it.
    Anyway, you mean we cannot output withholding tax in PO , with any customizing in 4.6C?
    Now we are planning upgrade for ERP 6.0 in this year.
    Is there IMG menu for output withholding tax in PO, in ERP6.0?
    Waiting for your reply.
    Thanks and Regards,

  • Purchase order item - avoid delete

    Hi Expert,
    I have to make a control to avoid the deletion of an item of purchase order.
    In other word, when the user press the delete button in the item of purchase order, I have to check variable A.
    If A = 'X' --> avoid delete item, and pop for info
    else.
    delete item
    endif.
    How I can make it ? There's a BADI, or an user exit ?
    Tks a lot.

    Hello,
    Please implement the Badi "ME_PROCESS_PO" in that go to
    if_ex_me_process_po_cust~process_item.
    Write the code
      DATA : re_data TYPE mepoitem.
      DATA : mmmfd_preq_no       TYPE mmpur_metafield VALUE 003.  "Banfnummer
      INCLUDE mm_messages_mac. "useful macros for message handling
      CALL METHOD im_item->get_data
        RECEIVING
          re_data = re_data.
      IF re_data-lokez ne space.
        CALL METHOD im_item->invalidate( ).
        mmpur_metafield mmmfd_preq_no.
      mmpur_message_forced 'E' 'ME' '083' text-003 'Deletion not allowed' '' ''.  ENDIF.

  • Meaning of MMPUR_FIELDSTATUS

    Hi all,
    I'm working with BADI for purchase documents. The question is that I must set a value for this element. I'm looking for the meaning of possible values (ie: + . * -). I think that * is view (demo for BADI ME_PROCESS_PO, method FIELDSELECTION_ITEM), but I don't find nothing (except the value *).
    Thanks in advance.
    Best Regards,
    Eduardo

    Hi,
    I found the following code in the where used list of the structure.
    case l_field_status. ( MMPUR_FIELDSTATUS)
         when '+'.
            screen-intensified = '1'.
           screen-required = '0'.
         when '.'.
           screen-required = '0'.
         when '-'.
           screen-required = '0'.
           screen-input = '0'.
           screen-output = '0'.
           screen-invisible = '1'.
         when '*'.
           screen-required = '0'.
           screen-input = '0'.
       endcase.
    Hope it helps.
    Sujay

  • SAPLMEPO control accounting tab field selection

    The requirement has been given that when a PO is created with reference to another document that the accounting should not be able to be changed. On the surface this seems like a simple requirement. However I have yet to find a solution. Standard field selections seem not to show the accounting fields. The BADI ME_PROCESS_PO, which does cover modification of the accounting fields, is not open for customer implementation and the BADI ME_PROCESS_PO_CUST does not cover field selection for for accounting fields.
    So am I forced to do an implict/explicit enhancment to LMEPOF3I?

    You guys misunderstood.
    Here's my business flow:
    I enter PR with account assignment K, input cost center and then save.
    After PR is released, there's only storage location can be changed.
    So I set up my own field seletion key in which I set storage location as optional, and other fields as display.
    But when I use ME52N to check my released PR, not only storage location but also all the fields in Account Assignment Tab can be changed!
    I can't find the corresbonding setting for cost center or GL account in "Define Screen Layout at Document Level".
    I can't use OME9 either, because once I set cost center as display, I have no change to enter even if I use ME51N.
    Sorry I didn't make myself clear enough. Hope you understand now and please help me to solve it. Thanks a lot.

  • Change Data of Purchase Requisition or PO

    Hello techies,
    I'm trying to find an user-exit or BADI in order to change the Purchase Requisition item line. If possible it's also fine to change the item line of the Purchase order.
    I want to change the material number.
    Best Regards,
    Frederik

    Hi,
    Check the BADi
    ME_PROCESS_PO.
    Hope it helps.
    Regards,
    Shashank

Maybe you are looking for

  • [39008] Logical dimension table X has a source that does not join to any...

    Hi Gurus, I have warning: "[39008] Logical dimension table X has a source that does not join to any fact source" WHERE X: PROMOTIONS,PRODUCTS, CUSTOMERS, CHANNELS but all logical table are mapped to fact. Eveb I can create reports for them (The metad

  • Problem updating

    I have, as many here, problem with dreamweaver 8 remembering FTP username and password. I tried to install dreamweaver 8.0.2 update, but all I get is corrupted file. 8.0.1 installs successfully but when I check help>about it shows current version 8.0

  • Referencing the main timeline from elsewhere

    From inside a movie clip (button) which is inside a display object (buttonSet), I want to gotoAndPlay a specific frame on the main timeline. I've tried stage.gotoAndPlay(thisFrame). I got closer with gotoAndPlay(stage.thisFrame). I still have somethi

  • Present string data as boolean !

    hello ! i am recieving data from UDP READ FUNCTION as string and want to present it as bits (like 10011100-11001100.....) the string indicator allows me to see the data as HEX/CODES/ASCII only. your help please. Solved! Go to Solution.

  • PDF in IE5

    Hi,I tried to run my report with PDF format in IE5. My report contains main report and drill-down reports. It works fine with displaying my main report, but when I click in my main report to drill-down to another report, there is an error message pop