HI All Capturing the error records in an internal table

Hi All,
         I am retrieving the data from application server .
        My requirement is to :
     Check if the Measurement Point Id provided in the file is a valid one or not. Query the table EUITRANS by passing the Measurement point Id in the EXT_UI field. If the query is successful, then proceed to next step. If not, log it in the error log with error message DM-001 and proceed with the next Measurement point id.
so i nee the code for capturing the error log with error message.
pls provide me ASAP.
Thanks&Regards,
Bharat

Hi,
if you like do display all messages online have a look at FM:
'MESSAGES_INITIALIZE'
'MESSAGE_STORE'
'MESSAGES_SHOW'
If you want to write application log look at function group SBAL modules BAL_LOG*. There is also a good documentation in SAPDOCU..
Kind regards,
HP

Similar Messages

  • Logic to capture the Error records

    Hi All ,
               I have one scenario like this ,one report program runs in R/3 system to fetch some data from BW system .
    It uses Remote FM to do this .
    The problem is the FM has got error table with error msgs , if there is any problem in fetching the data in R/3 system.
    But when program is excuted it fails after returning to R/3 system with  error msg in WHEN OTHERS and stops there itself
    Instead it should proceed with other program codes and then
    finally output the error records .There is already subroutine in the program to display the erros records in last.  How do i do it programatically
    CALL FUNCTION 'ZC_BW_FIREFIGHT' DESTINATION p_r3rfc
          EXPORTING
            mrp_planning_scenario       = p_mrppln
            error_indicator             = p_info
          IMPORTING
            r3client                    = w_r3client
            r3instance                  = w_r3instance
          TABLES
            materials                   = t_bwmat
            plants                      = s_plant
            firefighting                = t_firefight1
            error_msgs                  = t_r3_errors
          EXCEPTIONS
            no_material_data_found      = 1
            no_storage_loc_data         = 2
            proc_complete_no_rcds_found = 3
            OTHERS                      = 4.
        CASE sy-subrc.
          WHEN 0.
            PERFORM f4020_confirm_fm_executed.
          WHEN 1.
            MESSAGE e999 WITH
                  'R3: No material data found for materials/plants.'(049).
          WHEN 2.
            MESSAGE e999 WITH
                  'R3: No storage location data for materials/plants.'(050).
          WHEN 3.
            MESSAGE e999 WITH
                  'R3: ZC_BWFIREFIGHT processed, but no data found.'(051).
          WHEN OTHERS.
            MESSAGE e999 WITH
                  'R3: ZC_BWFIREFIGHT FM call to R3 failed'(052).
        ENDCASE.
      ENDIF .
    ENDFORM.                    " f4010_call_zc_bwfirefight
    <REMOVED BY MODERATOR>
    Kumaran.C
    Edited by: Alvaro Tejada Galindo on Feb 25, 2008 2:46 PM

    Try with the following method
    DATA : bapireturn TYPE TABLE OF bapireturn WITH HEADER LINE.
    CASE sy-subrc.
      WHEN 0.
        PERFORM f4020_confirm_fm_executed.
      WHEN 1.
        CALL FUNCTION 'BALW_BAPIRETURN_GET'
          EXPORTING
            type                       = 'E'
            cl                         = <msgclass>
            number                     = '049'
            par1                       = 'R3: No material data found for materials/plants.'
          IMPORTING
            bapireturn                 = bapireturn
          EXCEPTIONS
            only_2_char_for_message_id = 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.
        ELSE.
          APPEND bapireturn.
          CLEAR bapireturn.
        ENDIF.
      WHEN 2.
        " Do Simillarly
      WHEN 3.
        " Do Simillarly
      WHEN OTHERS.
        " Do Simillarly
    ENDCASE.

  • Copying the error records in a custom table

    Hi,
    I  have a report program which is fetching Invoice header and line items . I need to copy the error records (records having a custom field ZZKUNNR as blank) in a custom table . I am executing this report in background daily .
    The records in the custom table can be corrected by functional guys
    Daily the report should fetch the data from SAP and also it should check whether there are correct records in the custom table .
    If the records are found from custom table then those records also must be fetched.
    Finally the output is stored in an application server .
    Kindly help how to write the code for error records.

    Hang on a moment here... I am sure we deleted your user ID a few months ago for ponits gaming!
    Did it "pay off" somehow and now you have a "real job" but don't have a clue what you are doing?
    Doesn't that make you feel just a little bit unconfident about life, the universe and ABAP?
    Cheers,
    Julius

  • Capturing the error records

    The SDM interface runs in batch. A pop up message will not be useful.
    If errors occur, they can NOT be re-sent manually the next day after the data issue is corrected. The extract needs to be changed to automatically try to resend those that are captured in the ERROR table and include them in the next day. The sales for those items will fall in the current day, but that is okay.

    If you are going to post your spec, then you might as well post all of it...

  • Trapping the error records in a custom Table

    Hi,
    I am executing a report program. It is extracting different types of files - Invoice Header, Invoice line items, Customers, Master data attributes, Sales representative, Branch location data. Each file from different tables. In the selection screen we will be having check boxes for each file. The output is stored either on desktop or on application server in a file format.
    Here there are some mandatory fields for each file which should not be blank.
    For example there is one custom field for Sales Invoice header BUILDER which is mandatory. If it is blank then it will be an error record.
    We need to create a custom table with all these mandatory fields.
    Kindly pls help.

    Hi Abdul,
    this is a consulting issue, not an allowed question.
    Regards,
    Clemens

  • Pickup only the newest record in an Internal Table.

    Hi all:
    I have and internal table that i am accesing in a transformation.
    Which is the best approach to read from the internal table only the
    record with the newest date. Data look like this:
    Date_________MAT___ Qty
    12.08.2009___4050___70
    10.05.2009___4050___30
    18.11.2009___4050___42
    20.07.2009___4050___28
    In this case, for Material 4050 i need only the third record (18.11.2009),
    any code example or guideline..?
    Regards,

    Hi,
    You can sort the internal table by date and material in descending order and then perform read on the internal table with key as material. this would bring the latest date for that material.
    Regards,
    Rk.

  • Read the last record of an internal table

    Hello All,
    I need to read the last entry of the internal table? Is it possible to achieve this without using loop - endloop?
    In the following example, I need to get the Batch '110776' and store it in a variable.
    ITAB:
    MATNR|CHARG
    010780|110770
    010780|110772
    010780|110773
    010780|110774
    010780|110775
    010780|110776
    Thanks.

    Use DESCRIBE to get the number of entires in variable last_entry
    and then use read table ....index last_entry

  • How to delete the matching records from two internal tables

    Hi ,
    I have two internal tables say A and B of the same type. If A has 10 records and B has 4 records , I want to delete the 4 records in B from A .
    loop at B into wa .
    delete A where key = wa - key .
    endloop.
    takes a long time if the table B is huge. how can I improve the performance.
    Thanks.
    Gayathri

    Hi Gayathri,
    You could try field-symbols. It reduces the data transfer from the internal table B to the work area.
    field-symbols <fs_itab_b> like line of B.
    loop at B assigning <fs_itab_b>.
      delete A where key = <fs_itab_b>?-key.
    endloop.
    Regards,
    <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=zwcc%2fwm4ups%3d">anand Mandalika</a>.

  • How to get the last record of an internall table ....

    Hi All..
    i want to get the last record of an internal table itab, and i want the the value of the last record.

    Hi,
         Use describe statment.
    data: lv_line type i.
        Describe table itab lines lv_line.
        read table itab into wa_itab index lv_line.
    regards,
    Santosh Thorat

  • How to capture the error messages from incorrect session?

    Hi SDNs.,
    i am using BDC Session method to update transaction FB01. So my job runs daily. here i want to capture the error messages and i want to send it to mail.  Can i capture the unprocessed records???
    i think FM <b>SO_NEW_DOCUMENT_ATT_SEND_API1</b> used for sending mail? but how to capture mes or records?
    or Is there any other way to Do it???
    Thankning you.,
    Ram

    Hi Ramakrishna,
       Once you create the session, Process the session using
    the report RSBDCSUB using submit statement.
    It would list out the erroneous records.
    Hence, while submitting, just say submit RSBDCSUB in background and export output list to memory.,
    Then you can retrieve the list from memory using the FM LIST_FROM_MEMORY into the internal table and finally send the email by the fm you have already mentioned.
    Regards,
    Ravi

  • Any option is there to find the error record in loop for huge amount of rec

    Hi Guru's,
    In our production system we got a error. While debugging we found one of our loop getting 1 lakh records. One of the record from the internal table having some wrong values because of that its giving a error message. But we are not getting any proper message.
    Now our problem is its very difficult to debug all the records one by one. Even its not possible to give Watchpoint. bze in what situations its giving this error that also not predictable. So how to find the error record?
    Kindly suggest.
    Ananadhan

    Need a lot more info.
    To start with is this CR Designer or some other product?
    I suspect it's classic SAP products like Business One etc., if so please mark as answered and post your question int the correct forum.
    Thank you
    Don

  • About "the hospital for the error records"...

    Hi folks,
    I am new to ODI, and I am not buying the idea of "the hospital for the error records". In my personal opinion it introduces many complications. If some dimension records are "dirty" and we put them in the error table, then we are splitting the natural relation of the data, aren't we. The DWH data won't correspond to the source anymore, the dimension's data will be artificially split (the error records could apear on the next day), and we will need an additional process which should update the corresponding fact records on the next day (late arriving changes for the existing facts). Sounds much more complicated, than just to allow the ETL process to fail, fix the issue and start it again.
    Experts, please, help with an opinion.
    Thanks in advance!

    @DecaXD, thanks for your comment.
    "after that under my opinion "something is better than none"" This is exactly what I am worried about. The whole "hospital" idea, is something, which makes the whole process more complicated, without clear benefits. I like the idea to have E$ tables, but just for debugging purposes, just to be able to identify quickly, what were the error rows, so I can do a investigation based on failed data. What, I don't like is the idea that we can EASILY reuse the error data to recover the DWH state later.
    "Are you sure that you want to stop ALL your datawarehouse because the Address field is null?"Well, if during the analysis phase (especially, the data profiling step), we missed the fact that the address table could be null, then yes, I would like to stop the whole ETL, because this is situation, which has not been addressed correctly during the design of the ETL process.
    A rithorical question: Are you going to keep recovering the null records after each run (even a "successfull" one), or you would fix the interface/mapping to allow nulls, which would be updated on subsequent runs naturally ?
    What about more complicated error rows, like missing dimension key, which relates to many fact records ? Should we put the related fact records in their E$ table either. What if we have a snowflake design with many references to/from the error dimension records. Sounds too complicated for me.
    I would just store the error rows, and stop the ETL. Note, that I allow for dellay, but don't publish any not consistent data in the DWH.
    Bellow is a quote from the book you mentioned:
    "Don’t overuse the reject file! Reject files are notorious for being dumping
    grounds for data we’ll deal with later. When records wind up in the reject file,
    unless they are processed before the next major load step is allowed to run to
    completion, the data warehouse and the production system are out of sync."
    I am looking for more arguments, I do understand that it is not a simple issue, but I would like to see your real life experience here..
    Thanks!
    Edited by: hayrabedian on 2013-4-29 14:01
    Edited by: hayrabedian on 2013-4-29 14:02

  • HT5654 Just tried 3 times to update iTunes on my PC running Vista.  There was an error.  It stopped the installation.  Now iTunes will not start at all.  The error message tells me to reinstall which I tried but did not work.  What should I do?

    Just tried 3 times to update iTunes on my PC running Vista.  There was an error.  It stopped the installation.  Now iTunes will not start at all.  The error message tells me to reinstall which I tried but did not work.  What should I do?

    Hello, Jdragone. 
    Thanks for the question.  Start with completely uninstalling iTunes and all of it's components in the order specified in the article below.  Once this is done, download and install iTunes.
    Removing and reinstalling iTunes and other software components for Windows Vista, Windows 7, or Windows 8
    http://support.apple.com/kb/HT1923
    If you receive any errors when uninstalling any components of iTunes, try the steps in the article below for each component that gives you an error.
    "The feature you are trying to use is on a network resource that is unavailable" alert appears when removing Apple software in Windows
    http://support.apple.com/kb/TS3704
    Cheers,
    Jason H.

  • I recently did a system update and installed Yosemite on my Mac. Now I am unable to open CS5 at all. The error message I get is this: "To open Adobe Photoshop CS5.1, you need to install legacy Java SE 6 runtime." I have tried downloading this and it still

    I recently did a system update and installed Yosemite on my Mac. Now I am unable to open CS5 at all. The error message I get is this: "To open Adobe Photoshop CS5.1, you need to install legacy Java SE 6 runtime." I have tried downloading this and it still gives me the same mess

    In the details it is mentioned that it is an outdated version of Java.
    Is this a security risk that i need to live with to get CS5 to run with Yosemite?
    Also i need to reject messages from Java in the future about updates, or not?
    thx for any input

  • How to get the index of the error record when uploaded using standard LSMW

    Hi Experts,
    When uploading data using lsmw standard batch input method which creates an error session if any errors,how can we able to find the index of the error record
    eg: If 3rd record in input file is incorrect then error session is getting created with the error and index as 1.But I want to know that 3rd record in my input file is incorrect.
    Please help me out.

    Srinivas,
    In global data, i've written like this.
    TYPES: BEGIN OF TYPE_ERROR,
                 INDEX TYPE I,
                 END OF TYPE_ERROR.
    DATA: GT_ERROR TYPE TABLE OF TYPE_ERROR,
               GS_ERROR TYPE TYPE_ERROR,
               GV_TOTAL_COUNT TYPE I, GV_INDEX TYPE I,
               GV_STRING TYPE STRING,
              GV_FILE TYPE STRING VALUE '/usr/sap/interfaces/LSMW/Asseterror
    In Begin of transaction,
    GV_TOTAL_COUNT = GV_TOTAL_COUNT + 1.
    In End of processing,
    OPEN DATASET GV_FILE FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
    IF SY-SUBRC = 0.
    CLEAR GS_ERROR.
    LOOP AT GT_ERROR INTO GS_ERROR.
    CONCATENATE 'INDEX OF THE ERROR RECORD IS:' GS_ERROR INTO GV_STRING.
    TRANSFER GV_STRING TO GV_FILE.
    CLEAR: GV_STRING, GS_ERROR.
    ENDLOOP.
    ENDIF.
    How and where will I be assigning error count and append it to the internal table.
    Please help me out.

Maybe you are looking for