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.

Similar Messages

  • 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

  • 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...

  • 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

  • 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.

  • 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

  • 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

  • Auditing the Error Records

    How can I audit the bad records that are getting rejected from the target table. ie) i want to store the bad records rejected out to a separate table.
    i tried checking it out in the wb_rt_error_sources table in runtime repository, but it holds only the error column name and its value. i want to hold the entire record.
    Thanking in Anticipation,
    Amudha

    Amudha,
    There are two main methods of dealing with the error records:
    1. If the error records are violating key constraints, you can configure the target object (right-click on the the mapping, select configure and expand the sources and targets configuration, constraints section). You must put the constraints to false, so that OWB will disable the constraints during the load (and you will have better performance) and re-enable them after the load. The records violating the target table constraints will appear in the runtime audit error table as well as in the exceptions table, if you specify one.
    2. If you can detect the error condition with a filter, a lookup table etc., you can channel them through a splitter operator to a target table that will contain the erroneous rows.
    Regards:
    Igor

  • Edit the error records in error stack

    Hi,
    I want to edit the error records in error stack. There are around 300 records in error stack . I want to replace the value in one field with blank to correct the records. Can you please help me how to replace the value with blank.
    Thanks,
    Priya

    Hi,
    Open the original DTP and click on change.
    1) In Update you will find "create error DTP", just click on it system automatically create error DTP for you original DTP.
    2) Do not change any thing, just come back to your original DTP and activate your DTP again.
    Now come back and refresh the info provider tree.
    now execute your DTP, request will be green in target and you will error records in error stack.
    How to edit the error records in error DTP
    please find the doc.
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0406328-29c7-2e10-5db5-afe9b5695eeb?overridelayout=t…
    Thanks,
    Phani.

  • 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

  • BPM - Send Step to HTTP - How to capture the error?

    Hi gurus,
    I have a BPM with a Send Step that connects to an http server. I need the following:
    - If the HTTP returns code 200, end the BPM
    - If the HTTP returns another code, wait 5 minutos and try the send step again.
    I've made a LOOP with a flag. Inside the LOOP I have a BLOCK with an exception branch.
    In the send step I put in the field "system error" to go to the exception branch and in the exception branch i'm setting my flag to do the loop one more time.
    My problem is that the Send Step is not triggering the exception branch! The http returns 405 or 504 and it continues like everything is okey.
    Can you help with this?
    Thanks in advance !
    MD.

    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

  • 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

  • Capturing the error messages generated by ALV Grid

    Hi,
    I have a ALV Grid, and a field date of DATS type.
    If i enter wrong date a message pops up with invalid date entry.
    How can i capture this error message in ALV Grid.

    Hi,
    Instead of displaying the error message directly, capture the message into a string variable and display it along with the grid display.
    Thanks,
    Sri.

  • How to print the error records and success records in bdc

    how to print the number of error records and success records in bdc

    hai,
    plz refer this program,
    Z_130399130271_A
    REPORT Z_130399130271_A
           NO STANDARD PAGE HEADING LINE-SIZE 325.
    *INCLUDE YVALIDATE.
    *include bdcrecx1.
    INCLUDE YINCLUDE399.
    DATA ITAB LIKE TABLE OF FILE_TABLE WITH HEADER LINE.
    PARAMETERS: DATASET(132) LOWER CASE.
    DATA : RC TYPE I,
    ERR(40) TYPE C,
    SUCCESSCNT TYPE I VALUE 0,
    FAILCOUNT TYPE I VALUE 0.
       DO NOT CHANGE - the generated data section - DO NOT CHANGE    ***
      If it is nessesary to change the data section use the rules:
      1.) Each definition of a field exists of two lines
      2.) The first line shows exactly the comment
          '* data element: ' followed with the data element
          which describes the field.
          If you don't have a data element use the
          comment without a data element name
      3.) The second line shows the fieldname of the
          structure, the fieldname must consist of
          a fieldname and optional the character '_' and
          three numbers and the field length in brackets
      4.) Each field must be type C.
    Generated data section with specific formatting - DO NOT CHANGE  ***
    DATA: BEGIN OF RECORD OCCURS 0,
    data element: LIF16
            LIFNR_001(016),
    data element: KTOKK
            KTOKK_002(004),
    data element: ANRED
            ANRED_003(015),
    data element: NAME1_GP
            NAME1_004(035),
    data element: SORTL
            SORTL_005(010),
    data element: STRAS_GP
            STRAS_006(035),
    data element: PFACH
            PFACH_007(010),
    data element: ORT01_GP
            ORT01_008(035),
    data element: ORT02_GP
            ORT02_009(035),
    data element: LAND1_GP
            LAND1_010(003),
    data element: REGIO
            REGIO_011(003),
    data element: SPRAS
            SPRAS_012(002),
    data element: TELF1
            TELF1_013(016),
    data element: TELF2
            TELF2_014(016),
    data element: BANKS
            BANKS_01_015(003),
    data element: BANKK
            BANKL_01_016(015),
    data element: BANKN
            BANKN_01_017(018),
          END OF RECORD.
    DATA:   BEGIN OF ERRORITAB OCCURS 0,
            LIFNR_001 LIKE LFA1-LIFNR,
            KTOKK_002 LIKE LFA1-KTOKK,
            ANRED_003 LIKE LFA1-ANRED,
            NAME1_004 LIKE LFA1-NAME1,
            SORTL_005 LIKE LFA1-SORTL,
            STRAS_006 LIKE LFA1-STRAS,
            PFACH_007 LIKE LFA1-PFACH,
            ORT01_008 LIKE LFA1-ORT01,
            ORT02_009 LIKE LFA1-ORT02,
            LAND1_010 LIKE LFA1-LAND1,
            REGIO_011 LIKE LFA1-REGIO,
            SPRAS_012 LIKE LFA1-SPRAS,
            TELF1_013 LIKE LFA1-TELF1,
            TELF2_014 LIKE LFA1-TELF2,
            BANKS_01_015 LIKE LFBK-BANKS,
            BANKL_01_016 LIKE LFBK-BANKL,
            BANKN_01_017 LIKE LFBK-BANKN,
            ERRORMSG(60) TYPE C,
            SERIAL TYPE I VALUE '1',
        END OF ERRORITAB.
    End generated data section ***
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR DATASET.
      CALL FUNCTION 'TMP_GUI_FILE_OPEN_DIALOG'
    EXPORTING
        WINDOW_TITLE            = 'select a file '
        DEFAULT_EXTENSION       = 'TXT'
        DEFAULT_FILENAME        = 'ASSIGN5.TXT'
      FILE_FILTER             =
      INIT_DIRECTORY          =
      MULTISELECTION          =
    IMPORTING
      RC                      =
        TABLES
          FILE_TABLE              = ITAB
    EXCEPTIONS
       CNTL_ERROR              = 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.
      READ TABLE ITAB INDEX 1.
      DATASET = ITAB-FILENAME.
      WRITE DATASET.
    START-OF-SELECTION.
    *perform open_dataset using dataset.
    *perform open_group.
      DATA T TYPE STRING.
      T = DATASET.
      IF T EQ ' '.
        MESSAGE E110(ZX).
      ENDIF.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME                      = T
      FILETYPE                      = 'ASC'
          HAS_FIELD_SEPARATOR           = 'X'
      HEADER_LENGTH                 = 0
      READ_BY_LINE                  = 'X'
      DAT_MODE                      = ' '
      CODEPAGE                      = ' '
      IGNORE_CERR                   = ABAP_TRUE
      REPLACEMENT                   = '#'
      CHECK_BOM                     = ' '
    IMPORTING
      FILELENGTH                    =
      HEADER                        =
        TABLES
          DATA_TAB                      = RECORD
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      NO_AUTHORITY                  = 6
      UNKNOWN_ERROR                 = 7
      BAD_DATA_FORMAT               = 8
      HEADER_NOT_ALLOWED            = 9
      SEPARATOR_NOT_ALLOWED         = 10
      HEADER_TOO_LONG               = 11
      UNKNOWN_DP_ERROR              = 12
      ACCESS_DENIED                 = 13
      DP_OUT_OF_MEMORY              = 14
      DISK_FULL                     = 15
      DP_TIMEOUT                    = 16
      OTHERS                        = 17
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT RECORD.
        CLEAR RC.
        CLEAR ERR.
    *read dataset dataset into record.
        IF SY-SUBRC <> 0. EXIT. ENDIF.
        RECORD-KTOKK_002 = '0001'.
        PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0100'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RF02K-KTOKK'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_FIELD       USING 'RF02K-LIFNR'
                                      RECORD-LIFNR_001.
        PERFORM BDC_FIELD       USING 'RF02K-KTOKK'
                                      RECORD-KTOKK_002.
        PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0110'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'LFA1-TELX1'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '/00'.
        PERFORM BDC_FIELD       USING 'LFA1-ANRED'
                                      RECORD-ANRED_003.
        PERFORM BDC_FIELD       USING 'LFA1-NAME1'
                                      RECORD-NAME1_004.
        PERFORM BDC_FIELD       USING 'LFA1-SORTL'
                                      RECORD-SORTL_005.
        PERFORM BDC_FIELD       USING 'LFA1-STRAS'
                                      RECORD-STRAS_006.
        PERFORM BDC_FIELD       USING 'LFA1-PFACH'
                                      RECORD-PFACH_007.
        PERFORM BDC_FIELD       USING 'LFA1-ORT01'
                                      RECORD-ORT01_008.
        PERFORM BDC_FIELD       USING 'LFA1-ORT02'
                                      RECORD-ORT02_009.
        PERFORM BDC_FIELD       USING 'LFA1-LAND1'
                                      RECORD-LAND1_010.
        PERFORM BDC_FIELD       USING 'LFA1-REGIO'
                                      RECORD-REGIO_011.
        PERFORM BDC_FIELD       USING 'LFA1-SPRAS'
                                      RECORD-SPRAS_012.
        PERFORM BDC_FIELD       USING 'LFA1-TELF1'
                                      RECORD-TELF1_013.
        PERFORM BDC_FIELD       USING 'LFA1-TELF2'
                                      RECORD-TELF2_014.
        PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0120'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'LFA1-KUNNR'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=VW'.
        PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0130'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'LFBK-BANKN(01)'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM BDC_FIELD       USING 'LFBK-BANKS(01)'
                                      RECORD-BANKS_01_015.
        PERFORM BDC_FIELD       USING 'LFBK-BANKL(01)'
                                      RECORD-BANKL_01_016.
        PERFORM BDC_FIELD       USING 'LFBK-BANKN(01)'
                                      RECORD-BANKN_01_017.
        PERFORM BDC_DYNPRO      USING 'SAPMF02K' '0130'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'LFBK-BANKS(01)'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=UPDA'.
        PERFORM BDC_TRANSACTION USING 'XK01' CHANGING ERR RC.
        DATA: SERIAL TYPE I VALUE 1.
        IF RC <> 0.
          FAILCOUNT = FAILCOUNT + 1.
          CLEAR ERRORITAB.
          ERRORITAB-SERIAL = SERIAL.
          ERRORITAB-LIFNR_001 = RECORD-LIFNR_001.
          ERRORITAB-KTOKK_002 = RECORD-KTOKK_002.
          ERRORITAB-ANRED_003 = RECORD-ANRED_003.
          ERRORITAB-NAME1_004 = RECORD-NAME1_004.
          ERRORITAB-SORTL_005 = RECORD-SORTL_005.
          ERRORITAB-STRAS_006 = RECORD-STRAS_006.
          ERRORITAB-PFACH_007 = RECORD-PFACH_007.
          ERRORITAB-ORT01_008 = RECORD-ORT01_008.
          ERRORITAB-ORT02_009 = RECORD-ORT02_009.
          ERRORITAB-LAND1_010 = RECORD-LAND1_010.
          ERRORITAB-REGIO_011 = RECORD-REGIO_011.
          ERRORITAB-SPRAS_012 = RECORD-SPRAS_012.
          ERRORITAB-TELF1_013 = RECORD-TELF1_013.
          ERRORITAB-TELF2_014 = RECORD-TELF2_014.
          ERRORITAB-BANKS_01_015 = RECORD-BANKS_01_015.
          ERRORITAB-BANKL_01_016 = RECORD-BANKL_01_016.
          ERRORITAB-BANKN_01_017 = RECORD-BANKN_01_017.
          ERRORITAB-ERRORMSG = ERR.
          SERIAL = SERIAL + 1.
          APPEND ERRORITAB.
          MODIFY RECORD TRANSPORTING KTOKK_002.
          DELETE RECORD WHERE KTOKK_002 = '0001'.
        ELSE.
          SUCCESSCNT = SUCCESSCNT + 1.
        ENDIF.
      ENDLOOP.
    display output********************************************************
      SKIP.
      FORMAT COLOR 5 INTENSIFIED OFF.
      WRITE:/ 'No. of records successfully uploaded: '.
      FORMAT COLOR 4 INTENSIFIED OFF.
      WRITE: SUCCESSCNT.
    Displaying the success table******************************************
      IF SUCCESSCNT <> 0.
        SKIP.
        FORMAT COLOR 4 INTENSIFIED OFF.
        WRITE:/ 'Successful Records'.
        FORMAT COLOR 7 INTENSIFIED ON.
        WRITE:/(261) SY-ULINE,
              / SY-VLINE,
                'S.NO',                               007 SY-VLINE,
                'VENDOR ACC.NUM',                     023 SY-VLINE,
                'VENDOR ACC GROUP',                   041 SY-VLINE,
                'TITLE',                              048 SY-VLINE,
                'VENDOR NAME',                        064 SY-VLINE,
                'SORT FIELD',                         076 SY-VLINE,
                'HOUSE NO.& STREET',                  101 SY-VLINE,
                'PO.BOX NO',                          116 SY-VLINE,
                'CITY',                               129 SY-VLINE,
                'DISTRICT',                           141 SY-VLINE,
                'COUNTRY KEY',                        156 SY-VLINE,
                'REGION',                             166 SY-VLINE,
                'LANGUAGE KEY',                       180 SY-VLINE,
                'TELEPHONE NO 1',                     196 SY-VLINE,
                'TELEPHONE NO 2',                     213 SY-VLINE,
                'BANK COUNTRY KEY',                   231 SY-VLINE,
                'BANK KEY',                           241 SY-VLINE,
                'BANK ACC.NO',                        261 SY-VLINE,
                /1(261) SY-ULINE.
        FORMAT COLOR 4 INTENSIFIED ON.
        SERIAL = 1.
       SORT RECORD BY LIFNR_001.
        LOOP AT RECORD.
          WRITE:/ SY-VLINE,
          SERIAL LEFT-JUSTIFIED,          007 SY-VLINE,
          RECORD-LIFNR_001(016),          023 SY-VLINE,
          RECORD-KTOKK_002(004),          041 SY-VLINE,
          RECORD-ANRED_003(015),          048 SY-VLINE,
          RECORD-NAME1_004(035),          064 SY-VLINE,
          RECORD-SORTL_005(010),          076 SY-VLINE,
          RECORD-STRAS_006(035),          101 SY-VLINE,
          RECORD-PFACH_007(010),          116 SY-VLINE,
          RECORD-ORT01_008(035),          129 SY-VLINE,
          RECORD-ORT02_009(035),          141 SY-VLINE,
          RECORD-LAND1_010(003),          156 SY-VLINE,
          RECORD-REGIO_011(003),          166 SY-VLINE,
          RECORD-SPRAS_012(002),          180 SY-VLINE,
          RECORD-TELF1_013(016),          196 SY-VLINE,
          RECORD-TELF2_014(016),          213 SY-VLINE,
          RECORD-BANKS_01_015(003),       231 SY-VLINE,
          RECORD-BANKL_01_016(015),       241 SY-VLINE,
          RECORD-BANKN_01_017(018),       261 SY-VLINE.
          WRITE:/(261) SY-ULINE.
          SERIAL = SERIAL + 1.
        ENDLOOP.
        WRITE:/1(261) SY-ULINE.
      ENDIF.
      SKIP.
      FORMAT COLOR 5 INTENSIFIED OFF.
      WRITE:/ 'No. of records not uploaded: '.
      FORMAT COLOR 4 INTENSIFIED OFF.
      WRITE: FAILCOUNT.
    *Displaying the error table
      IF FAILCOUNT <> 0.
        SKIP.
        FORMAT COLOR 4 INTENSIFIED OFF.
        WRITE:/(320) SY-ULINE,
                'Error Records'.
        FORMAT COLOR 7 INTENSIFIED ON.
        WRITE:/ SY-ULINE, SY-VLINE,
                'S.NO',                               007 SY-VLINE,
                'VENDOR ACC.NUM',                     023 SY-VLINE,
                'VENDOR ACC GROUP',                   041 SY-VLINE,
                'TITLE',                              048 SY-VLINE,
                'VENDOR NAME',                        064 SY-VLINE,
                'SORT FIELD',                         076 SY-VLINE,
                'HOUSE NO.& STREET',                  101 SY-VLINE,
                'PO.BOX NO',                          116 SY-VLINE,
                'CITY',                               129 SY-VLINE,
                'DISTRICT',                           141 SY-VLINE,
                'COUNTRY KEY',                        156 SY-VLINE,
                'REGION',                             166 SY-VLINE,
                'LANGUAGE KEY',                       180 SY-VLINE,
                'TELEPHONE NO 1',                     196 SY-VLINE,
                'TELEPHONE NO 2',                     213 SY-VLINE,
                'BANK COUNTRY KEY',                   231 SY-VLINE,
                'BANK KEY',                           241 SY-VLINE,
                'BANK ACC.NO',                        261 SY-VLINE,
                'ERROR MESSAGE',                      320 SY-VLINE.
        WRITE:/(320) SY-ULINE.
        FORMAT COLOR 4 INTENSIFIED ON.
       SORT ERRORITAB BY LIFNR_001.
        LOOP AT ERRORITAB.
          WRITE:/ SY-VLINE,
                ERRORITAB-SERIAL LEFT-JUSTIFIED,          007 SY-VLINE,
                ERRORITAB-LIFNR_001 ,       023 SY-VLINE,
                ERRORITAB-KTOKK_002,       041 SY-VLINE,
                ERRORITAB-ANRED_003,       048 SY-VLINE,
                ERRORITAB-NAME1_004,       064 SY-VLINE,
                ERRORITAB-SORTL_005,       076 SY-VLINE,
                ERRORITAB-STRAS_006,       101 SY-VLINE,
                ERRORITAB-PFACH_007,       116 SY-VLINE,
                ERRORITAB-ORT01_008,       129 SY-VLINE,
                ERRORITAB-ORT02_009,       141 SY-VLINE,
                ERRORITAB-LAND1_010,       156 SY-VLINE,
                ERRORITAB-REGIO_011,       166 SY-VLINE,
                ERRORITAB-SPRAS_012,       180 SY-VLINE,
                ERRORITAB-TELF1_013,       196 SY-VLINE,
                ERRORITAB-TELF2_014,       213 SY-VLINE,
                ERRORITAB-BANKS_01_015,    231 SY-VLINE,
                ERRORITAB-BANKL_01_016,    241 SY-VLINE,
                ERRORITAB-BANKN_01_017,    261 SY-VLINE,
                ERRORITAB-ERRORMSG,        320 SY-VLINE.
          WRITE:/(320) SY-ULINE.
        ENDLOOP.
        WRITE:/ SY-ULINE.
      ENDIF.
    hope this ll help you..
    regards,
    prema.A

  • How to Create a Function module z_create and to track the error records?

    I want to create a function module z_create which will insert the data from the internal tables gt_model_master and gt_model  into the corresponding database custom tables y_model_master.
    Secondly if any error is encountered during the above updation, then how to track those error records ?

    HI,
    check the sy-subrc ,if it is zero the insertion is success,otherwise use 
    message class.
    if sy-subrc ne 0.
    message e052(zmessage).
    endif.
    Edited by: rakesh dhudipala on Feb 12, 2008 2:33 PM
    Edited by: rakesh dhudipala on Feb 12, 2008 2:33 PM

Maybe you are looking for

  • Movie rental Q: How many times can you watch the film within 48 hours?

    It's just I have 8 hours left on Into The Wild and I fancied watching it a second time, only it is not playing when I click on the thumbnail. It just says "accessing the iTunes store" for a few seconds. I've tried clicking play. Other films appear to

  • How do you share a photo album?

    OK I have a photo album in iPhoto.  How do you share that now that mobileMe is gone?  I want to be able to send a link to someone whether or not they have iCloud. I tried making a shared photoStream album, and it sort of works.  I can't re-order the

  • Runtime Tax Sum

    Dear Expert, I want to show sum of VAT & AVAT at Document level UDF before adding PO document. I have tried through FMS but its giving Internal Error. Is it possible to show in UDF?? Regards, Bhavank

  • How to call an HTMl page using URL in OAF?

    Hi, There is a page that has a toolbar. There we have to provide a help menu in which we need to display a customized html page. Therefore, we need to set the URL property in such a way that it should map to the path where this HTML file is located.

  • Quiz Reporting - Best Practice?

    I have been experiencing issues with the email quiz result function. No score in the email. I have tried as an attachment and in the body. Note: I've got this function to work at other job sites. What is the best workaround for this? Another app such