How to capture error message from standard function module

Dear friends
when i  execute standard function module in finance , i am getting error message , pls check the below screen shot,
how to capture the below error message so that i have display in my webdynpro component
Thanks
Vijaya

Hello Vijaya,
Incase of BAPI's they have a return table parameter T_RETURN. Just read that return table to get the error message.
Incase of normal function modules, there will be exceptions raised for the message used inside the function module. Just read the sy-subrc after the FM and based on the sy-subrc value find the respective exception raised.
May be you can try like this, whenever the message is raised it will be stored in the system variable.
CALL FM.
check for the system variables.
sy-msgid = Message ID of the latest message raised.
sy-msgno = message number of the latest message raised.
sy-msgty = message type of the latest message raised.
sy-msgv1 = variable1 of the latest message raised.
sy-msgv2 = variable2 of the latest message raised.
sy-msgv3 = variable3 of the latest message raised.
sy-msgv4 = variable4 of the latest message raised.
Regards,
TP

Similar Messages

  • Catching error message from standard function module to internal table.

    Hi,
    i am calling a FM in my custom prog.
    After execution of the FM some auto generated errors is getting displayed.
    I want to pass this error to an internal table.
    Please tell me how to do this?
        CALL FUNCTION 'FORMAT_CHECK'
          EXPORTING
            i_checkrule   = t005-prbkn
            i_checkfield  = it_ven-bankn
            i_checklength = t005-lnbkn
            i_checkmask   = space
            i_fname       = fname
          EXCEPTIONS
            not_valid     = 1
            OTHERS        = 2.
      IF sy-subrc <> 0.
           MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    I want to catch this particular error message in the itab.
    Thanks,
    SAM.

    Even we can create an internal table  nad move the messages to it.
    DATA : BEGIN OF L_ERR OCCURS 0,
            SNO LIKE SY-tabix,                                  "serial no
            MSGTY LIKE SY-MSGTY,                         "message type
            MSGNO LIKE SY-MSGNO,                        "message no
            ERR_TEXT LIKE T100-TEXT,                     "message text
           END OF L_ERR. 
       IF SY-SUBRC <> 0.
              L_ERR-SNO      = SY-TABIX.
              L_ERR-MSGTY    = SY-MSGTY.
              L_ERR-MSGNO    = SY-MSGNO.
              L_ERR-ERR_TEXT = TEXT-015.                        "Problem encounterd in uploading data.
              APPEND L_ERR.
              clear L_ERR.
         ENDIF.

  • How ro send error message from BADI to BAPI

    i have a BADI which is triggered from a BAPI.This BADI has only importing and changing parameters.How can i send error message to BAPI.Please reply at the earliest.
    High points can be expected.

    Hi Arshi,
         Please check whether the following link is of any use to you,
    how to capture the error message from bapi
    Best Regards.
    Reward points if it is helpful.

  • CcBPM, how to capture error message in the exception branch ?

    Hi,
    Can I capture error message in the exception branch ? how to do that ?
    because i want to raise the alert including with the error message ?
    Cheers
    Fernand

    Hello Fernand,
    I hope at the end of this you may get some knowledge on Alerts.
    /people/michal.krawczyk2/blog/2005/09/09/xi-alerts--step-by-step XI:Alerts step-by-step. (fundamental Basic)
    /people/sap.user72/blog/2005/11/24/xi-configuring-ccms-monitoring-for-xi-part-i CCMS Monitoring for XI. (CCMS monitoring for XI is enough later
    we configure to Adapter Engine).
    /people/aravindh.prasanna/blog/2005/12/23/configuring-scenario-specific-e-mail-alerts-in-xi-ccms-part--1 Configuring scenario specific E-mail alerts in XI-CCMS: Part-1
    (This is Important)
    /people/aravindh.prasanna/blog/2005/12/24/configuring-scenario-specific-e-mail-alerts-in-xi-ccms-part-2 Configuring scenario specific E-mail alerts in XI-CCMS: Part-2
    /people/aravindh.prasanna/blog/2006/02/20/configuring-scenario-specific-e-mail-alerts-in-xi-ccms-part-3 Configuring scenario specific E-mail alerts in XI-CCMS: Part 3
    /people/federico.babelis2/blog/2006/05/03/solution-manager-cen-and-alerting-configuration-guide-for-dummies Solution Manager CEN and Alerting configuration (Advanced)
    Please reward points if it is useful...
    Thanks,
    Satya Kumar

  • Copying Enchancement spots from standard function module to Z fun module

    Hi All,
    I copied standard function module SD_BACKORDER_LIST to my Z function module . But i am unable to copy the enchancement spots available in the standard function module . please give me the suggestion to copy this to my Z function module .
    Regards
    R.Vijayakumar

    Hi Martin,
    A SAP note will soon be released about this (compatible back to 6.40)
    There is a light version available in 7.3 to transfer data between PFCG and ST01.
    There is an optional Rolls-Royce version available for Z-codes / functions and the import parameter specific checks. The trick is to keep the original context of the call and maintain the proposals to the RFC enabled entry point, and know whether the tcode triggered it or the external caller.
    There is a service delivered which is context sensitive (e.g. the message type of the IDOC determines the application authorizations needed for synchronous processing, so SAP cannot deliver SU24 reliable proposals and the ones they tried for the /SDF/ are very isolated..).
    You need a "common functions" role for the basic scenarios like you have for interactive SAPGUI end-users, and then you need a runtime analyzer to perfect SU24 context sensitively. You also need to distinguish between a local BAPI (context is tcode) and remote one (context is RFC protocol, or http protocol... etc)
    That comes with the SAP Note...  (it is not released yet. I will update this with the number in the next weeks.)
    --> Just a little heads-up and insight that there is some light at the end of the tunnel and you can even order it as a service from SAP to fix your Z-problems for you. The question happened to match that which I know SAP is working on.
    Cheers,
    Julius
    Disclaimer : I have done many such spagetti fixes in the wild and developed the tool and services for customer scenarios together with SAP from my experiences, it is one of my favourite topics --> the Rolls-Royce version with Z-functions, hard-wired external RFC clients and configuration scenario dependent checks includes consulting fees if you want SAP to secure your own scenarios for you. The tools help this, but you cannot fully automate or propose it fro SU24 in "factory settings".

  • How to create textpool by using standard function module?

    hi,
    gurus.
    I have find two function modules ( RS_TEXTPOOL_READ / BX_AGR_READ_TEXTPOOL ) which is used to read but i want to write into the textpool is there any standard function module

    REPORT ZTEST1.
    WRITE : / 'ddddddd'.
    WRITE : / 'ddddddd'.
    WRITE: / 'hhhhhhh'.
    WRITE: / 'ddddddd'.
    WRITE: / 'ddddddd' , 'uuuuuuuu'.
    WRITE: / 'ddddddd', 'sssssssss'.
    for example i am this report i want to convert it into text elements like
    REPORT ZTEST1.
    WRITE : / 'text-001'.
    WRITE : / 'text-001'.
    WRITE: / 'text-002''.
    WRITE: / 'text-001''.
    WRITE: / 'text-001'' , 'text-003''.
    WRITE: / 'text-001'', 'text-004'.
    this elements also store into the textpool so how can we achieve  this functionality by using standard function module.
    can any body give some idea .
    shabeer ahmed

  • How to capture error message log for Tcode MIR7

    Hi ,
    I have a problem to capture the error message outside the tcode which are created by MIR7/MIR0 .
    Are they stored in any database table?
    Is there any other way to access them?
    Anybody knows how to solve this that will be very helpful.
    Thanks,
    Anu

    call transaction 'XK01' using i_bdcdata
                     mode 'N'
                     update 'S'
                     messages into i_bdcmsgcoll.
    if sy-subrc <> 0.
        perform get_error.
            write:/ itab , v_text.
    endif.
    *Form
    form get_error.
    loop at i_bdcmsgcoll.
    CALL FUNCTION 'FORMAT_MESSAGE'
    EXPORTING
       ID              = i_bdcmsgcoll-MSGID
       LANG            = sy-langu
       NO              = i_bdcmsgcoll-MSGNr
       V1              = i_bdcmsgcoll-MSGV1
      V2              = SY-MSGV2
      V3              = SY-MSGV3
      V4              = SY-MSGV4
    IMPORTING
       MSG             = v_text
    EXCEPTIONS
      NOT_FOUND       = 1
      OTHERS          = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endloop.
    endform.                    " get_error
    Edited by: Bala Krishna on Sep 9, 2008 7:50 PM

  • How to capture error message in a FM call during exception

    Hi,
    The FM i'm trying to call is giving an exception and don't have the built in mechanism to pass on the error message that occured during processing.
    However, if i see the job log in SM37, I'm able to see the corresponding error message.
    Please let  me know on how to capture this error message with in my program.
    Thanks,
    Vijay.

    Hi,
    add the exceptions...ERROR_MESSAGE to capture the error message..raised in the function module.
             EXCEPTIONS
                  ERROR_MESSAGE = 1.
    Thanks
    Naren

  • How to access error messages from gateway response in browser?

    hi,
    i get 400 bad request as response with error messages and transaction id .
    i need those messages in my alert box.
    how to do it?
    thanks and regards,
    kartik

    Hi,
    Now just use below code.
      oModel.read( sRead, null, null, true, function(oData, oResponse){
                          alert("Read successful: " + JSON.stringify(oData));
    },function(oError){
                          alert("Read failed");
                       var oXmlData = oError.response.body;
                       var oXMLModel = new sap.ui.model.xml.XMLModel();
                       oXMLModel.setXML(oXmlData);                              
                        console.log(oXMLModel.getProperty("/message")); 
                        console.log(oXMLModel.getProperty("/code")); 
                        console.log(oError);
    with above code, you will be able to read the response from body. also no need to add messages to header that I mentioned in earlier reply.
    I believe with above code, you will be able to read exact error messages.
    Regards,
    Chandra

  • Capture error messages from stored procedure calls

    Hi there,
    How do I capture a stored procedure calls error messages provided the stored procedures does not have output parameters? This questions applies to Oracle 7.3.4 stored procedures calls.
    TQ
    Neo

    There are two parts.
    The stored proc must 'throw' an exception.
    And java must catch it.
    You probably already have the java part. That is the catch(SQLException).
    As for the stored proc you can use the following search string in the jdbc forum
    raise oracle
    You need to use 'raise' in the stored proc but I am not sure of the exact form, but one of the threads using the above search string is likely to have it.

  • How to raise error message from PAI of oops ALV report

    Hi All,
    I have a requirement to raise error message form editable oops alv . After entering the data and then press SAVE button .
    Please help.
    Thanks in Advance

    HI SK,
    Write a Local class (Event Handeler) to handel the events. In Editable ALV once the user enter a value, CL_GUI_ALV_GRID will raise an event called DATA_CHANGED.
    1. Define and Implement a local class to handle that event.
    In the implementation of this class you need to get data from imported object to an internal table, then compare the same with the ALV output table.
    * Local Class to handler the events raised from the ALV Grid
    CLASS LCL_EVENT_HANDLER DEFINITION.
    PUBLIC SECTION.
    * Method to handel EDIT event, DATA_CHANGED of CL_GUI_ALV_GRID
      METHODS : ON_DATA_CHANGE FOR EVENT DATA_CHANGED OF CL_GUI_ALV_GRID
                           IMPORTING ER_DATA_CHANGED.
    ENDCLASS.
    * Event handler class Implementation
    CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
      METHOD ON_DATA_CHANGE.
        DATA : LT_MODIFY TYPE LVC_T_MODI,
                   LS_MODIFY TYPE LVC_S_MODI.
    * Copying changed data into intenal table from Object
        LT_MODIFY = ER_DATA_CHANGED->MT_MOD_CELLS.
    * Modifying the ouptut table with the changed values
        IF LT_MODIFY[] IS NOT INITIAL.
              *Compare the ALV Output table with LT_MODIFY
        ENDIF.
      ENDMETHOD.
    ENDCLASS.
    Then raise  a message on required condition in the same method.
    Note: To trigger the above method, you need to set event handler before displaying ALV (before calling method SET_TABLE_FOR_FIRST_DISPLAY)
    * Creating object for the Local event handler class
      CREATE OBJECT GR_HANDLER.
    * Set handler (call method of Event_handler) to handler Edit event
      SET HANDLER GR_HANDLER->ON_DATA_CHANGE FOR  GR_GRID.
    Regards,
    Vijay

  • 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 eliminate error messages that some functions produce?

    ?

    Hi,
    In order for the error messages not to appear, you can comment them out. Please look at the example below:
    CALL FUNCTION 'HRCA_PLANT_GET_COMPANYCODE'
               EXPORTING
                    plant                 = wa_equz2-iwerk
               IMPORTING
                    companycode           = lv_bukrs
               EXCEPTIONS
                    no_company_code_found = 1
                    plant_not_found       = 2
                    OTHERS                = 3.
         IF sy-subrc <> 0.
           MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
         ENDIF.
    Or you can just leave them out.
    Hope this helps...
    P.S. Please award points for useful answers.

  • How to get error message from the BPEL process

    Hi,
    We have some BPEL processes running in BPEL PM 10g. If any of these BPEL process fails, we would like to get the error message caused this process to fail.
    Please let me know where does the BPEL proccess holds (table/file) these details. or is it possible to get the error message programatically.
    Thanks

    You can go through below link that can help
    http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/faults.htm#sthref1186
    http://bpelknowledge.blogspot.com/2010/07/error-conditions-that-cannot-be-handled.html
    http://blog.whitehorses.nl/2009/11/03/error-handling-in-soa-suite-11g/
    Hope it helps!!
    Thanks
    AJ

  • How to display error messages for Standard validators

    I am designing a simple login application.I have two input text-fields,say,email and password.
    In my JSF page i have following,
    <h:inputText id="email" value="#{User.email}" >
    <f:validateLength minimum="1" maximum="6"/>
    </h:inputText>
    <P><BR>
    <B>Password: </B>
    <h:inputSecret id="password" value="#{User.password}" required="true">
    <f:validateLength minimum="1" maximum="5"/>
    </h:inputSecret></P>
    Now if the user does not enter anything in one or both of the text boxes i.e if null value is transfered to the server,
    I want the JSF to display some error message to the user that he has not filled up all the fields correctly.
    Even i tried with something like,
    <B><h:message for="email"/></B>     
    but still it does not work.
    I am using JSF1.0 Final.
    Well this problem was dam simple with JSF1.0 beta beacause of the existence of <h:output_errors>.
    Is there any such facility with JSF1.0 final?

    Your h:inputText does not contain required="true". I guess, it should. Otherwize, validateLength will not work.

Maybe you are looking for

  • MAC requests?

    I requested my MAC from my current ISP as BT told me upon ordering my new package. This was last week.... I phoned 1st and was told I had to e-mail, which I did, got confirmation e-mail, then the next day they try to get me to stay with them, when I

  • How do I view connection status of attendees in version 9

    I have tried Pod options but there is no option to view connection status as described in this article:http://www.connectusers.com/tutorials/2009/03/voip_best_practices/index.php

  • Can't install/uninstall Flash v10 in Debian.

    Hello! I downloaded http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.deb to upgrade my old Flash v10 in Debian, but I am getting problems: # dpkg --install install_flash_player_10_linux.deb (Reading database ...

  • Difficulty downloading episodes from your feed, but everything looks good :(

    So I've just started up a podcast and I'm trying to get it in to iTunes, but can't for the life of me figure out what the problem is. The feed is here: http://theinquisitiveatheists.com/podcast.xml It has a single episode, and I can subscribe using t

  • Want to make google my default search engine in safari

    When doing a search today on my ipad, I inadvertently checked a box asking to have yahoo become default search engine. I didn't realize until it was too late. I want to go back to using google for search when I have safari open. Don't seem to see a w