Raise an Error message in ME21N

Dear All,
I am using user exit (SRVDET: EXIT_SAPLMLSP_040) to raise an Error message, it will terminate ME21N by the Error message. Did anyone know how to make it return to ME21N after an Error message...
I try to set screen to 500, 210...etc. but it seems make the program hung after leave screen. Any idea? Thanks a lot!
BR,
Well

Hi
Try to use the BADI ME_PROCESS_PO_CUST
and raise the error message
see the sample code
BAdI Name: ZCHECK_PO_LINE_ITEM (Implementation name) PO Account assignment
Definition Name: ME_PROCESS_PO_CUST
Interface Name : IF_EX_ME_PROCESS_PO_CUST
Implementing Class: ZCL_IM_BADIN_ACCOUNT_ASSGN
Method :            PROCESS_HEADER
METHOD if_ex_me_process_po_cust~process_header .
  DATA : re_data TYPE mepoheader.
*get the item data
  CALL METHOD im_header->get_data
    RECEIVING
      re_data = re_data.
  re_header = re_data.
  IF ( re_data-bsart NE 'ZOC' AND re_data-bsart NE 'ZPC' ).
    IF ( re_data-bsart <> 'ZIC' AND re_data-bsart <> 'UB' ).
      IF re_data-bukrs NE '1001'.
        MESSAGE ID 'ZM_MSG' TYPE 'E' NUMBER '000' WITH 'Use only Sipchem Company'
                                        'Code for External Procurement'.
      ENDIF.
    ENDIF.
  ENDIF.
ENDMETHOD.
Method :            PROCESS_ITEM
METHOD if_ex_me_process_po_cust~process_item .
  DATA: v_menge TYPE bamng,   " PR Quantity
        v_statu.              " PR Status
  DATA : re_data TYPE  mepoitem,
       re_data1 TYPE mepoaccounting,
re_accountings TYPE purchase_order_accountings ,
header TYPE purchase_order_accounting.
*get the item data
  CALL METHOD im_item->get_data
    RECEIVING
      re_data = re_data.
  IF ( re_header-bsart NE 'ZOC' AND re_header-bsart NE 'ZPC' ).
    IF re_header-bsart EQ 'ZRL'.
      IF re_data-konnr EQ space.
    MESSAGE ID 'ZM_MSG' TYPE 'E' NUMBER '000' WITH 'You cant create a Release order'
                                          'without a reference to Outline Agreeement'.
      ENDIF.
    ENDIF.
    IF ( re_data-banfn EQ space AND re_data-anfnr EQ space ).
      MESSAGE ID 'ZM_MSG' TYPE 'E' NUMBER '000' WITH 'You can create a Purchase order'
                                                     'only with reference to a PR or RFQ'.
    ENDIF.
    IF re_data-knttp NE 'K' AND re_data-pstyp NE '9' .
      IF syst-cprog EQ 'RM_MEPO_GUI'.
        IF re_data-uebto IS NOT INITIAL OR
           re_data-uebtk IS NOT INITIAL OR
           re_data-untto IS NOT INITIAL.
      MESSAGE ID 'ZM_MSG' TYPE 'E' NUMBER '000' WITH 'You cant change delivery settings'.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDIF.
ENDMETHOD.
<b>Reward points for useful Answers</b>
Regards
Anji

Similar Messages

  • Error message in ME21n / me22n (on save)

    Hi Gurus
               I need to raise a error message in ME21n for which I am using ZXM06U44 and EXIT_SAPMM06E_013
    I followed this link to help me out... https://forums.sdn.sap.com/click.jspa?searchID=20007769&messageID=6723170
    I am getting a information message even though I gave a message of type E. I tired two options:
    1.
    *    mmpur_message 'E' 'ZV' '013' lv_lifnr lv_bukrs text-t00 text-t01 .
    2.
    MESSAGE e013(zv).
    none of these was able to give a error message..

    Use BAdi:ME_PROCESS_PO_CUST
    Method:PROCESS_ITEM/PROCESS_HEADER"As per your Requirement.
    DATA : re_data TYPE mepoitem.
      CALL METHOD im_item->get_data
        RECEIVING
          re_data = re_data.
    "Check for account assignment cat only for "A" and "L".
      IF re_data-knttp = 'L' OR re_data-knttp = 'A'.
        GET PARAMETER ID 'KNT' FIELD re_data-knttp.
        IF sy-subrc NE 0.
          MESSAGE 'You are not aurthorized to use Account Assignment Category (Logit)L!!' TYPE 'E'.
        ENDIF.
      ENDIF.
    I got Error Message in Incomplete log.

  • How to raise multiple error messages at a time in a BADI

    Hi all,
    I'm using CHECK method of BADI ME_PROCESS_PO_CUST for some validation in ME21N/ME22N. I want to raise multiple error message at a time, when user clicks on Check button or Save button. Please let me know, is there any function module for this or is there any particular procedure for this?
    Thanks in Advance,
    Siva Sankar.

    Hi,
    Raising messages from within BAdis is not a good choice and from the look of it , it appears to be causing a dump.
    Look if the BAdi interface has any exceptions defined for the method, if so, raise the exception with your message like:
    MESSAGE e002(sy) WITH 'Error' RAISING <badi_exception>.
    Otherwise call the FM POPUP_TO_CONFIRM To show msgs to user
    Regards
    Kiran Sure

  • Problem after raising an Error message in VA01

    Requirement: I need to raise an error message when a particular item and sold to party combination is not having any live contract.
    What I did: In USEREXIT_MOVE_FIELD_TO_VBED.
    1.     XVBAP having item details
    2.     VBAK structure having header details (I will get sold to party here)
    3.     VAPMA structure having the contract detail if any contract is exist.
    Here I raised an error message and its getting raised properly.
    Problem: Once the error message came I can’t able to clear or delete that line item (in va01 screen), I am getting an error message” No item category is available” only I can go back without saving.
    And I have tried in USEREXIT_MOVE_FIELD_TO_VBAP. Here I am not able to access the contract details from VAPMA (coming as blank)
    Please help me to clear this problem

    Use the form-exit USEREXIT_MOVE_FIELD_TO_VBAP.
    You can retrieve the VAPMA data as:
      SELECT * FROM VAPMA WHERE MATNR = US_MATNR AND
                                VKORG = US_VKORG AND
                                TRVOG = US_TRVOG AND
                                VTWEG = US_VTWEG AND
                                SPART = US_SPART AND
                                KUNNR = US_KUNNR.
    You will find this code in form VAPMA_SELECT in include MV45AFDB_VAPMA_SELECT

  • The adapter "SQL" raised an error message. Details "Login timeout expired".

    Hi All
    Please help me to understand "Login timeout". All feedback is welcome.
    BizTalk Server 2009 on Windows Server 2008 R2 64 bit
    SQL Server 2008 SP1 64 bit
    BizTalk Adapter Pack 2.0
    Event Viewer -> Windows Logs -> Application
    The adapter "SQL" raised an error message. Details "Login timeout expired".
    The adapter failed to transmit message going to send port "ALL.Exceptions" with URL "SQL://xxxxxxxxx/EsbExceptionDb/". It will be retransmitted after the retry interval specified for this Send Port. Details:"Login timeout expired".
    Regards
    Steve

    Hi Abhishek,
    Thank you for your input.
    I found errors in the Table [EsbExceptionDb].[dbo].[Fault] relating to the write to the target Oracle database
    Microsoft.ServiceModel.Channels.Common.MetadataException: Metadata resolution failed for OperationId:ATHENA/Table/WO_ADDITIONAL/Delete ---> System.TimeoutException: Timeout Expired     at
    The BizTalk send port timeout has been increased from 1 minute to 30 minute and all is well
    Regards
    Steve

  • TMG events and raising an error message

    I have written the code in TMG events and raising an error message for a certain condition.Whenever the error message is getting triggered it is making all the fields read only.So the user is not be able to change the value.
    Any Solutions Please.?

    Hi,
    It TMG events will be triggered after entering values in other field and -> press enter
    Follow the steps.
    Go to se11 check table maintanance check box under
    attributes tab
    utilities-table maintanance Generator->
    create function group and assign it under
    function group input box.
    also assign authorization group default &NC& .
    select standard recording routine radio in table
    table mainitainence generator to move table
    contents to quality and production by assigning
    it to request.
    select maintaience type as single step.
    maintainence screen as system generated numbers
    this dialog box appears when you click on create
    button
    save and activate table
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm
    One step, two step in Table Maintenance Generator
    Single step: Only overview screen is created i.e. the Table Maintenance Program will have only one screen where you can add, delete or edit records.
    Two step: Two screens namely the overview screen and Single screen are created. The user can see the key fields in the first screen and can further go on to edit further details.
    please check the link for getting information about table maintenance generator !
    https://www.sdn.sap.com/irj/sdn/advancedsearch?query=use%20of%20table%20maintenance%20generator&cat=sdn_all
    http://www.sapdevelopment.co.uk/tips/tips_tabmaint_tcode.htm
    http://www.sap-img.com/abap/create-a-table-maintance-program-for-a-z-table.htm
    Regards,
    Raj.

  • Error message in Me21n tcode

    Hi,
       we have developed a  user exit to get error message when po value is greater than some amount in me21n tcode. am getting error message when entering all items. But when  press SAVE button  i want that error message also. But am not getting that error message in that time.How i can write a code for that.

    Hi Geetha,
    For that requirement you have to code in  EXIT_SAPMM06E_012 or  EXIT_SAPMM06E_013 MM06E005.
    EXIT_SAPMM06E_012 : it will get triggered whenever you press HOLD,CHECK or SAVE button
    EXIT_SAPMM06E_013 : it will get triggered just before saving the PO.
    Thanks & Regards,
    Faheem.

  • How to display long error message in ME21N

    Hi,
    How to display a long error text (in multiple lines) in ME21N / ME22N message popup we get while saving or checking the PO. My error message length is 100 chars. It is displaying only 40 chars in a single line. My requirement is to display that in multiple lines of message popup. Please let me know asap.
    Thnks in Advance.

    Hi,
    Messages have long texts.... Uncheck the self-explanatory box, change your long message to a short one, place your long message in the long text of your message. SAP should handle the rest.
    Reward if helpfull...
    Cheers,
    Ameen.

  • Raise an ERROR message from Script logic

    Hi All
    Here i have developed a custom copy funtion im not using standard copy functionality.
    I am trying to copy from working version to another version ex: V01 to V02. I have scoped these two versoins in script logic.
    But when user runs DM package for a different version other than v01 and v02 then user has to get the error message.
    Can i achive this by including some code in the script logic. i dont want to use the security options on user level.
    is there any function to raise error??
    Please suggest thanks in advance.
    Regards
    AK

    Hi AK,
    As I understood from your question, you want to copy always from V01 to V02. No other versions will be used other than these 2. So, it will be better to have them hardcoded in your script logic, instead of keeping error messages for the user. Anyways, you dont want the user to enter anything other than V01 and V02.
    Hope this helps.

  • Display Error Message in ME21N

    Hi,
    As per my requirement, I need to display an error message while creating a PO based on certain conditions. I tried the Exit: EXIT_SAPMM06E_012 using which i can stop the creation of PO but it gives a pop up box saying HOLD or EDIT. Inside edit i can find my custom error message. The requirement is to print this error message at the task bar and not to allow the HOLD option to come. The creation of the PO should stop immediately after displaying an error msg at the task bar and before the Hold option.
    Please suggest which exit i need to use...

    Hi,
    You want to restrict the standard msg and instead of that u want to show your message,  i feel you can't erase the stnd message.
    However, try to use  where-used- list for that message using se93 mess no.
    Best thing, is to find the implicit enhancement and insert the message before your HOLD  mesages get populated.
    Try this keeping break point at ' MM06EFDCM' debug to find the excat place.
    Hope this will help you as i have done same for the similar type of requirment.

  • Raising custom error message in generic service initialize method of Pr&for

    Dear all,
    I am developing the HCM process form.
    Is it possible to raise an error if any condition is not met in initialize method in generic service of HCM process & forms?
    If possible could you please provide me the steps/process.
    Thanks & Regards,
    Krishna K

    Change for a BADI more suited (not in the update of after-save process) like ME_PROCESS_PO_CUST (Method PROCESS_ITEM, CHECK).
    ME_PURCHDOC_POSTED  is too late.
    Regards

  • Error message in ME21N and ME22N

    Dear Friends,
    I am facing one problem... my requirement is at the time of saving purchase order i need to check some thing and if that check fails i need to display the error message and needs to stop the creation of purchase order. That error message at the status bar also ok and pop up also ok. But when i try to display that error message in one exit 'EXIT_SAPMM06E_012' then the eror message is not coming properly.. i mean it is displaying one box under that one red symbol and in the message comming my message class name. I could not able to display the proper error message in proper way.
    I have tried one BADI also post save method that is displaying error message properly but immediately after that i am getting one more pop up saying system error with POST_METHOD some thing like that. I haVe checked in debugging that second error message is displaying from the standard program (message class : ME and number 816) but i dont want that second pop up. How to skip that and how to provide proper error message.
    Any help will be highly appreciated.
    Thanks a lot in advance,

    Hi,
    here is the sample of the code we have used in our system.
    restrict logic based on Document Type and Company Code
    IF i_ekko-bsart EQ c_ub AND i_ekko-bukrs EQ 'XXXX'.
    loop at Line Items of PO
      LOOP AT tekpo WHERE loekz EQ space.
      if Receiving Plant is YYYY and Storage Location is NULL
        IF tekpo-werks = 'YYYY' AND
           tekpo-lgort = space.
        issue error message
          MESSAGE ID 'ZM' TYPE 'E' NUMBER '042' WITH
              tekpo-ebelp                               "line item
              tekpo-werks.                              "receiving plant
        ENDIF.          "receiving plant/storage location
      ENDLOOP.
    ENDIF.          "document type
    Hope this helps.
    -Ramesh

  • How to raise an error message when duplicate value is entered in a tabular field column? Basically not allow duplicate value at the form level.

    Hi all,
    I have created a form with one data block MATURED_FD_DTL which looks like below:
    ACCT_FD_NO
    CUST_CODE
    FD_AMT
    FD_INT_BAL
    TDS
    CHQ_NO
    ADD_FD_AMT
    P_SAP_CODE
    P_TYPE
    CREATE TABLE MATURED_FD_DTL
      ACCT_FD_NO    VARCHAR2(17 BYTE)               NOT NULL,
      CUST_CODE     NUMBER(9),
      FD_AMT        NUMBER(15),
      FD_INT_BAL    NUMBER(15),
      TDS           NUMBER(15),
      CHQ_NO        NUMBER(10),
      ADD_FD_AMT    NUMBER(15),
      P_SAP_CODE    NUMBER(10),
      P_TYPE        VARCHAR2(1 BYTE)
    For MATURED_FD_DT.ACCT_FD_NO, Trigger: KEY_NEXT_ITEM, I have written the following code:
    DECLARE
    V1 NUMBER;
    V2 NUMBER;
    BEGIN
    V1:=:MATURED_FD_DTL.ACCT_FD_NO;
    MESSAGE('V1:'||V1);
    MESSAGE(' ');
    END;
         GO_ITEM('MATURED_FD_DTL.CUST_CODE');
    This is just a dummy code.
    When ever i enter the value in the field of ACCT_FD_NO, it pops up a message saying "V1:Value of ACCT_FD_NO",
    So i want to store that value .
    Compare them & if it is egual, it should pop up a message saying duplicate value is entered and must not allow to enter, at form_level.
    So how can I compare the ACCT_FD_NO value between FIRST_RECORD and NEXT_RECORD ??
    Help Me .
    Thank You.
    Oracle Forms 6i.
    Oracle 9i.

    Thank You HamidHelal.
    Actually before posting the code, I went through the first link you have mentioned. I tried also, it is quite tedious procedure, however i dint get the proper result, may be i have done some mistake. Anyways , can you tell me how do i check in database table, if a value exists OR IF VALUE FOUND & then message and raise form trigger failure; something like below.
    IF :MATURED_FD_DTL.ACCT_FD_NO EXISTS
    THEN MESSAGE('YOU HAVE ENTERED AN EXISTING OR DUPLICATE VALUE');
              MESSAGE(' ');
    RAISE FORM_TRIGGER_FAILURE;
    END;
    OR
    IF :MATURED_FD_DTL.ACCT_FD_NO FOUND
    THEN MESSAGE('YOU HAVE ENTERED AN EXISTING OR DUPLICATE VALUE');
              MESSAGE(' ');
    RAISE FORM_TRIGGER_FAILURE;
    END;
    Is there any equivalent in the form in oracle forms 6i?? Please let me know how do i do this??

  • Is it possible to add error message in me21n  ?

    i post this question before  , but didn't
    get any answer .
    i add subscreen to me21n by (MM06E005).
    now i want to add message to inforce the user to fill
    the field in the tab .
    i tried to do so in the exit but its just lock the
    customer data tab .
    i tried exit EXIT_SAPMM06E_012  .
    the problem's are :
    1) is possible  ?
    2) if yes than where ?  (EXIT_SAPMM06E_012 ? )
    3) if yes how can i solve the problem that in the edit
    ( in the save process ) the user don't get the customer data tab of my ( go back to the last tab he was ) ?

    Hi,
    Yes..The macro is available in the top include of the user exit..
    You can use it as I mentioned above..
    I took the example from a standard program..The l_illegal_char is a field..
    Try this example..
    mmpur_message 'E' '00' '208' 'Custom field not populated' '' '' ''.
    Thanks,
    Naren

  • Raising Custom error message during posting

    Hi All,
    I have a requirement , while vendor/customer posting (Say in FB01 one will be Vendor line item and other will be GL line item). If the user enters the GL line item first then it should throw an error and should not allow the user to post the document.
    Please help me how to achieve this.
    Regards,
    SK

    Hi,
       You can achieve this through Validation. Create a validation in GGB0
    Create Validation  
    prerequisite: Transaction code = (give the transaction code that you want) FB01 and Line Item = 001
    Check: Posting Key= Vendor posting key or Customer posting key
    Message: Enter Message type as E
    Message number: 001 (for eg)
    Message text: Entry allowed only for Vendors/ customers or what ever text ou want to give you can enter.
    For message number and text goto SE91 and select the message class and then change
    Select the next free number and enter the text.
    Regards,
    B. Radhika.

Maybe you are looking for

  • Report runs OK through concurrent program, but not when called through URL

    We have a custom 6i report developed that works successfully 100% of the time when run through a concurrent program. We are now attempting to integrate this into an OAF application. To do this, we build the necessary call to the reports server by rea

  • How do I use the back button to go back more than 1 step?

    In previous versions of Firefox and common in other browsers is a small pull-down option on the back button that will allow the user to go back more than 1 step in browsing history. Typically, the pulldown will show a chronological list of recent sit

  • Servlet output problem

    hi Im having a problem with reading some data out of my servlet textbox. the user pastes some data into the textbox below and tixks the checkbox if the first column is headings. <BR><TEXTAREA NAME="Paste" ROWS="15" COLS="65"></TEXTAREA> <ul> <INPUT T

  • Notification Comments are storing in which database table?

    Hi All, Can anyone help me to find the table name in which notification comments are storing (like checklist notification or Leave approval notification)

  • Safari4Windows: how to hilite multiple files for deletion

    Am asking about Links/URLs  in the 'Bookmarks' section on the left side (the caps title 'Bookmarks' below the Collections section and NOT anything IN the Collections section) . I have several  hundred and can't take the time to delete each one.