Populate Error message in CRMD_ORDER

Dear all,
I need to launch Error message in Service Order(CRMD_ORDER) when net_value is more than 1000.
And i got that FM CRM_MESSAGES_DISPLAY can achieve that. But I'm having confusion on the FM. I coded it as below:
CALL FUNCTION 'CRM_MESSAGES_DISPLAY'
EXPORTING
   IV_DOCUMENT_NUMBER              = IV_REF_GUID
   IV_REPID                        = sy-repid
   IV_DYNNR                        = sy-dynnr.
May i know how can i populate my customize message into the FM's structure? and which should i populate to?
Please guide.
Thanks in advance.

Technically you are doing the wrong technique if raising an error message in the event handler or BADI.  You need to use the following code construct instead
data:
       ls_msgidno type bal_s_idno,
       lt_msgidno type  bal_r_idno,
       lv_save_message    type c.
* Delete existing error messages
  ls_msgidno-sign       = 'I'.
  ls_msgidno-option     = 'EQ'.
  ls_msgidno-low-msgid  = 'ZCMPL'.
  ls_msgidno-low-msgno  = '000'.
  append ls_msgidno to lt_msgidno.
  call function 'CRM_MESSAGES_DELETE'
    EXPORTING
      it_r_msgidno   = lt_msgidno
      iv_ref_object  = is_customer_h_wrk-guid
      iv_caller_name = 'CUSTOMER_H'.
* Now if error message condition occurs then raise the message
      message id 'ZCMPL' type 'E' number '000'
            into lv_save_message.
      call function 'CRM_MESSAGE_COLLECT'
        EXPORTING
          iv_caller_name = 'CUSTOMER_H'
          iv_fieldname   = 'ZFIELD'
          iv_ref_object  = is_customer_h_wrk-guid.
You need to replace CUSTOMER_H with the segment of the business transaction where the error is being raised and ZFIELD with the name of the field that caused the error condition.
This will then add the error message to the list of error messages for the business transaction.
Take care,
Stephen

Similar Messages

  • Populate Error Message while submitting Travel Request if Supervisor(A002) relationship is not maintained for employee

    Hi Team,
    We have a requirement to "Populate Error Message(Supervisor not Maintained) while submitting Travel Request if Supervisor(A002) relationship is not maintained for employee in ESS.
    We are using standard WDA application - FITV_REQUEST and standard travel request workfow - WS20000050.
    Please suggest how to do this.
    Thanks,
    Ravi

    Hi Rajesh,
    Thanks for the reply...
    We created enhancement for FM HRTRV_IF_GET_CUSTOMIZING and written code in that.
    So by this if Logged in Employee is not assgned with Line Manager , it will throw error while accessing "Create Travel Request application".
    Thanks,
    Ravi.

  • Populate Error Message using  MB_MIGO_BADI

    Hi Friends,
      My requirement is whenever the user does a goods receipt using transaction "MIGO" I need to check whether the item selected has an indicator "Delivery Completed" at the PO level and if this indicator is set for this PO item I need to throw an Error message and should not allow the user to create a GR against that item. I have implemented the BADI "MB_MIGO_BADI" for this purpose and I am using the method "POST_DOCUMENT" to check the PO item and throw an error message, bu the issue is afterI  throw an error message and when the user tries to exit from the transaction MIGO using the exit button, the system throws an short dump " Screen: Illegal message" because the program attempted to issue a " " message during "Exit Command" processing. In order to avoid this i tried the method "CHECK_ITEM" to populate the error message to application log, it works fine but I am not able to get the line item details inside this method. I even tried to import the line item details from the method "LINE_MODIFY" and then use it in "CHECK_ITEM" method, but the issue here is CHECK_ITEM is called only once for all the line item, ""LINE_MODIFY" was called every time i change the line item, so I was not able to use it. Can you please let me know if there is any other better way to achieve this.
    As per the below weblog, this scenario is available as part of the standard in ECC Ehp4, but unfortunately we are on Ehp1.
    Delivery Complete Indicator of PO and Goods Receipt

    Dear Imran,
       To achieve the best possible solution you have to use two methods of this BADI in combination with each other. These two methods are 'LINE_MODIFY' and 'CHECK_ITEM'.
       The method 'LINE_MODIFY' will be called every time there is some activity on the MIGO screen. In this method you will have both the item line id and the item structure available in the interface. You will need to create a class attribute which is an internal table of a locally defined structure. The first field of this  structure will be the line_item_id and the second will be the item structure itself. The first time when this method is called for a line item a new entry is inserted into this class level attribute. For each subsequent time this structure needs to be updated with the new values comparing the line item id.
      The method 'CHECK_ITEM' will be called when you press the 'CHECK' or the 'POST' buttons. In this method based on the line item id the corresponding item structure will be obtained from the class level attribute. Using the data of the structure you can then perform your validations and populate the BAPIRET2_TAB parameter with the message details which will then be dispayed in the popup message box in MIGO.
      Hope this helps.
    Best regards,
    Pradip

  • Populate error message if not selected any of the check box in select scren

    hi,
               I am working on a bdc program to upload selected fields, I have populated my 10 fields on selection screen. Given one check box for test run. If I have selected test run check box and not selected any of the field check boxes, it has to populate one error message message 'select atleast one field checkbox' and should stay on selection screen itself.  I used 'S' and used message leave list-processing, but i need error message 'E' and populate message select on check box and do not go for process.
    thanks & regards,
       Sekhar.

    Hi,
    as you don't want to process further and also want to stay on the same screen,then use this at
    AT SELECTION-SCREEN.
    if p_test_run = 'X' AND.......   " conditions for which msg is to be raised
        MESSAGE Ixxx(xyz).    " *use msg type 'I' Information message*
        LEAVE LIST-PROCESSING.
        LEAVE SCREEN.
    endif
    regards,
    neha
    Edited by: Neha Shukla on Mar 6, 2009 11:22 AM

  • How to populate error message in Tcode ML81N

    HI Experts,
    I have done development in ML81N tcode.
    In this Enchancement spot in FM "MS_SUBSCREEN_INFO_PBO".
    As per requirment code is developed. But I want to print error message when my condition is fail.
    In this case like this i have below statemnets are written.
        MESSAGE 'Error in EKPO' TYPE 'E'.
       mmpur_message 'E' 'ZMSG' '001'  v_srv_esll  '' '' '' .
        MESSAGE e001(ZMSG).
    but these statement are not supported .
    Please how can write error message. Help on this.
    You are get revared point.
    Advance Thanks for your help.
    Regards
    Srinu

    sloved

  • Populating an error message

    Hi,
      I need to populate an error message in crmd_order when the status is 'open' or 'dispatched' for uninstall order. how to get only these two status into a table??????
    Regards,
    Lakshmi

    Hi,
    CRM_MESSAGE_COLLECT can be used to collect the error message . It is not required to do anything specifically to show the same message in CRM UI aswell.
    Here is an example code :
    CONSTANTS:
       lc_message_class   TYPE symsgid  VALUE 'ZCF_CUST_MSG'.
    CALL FUNCTION 'CRM_MESSAGE_COLLECT'
              EXPORTING
                iv_caller_name = flt_val
                iv_ref_object  = <fs_data>-ref_guid
                iv_ref_kind    = <fs_data>-ref_kind
                iv_msgno       = '002'
                iv_msgid       = lc_message_class
                iv_msgty       = 'E'.
    flt_val should be the crm object name..
    You may use Badi : CRM_GEN_EXT_BADI by setting the FILTER with CRM object name (ex . STATUS ) .
    You can write the validation in the Check / Merge method.
    Best Regards,
    Karthik V

  • Populating error message based on search help

    Hi team,
    How can we populate error message in a shopping cart account assignment "order " field for the bellow two senarios. I am adding a custom field called "Operational Activity" in account assignment. based on which search help has to be done
    the 2 senarios are
    1. When user does not select the "Order" but tries to search for the operational activity, he should get error .
    2. When user selects the "Order" and this order has an operational activity linked to it, then give error message to input the OA The logic will be to do a RFC call to ECC by sending the SRM Order number BBP_PDACC-ORDER_NO to ECC table AFKO and see if there is AUFPL.
    Edited by: goutam kolluru on Nov 16, 2011 5:48 AM

    Hi Anshu,
    Thank for u replay.
    yes it can be done using doc_check_badi, but my question is how can we display error message by comparing search help values.
    if user is not entering value of order field and select  search help for custom operational activity field how it can be done in check badi.
    Edited by: goutam kolluru on Nov 16, 2011 6:54 AM
    Edited by: goutam kolluru on Nov 16, 2011 6:59 AM

  • Error message at the selection screen while processing screen logic

    Hi All,
      I need to show error message at the selection screen.
    I am calling the screen inside the START-OF-SELECTION, and processing the calculation and putting the data into i_final internal table. If internal table I_FINAL is empty I have to show error message saying ' DATA is empty' , this error message should be shown at the SELECTION SCREEN (Report input screen 1000) and provide the user to enter the input values once again.
    But whenever I am populating error message, I am getting a pop up to chose exit, and process is terminating.
    Since I am in the middle of the screen processing whenever I am giving a error message.
    Please let me know how can I populate error message without terminating the process while I was in the middle of the screen processing logic.
    Regards,
    Mahesh

    hi
    If u are trying to validate a field use
    AT SELECTION_SCREEN ON <field>
    if want to validate a block
    AT SELECTION SCREEN ON <block>
    If Universal Validation
    AT SELECTION SCREEN
    and display a 'E' Message inside the block.
    You can Enter Correct Value and start processing Forward.
    hope this will help.
    Regards
    Sumit Agarwal

  • How to populate a Error message in WebUI Screen

    Dear Experts,
    I have a small issue in Lead creation screen. I need to restrict the followup document if the lead end date is lesser than the system date, if the end date lesser than the system date system should through a error message in web Ui Screen and the lead follow up creation should be stoped.
    We found an enhancement spot in backend(GUI) of lead creation we raised the error message in the backend screen. Here its working fine, But we are not able to get any error message in WebUI lead creation screen.
    We written the code in CREATE_ORDER Method of lead creation in GUI ( tcode : CRMD_ORDER). We tried to debug the program using external debuger from webui but its not getting triggered.
    Pls suggest me, how to raise a error message for WEBUI lead follow up creation validation.
    Kindly do the needful.
    Reg,
    Anandhan

    HI Anandhan,
    Try this way,
    This should work.
    lr_global_messages type ref to cl_crm_genil_global_mess_cont,
            lr_core                 type ref to cl_crm_bol_core,
      "Instantiate the error message class.
      lr_core = cl_crm_bol_core=>get_instance( ).
      if lr_core is bound.
        lr_global_messages ?= lr_core->get_global_message_cont( ).
      endif.
            if lr_global_messages is bound.
              call method lr_global_messages->add_message
                exporting
                  iv_msg_type       = lv_msg_type
                  iv_msg_id         = '
                  iv_msg_number     =
                  iv_show_only_once = 'X'
                  iv_msg_v1         =
                  iv_msg_v2         =
            endif.

  • How do i pass the error message at header level in CRMD_order

    Hi all,
    i got one requirement like when i create/change the sevice order (CRMD_ORDER)
    if net_value is more than 1000 i have to set the message 'E' like 'order is blocked'
    else 'approved' at header level before going to save the order.
    please help me out it is high priority and as i am new to CRM.
    thanks in advance.
    Thank you,
    Madhu.

    Anil
         You have to look for a BADI to add the Error Message.
          Also use the FM CRM_MESSAGES_DISPLAY to display the message !
    Thanks
    <b>Allot points if this helps!</b>

  • How to populate the error message in OVS search popup

    Hi All
    We have the following requirement to display the error message in the OVS popup.
    currently we are opening an OVS popup on click of an action successfully.
    Currently we had put the error message in the ApplyResult() method, but error message was not displaying on the screen in the OVS popup itself & currently popup is being closed which should not happen
    Thanks
    Kalki Reddy

    Hi,
    Currently we had put the error message in the ApplyResult() method, but error message was not displaying on the screen in the OVS popup itself & currently popup is being closed which should not happen
    the OVS is not in our control its framework controlled. when applyResult method is called, framework automatically closes the pop up and shows the error messages in the main window( if any error is thrown in the apply result method) .
    Please give more details about ur requirement.
    regards,
    Akila

  • How to populate User defined Error message

    Hi
    i have a requirement as follows,
    we have 2 types users(patient and doctor) some fields are mandatory for doctor and some of them for patient creation.
    when they miss some fields while creating doctor it has to throw error message saying " these fields arer mandatory for doctor " same will follow for patient.
    so can any body please tell me how to use the UDF error messages. (no external code).
    Thank you.

    IF b1 = 'Business One'.
      ASK question [here|SAP Business One SDK;.
    ENDIF.

  • Problem with CRMD_ORDER: error messages

    Hi, i have a very urgent problem when creating a new sales order..(in crm, but not in the web application) at this moment, when a product's quantity is less than the minimum, i get an error message at the top of the page. What i need is to treat those messages, and be able to delete them if i want... is it possible ??? where can i do this ??? where are thos messages treated ???
    thanks in advance !!!

    i think i solved the problem at last... this is what i have done if the product's quantity <> MOQ.. :
    DATA: lv_logh    TYPE balloghndl,
              lt_logh    TYPE bal_t_logh,
              lt_msgh    TYPE bal_t_msgh,
              lr_msgidno TYPE bal_r_idno.
    CLEAR lt_msgidno.
    REFRESH lt_msgidno.
    ls_msgidno-sign = 'I'.
    ls_msgidno-option = 'EQ'.
    ls_msgidno-low-msgid = 'CRM_SCHEDLIN'.
    ls_msgidno-low-msgno = '314'.
    APPEND ls_msgidno TO lt_msgidno.
    CALL FUNCTION 'CRM_MESSAGES_REGISTER'
    EXPORTING
                IV_DOCNUMBER  = iv_guid
    CHANGING
                CV_LOG_HANDLE = lv_logh.
    CLEAR lt_logh.
    INSERT lv_logh INTO TABLE lt_logh.
    CLEAR lt_msgh.
    CALL FUNCTION 'CRM_MESSAGES_SEARCH'
    EXPORTING
                it_r_msgidno   = lt_msgidno
                iv_log_handle  = lv_logh
    IMPORTING
                et_msg_handle  = lt_msgh
    EXCEPTIONS
                appl_log_error = 1
                others         = 2.
    IF sy-subrc EQ 0 AND NOT lt_msgh IS INITIAL.
         CALL FUNCTION 'CRM_MESSAGES_DELETE'
                EXPORTING
                  iv_log_handle  = lv_logh
                  it_msgh        = lt_msgh
                EXCEPTIONS
                  appl_log_error = 1
                  others         = 2.
    ENDIF.
    so, when i save a sales order, if there are error messages and the amount of all the lines for the same product are = MOQ, then the messages are deleted.

  • Error Message " Enter a Vendor Number "?

    Hi,
    When we are executing MIGO 411 K transaction we are getting error message 'Enter Vendor Number'. My requirement is populate vendor dynamically based on combination of Material, Plant, Storage location and Batch. I got user exit for this User-exit (EXIT_SAPMM07M_001) when click on check button.
    We found a User-exit (EXIT_SAPMM07M_001) triggered when User clicks on 'CHECK' button. But since the vendor field (LIFNR) is a mandatory field in MIGO 411 K transaction, its throwing an error message 'Enter Vendor Number'.
    SO we are not able to populate the vendor number dynamically in user exit.
    Can any one help on this ..how to proceed further...
    Thanks
    Edited by: Venkatesh Padarti on Jan 2, 2008 11:21 PM

    All mandatory fields are checked before any processing happens.
    The simplest way is to enter a dummy vendor number (create a one-time or a dummy vendor for this purpose)
    Hope this helps,
    Lakshman

  • Error Message: Data from Business Add-In ME_PROCESS_PO_CUST not transferred

    Hi All,
    I have done a BADI implementation for ME_PROCESS_PO_CUST and when I try to convert a PR to PO using ME59N in ECC u2013 AFS System I am getting below error message.
    Data from Business Add-In ME_PROCESS_PO_CUST not transferred.
    I am trying to populate certain PO fields ( ekko and ekpo ) from PR fields. But the above error occurs when I update the Ex Factory Date manual that is EKPO-J_3AEXFCM.
    I am updating this in the method PROCESS_ITEM and what I found while debugging is in the class CL_PO_HEADER_HANDLE_MM, in the implementation of IF_FLUSH_TRANSPORT_MM~START, the contents of field u2018my_iteration_countu2019 keeps increasing and becomes 10 and raises this error.
    I read few of the related questions raised by others in this forum and understood that this can happen if I try to change the field that is disabled ( greyed) in ME22N. But this field that I am talking about is enabled.
    I also tried to move my code of populating the field EKPO-J_3AEXFCM from the PROCESS_ITEM to the enhancement point just above the user exit EXIT_SAPMMO6E_018 but still it doesnu2019t resolve the error.
    (We donu2019t want to use User Exit and hence we are trying with BADIs or enhancement point.)
    Can anyone please help me with this. I also found an OSS note 1334046 but not sure if that can resolve my issue.
    Thanks in advance.
    Ameesha.

    Hi Ameesha,
    i think u need to implement the BADI ME_PROCESS_PO_CUST in SPRO settings.
    SPRO>Purchasing>Business Add-in Purchasing-->BAdI: Enhance Processing of Enjoy Purchase Order
    try this once.
    All check this link.
    [Error Message: Data from Business Add-In ME_PROCESS_PO_CUST not transferred;
    Hope it helps.
    Regards,
    Raj

Maybe you are looking for

  • Program was terminated by signal 6 Concurrent Manager encountered an error while running Oracle*Report

    Hi, My concurrent request failed due to Program was terminated by signal 6 Concurrent Manager encountered an error while running Oracle*Report stat_low = 6 stat_high = 0 emsg:was terminated by signal 6 Error occurred during initialization of VM Could

  • Error Message on the list page

    What is the following error message? "The HTTP request parameter 'AccountList.LAYOUT' contains invalid data." When clicking the arrow which changes to the next page, an error message is displayed and following records are not displayed. It seems that

  • What games can i run with a Intel GMA 950 64 MB

    what games can i run with a Intel GMA 950 64 MB i want to play games like cod halo gta anything like these can i do it

  • .m4v to idvd

    i've downloaded some movies (.m4v) and converted them to a dv format. The file size was 8Gig!!!! Is there any other way to format a movie file to idvd using isquint or handbrake???? I tried converting the .m4v file in imovie, which took 2 hours, but

  • Connect To Server Hangs Before Prompting For Name And Password

    Hi Everyone. Connect to Server hangs for 25 seconds before prompting for name and password. I am trying to access a share on a Windows 2008 R2 domain controller via a Mac running 10.6.8 (Snow Leopard) using SMB. Example: smb://192.168.101.11/sharenam