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.

Similar Messages

  • Error Message during posting return delivery against materil document

    Dear experts
    I have created a purchase order with batch specific unit of measure KAI.
    I created the inbound  delivery document (say for eg: 30,000 KG)
    I have taken GRN for the above IBD through MIGO transaction with 101 movement for all 30,000 KG.
    Later i have posted the return delivery 122 movement with reference to above 101 material document. 30,000 KG
    After this i realized that i need cancel the 101 movement document.
    So cancelled the 122 movement document, and try to cancell the 101 material document.
    Then system is issuing error message VLA 321 "Movement type 102 cannot be used here".
    Also if i again want to post return delivery to send the stock back, then also i have error message. but this time it is VLA 319
    "Return delivery qty greater than previously GR-posted qty:"
    My Support package for SAP_APPL, relese 600 is SAPKH60019.
    Please suggest me solution to fix these errors as these are not relavant for the situation.
    Regards/Murali

    Hi,
    Can you please check this note...
    Note 1050944 - GR for inbound delivery using inventory mgmt as of ECC 6.00
    Note 1342935 - Error message BORGR 623 during GR reversal in MIGO
    Regards
    Bhuban

  • 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

  • Custom error message in mapping-Alert

    We are using XSLT mapping and We are raising custom error message based upon some conditions i.e if vendor number is invalid or blank.If it doesn't meet the requirement,mapping will fail and it will throw error message as" IDoc XXXXXXXXX is having invalid vendor number".
    My question is,we would like to send this custom error message to email receipients through RWB-AFW.
    How do we capture this custom error message is alert category or alert rule?

    SOLVED!!!!
    UDF call to RFC-FM by passing payload dato in t it

  • Capturing custom error message from alert category

    We are using XSLT mapping and We are raising custom error message based upon some conditions i.e if vendor number is invalid or blank.If it doesn't meet the requirement,mapping will fail and it will throw error message as" IDoc XXXXXXXXX is having invalid vendor number".
    My question is,we would like to send this custom error message to email receipients through RWB-AFW.
    How do we capture this custom error message is alert category or alert rule?

    You can not unless u use BPM.
    VJ

  • K8N DIAMOND Plus Error(?) message during post.....

    I know some of the DIAMOND PLUS owner have gotten this...it appears at the bottom of the screen, only when both SATA controllers are enabled and a drive plugged in to both:
    "NOT ENOUGH SPACE TO COPY PCI OPTION ROM [00:13:00]"
    Has there been any answer or resolution to this? Or does anyone know what it means??

    Rocketman18,
    I have scene that error message when I first start being up my Diamond Plus.  It never seamed to have any effect on the system or its function and after one of my first real completed BIOS Clears procedures it never came up again.  I think it is one of those undocumented BIOS parameters gets trash in it that causes the unused error message to be displayed.  I contacted MSI Support and that is when they sent me the V1.16 BIOS was to clear that error message and a few other ones weird error message during boot.  I think if you will take the time to do that supper BIOS clear procedure I have been trying to get you to, but you never seam to get around too.
    Here is the procedure again if you want to try it, now.
    This procedure insures the there is no power let in the system to defeat your attempt to clear the clear the BIOS parameters.
    (1) Unplug the AC Plug cord from the computer.
    (2) Remove the Battery.  If your like me and has always struggled with get the little battery out when buried behind and under cables in between I/O cards.  Get a small pair of needle nose priers and press the two metal tabs together that make up the retaining clip.  Now this first time you do this it will surprise you, because if there is nothing it its way the spring contact behind it will pop it out with enough force to send it flying.  If you power supply is mounted in the bottom of your case, put paper over the grill, because if the battery goes in there you are in for at lest 12 pack day.
    (3) With power, unplugged and the battery remove press the BIOS clear button and the Power switch and holed them for twenty to thirty seconds.
    (4) Then, let the system set for as long as you have patience, at lest thirty minutes.
    (5) Again, press the BIOS clear button and the Power switch and holed them for twenty to thirty seconds.
    (6) Reinstall the battery and plug the power back in.
    (7) Boot the system to the BIOS to BIOS Default Values, Save and Exit.
    (8) Reboot to BIOS Setup Routine and Set all Bios parameters to the normal system operating parameters, save and exit.
    Note: Do not setup your system for any over-clocking, but check you memory default setting to insure the BIOS is setting them correctly.  Mine sets the default memory voltage to below the manufactures spec.
    (9) Reboot the system to the BIOS setup routine, YES again, rechecks that all of you normal system operating parameters are still correct save and exit.
    Roger
    When submitting a problem, include a complete list of your system components; include part numbers, all Power Supply Voltages, and their output ratings.  It is almost impossible to estimate what your problem is without knowing something about it. 

  • Customer error message in sales order on save

    Hi Friends,
    as per requirement i have to raise the error message and system should enable the field to change values. This should happen when condition is not met on Saving of Sales order.
    For this, i have used the user exit USEREXIT_SAVE_DOCUMENT_PREPARE. But the problem is system throwing error message and all r in display mode only. as per my requirement system should allow to change the error value field.
    i have verified many posting in this SDN, but nothing is working out.
    Please guide me, how to raise the error message and system should enable that filed.
    My doubt is where should i raise the error message in sales order (MV45AFZZ)??? if any badi to raise the error message also fine for me. I tried many ways like... message with display like..... and set / get parameters and badis....  but not able to find the correct solution.
    Thanks in Advance.
    Bala

    Hi
    You need to use check for enahcement spot, which will be help to you.
    Bcz you are throwing custom error message in the standard transaction, once the error is display, you could not able to change the values. your prob can be solved by using the enhancement sport.
    This is include name (Include:MV45AF0B_BELEG_SICHERN).
    In the above include, you need to create a enhancement spot after this spot (ENHANCEMENT 16  OI0_COMMON_SAPMV45A.)  
    write your custom code and while displaying an error message. set flag = 'x', then use below code. It will display error message once you press ENTER, you will get the sale order in change mode, you change the values.
      IF flag = 'X'.
              fcode = fcode_gleiche_seite.
              perform fcode_bearbeiten.
              ch_subrc = 4.
              exit.
            ENDIF.

  • Catch datetime exception and custom error message in SSRS

    I currently working on create report by using SSRS. I have 2 parameters: [Start date] and [End date] to filter data from database and show it on report. I want to validate 2 datetime parameter as describe above. Please tell me a solution to do this.
    For example:
    When user type the text like: 4/15/2014mmm => System validation thrown a message: [The From Date not correct type]
    But in my case, I want to receive a custom error message by myself.(Look like: [Date Invalid!])

    Hi Brain,
    According to your description, you have a report with two parameters for user to input. Now you want to validate these two parameters and display custom error message when the date is invalid. Right?
    In Reporting Service, it doesn’t provide any interference for us to modify the system error message (the text in grey color). That means we can’t modify the system message when error occurs. However we can create a textbox in this report, use custom code
    and expression to display the custom error message. But this all based on the report is successfully running. So if error occurs during report processing, all the custom code and expression will not work. In this scenario, we find a workaround for you. We
    use custom code to judge if the date is valid, if the users type an invalid date, we return a default value to make sure this report can successfully run. Then we use expression to control the visibility of tablix in this report and create a textbox to show
    the custom error message. Your case has been tested in our local environment. Here are steps and screenshots for your reference:
    Go to Report Properties. Put the code below into custom code:
    Public Shared a As Integer=0
    Public Shared Function IsDate(d1 As String,d2 As String) as Integer
            Try
               FormatDateTime(d1)
               FormatDateTime(d2)
            Catch ex As Exception
                       a=1
            End Try
    return a
    End Function
    Create two parameters. One is StartDate, the other is EndDate. Set the data type of these two parameters Text.
    Create a filter for StartDate, put the expression below into Value:
    =IIF(Code.IsDate(Parameters!StartDate.Value,Parameters!EndDate.Value)=0,CDate(IIF(Code.IsDate(Parameters!StartDate.Value,Parameters!EndDate.Value)=0,Parameters!StartDate.Value,"1/1/2012")),CDate("1/1/2012"))
    Create a filter for EndDate, put the expression below into Value:
    =IIF(Code.IsDate(Parameters!StartDate.Value,Parameters!EndDate.Value)=0,CDate(IIF(Code.IsDate(Parameters!StartDate.Value,Parameters!EndDate.Value)=0,Parameters!EndDate.Value,"1/1/2013")),CDate("1/1/2013"))
    Ps: In step3 and step4, the date(“1/1/2012”, “1/1/2013”) in the expression are the default we set to make sure the report can successfully process. You can set any date existing in your dataset.
    Use the expression below to set the visibility of the tablix:
    =IIF(Code.IsDate(Parameters!StartDate.Value,Parameters!EndDate.Value)=0,false,true)
    Create a textbox, put the expression below into it:
    =IIF(Code.IsDate(Parameters!StartDate.Value,Parameters!EndDate.Value)=0,"","Date invalid")
    Save and preview. It looks like below:
    Reference:
    SSRS Calendar and Date Restriction
    Errors and Events Reference (Reporting Services)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou
      

  • How to create Custom error message in SharePoint 2013

    Hi,
    I have created one document library.On uploading the same file SharePoint throws error as"server error.The same file exit".
    But my requirement is not to show the SharePoint default message.I wanted to create custom message and show the pop up for the same file upload.
    Is there any way to create any custom error page or can I manipulate SharePoint default error page?
    Any help?
    Thank you

    Hi,
    You can create an event receiver to set the validation error messages.  One such post to redirect the custom error page is as follows
    https://social.msdn.microsoft.com/Forums/office/en-US/2bc851f6-e04b-4550-b87f-9b874a290482/sharepoint-event-receivers-and-custom-error-messages?forum=sharepointdevelopmentlegacy
    Create custom error page for SharePoint event receiver
    Please mark it answered, if your problem resolved or helpful.

  • How to show custom error message in WebADI Excel template?

    Hi,
    I've  created a custom Web ADI integrator and associated it with a 'Procedure' based custom interface.
    WebADI Interface API Returns is set to  "Error Message".
    I'm using  raise_application_error(-20001, "Actual Error Message") for invalid rows,but custom error message from PL/SQL  is not populated on the excel template.
    Instead it is showing "SQL exception occurred during PL/SQL upload".
    Am I missing anything? How to show custom error message from Pl/SQL procedure to WebADI Excel template?
    TIA
    Narasimha

    The custom API errors are visible in the BNE log but not on the Excel.
    BNE Log=>
    12/10/13 2:52 PM Web ADI Upload Job 13008 ERROR          BnePLSQLUpload.doUpload: Exception while uploading to PL/SQL API.  Error Code: 20001, Message: ORA-20001: -Please enter CONTAINER_ID -  Enter PO_NO -
    ORA-06512: at "APPS.XXPO_COSTFACTS_WEBADI_PKG", line 264
    ORA-06512: at line 1
    12/10/13 2:52 PM Web ADI Upload Job 13008 ERROR          BnePLSQLUpload.doUpload: Stack trace: java.sql.SQLException: ORA-20001: -Please enter CONTAINER_ID -  Enter PO_NO -
    ORA-06512: at "APPS.XXPO_COSTFACTS_WEBADI_PKG", line 264
    ORA-06512: at line 1
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
      at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
      at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
      at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
      at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
      at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
      at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:202)
      at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:1005)
      at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1307)
      at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3449)
      at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3550)
      at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4710)
      at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1374)
      at oracle.apps.bne.integrator.upload.BnePLSQLUpload.doUpload(BnePLSQLUpload.java:284)
      at oracle.apps.bne.integrator.upload.BneSAXUploader.processDeepestLevel(BneSAXUploader.java:2346)
      at oracle.apps.bne.integrator.upload.BneSAXUploader.startElement(BneSAXUploader.java:1182)
      at oracle.xml.parser.v2.XMLContentHandler.startElement(XMLContentHandler.java:181)
      at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1288)
      at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:336)
      at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:303)
      at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:234)
      at oracle.apps.bne.integrator.upload.BneUploader.processUpload(BneUploader.java:301)
      at oracle.apps.bne.integrator.upload.BneAbstractUploader.processUpload(BneAbstractUploader.java:114)
      at oracle.apps.bne.integrator.upload.async.BneAsyncUploadThread.run(BneAsyncUploadThread.java:140)
    12/10/13 2:52 PM AJPRequestHandler-HTTPThreadGroup-5 WARNING        BneOracleWebAppsContext.getTimeZone CLIENT_TIMEZONE_ID has not been set
    12/10/13 2:52 PM AJPRequestHandler-HTTPThreadGroup-5 ERROR          BneOracleWebAppsContext.getExtraJDBCConnection recieved the same connection as the base connection.  There may be transaction problems.
    How to show the same error in the excel template?
    Here is the package:
    CREATE OR REPLACE PACKAGE BODY APPS.XXPO_COSTFACTS_WEBADI_PKG
    AS
       PROCEDURE upload_data (
                              P_CONTAINER_ID IN VARCHAR2
                            , P_SAIL_DATE IN DATE
                            , P_PO_NO IN VARCHAR2                     
                             ) IS
        --declare
        lv_err_msg      VARCHAR2(240);
        lf_err_flag     NUMBER := 0;
        ln_temp         NUMBER;
        BEGIN
        --------------------- checking for mandatory parameters---------------------------
          IF (P_CONTAINER_ID IS NULL) THEN
             lf_err_flag := 1;
             lv_err_msg := lv_err_msg||'-'||'Please enter CONTAINER_ID - ';
          END IF;
          -------------Validation for Sail Date Format----------------------
          IF (P_SAIL_DATE IS NULL) THEN
             lf_err_flag := 1;
             lv_err_msg := lv_err_msg || ' ' || 'Enter Sail Date - ';
          ELSE
             BEGIN
                SELECT 1
                  INTO ln_temp
                  FROM DUAL
                 WHERE P_SAIL_DATE =  TO_DATE (TO_CHAR (P_SAIL_DATE, 'DD-MON-YYYY'), 'DD-MM-YYYY');
             EXCEPTION
                WHEN NO_DATA_FOUND THEN
                   lf_err_flag := 1;
                   lv_err_msg := lv_err_msg || ' Enter Sail date in DD-MON-YYYY Format';
                WHEN OTHERS THEN
                   lf_err_flag := 1;
                   lv_err_msg := lv_err_msg || ' Enter Sail date in DD-MON-YYYY Format'|| SQLERRM;
             END;
          END IF;
          -------------Validation for PO_Number----------------------
          IF (P_PO_NO IS NULL) THEN
             lf_err_flag := 1;
             lv_err_msg := lv_err_msg || ' ' || 'Enter PO_NO - ';
          ELSE
             BEGIN
                SELECT count(1)
                  INTO ln_temp
                  FROM PO_HEADERS
                 WHERE Attribute4 =  P_PO_NO;
             EXCEPTION
                WHEN NO_DATA_FOUND THEN
                   lf_err_flag := 1;
                   lv_err_msg := lv_err_msg || ' No Oracle PO for Biceps PO#'||P_PO_NO;
                WHEN OTHERS THEN
                   lf_err_flag := 1;
                   lv_err_msg := lv_err_msg || ' Error getting the Oracle PO for Bicpes PO#'||P_PO_NO||' Error-' || SQLERRM;
             END;
          END IF;
         -----------------------Insert Record----------------------------
         IF lv_err_msg is NULL THEN
         BEGIN
             INSERT
              INTO XXP2P_HW_COST_FACTORS_STG
                     CONTAINER_ID
                    ,SAIL_DATE
                    ,PO_NO
                    , ERROR_FLAG
                    , ERROR_MSG
                   ,CREATED_BY
                    ,CREATION_DATE
                    ,LAST_UPDATED_BY
                    ,LAST_UPDATE_DATE
                    ,LAST_UPDATE_LOGIN              
                VALUES
                     P_CONTAINER_ID
                    ,P_SAIL_DATE
                    ,P_PO_NO              
                    ,lf_err_flag
                    ,lv_err_msg
                  ,FND_GLOBAL.USER_ID
                    , trunc (sysdate)
                    ,FND_GLOBAL.USER_ID
                    , trunc (sysdate)
                    ,FND_GLOBAL.LOGIN_ID              
                  --  commit;
                  DBMS_OUTPUT.put_line
                    '-' || 'After ap_invoices_interface'
            EXCEPTION
            WHEN OTHERS THEN
              ROLLBACK;
              lf_err_flag := 1;
              lv_err_msg  := lv_err_msg || ' ' || 'error loading CONTAINER_ID-' || P_CONTAINER_ID || SQLERRM;
              raise_application_error(-20001, lv_err_msg);
            END;
        ELSE
              raise_application_error(-20001, lv_err_msg);
        END IF;
      END upload_data;                        
    END XXPO_COSTFACTS_WEBADI_PKG;

  • Cannot display custom error message in CRM_MKTLIST_BADI

    We did implement the following BADI BADI Name: CRM_MKTLIST_BADI
    Interface: IF_EX_CRM_MKTLIST_BADI Method: MAP_AND_CONVERT_DATA
    This enhancement is for suport the extension field for create new BP in
    external list management (transaction CRMD_MKTLIST). The BP creation
    process work properly but we cannot display our custom error message,
    only SAP standard error message is shown. We did try using the export
    parameter ET_MKTLIST_E but it does not work as expected, custom message
    still cannot display.
    How we can be show the custome error message ?
    Thanks in advance.
    Supreeya K.

    Hello Supreeya,
    have you tried to post this question in the SAP CRM: Webclient UI - Framework forum?
    Regards
    Gregor

  • Custom error message in user exit is giving Short dump

    Hi All,
    We have a scenario where in if any user try to create/Change/Delete particular types of contract in SAP system we have to issue error message
    saying ZIN/ZIR contract creation/Change/Deletion is blocked in SAP. This has to be done from the web application. So we are putting below code
    in user exit MV45AFZZ in the form USEREXIT_SAVE_DOCUMENT_PREPARE.
    CONSTANTS: lc_vbcpic01 TYPE sy-uname VALUE u2018VBCPIC01u2019, u201CWeb application user ID
             lc_zin           TYPE vbak-auart VALUE u2018ZINu2019,
                         lc_zir            TYPE vbak-auart VALUE u2018ZIRu2019,
                         lc_text(32)    TYPE c VALUE u2018Check long text for more detailsu2019.
    DATA: l_uname TYPE sy-uname.
    CLEAR: l_uname.
    MOVE sy-uname TO l_uname.
    *If user ID is not the Web application ID then block the creation/Change/Deletion
    IF   l_uname NE lc_vbcpic01
    AND ( vbak-auart EQ lc_zin
    OR    vbak-auart EQ lc_zir ).
    MESSAGE e830(zv) WITH lc_text.
    ENDIF.
    This code is working fine while creating/Changing the contract i.e. Giving us error message so that user wonu2019t be able to create/change the contract.
    But when we delete the contract from VA42, Control is coming to this message statement and is giving Short dump. Below is the error analysis of the dump.
    Error Analysis:
    During "Exit Command" processing, the program tried to send a " " message.
    This is not allowed at this point in processing.
    The program had to be terminated.
    Screen name.............. "SAPMV45A"
    Screen number............ 4001
    If any one has come across such scenario/any work around for this problem please let me know your inputs. Your inputs are highly appreciated.
    I am working on 4.6C version of SAP.
    Note: When i issue information/Warning message contract is getting deleted after displaying the message.
    Thanks,
    Vinod.

    I exactly replicated the same in DELETE_DOCUMENT also
    I am getting the Dump. I tried with exit also , but it continued and deleted. To avoid deletion we have to use Leave program or LEAVE TO CURRENT TRANSACTION.
    Delete Function is Defined as EXIT command. so it is not possible to give error message. To convice you i just copied demo program and raised the error message.
    it is also giving the dump.
    copy the demo program DEMO_DYNPRO_AT_EXIT_COMMAND and make this change , information to error .
    MODULE cancel INPUT.
      MESSAGE e888(sabapdocu) WITH text-001 ok_code input1 input2.
      IF ok_code = 'CANCEL'.
        CLEAR ok_code.
        LEAVE PROGRAM.
      ENDIF.
    ENDMODULE.
    and see...

  • Custom Error message in portal

    HI Experts,
    I trying to implement cutom error messages in portal. By Following the below link.
    [https://cw.sdn.sap.com/cw/community/docupedia/nw70java/blog/2010/03/21/custom-error-messages-in-the-portal]
    As of now I trying to implement it for error code "500".
    <error-page>
                 <error-code>500</error-code>
                 <location>/Customerrors/500.html</location>
           </error-page>
    </web-app>
    The above code I pasted in web.xml. 500.html is there in customerrors folder. I have also restrated the system.
    when I log in to portal system still I could see standard message coming for "500" code error not the custom one from 500.html.
    Iam using EP7.0 EHP1 .
    Thanks
    Surender Singh Dahiya

    Surender,
    I guess it should work in the similar fashion.However, I do not have access to a portal system now. Will try testing the scenario soon and keep you posted.
    Cheers!
    Sandeep Tudumu

  • Custom error messages in scheduler_job_run_detail

    Is it possible for a job to send custom error# and customer error message to error# and additional_info in schedulerjob_run_details table

    Never mind, I have figured it out. All one needs to do is RAISE application error and pass erro# and a custom msg.

  • Custom error messages impossible with jsf ea4??

    Hello,
    Does jsf allow custom error messages for built-in validators?
    I was told by a member of the jsf team that what is described in the tutorial applies only to future versions of jsf.
    Is this a bug? If it isn't and if it is indeed possible to have your own error messages for built-in validators, I would be grateful for someone of the jsf team to help me.
    I have already posted some messages asking for help but I never got any answer.
    Julien

    If a validator wants to add an error message to the current page, it has to call FacesContext.addMessage() with a javax.faces.application.Message argument. The design intent is that you can look up localized messages (defined in the config file) via MessageResources -- that's the part that does not work right now.
    In the interim, though, you can construct your own Message instances by leveraging the MessageImpl class:
    context.addMessage
    (new MessageImpl(Message.SEVERITY_ERROR,
    "You goofed",
    "Here are the gory details..."));
    or look up the message strings from a resource bundle.
    Craig

Maybe you are looking for