How to trigger error message in PCUI when a BADI is called in SAP Backend

Hi,
I am currently coding some validations in the implementation of BADI, CRM_CUSTOMER_I_BADI.
I know that PCUI will trigger the interface methods, CRM_CUSTOMER_I_CHECK and CRM_CUSTOMER_I_MERGE.
So is there any way I can deliver status or warning or error message to the users in PCUI, by coding in the above 2 methods?? If yes, how do I do it or if anyone has any sample codes, I will appreciate it very much.
Thanks.

Hi,
i think you should post a link to this question in the  <a href="https://forums.sdn.sap.com/forum.jspa?forumID=126">CRM Development Forum</a> here in SDN.
Regards
Gregor

Similar Messages

  • How to trigger error message

    We are using the following sceanrio:
    R/3 Idoc > IDoc Adapter > XI > JDBC Adapter > SQL databse
    and reverse.
    we want to trigger some error messages enroute.
    But we are not able to finalize the points where we can anticipate for errors, how to catch thema dn report.
    Is there any documentation out there that can help us to proceed with our sceanrio?
    Thanks,
    Bhaskar

    closing - no answer

  • How to capture error messages for BCP when running through XP_CMDSHELL

    XP_cmdshell returns 0 as success when running BCP that causes insertion failure for any records (failure because of truncation, data type mismatch etc.)
    One way is to capture output message in temp table and can parse the messages. but I am looking for some direct methods.

    Hi Naveen Raikwar,
    We can use insert/execute syntax to insert error output to a file, here is a good article, please see:
    http://www.sqlservercentral.com/articles/Error+Handling/69196/
    And here is a similar thread, please refer to:
    http://social.msdn.microsoft.com/Forums/en-US/sqltools/thread/b37ec1fd-ea2f-4546-93c1-8bb9d589710d
    Thanks,
    Eileen
    Eileen Zhao
    TechNet Community Support

  • How to prevent error message for material description in MDG material detail screen, when user click on check action

    Dear Experts,
    I have a requirement for making material description as non mandetory in change request view of mdg material screen.
    I have done that using field usage in get data method of feeder classes, but still message is displaying.
    This message 'Material description is mandatory is displaying with check action only, but not with save or submit after i anhance field property as not mandetory.
    How to prevent error message for material description in MDG material detail screen, when user click on check action.
    Thanks
    Sukumar

    Hello Sukumar
    In IMG activity "Configure Properties of Change Request Step", you can completely deactivate the reuse area checks (but will then loose all other checks of the backend business logic as well).
    You can also set the error severity of the checks from Error to Warning (per CR type, not per check).
    Or you provide a default value for the material description, e.g. by implementing the BAdI USMD_RULE_SERVICE.
    Regards, Ingo Bruß

  • How to give error message for the screen element text field when wrong i/p

    How to give error message for the screen element text field when wrong i/p
    when wrong input given
    eg. 
    I have a text box with SBOOK-CARRID
    so when user give wrong entry in text box i.e LG
    then I should give some error stating that the the input is invalid or not available ,
    now it showing the error of standard messages,
    i want manual message to be displayed when error comes.
    Thank you,
    Regards,
    Jagrut Bharatkumar Shukla

    Hi all,
    Thank you for your valuable reply,
    but the thing is that its a screen field,
    i.e text box not a selection screen
    i created in screen layout
    with name sbook-carrid
    now i want to get error message display if wrong i/p is given
    thank you.
    Regards,
    Jagrut bharatkumar Shukla,

  • How to show a database trigger error message as a notification on a page

    I have a database with database triggers to ensure data integrity.
    If an insert or update does not comply to all the business rules, a database triggers raises an exception. When using Apex this exception is caught in the Error Screen, a separate screen, where the whole error stack is displayed.
    Does anyone know a way to display only the error in RAISE_APPLICATION_ERROR as a notification in the screen from which the transaction was initiated?
    Dik Dral

    Well, having had so little response, i had to figure it out myself ;-)
    Using Patrick Wolff's ideas from ApexLib I 'invented' a solution for my problem, that I would like to contribute to the community. I hope that it will come out a bit nicely formatted:
    Apex: Show Database Error Message in calling form
    The purpose is to show a neat error message in the notification area of the calling form.
    Default Apex show the whole error stack raised by a DB trigger in a separate error page.
    With acknowledgement to Patrick Wolf, I lent parts of his ApexLIB code to create this solution.
    <br./>
    Assumptions
    <ul><li>The error message is raised from a DB trigger using RAISE_APPLICATION_ERROR(-20000,’errormessagetext’).</li>
    <li>The relevant part of the error stack is contained within the strings ‘ORA-20000’ and the next ‘ORA-‘-string, i.e. if the error stack is ‘ORA-20000 Value should not be null ORA-6502 …’, than the relevant string is ‘Value should not be null’ .</li>
    <li>Cookies are enabled on the browser of the user </li>
    </ul>
    Explanation
    The solution relies heavily on the use of Javascript. On the template of the error page Javascript is added to identify the error stack and to extract the relevant error message. This message is written to a cookie, and then the control is passed back to the calling page (equal to pushing the Back button).
    In the calling page a Javascript onLoad process is added. This process determines whether an error message has been written to a cookie. If so the error message is formatted as an error and written to the notification area.
    Implementation
    The solution redefines two template pages, the two level tab (default page template) and the one level tab (error page template).
    Javascript is added to implement the solution. This Javascript is contained in a small library errorHandling.js:
    <pre>
    var vIndicator = "ApexErrorStack=";
    function writeMessage(vMessage)
    {       document.cookie = vIndicator+vMessage+';';
    function readMessage()
    { var vCookieList = document.cookie;
    var vErrorStack = null;
    var vStart = null;
    var vEnd = null;
    var vPos = null;
    vPos = vCookieList.indexOf(vIndicator);
    // No cookie found?
    if (vPos == -1) return("empty");
    vStart = vPos + vIndicator.length;
    vEnd = vCookieList.indexOf(";", vStart);
    if (vEnd == -1) vEnd = vCookieList.length;
    vErrorStack = vCookieList.substring(vStart, vEnd);
    vErrorStack = decodeURIComponent(vErrorStack);
    // remove the cookie
    document.cookie = vIndicator+"; max-age=0";
    return(vErrorStack);
    function getElementsByClass2(searchClass,node,tag)
    var classElements = new Array();
    if ( node == null )
    node = document;
    if ( tag == null )
    tag = '*';
    var els = node.getElementsByTagName(tag);
    var elsLen = els.length;
    var pattern = newRegExp('(^|\\s)'+searchClass+'(\\s|$)');
    for (i = 0, j = 0; i < elsLen; i++) {
    if ( pattern.test(els.className) ) {
    classElements[j] = els[i];
    j++;
    return classElements;
    function processErrorText()
    var errorElements = new Array();
    errorElements = getElementsByClass2("ErrorPageMessage",document,"div");
    if (errorElements.length > 0 )
    { errorText = errorElements[0].innerHTML;
    errorText = errorText.substr(errorText.indexOf("ORA-20000")+ 11);
    errorText = errorText.substr(0,errorText.indexOf("ORA")-1);
    // errorElements[0].innerHTML = errorText;
    writeMessage(errorText);
    function show_message()
    { var vCookieList = document.cookie;
    var vErrorStack = null;
    var vErrorName = null;
    var vErrorMessage = null;
    var vStart = null;
    var vEnd = null;
    var vPos = null;
    // get errorStack
    vErrorStack = readMessage();
    if (vErrorStack == -1) return;
    // search for our message section (eg. t7Messages)
    var notificationArea = document.getElementById("notification");
    if (notificationArea != null)
    { notificationArea.innerHTML = '<div class="t12notification">1 error has occurred<ul class="htmldbUlErr"><li>' + vErrorStack + '</li></ul>'; }
    else
    { alert(vErrorStack); }
    </pre>
    This code is loaded as a static file in Application Express (no application associated).
    In both templates a reference to this code is added in the Definition Header section:
    <pre>
    <script src="#WORKSPACE_IMAGES#errorHandling.js" type="text/javascript"></script>
    </pre>
    This library is called from the two level tab to show the error message (if any) in het onLoad event of the body tag.
    <body onLoad="javascript:show_message();">#FORM_OPEN#
    This code checks whether a message has been written to a cookie and if found displays the message in the notification area.
    In the error template page the Error section has the content:
    <script language="javascript">
    processErrorText();
    window.history.go(-1);
    </script>
    Back
    The call to processErrorText() looks for the error message, extracts the relevant part of it (between ‘ORA-20000’ and the next ‘ORA-‘), writes it to a cookie and returns to the previous screen.
    The link to the previous page is added should an error in the Javascript occur. It provides the user with a path back to the application.
    With these actions taken, the error messages issued from triggers are shown in the notification area of the form the user has entered his data in.
    The need for database driven messaging
    In some cases the need exists to process error messages in the database before presenting them to the user. This is the case, when the triggers return message codes, associated to error messages in a message table.
    This can be done by using a special Error Message Processing page in Apex.
    The error message page extracts the error message, redirecting to the Error Message Processing page with the error message as a parameter. In the EMP page a PL/SQL function can be called with the message as a parameter. This function returns the right message, which is written to a cookie using dynamically generated Javascript from PL/SQL. Than the contol is given back to the calling form.
    The redirect is implemented by location.replace, so that the error message page does not exist within the browsing history. The normal history(-1) will return to the calling page.
    Implementation of database driven messaging
    The solution redefines two template pages, the two level tab (default page template) and the one level tab (error page template).
    Javascript is added to implement the solution. This Javascript is contained in a small library errorHandling.js already listed in a previous paragraph.
    In both templates a reference to this code is added in the Definition Header section:
    <script src="#WORKSPACE_IMAGES#errorHandling.js" type="text/javascript"></script>
    This library is called from the two level tab to show the error message (if any) in het onLoad event of the body tag.
    <body onLoad="javascript:show_message();">#FORM_OPEN#
    This code checks whether a message has been written to a cookie and if found displays the message in the notification area.
    In the error template page the Error section has the content:
    <script language="Javascript">
    var errorText = null;
    function redirect2oracle()
    { window.location.replace("f?p=&APP_ID:500:&APP_SESSION.::::P500_MESSAGE:"+errorText); }
    function getError()
    { errorText = processErrorText(); }
    getError();
    redirect2oracle();
    </script>
    Go to Error Message Porcessing Page
    Back to form
    The call to processErrorText() looks for the error message, extracts the relevant part of it (between ‘ORA-20000’ and the next ‘ORA-‘), writes it to a cookie.
    Then the EPM-page (500) is called with the extracted message as parameter.
    The link to the EPM page and the previous page is added should an error in the Javascript occur. It provides the user with a path back to the application.
    We need to create an Error Message Porcessing Page.
    Create a new page 500 with a empty HTML-region “Parameters”
    Create an text-area P500_MESSAGE in this region
    Create a PL/SQL region “Process Messages” with source:
    convert_message(:P500_MESSAGE);
    Create a PL/SQL procedure convert_message like this example, that reads messages from a message table. If not found, the actual input message is returned.
    CREATE OR REPLACE procedure convert_message(i_message in varchar2) is
    v_id number := null;
    v_message varchar2(4000) := null;
    function get_message (i_message in varchar2) return varchar2 is
    v_return varchar2(4000) := null;
    begin
    select msg_text into v_return
    from messages
    where msg_code = upper(i_message);
    return(v_return);
    exception
    when no_data_found then
    return(i_message);
    end;
    begin
    v_message := get_message(i_message);
    // write the message for logging/debugging
    htp.p('Boodschap='||v_message);
    // write cookie and redirect to calling page
    htp.p('<script language="Javascript">');
    htp.p('document.cookie="ApexErrorStack='||v_message||';";');
    htp.p('window.history.go(-1);');
    htp.p('</script>');
    // enter return link just in case
    htp.p('Ga terug');
    end;
    Note: The way the message is converted is just an example
    With these actions taken, the error messages issued from triggers are shown in the notification area of the form the user has entered his data in.
    Message was edited by:
    dickdral
    null

  • How to send error message to forms from Database Trigger

    Hi, Please help me to send error message to forms from Database Trigger?
    RgDs,
    Madesh.R.M

    You are correct, the On-Error trigger is a Forms trigger. However, if your Form is going to display the error generated by the database stored procedure or trigger - you might not see the database error in your Form unless you check the DBMS_ERROR_CODE in the On-Error trigger and manually display the Error Code and associated Text. I've see this happen with a co-worker. The Form she was working on was based on a table with an Before-Insert trigger. Because she was not explicitely handling the error from the Before-Insert trigger in the Forms On-Error trigger, her Form appeared to halt for no reason at all. Once she added code to the On-Error trigger in the Form to handle the DBMS_ERROR_CODE, she discovered the trigger was producing an error and was able to show the error to the user in the On-Error trigger.
    I understand the desire to keep as much as possbile in the database, but with that comes some extra coding in your Forms to handle this. This extra coding could easily be placed in a Forms Library, attached to a Form and called in the On-Error trigger. Your code could look like this:
    DECLARE
       /*This example assumes you have an Alert defined
          in your Form called: 'ERROR' */  
       al_id    ALERT;
       al_text  VARCHAR2(200);  /* Max text of a Forms Alert message*/
       al_btn   NUMBER;
    BEGIN
    IF DBMS_ERROR_CODE != 0 THEN
       /* Error code is ORA-00000 Normal Successful completion
           So only handle non-zero errors  */
       al_text := DBMS_ERROR_CODE||':'||DBMS_ERROR_TEXT;
       al_id := Find_Alert('ERROR');
       set_alert_property(al_id, alert_message_text, al_text);
       al_btn := show_alert(al_id);
    END IF;
    END;Your original question was "How to send error message to forms from Database Trigger?" The answer is you don't because Forms already gets the database error code and database message through the Forms DBMS_ERROR_CODE and DBMS_ERROR_TEXT functions. Look these up in the Forms help and it should clear things up for you.
    Craig...
    Edited by: CraigB on Jun 14, 2010 4:49 PM
    Edited by: CraigB on Jun 14, 2010 4:49 PM
    Edited by: CraigB on Jun 14, 2010 4:50 PM
    Edited by: CraigB on Jun 14, 2010 4:51 PM
    Edited by: CraigB on Jun 14, 2010 4:51 PM

  • Error message 70001 appears when I am trying to change DVD zone. How can I solve this issue?

    Error message 70001 appears when I am trying to change DVD zone. How can I solve this issue?

    This has already been brought up before:
    https://discussions.apple.com/thread/820087

  • How to print error messages in browser?

    When I visit a jsp file in browser, there's some errors in the jsp file, so the browser returns
    The page cannot be displayed
    There is a problem with the page you are trying to reach and it cannot be displayed.
    I want the detail error messages, so I can debug my problem. How to print error message in browser or find the message in some log file?

    Hi Kanaraja,
    Thanks for your answer. I need to get certain information from the list. So, I use LIST_To_ASCII FM. However, may I know the ascii_tab should be type to what? And after this FM, do I have to use another FM to display the ascii list?
    data ABAPLIST type ABAPLIST OCCURS 0.
    SUBMIT  RPCALCU0 VIA SELECTION-SCREEN
    with PNPXABKR = 'US'
    with PNPTIMRA = 'X'
    with PNPPABRP = '10'
    with PNPPABRJ = '2003'
    with PNPPERNR-LOW = '100750'
    with PNPPERNR-LOW = '109202'
    with PNPPERNR-LOW = '100255'
    with PNPABKRS-LOW = 'US'
    with SCHEMA = 'ZUSP'
    with RADI_EDT ='X'
    with EDT_VARI = 'CUS&SAP_US'
    with TST_ON = 'X'
    EXPORTING LIST TO MEMORY and RETURN.
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject       = ABAPLIST
    EXCEPTIONS
       NOT_FOUND        = 1
       OTHERS           = 2.
    CALL FUNCTION 'LIST_TO_ASCI'
      EXPORTING
        list_index         = -1
      TABLES
        listasci           = asci_tab
        listobject         = ABAPLIST
      EXCEPTIONS
        empty_list         = 1
        list_index_invalid = 2
        OTHERS             = 3.
    IF sy-subrc NE '0'.
      WRITE:/ 'LIST_TO_ASCI error !! ', sy-subrc.
    ENDIF.

  • How To Handle Error Message In TCD Recording?

    Hi All,
      I tried recording a transaction (my own transaction) by not enterring value in an obligatory field. the error message came. but when i executed the script, it showed an error. but actualy, the error message was expected right? how to handle this situation? i tried with tcd and sapgui recording. both gave almot the same result.
      i am including the script which i have written.
    MESSAGE ( MSG_1 ).
    *TCD ( ZCUST , ZCUST_1 , ECC ).
    SAPGUI ( SAP_1 , ECC ).
    ENDMESSAGE ( E_MSG_1 ).
    v_mno = &tfill.
    v_msg = E_MSG_1[v_mno]-msgtext.
    v_mtp = E_MSG_1[v_mno]-msgtyp.
    If Msg Type is E *** **** It Has To Be E ****
    IF ( v_mtp = 'E' and v_msg = 'Account no AC02 does not exist EXIT = X').
    logtext(0,'Passed').
    ELSE.
    log(v_mtp).
    log(v_msg).
    logtext(1,'Failed').
    ENDIF.
    End Of The Condition For Message Type E ******

    I have recording messages using the TCD command.
    My script (very simple):
    MESSAGE ( MSG_2 ).
    TCD ( ME21 , ME21_1 , R3 ).
    ENDMESSAGE ( E_MSG_2 ).
    In the MESSAGE command interface, I defined rules to allow several kind of messages.
    Execution: 3 mesages found:
          * transform PR into PO
           MESSAGE     MSG_2 [1,009 sec]
             RULES  MSG_2 = XML-DATA-01
            Message  MODE  EXIT  TYPE  ID    NR
            [1]      'A'         'I'   06    456
            [2]      'A'         'W'   'ME'  080
            [3]      'A'         'E'   'ZE'  029
             TCD    ME21                 [0,545 sec N] Target sys R3 -> ZDA010A219
            S06017 Standard PO created under the number 8201075606
               Tgt System Z_A219->R3->ZDA010A219 (ZDA 010 ... HP-UX ORACLE)
               CALL TRANSACTION ME21 ME21_1 XML-DATA-01
               03 MESSAGES FROM ME21 ME21_1 XML-DATA-01
               I  06 456 Release effected with release code 00001
               W  ME  080 Delivery date: next workday is 02.05.2007
               S  06 017 Standard PO created under the number 8201075606
           ENDMESSAGE  E_MSG_2 (&TFILL = 0)
    As you can see, 3 messages are found but the &TFILL variable is still 0.
    I guess (but cannot test yet) I would manage to record those messages using SAPGUI command.
    Is there anything wrong with my script?
    My SAP_BASIS component is in version 620. I'm not using the ultimate version of eCATT (no WEBDYNPRO command, etc.). Could it be an explanation?
    Thank you in advance,
    Olivier

  • Best Practices Question: How to send error message to SSHR web page.

    Best Practices Question: How to send error message to SSHR web page from custom PL\SQL procedure called by SSHR workflow.
    For the Manager Self-Service application we’ve copied various workflows which were modified to meet business needs. Part of this exercise was creating custom PL\SQL Package Procedures that would gather details on the WF using them on custom notification sent by the WF.
    What I’m looking for is if/when the PL\SQL procedure errors, how does one send an failure message back and display it on the SS Page?
    Writing information into a log or table at the database level works for trouble-shooting, but we’re looking for something that will provide the end-user with an intelligent message that the workflow has failed.
    Thanks ahead of time for your responses.
    Rich

    We have implemented the same kind of requirement long back.
    We have defined our PL/SQL procedures with two OUT parameters
    1) Result Type (S:Success, E:Error)
    2) Result Message
    In the PL/SQL procedure we always use below construct when we want to raise any message
    hr_utility.set_message(APPL_NO, 'FND_MESSAGE_NAME');
    hr_utility.raise_error;
    In Exception block we write below( in successful case we just set the p_result_flag := 'S';)
    EXCEPTION
    WHEN APP_EXCEPTION.APPLICATION_EXCEPTION THEN
    p_result_flag := 'E';
    p_result_message := hr_utility.get_message;
    WHEN OTHERS THEN
    p_result_flag := 'E';
    p_result_message := hr_utility.get_message;
    fnd_message.set_name('PER','FFU10_GENERAL_ORACLE_ERROR');
    fnd_message.set_token('2',substr(sqlerrm,1,200));
    fnd_msg_pub.add;
    p_result_message := fnd_msg_pub.get_detail;
    After executing the PL/SQL in java
    We have written some thing similar to
    orclStmt.execute();
    OAExceptionUtils.checkErrors (txn);
    String resultFlag = orclStmt.getString(provide the resultflag bind no);
    if ("E".equalsIgnoreCase(resultFlag)){
    String resultMessage = orclStmt.getString(provide the resultMessage bind no);
    orclStmt.close();
    throw new OAException(resultMessage, OAException.ERROR);
    It safely shows the message to the user with all the data in the page.
    We have been using this construct for a long time for all our projects. They are all working as expected.
    Regards,
    Peddi.

  • I'm trying to sync my phone to my computer and keep getting error message "1140" just when it's about to finish.  My updates are current.  Thoughts?

    I'm trying to sync my phone to my computer and keep getting error message "1140" just when it's about to finish.  My updates are current.  Thoughts?

    Hi hannijin,
    What version of the Mac OS X do you have on your computer?  The version of iTunes that you can install is dependent on the operating system that you have.  For example, the current version of iTunes requires OS X version 10.7.5 or later.
    Finding the OS X version and build information on your Mac - Apple Support
    https://support.apple.com/en-us/HT201260
    Apple - OS X Yosemite - How to Upgrade
    https://www.apple.com/osx/how-to-upgrade/
    Hope that helps ...
    - Judy

  • TS3274 Error message 5000 received when trying to update ipad software

    How do I resolve this error message 5000 received when trying to update ipad software from my computer?

    iOS: Resolving update and restore alert messages
    http://support.apple.com/kb/TS1275
    iPad: Unable to update or restore
    http://support.apple.com/kb/ht4097
     Cheers, Tom

  • Error message: 50103 (oxffff3c49) when trying to run VILogger

    I get this error message: 50103 (oxffff3c49) when trying to run VI logger for data received from the NI USB 6008 DAQ. What does this mean and how do I fix it?

    Go through all these threads and post back if that solves your problem or still you stuck up.
    Mathan

  • I cannot upload my iMovie video to Facebook, etc. I cannot even attach it to an email, an 'error' message comes up when almost complete. It plays fine in imovies, VLC, mplayerx. Confused, is the file damaged somehow?

    I cannot upload my iMovie video to Facebook, etc. I cannot even attach it to an email, an 'error' message comes up when almost complete. It plays fine in imovies, VLC, mplayerx. Confused, is the file damaged somehow?

    The Deskjet series printers connect to wireless networks with what is called USB to Wireless.
    You will need a supported operating system to connect a Deskjet to a wireless network.  Supported operating systems to connect the printer to a wireless network are Windows 7 (32bit and 64bit), Windows Vista (32bit and 64bit), and Mac OS X (10.5, 10.6, and 10.7).  
    While there is a software download option for Linux distributions, this is not the full featured software that is capable of adding the printer to a wireless network.  Most printers have a wireless setup wizard to accomplish this task, but the Deskjet series printers connect in a different way.
    Once the printer is connected to a wireless network,  HPLIP 3.12.4 drivers should be able to locate the printer.
    Click on Installing the Product Software for a Wireless Network Connection to receive instructions to connect to a wireless network using Windows and Mac operating systems.
    Click on Software & Driver Downloads - HP Deskjet 3070A e-All-in-One Printer - B611a to download the appropriate software for a supported operating system to connect to a wireless network.
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

Maybe you are looking for