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.

Similar Messages

  • 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

  • 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 catch exception thrown from a function module?

    Hi all,
             When we are calling a function module from JSPDynpage setting some import parameters, If in some case an exception is thrown in the function module.  How can we catch the same exception in the JSPDynpage program?
    Thanks & Regards,
    Ravi

    Hi Ravi
                                    Try this
                                                try
                    Object retMsgs = output.get(bapiretrunmsgobject);
                      if(result != null )
    IrecordSet rmsg = (IrecordSet) result
                   catch(Exception ex)
                        printException(ex, "Error getting function result");
    Lemme know for any further questions.
    Regards
    Praveen

  • Error message when using function module HRIQ_TESTRESULTS_CREATE

    Hi,
    I need your help, I'm trying to use function module HRIQ_TESTRESULTS_CREATE to create external test results, I've used this function before without subscores, now I need to create subscores, but I get the message: "Grading scale UBID applies".
    The test type EXAM_UB_ING has assigned the UBID academic scale, which has a range from 1 to 677. Test type EXAM_UB_ING has 3 subtests (grammar, listening and reading) which also have the UBID academic scale assigned.
    I think this isn't a customizing problem because I can create test results with subscores using the PIQST00 transaction, the error message happens just when using the function module.
    I'm using this import parameters:
    STUDENT:
    PL:           01
    OT:          ST
    OBJID:     Student ID
    TESTRESULTS_HEADER:
    ISSUEDATE                      08.02.2010
    VALIDDATE                      30.04.2010
    TEST_GUID
    TESTEO                         50000269
    TRANSEO                        00000000
    TESTTYPE                       EXAM_UB_ING
    SESSIONID                      T1
    SESSIONYEAR                    2010
    ENTRYDATE                      08.02.2010
    TESTPASSFAIL
    TESTTOTRES                     458
    TESTSCALE_ID
    TOTALPERCENT1                   0,00
    TOTALPERCENT2                   0,00
    ENTRYMODE
    SUBTY
    Table TESTRESULTS_SUBSCORES:
    SUBTESTID            GRAMMAR
    SUBTESTTRES      GRAMMAR
    SUBT                     203
    SUBTESTID            READING
    SUBTESTTRES      READING
    SUBT                     120
    Does anybody know which could be the error? Or any other function module which I can use? (with HRIQ_TESTRESULTS_PROCESS_DATA I get the same error message).
    Thanks in advance!
    Araceli

    Araceli,
      I just noticed. You are populating SUBTESTSCALE_ID in subtest result structure.That's the reason it's throwing this error. it is trying to match Scale ID from test with value in sub test result scale ID.
    Prabhat Singh

  • Is it possible to circumvent error message within a function module?

    Hello friends,
    Is it possible to circumvent error message generation from within a function module? My program calls a FM (namely FKK_S_CADOCUMENT_WRITEOFF) to do some updates. However, in certain cases this FM throws error messages and terminates the whole process. I cannot control the aftermath because it never gets back to the calling program.It stops at the FM level and not at my program level.
    In essence, what I would like to do is to let the FM do its thing, generate some kind of exception (but no error message), come back to the calling program, and then I can capture the status in my program and do what is necessary from then on.
    Your help is greatly appreciated

    Hi,
    Do not use Excerption Tab.
    Instead declare a variable or Structure at export parameter.
    Which will return you error Description or Status of the FM.
    For Example.
    Goto Se37 ---> key in FM name of yours.
    Go to Table tab
    At Parameter Name Column key in RETURN, Type as LIKE and Associate type as BAPIRET2.
    ThankS & regards,
    ShreeMohan
    Edited by: ShreeMohan Pugalia on Aug 10, 2009 12:31 PM

  • Catch the Exceptions of standard Function Module

    Hi Experts,
    I am Using Version 4.6C.
    I am developing an RFC for creation of commitments into the system for this i have used 'FMFR_CREATE_FROM_DATA'  Function Module. But i need to capture the System exception so as to alert the user when it puts in invalid data. However function Module 'FMFR_CREATE_FROM_DATA' is working fine but   I am unable to System Exceptions i have tried using Function Module FORMAT_MESSAGE by importing the system variable into it but my program gets append ever time an system exception raised.
    Can anyone help in getting it fix.

    Hi,
    Which thrid party system you are configuring check the system destinations propely given or not and in third parthy which type error or any message u r getting or not.  Once if it is working find in from R/3 to other it is not RFC problem it may related to u r settings or in third parthy system not set properly.
    contact your basis teams
    Regards
    Ganesh

  • Catch Error message from WLI Process

    Hi,
    I have a big application developed with WLI and I wanna know if there is a way to recive error messagem from this application throught the ALSB. The ALSB call a WLI jpd procces by BussinesProxy.
    For example, when occurs a database error into JPD proccess, I want to receive this error and log it or pass it to another application to nofify error and so one.
    All the procces in my WLI application were developed with ClientRequestWithReturn and I am thinking in put in this return one tag called <ERROR>ORACLE-0002 - JDBC ERROR bla bla</ERROR> in case off error and <ERROR>FALSE</ERROR> when everythig went OK at the WLI Application.
    Is there another way to do this?
    Thanks!
    Edited by denimar at 05/12/2008 2:33 PM

    Hi,
    Try throwing an RPC SoapFaultException from your JPD. That should make it back to ALSB as an error and does not count as "Unhandled Exception" by WLI. Although SoapFaultExceptions are a pain to create.
    Otherwise passing an error element back in the body has worked fine for me in the past.

  • SM21 Messages stored in function modules or database tables.

    Hi Everyone,
    Can anyone please inform me where the messages from SM21 are stored, i.e in which function modules or through which data base tables. And how can I retrieve those messages in my ABAP program for a specific error.
    Please respond the earlier the better.
    Thanks,
    Prashant.

    Check with the table.
    T100 Messages
    Regards,
    Maha

  • Standard Function to convert internal table to binary

    Hello Firends,
    Is there a standard function that can be used to convert an internal table to binary data
    and vice versa.
    regards
    kaushik

    Hi,
    I am not sure what is the requirement but you can download internal table contents in BINARY format using GUI_DOWNLOAD and viceversa you can upload Binary contents.
    ashish

  • Regarding error message from a transaction

    Hello all,
          I have a scenario where i need to collect all the error message from a trasaction and display it in a pop up.
          i am calling a function module and inturn calling transaction 'FB08' using bdc. i may get one or more error message. if there are more than one messages from my function module then i need to display this messages in a popup.
        Currently i am displaying one message using 'message ID' syntax at the bottom. what should i do to display error messages in a popup if there are more message
    Thanks,
    Raju N.

    use following fm.  
    CALL FUNCTION 'COPO_POPUP_TO_DISPLAY_TEXTLIST'
          EXPORTING
          TASK             = 'DISPLAY'
            titel            = 'Creation Log'
        IMPORTING
          FUNCTION         =
          TABLES
            text_table       = i_documents_log.

  • Display message from exit function on web

    Hi all,
    Is there a way to display the output error message from Exit Function on web interface?
    Regards,
    Kadir

    Hi All,
    I have a similar problem - but for variable exits.
    The solution posted by Kadir works fine for an exit changing xthdata (bps exit function).
    I want to display a message in Web created within an bps variable exit. In this case the  solution does not work.
    Does anyone of you experts have an idea how to append a message to the message table used for the WebInterface?
    Thanks in advance and best regards
    Steffen

  • Error in the SAP standard function module 'RSDRI_INFOPROV_READ'.

    Hello Experts,
    We upgraded from 3.5 to 7,0 support pack 17 .
    After upgrade we are getting error
      with return code 11 'Others´'.
    While debugging the standard function module we found that the standard method s_r_infoprov->read is being executed with the return code = 8 (inherited_error).
    Any suggestions?
    Regards,
    Vivek

    Not sure if the parameters provided were correct,you may wish to do a sanity check
    Input Parameters:
    1. I_INFOPROV - This will hold the Name of the Info Cube from where we need the pull the data.
    2. I_T_SFC - This parameter is in the format of Internal Table which holds the Character Info Objects we need to pull from the Source Cube.
    3. I_T_SFK - This parameter is also in the format of Internal Table which holds the Key Figure Info Objects which we need to pull from the Source Cube.
    4. I_T_RANGE - This is also in the format of Internal Table which holds the Selection criteria for which we need to pull from the Source Cube u2013 For example the Company Code u2013 001 and Fiscal Year Period u2013 001/2006.
    5. I_T_REQUID u2013 Selection of cube data based on Request Id.
    6. I_SAVE_IN_TABLE u2013 In case you need to save the data in DB table
    7. I_REFERENCE_DATE u2013 This holds the current date.
    8. I_AUTHORITY_CHECK u2013 This will hold the value u2018Ru2019, which is meant for READ.
    9. I_DEBUG u2013 This is for Debugging mode and holds the default value u2018Yu2019.
    Output Parameters:
    1. E_T_DATA u2013 This Output Parameter is of internal table format, in which we can mention the output fields (For all the fields mentioned in the Input Parameter, this output parameter will hold the values).
    2. E_END_OF_DATA u2013 Once the FM is executed successfully, this output parameter will hold the value u2018Xu2019, means extraction completed successfully.
    Hope it Helps
    Chetan
    @CP..

  • Is it possible to send error message from Adapter Module to CCMS?

    Hi
    Is it possible to send error message from Adapter Module  to CCMS...?I have written on adatper module from there i have to send error message to CCMS or SXMB_MONI. Is it possible if yes please send me the related documents
    Best Regards
    Ravi Shankar B

    Hi
    I have written following User Defined Exeption in my Module program
    class DuplicateFileException extends ModuleException{
              DuplicateFileException(String message){
                   super(message);
    I am throwing my Exception like this
    try{
         throw new DuplicateFileException("Duplicate File");
    }catch(DuplicateFileException e){
         throw e;
    But i am not getting this exception in SXMB_MONI. In adpater monitoring i am getting the following exceptions
    <b>
    2007-05-16 15:51:30 GMT+05:30: Retry interval started. Length: 5.000 s
    - 2007-05-16 15:51:30 GMT+05:30: Error: java.lang.NullPointerException
    - 2007-05-16 15:51:30 GMT+05:30: An unknown error occured.
    - 2007-05-16 15:51:30 GMT+05:30: Processing started
    - 2007-05-16 15:51:25 GMT+05:30: Error: java.lang.NullPointerException</b>
    can any one give me the idea how to send error from module program to SXMB_MONI
    Thanks & Regards
    Ravi Shankar B

  • Any standard function module to read data from a cube

    Hi,
    I want to read data from a cube say XYZ, into an internal table. Is there any standard function module to do this? If so can anyone plz tell me what change should i make in the function module for my requirement.
    Regards
    BW Fresher.

    Hi R,
    Try function module 'RSDRI_INFOPROV_READ'
    ABAP Report RSDRI_INFOPROV_READ_DEMO contains an example of how the function module can be used.
    Udo

Maybe you are looking for

  • Hide settings icon from home screen in an enterprise environment

    Hi, This question may have already been answered but I was wondering if there was anyway apart from jailbreaking the iPad, the settings icon can be hidden. I have seen it done before on other iPads that have not been jailbroken. Is there an xml file

  • Down Payment against PO - Urgent

    Hi, I am MM consultant my issue When user entering down payment in F-47 for a purchase oder the system is allowing the amount more than PO amount  which is logically incorrect.How can I prevent this ? Regards, Chetan.

  • How to access my itunes library online?

    I used to be able to access my itunes library for my ipod touch by going online. Now I cannot find any choice that allows me to do that. Is the site lost in the CLOUDS? Am not happy with the cloud thingy. How to I get to my library to make changes, a

  • XSLT Help On Loop

    I have an array of 2 stops that I am looping over. Each element can have multiple orders. When I map to the target there is only 1 place to put orders per stop. So I want to loop over all of the orders and concatenate them with a "|" in 1 field on th

  • My windows was down but I can't find the installation CD in My T60

    My windows was down but I can't find the CD for windows XP home edition. I tried to call the local repair center and they said they only solve the hardward problem. Anyone knows where I should ask for help or where I can get the CD for windows XP hom