How to catch error or exception for FM JOB_OPEN in code

Hi,
i am calling the FM 'JOB_OPEN' in my code to catch the error message when sy-subrc ne 0 but it is giving dump as there is nothing coming in sy-msgid, sy-msgtype. but when i just run this FM in SE37 then I am able to get the error for example when I pass blank for jobname then error comes is 'job missing'  which is fine.
But this error I am not able to display from ABAP code which is as :
CALL FUNCTION 'JOB_OPEN'
          EXPORTING
            jobname          = g_jobname
          IMPORTING
            jobcount         = g_jobcount
          EXCEPTIONS
            cant_create_job  = 1
            invalid_job_data = 2
            jobname_missing  = 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.
Please suggest how to correct it ???
Thanks,
Mohan

try this way
CALL FUNCTION 'JOB_OPEN'
           EXPORTING
             jobname          = g_jobname
           IMPORTING
             jobcount         = g_jobcount
           EXCEPTIONS
             cant_create_job  = 1
             invalid_job_data = 2
             jobname_missing  = 3.
         IF sy-subrc NE 0. 
            if sy-subrc = 1.
              message 'cant_create_job  '   type 'E'.   "Exxception 1
            elseif sy-subrc = 2.
              message 'invalid_job_data  '   type 'E'.   "Exxception 2
            else.
              message ' jobname_missing '   type 'E'.   "Exxception 3
            endif.
       ENDIF.
Regards,
Prabhudas

Similar Messages

  • Pop Up blocker exceptions are not saved in the browser for use, the next time the PC reboots. How do you save these exceptions for long term use?

    Pop Up blocker exceptions are not saved in the browser for use, the next time the PC reboots. How do you save these exceptions for long term use?

    In case you are using "Clear history when Firefox closes":
    *do not clear the Site Preferences
    *Tools > Options > Privacy > Firefox will: "Use custom settings for history": [X] "Clear history when Firefox closes" > Settings
    *https://support.mozilla.org/kb/remove-browsing-search-and-download-history
    Note that clearing "Site Preferences" clears all exceptions for cookies, images, pop-up windows, software installation, passwords, and other website specific data.
    If you have software like Advanced SystemCare (Surfing Protection feature) that might reset some files to older versions to protect these files against changes then check the settings or uninstall this software.

  • Error "An exception occurred within the external code..." when stopping LabView

    I am having an error "An exception occurred within the external code called by a Call Library Node...", see the attached image, when I am trying to stop LabView. As a result of the error, the tag engine doesn't close normally.
    I am using LabView 7.1 with DSC. I read values from a LNS (LON) OPC-server.
    Is this a known issue and is there any way to repair it? I haven't noticed any direct consequences because of the error except that when I re-start LabView and the close it again without having first rebooted the computer, tag engine sometimes starts again when it should stop. This is fixed by always rebooting the computer before restarting LabView. I am getting suspicious that there might be some strange behaviour because the error says "it might have corrupted LabView's memory".
    For example, sometimes when I have made a copy of an input number field to another, they follow each other's value changes even though there is no connections between them.
    Simo Martikainen
    Message Edited by Simo Martikainen on 12-17-2008 03:11 AM
    Attachments:
    LabView stop error.JPG ‏45 KB
    TAGENGINE.JPG ‏16 KB

    Especially in earlier versions of LV these sorts of errors were common if the call wasn't made just right or the parameters were set up incorrectly.
    Where did you get the DLL from? Was it written internally or did it come from another vendor?
    Try building a DLL call into a very small, simple application. Do you see the same issue?
    Are there multiple calls to the same DLL in your code? If so, is there problems with all of them?
    Can you track it down to a specific function that you are trying to access that is causing the problem?
    Is there any indication of a memory leak?
    Finally any additional information you can provide would helpful.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How to catch error records while inserting

    hi all,
    i am trying to insert some records in my function where i need to catch the records that are not inserted due to some data incosistencies. i am using a cursor that has the data. can you please let me how can i accomplish this .below is the part of code which does this but it is not working.
    open c_upd;
    fetch c_upd bulk collect into tbl_rftm_pid_details_upd;
    close c_upd;
    if tbl_rftm_pid_details_upd.count > 0 then
    BEGIN
    FORALL i IN 1.. tbl_rftm_pid_details_upd.COUNT SAVE EXCEPTIONS
         insert into rftm_pid_details
    (pid,project_description ,start_date ,end_date ,cust_name ,end_cust_name ,processing_status,
    pid_status ,effective_date,offshore_onsite ,unit ,sub_unit ,pm_id, pm_name,product ,
    project_location ,rm_id ,rm_name ,pid_release_date ,project_type ,project_type_desc ,
    pid_class_desc ,pa_number ,parent_pid ,ideal_ref_no_zv ,ideal_ref_no_lv ,opp_id ,opp_status ,
    bid_margin ,bpw_version ,bid_vsoe ,est_backlog ,div ,grp ,order_number ,project_exec_type ,
    sow_ol_number ,cd_number ,billable_psd ,non_billable_psd ,total_psd ,ltd_billable_psd ,
    ltd_non_billable_psd ,npr_psd ,cash_cntry ,version_number ,system_date )
    values
    (tbl_rftm_pid_details_upd(i).pid,tbl_rftm_pid_details_upd(i).project_description ,tbl_rftm_pid_details_upd(i).start_date ,tbl_rftm_pid_details_upd(i).end_date ,tbl_rftm_pid_details_upd(i).cust_name ,tbl_rftm_pid_details_upd(i).end_cust_name ,tbl_rftm_pid_details_upd(i).processing_status,
    tbl_rftm_pid_details_upd(i).pid_status ,tbl_rftm_pid_details_upd(i).effective_date,tbl_rftm_pid_details_upd(i).offshore_onsite ,tbl_rftm_pid_details_upd(i).unit ,tbl_rftm_pid_details_upd(i).sub_unit ,tbl_rftm_pid_details_upd(i).pm_id, tbl_rftm_pid_details_upd(i).pm_name,tbl_rftm_pid_details_upd(i).product ,
    tbl_rftm_pid_details_upd(i).project_location ,tbl_rftm_pid_details_upd(i).rm_id ,tbl_rftm_pid_details_upd(i).rm_name ,tbl_rftm_pid_details_upd(i).pid_release_date ,tbl_rftm_pid_details_upd(i).project_type ,tbl_rftm_pid_details_upd(i).project_type_desc ,
    tbl_rftm_pid_details_upd(i).pid_class_desc ,tbl_rftm_pid_details_upd(i).pa_number ,tbl_rftm_pid_details_upd(i).parent_pid ,tbl_rftm_pid_details_upd(i).ideal_ref_no_zv ,tbl_rftm_pid_details_upd(i).ideal_ref_no_lv ,tbl_rftm_pid_details_upd(i).opp_id ,tbl_rftm_pid_details_upd(i).opp_status ,
    tbl_rftm_pid_details_upd(i).bid_margin ,tbl_rftm_pid_details_upd(i).bpw_version ,tbl_rftm_pid_details_upd(i).bid_vsoe ,tbl_rftm_pid_details_upd(i).est_backlog ,tbl_rftm_pid_details_upd(i).div ,tbl_rftm_pid_details_upd(i).grp ,tbl_rftm_pid_details_upd(i).order_number ,tbl_rftm_pid_details_upd(i).project_exec_type ,
    tbl_rftm_pid_details_upd(i).sow_ol_number ,tbl_rftm_pid_details_upd(i).cd_number ,tbl_rftm_pid_details_upd(i).billable_psd ,tbl_rftm_pid_details_upd(i).non_billable_psd ,tbl_rftm_pid_details_upd(i).total_psd ,tbl_rftm_pid_details_upd(i).ltd_billable_psd ,
    tbl_rftm_pid_details_upd(i).ltd_non_billable_psd ,tbl_rftm_pid_details_upd(i).npr_psd ,tbl_rftm_pid_details_upd(i).cash_cntry ,tbl_rftm_pid_details_upd(i).version_number ,tbl_rftm_pid_details_upd(i).system_date);     
    EXCEPTION
    WHEN ex_dml_errors THEN     
    l_exceptions := SQL%BULK_EXCEPTIONS.COUNT;
    FOR i in 1.. l_exceptions LOOP
    l_index := SQL%BULK_EXCEPTIONS(i).error_index;
    l_err_code := SQL%BULK_EXCEPTIONS(i).error_code;
    INSERT INTO rftm_pid_details_exception
         (pid,err_code)
    VALUES
         (tbl_rftm_pid_details_upd(l_index).pid,
         l_err_code);
    END LOOP;
    END;     
    END IF;

    how can i use this DBMS_ERRLOG.CREATE_ERROR_LOG in my function?
    i tried doing this, before the insert command.
    DBMS_ERRLOG.CREATE_ERROR_LOG('rftm_pid_details');
    BEGIN
         FORALL i IN 1.. tbl_rftm_pid_details_upd.COUNT
    INSERT INTO rftm_pid_details
    (pid,project_description ,start_date ,end_date ,cust_name ,end_cust_name ,processing_status,
    pid_status ,effective_date,offshore_onsite ,unit ,sub_unit ,pm_id, pm_name,product ,
    project_location ,rm_id ,rm_name ,pid_release_date ,project_type ,project_type_desc ,
    pid_class_desc ,pa_number ,parent_pid ,ideal_ref_no_zv ,ideal_ref_no_lv ,opp_id ,opp_status ,
    bid_margin ,bpw_version ,bid_vsoe ,est_backlog ,div ,grp ,order_number ,project_exec_type ,
    sow_ol_number ,cd_number ,billable_psd ,non_billable_psd ,total_psd ,ltd_billable_psd ,
    ltd_non_billable_psd ,npr_psd ,cash_cntry ,version_number ,system_date )
    VALUES
    (tbl_rftm_pid_details_upd(i).pid,tbl_rftm_pid_details_upd(i).project_description ,tbl_rftm_pid_details_upd(i).start_date ,
    tbl_rftm_pid_details_upd(i).end_date ,tbl_rftm_pid_details_upd(i).cust_name ,tbl_rftm_pid_details_upd(i).end_cust_name ,
    tbl_rftm_pid_details_upd(i).processing_status,tbl_rftm_pid_details_upd(i).pid_status ,tbl_rftm_pid_details_upd(i).effective_date,
    tbl_rftm_pid_details_upd(i).offshore_onsite ,tbl_rftm_pid_details_upd(i).unit ,tbl_rftm_pid_details_upd(i).sub_unit ,
    tbl_rftm_pid_details_upd(i).pm_id, tbl_rftm_pid_details_upd(i).pm_name,tbl_rftm_pid_details_upd(i).product ,
    tbl_rftm_pid_details_upd(i).project_location ,tbl_rftm_pid_details_upd(i).rm_id ,tbl_rftm_pid_details_upd(i).rm_name ,
    tbl_rftm_pid_details_upd(i).pid_release_date ,tbl_rftm_pid_details_upd(i).project_type ,tbl_rftm_pid_details_upd(i).project_type_desc ,
    tbl_rftm_pid_details_upd(i).pid_class_desc ,tbl_rftm_pid_details_upd(i).pa_number ,tbl_rftm_pid_details_upd(i).parent_pid ,
    tbl_rftm_pid_details_upd(i).ideal_ref_no_zv ,tbl_rftm_pid_details_upd(i).ideal_ref_no_lv ,tbl_rftm_pid_details_upd(i).opp_id ,
    tbl_rftm_pid_details_upd(i).opp_status ,tbl_rftm_pid_details_upd(i).bid_margin ,tbl_rftm_pid_details_upd(i).bpw_version ,
    tbl_rftm_pid_details_upd(i).bid_vsoe ,to_number(tbl_rftm_pid_details_upd(i).est_backlog) ,tbl_rftm_pid_details_upd(i).div ,
    tbl_rftm_pid_details_upd(i).grp ,tbl_rftm_pid_details_upd(i).order_number ,tbl_rftm_pid_details_upd(i).project_exec_type ,
    tbl_rftm_pid_details_upd(i).sow_ol_number ,tbl_rftm_pid_details_upd(i).cd_number ,tbl_rftm_pid_details_upd(i).billable_psd ,
    tbl_rftm_pid_details_upd(i).non_billable_psd ,tbl_rftm_pid_details_upd(i).total_psd ,tbl_rftm_pid_details_upd(i).ltd_billable_psd ,
    tbl_rftm_pid_details_upd(i).ltd_non_billable_psd ,tbl_rftm_pid_details_upd(i).npr_psd ,tbl_rftm_pid_details_upd(i).cash_cntry ,
    tbl_rftm_pid_details_upd(i).version_number ,sysdate)
    LOG ERRORS
    REJECT LIMIT UNLIMITED;
    when i try compiling the function, it is giving an error table not exists for 'rftm_pid_details'.

  • How to catch errors in calling program when using SUBMIT ... AND RETURN ?

    Hi ,
    I am calling a report using submit and return statement from a function module. The report has select-options field for a date field. If user enters a date in low, which is greater than high, getting error message "Lower limit is greater than upper limit".
    How to catch this error without endup stoping on selection screen of the report?
    In the documentation, I read :
    Programs called with SUBMIT ... AND RETURN or CALL TRANSACTION cannot propagate exceptions to the caller, because exception objects are bound to the internal mode of a program.
    Is there any way to overcome this?
    Also my aim is to write a validation on the date selection-option to have the date range not more than 20 days.
    I am not sure of how to achieve this. 
    Is there a way to do validation of select-options data before submiting to the report ?
    Is there any standard FM to achieve this task?
    Thank you,
    Surya.
    Edited by: Surya on May 24, 2009 6:08 PM

    Hi Surya ,
    In your function module's code validate the date .
    If the low value of the date less than high and date period is not more than 20 then
    call transaction and in else condition raise exception.
    In your FM write like that - -
    IF   date-low LT date-high AND
                           date_difference LE '20' .
    CALL  TRANSACTION   'transaction'.
    ELSE.
    RAISE  ...........  " Raise the invalid date exception
    ENDIF.
    Regards
    Pinaki

  • How to catch Jbo-DML exception

    Dear Forum
    while exception throw from bc4j some particular
    type error such as (oracle.jbo.DMLException) JBO-26041
    message display.
    i want to catch error no 26041 inorder to display own
    messageBox.
    There is two methods
    1-:
    i used messageBundle class i overite message string but unable to customize size of dialogbox.
    2-:
    And i fund ,DML exception message return from JUErrorHandlerDlg class.So using this subclass how
    to catch and throw own message.
    Plase send me some code to write sub class of JUErrorHandlerDlg.

    Hello
    I also want to catch Exception if u r now able then plz send me the procedure
    [email protected]
    Thanks and Regards
    Prashant

  • How to catch error

    In my application I want to cathc an error from mysql database.
    Does anybody know?
    Thanks in advance.

    You should be getting an SQLException
    But if you are really getting an error you can do
    try {
       ... throws an Error
    } catch(SQLException e) {
        e.printStackTrace();
    } catch (Error e) {
        e.printStackTrace();
    }

  • Need to create 500 designs, all identical in every way except for a unique QR code

    Hi there. I am using Photoshop CS6.
    I have a design from which I want to create 500 versions of an image. All will be identical, except for the QR code which will be unique for every one.
    The placement of the QR code will be identical in all of them. It's just the actual QR code that changes.
    Any idea how I can achieve this in an automated way? I have the QR codes in a folder, already created, and I have the design already created. I just need to marry up the 2 now and end up with 500 design files to give to the printers for printing.
    Thanks for any direction on how to do this!

    I think you can do it with variables.   I haven't ever tried it, but someone posted up a link to it a few weeks back when a similar question came up.  I bookmarked it because it looked interesting:
    PS CS5 - Working with Variables | The Complete Picture with Julieanne Kost | Adobe TV
    And here's a walkthrough:
    Using Variables in Photoshop with External Data Source

  • How to identify all the information for a given company code?

    Hi,
    Our company provides data migration services for SAP and other ERP applications. Our customers provide us the specifications for extractions and conversions. We use one or more 3rd party tools to extract data from legacy systems into text/Excel files. Customers use LSMW to load generated files.
    We just got an unusual request. This customer wants to get ALL the data from SAP for a given company code and dump into Excel. They would do some manual editing on the data and load it into a new SAP client.
    In the past, customers would be more specific in their requirements. For example, they will mention Materials, Customers, Inventory, etc. In this case, the customer simply wants ALL the data for a given company code.
    Q1. Is everything in SAP related to company code, either directly or indirectly? For example, can materials be filtered by company code?
    Q2. The tools that we use let us extract data from SAP using SQL-like queries. How do I identify ALL the tables that I would need for a given company code?
    My feeling is the customer themselves are not clear on what they really want. Perhaps they are expecting us to guide them.
    I would appreciate any thoughts that you may have.
    If there is a more appropriate forum for this question, please let me know.
    Thank you in advance for your help.
    Regards,
    Peter

    hi
    t001w is the master table for plants, u can see all plants in this table.
    regads:
    rajesh.k

  • How to catch error message inside a variable?

    Hi,
    I'm trying to catch the error message inside a variable using this this command below:-
    <%=odiRef.getPrevStepLog("MESSAGE")%>
    Could you please tell me what is the right approach to capture the error message inside a variable.
    Thanks
    Anindya

    Hi Bhabani,
    I have done this and select an oracle schema.But the variables only captures the (null).Please look into this.You must have one step prior to this refresh variable. Then only it can get the status as given below.
    Returns the one-letter code indicating the status with which the previous step terminated. The state R (Running) is never returned.
    D: Done (success)
    E: Error
    Q: Queued
    W: Waiting
    M: Warning
    If you want the complete error details then you will face issues in case of multi line message. For this best option would be jython variable.Could please provide me some idea how to use this jython variable.I will update you on this soon
    Thanks
    Anindya

  • How to catch error in the Active Sync process

    Hi, we are using Flat File active sync to update IDM user attribute. Once IDM found matched record, it builts view. However, during this period, the the matched user is locked, for example. Then IDM stop processing this record then go to next record. How can I catch this error? In log file I saw error message but how can use workflow or other way to know the error? How can get ResultItem that contains error message during AS?

    Hi,
    I am doing the following....
    Assume a main workflow which calls many sub workflows ...
    1. Define two global variables as follows
    <Variable name='anyErrorOccured'><Boolean>false</Boolean></Variable>
    <Variable name='allErrorMsg'><s>Error..</s></Variable>
    2. In the all main and sub workflows, add an special 'Action' to check the errors after each Action
    <Action id='1' name='doSomething'>
    </Action>
    <Action id='2' name='checkForErrors'>
    <cond>
    <isTrue><ref>WF_ACTION_ERROR</ref></isTrue>
    set the anyErrorOccured variable to true
    Append a custom error message(hard coded) to allErrorMsg variable - error message may contain workflow name and in which action error occured
    </cond>
    </Action>
    3. Before ending the main workflow, if anyErrorOccured is true, then send an email to IDM administartor with allErrorMsg
    <Activity id='3' name='CheckOverallError'>
    <Transition to='SendOverallErrorNotificationToIDM'>
    <ref>anyErrorOccured</ref>
    </Transition>
    <Transition to='end'/>
    </Activity>
    Hope, this helps.
    Furthermore, I tried to catch the actual error trace from IDM using the following in each 'checkForErrors' Action and append all IDM error messages for email notification.
    <invoke name='getMessage'>
    <get>
    <invoke name='getErrorMessages'>
    <ref>WF_CASE_RESULT</ref>
    </invoke>
    <i>1</i> ???????
    </get>
    </invoke>
    But , it was not successful, as I could not extract the right error mesage at the right place from WF_CASE_RESULT

  • How to CATCH error from call to standard SAP Function Module

    Please, is it possible to catch the following error with the TRY CATCH ENDTRY construct?
    From a custom program, am calling CS_BOM_EXPL_MAT_V2.
    Several nested calls in, Form STL_DATEN_HOLEN (LCSS4F1I) calls FM CS_ALT_SELECT_MAT. 
    However, that call is missing the CALL_INVALID Exception. 
    CS_ALT_SELECT_MAT is raising CALL_INVALID, but since it was not included in the FM call, the RAISE_EXCEPTION runtime error is issued.
    I added a TRY CATCH ENDTRY construct around the call in the custom program using CATCH cx_root, but the program is still short dumping.
    All the research I have done has been misleading...some articles indicate all errors should be caught, some indicate only catchable runtime errors can be caught, others are not quite clear.
    So, I would like to find out if, in this scenario, it is even possible to catch this error and avoid the short dump.
    I will open a message to see about having the SAP code fixed as soon as I get authorization to do so, (as well as fix the data causing the issue in the first place), but in the meantime, I would like to handle it in my code if possible.
    ECC 6.0
    Thanks for any information!
    Kind Regards,
    Deb
    Edited by: Debra Garner on Jan 26, 2012 5:19 PM

    Hi Debra,
    You cannot catch non class based exceptions using the TRY/ENDTRY.  You might also find no luck with help from SAP since the FM in question 'CS_BOM_EXPL_MAT_V2' is not released for customer use.  The best bet is to examine why the error is occurring and figure out what needs to be done to fix it and/or avoid it in the future.
    Regards,
    Ryan Crosby

  • How to catch error message and show it in VC?

    I want to catch the error message and show it in VC.For example, if there is no data row in table view queryed from data service, then popup a window to show the message "No Data Found".I don't konw how to implement it!

    Hello Kane
    use expression{disble this after defining erroe messege} box in that popup there u can define your own message as error or warning accordingnly it display message
    I hope it work or Let me know it
    Regards
    ````Satish````

  • How to catch errors watched in sxmb_moni through abap program??

    Dear Gents,
    I have one scenario which is proxy -> xi -> jdbc. Scenario works fine when every thing is good, but if there are any errors in XI usually we catch the exception after calling the proxy as :
    TRY.
        CALL METHOD cl_rfq_sapin->mios_rfq_sapin
          EXPORTING
            output = output
          IMPORTING
            input  = input.
        COMMIT WORK.
      CATCH cx_ai_system_fault INTO cl_system_fault .
        gv_system_fault = 'X'.
      CATCH cx_ai_application_fault INTO cl_application_fault.
        gv_application_fault = 'X'.
    ENDTRY.
    But by this code we are able to know whether it is system error or application error. But we cant get actual error. To see the actual error we need to go to SXMB_MONI in XI. The some sample error in sxmb_moni is as follows :
      <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Inbound Message
      -->
    - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
      <SAP:Category>XIAdapterFramework</SAP:Category>
      <SAP:Code area="MESSAGE">GENERAL</SAP:Code>
      <SAP:P1 />
      <SAP:P2 />
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: Error when attempting to get processing resources: com.sap.aii.af.service.util.concurrent.ResourcePoolException: Unable to create new pooled resource: DriverManagerException: Cannot establish connection to URL 'jdbc:microsoft:sqlserver://10.56.5.79:1433;databaseName=SXD': SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]The requested instance is either invalid or not running.</SAP:AdditionalText>
      <SAP:ApplicationFaultMessage namespace="" />
      <SAP:Stack />
      <SAP:Retry>M</SAP:Retry>
      </SAP:Error>
    So is there any way we can catch the above error in the abap program ??
    Your responeses were highly appreciated.
    Regards,
    Santhosh

    hi,
    did you try using acknowledgments?
    http://help.sap.com/saphelp_nwpi71/helpdata/en/f4/8620c6b58c422c960c53f3ed71b432/content.htm
    (code at the bottom of this page)
    Regards,
    Michal Krawczyk

  • 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

Maybe you are looking for