Compare two cells in a ALV

Hi!!
I'm doing an ALV, and I need to compare two cells. Only one of them could be inform.
I used this code:
      CLASS lcl_event_hadler DEFINITION
CLASS lcl_event_handler DEFINITION.
  PUBLIC SECTION.
    METHODS:
      handle_data_changed
        FOR EVENT data_changed OF cl_gui_alv_grid
            IMPORTING er_data_changed.
ENDCLASS.                    "lcl_event_handler DEFINITION
      CLASS lcl_event_handler IMPLEMENTATION
CLASS lcl_event_handler IMPLEMENTATION.
      METHOD handle_data_changed
  METHOD handle_data_changed.
    PERFORM handle_data_changed USING er_data_changed.
  ENDMETHOD.                    "handle_data_changed
ENDCLASS.                    "lcl_event_handler IMPLEMENTATION
*&      Form  HANDLE_DATA_CHANGED
      text
     -->P_ER_DATA_CHANGED  text
FORM handle_data_changed  USING    ir_data_changed
                                   TYPE REF TO
                                   cl_alv_changed_data_protocol.
  DATA: ls_mod_cell TYPE lvc_s_modi,
        lv_value    TYPE lvc_value,
        lv_value1   TYPE lvc_value.
SORT ir_data_changed->mt_mod_cells." BY row_id.
  LOOP AT ir_data_changed->mt_mod_cells
                           INTO ls_mod_cell
                           WHERE fieldname = 'CELL2'.
    CALL METHOD ir_data_changed->get_cell_value
      EXPORTING
        i_row_id    = ls_mod_cell-row_id
        i_fieldname = 'CELL2'
      IMPORTING
        e_value     = lv_value1.
  ENDLOOP.
  LOOP AT ir_data_changed->mt_mod_cells
                          INTO ls_mod_cell
                          WHERE fieldname = 'CELL1'.
    IF it_prueba-clase IS INITIAL.
      CALL METHOD ir_data_changed->modify_cell
        EXPORTING
          i_row_id    = ls_mod_cell-row_id
          i_fieldname = ls_mod_cell-fieldname
          i_value     = campo_prueba.
    ENDIF.
    CALL METHOD ir_data_changed->get_cell_value
      EXPORTING
        i_row_id    = ls_mod_cell-row_id
        i_fieldname = 'CELL1'
      IMPORTING
        e_value     = lv_value.
    IF lv_value = lv_value1.
      CALL METHOD ir_data_changed->add_protocol_entry
        EXPORTING
          i_msgid     = 'SU'
          i_msgno     = '000'
          i_msgty     = 'E'
          i_msgv1     = 'Only one cell '
          i_fieldname = ls_mod_cell-fieldname
          i_row_id    = ls_mod_cell-row_id.
    ENDIF.
  ENDLOOP.
ENDFORM.                    " HANDLE_DATA_CHANGED
With this code, i can check only one time the cells. If I clear cell2 press enter, and then I write in cell2 again it code doesn't work.
How can i do it with other method?
Thanks in advance

Head Crab wrote:
Tuesdays 1st 2nd 3rd 4th 5th MB
Jan 4, 2011 7 14 21 28 36 32
Jan 11, 2011 5 15 25 28 38 16
Jan 18, 2011 2 17 25 28 38 25
Okay, say the above is my table, how do I compare two cells in a row for two numbers? Say I wanted to find out if row A2 contained a 7 and a 28?
"A2" is an address for a single cell, not a row. Its current content, assuming no empty rows above or empty columns left of what's shown, is "Jan 4, 2011". Perhaps you mean Row 2, or the range B2:G2.
Assuming that you want to know 'if' (or 'how many times') two specific numbers occur in the range of cells from column B to column G in a single row, COUNTIF is the function you want.
Place the two target numbers into cell I1 and J1.
Enter the formula below into I2:
=COUNTIF($B2:$G2,I$1)
Fill the formula right into J2, then fill both down to row 4.
You'll get a count of the occurrences of each number.
If you want only a "Yes" (both numbers appear in the range) or "No" (neither of the numbers appear, or one appears but not the other), use this variation (in I2 or J2):
=IF(AND(COUNTIF($B2:$G2,I$1)>0,COUNTIF($B2:$G2,J$1)>0),"Yes","No")
Regards,
Barry

Similar Messages

  • Compare two cells in a row and group of rows

    Tuesdays 1st 2nd 3rd 4th 5th MB
    Jan 4, 2011 7 14 21 28 36 32
    Jan 11, 2011 5 15 25 28 38 16
    Jan 18, 2011 2 17 25 28 38 25
    Okay, say the above is my table, how do I compare two cells in a row for two numbers? Say I wanted to find out if row A2 contained a 7 and a 28?
    I thought an IF formula might do it, but can't figure it out.
    Thanks in advance!
    Jim

    Head Crab wrote:
    Tuesdays 1st 2nd 3rd 4th 5th MB
    Jan 4, 2011 7 14 21 28 36 32
    Jan 11, 2011 5 15 25 28 38 16
    Jan 18, 2011 2 17 25 28 38 25
    Okay, say the above is my table, how do I compare two cells in a row for two numbers? Say I wanted to find out if row A2 contained a 7 and a 28?
    "A2" is an address for a single cell, not a row. Its current content, assuming no empty rows above or empty columns left of what's shown, is "Jan 4, 2011". Perhaps you mean Row 2, or the range B2:G2.
    Assuming that you want to know 'if' (or 'how many times') two specific numbers occur in the range of cells from column B to column G in a single row, COUNTIF is the function you want.
    Place the two target numbers into cell I1 and J1.
    Enter the formula below into I2:
    =COUNTIF($B2:$G2,I$1)
    Fill the formula right into J2, then fill both down to row 4.
    You'll get a count of the occurrences of each number.
    If you want only a "Yes" (both numbers appear in the range) or "No" (neither of the numbers appear, or one appears but not the other), use this variation (in I2 or J2):
    =IF(AND(COUNTIF($B2:$G2,I$1)>0,COUNTIF($B2:$G2,J$1)>0),"Yes","No")
    Regards,
    Barry

  • Comparing two cells together and highlighting duplicates

    Hello
    I have two lists of emails that are of different length. I'd like to compare these two lists and highlight any duplicates, so that I don't send any email twice to the same person.
    How is this done in Numbers'09?
    Thanks!

    jknuutila wrote:
    Never mind, I got Yvan's formula to work now, thanks both for your help!
    JK,
    Yvan's formula and mine are functionally equivalent, but assume different table names. (Yvan posted before I finished composing my answer and I opted to let mine stand when I noticed.) Of course you must always take care to either make your table names match the equation or make the equation match your table names. And of course, the proper parameter separators must be used.
    We can often avoid problems with parameter separators in our examples, and we can be careful to use simple, plain English, if we suspect that you are in a location where the semicolon replaces the comma as a separator, and where English may not be the first language. This requires that you edit your Profile Data to show your country/location. The more we know about you, the easier this becomes.
    Best regards,
    Jerry

  • How can I compare two collections at the same time? (View two grid views)

    I have two collections containing some of the same images. (My Nikon D70 did not put an end-of-file on some images. I recovered them into a different collection.) Now I want to display both collections side-by-side in grid view. I will select those images in the "recovered" collection that correspond to the bad images in the "main" collection, add the ratings etc, and move just these to another collection.
    It is extremely frustrating to have to bounce back and forth between collections, remembering each image one by one and selecting it in the "recovered" collection. (The image names are not preserved in the "recovered" collection -- I have to go by what the image looks like.)
    LightRoom allows me to compare photos in the compare view. I want to compare collections in two grid views.

    CaptureTheLight,
    you have ran into a situation when you have to compare two sets of images and now you're wondering how come Lightroom doesn't have such "obviously necessary" functionality? But you have to admit it, this is not such a common situation in a photographer's workflow recovers broken files and tries to compare them against themselves. I think it's a pretty specific feature you need. Still, Lightroom has enough powerful tools for editing and sorting images.
    For example...
    You could just put them all - "main" and "recovered" - into a single collection or into the Quick Collection. Label the entire "recovered" collection with, say, red and sort by capture time. Now you'll have everything side by side, ordered chronologically. The "recovered" images will stay next to the "main" images since their capture time will be the same, and they will also stand out since they have the red label.
    Make the thumbnails bigger and set up the grid view so it tints the thumbnail cell are tinted with the label color. Now, you can go quickly through them visually checking labeled vs unlabeled.

  • How to set a single cell editable in alv Webdynpro Abap

    I am trying to edit a single cell on lead selection. here the steps i did to achive this.
    1. I added a Attribute READ_ONLY  inside my node of type WDY_BOOLEAN.
    2. i am conditionally making this Attribute - READ_ONLY = 'X'.
    3. i am binding my node with new values.
    4. for ALV here is the code i have added.
    DATA :lo_cmp_usage TYPE REF TO if_wd_component_usage,
            lr_column    TYPE REF TO cl_salv_wd_column,
            lr_table_settings TYPE REF TO if_salv_wd_table_settings,
            lt_columns TYPE salv_wd_t_column_ref,
            ls_columns TYPE salv_wd_s_column_ref,
            lr_input_field TYPE REF TO cl_salv_wd_uie_input_field,
            lo_interfacecontroller TYPE REF TO iwci_salv_wd_table ,
            lv_value TYPE REF TO cl_salv_wd_config_table.
    *Taking reference of the Component Usage
      lo_cmp_usage =   wd_this->wd_cpuse_cu_alv( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
      lo_interfacecontroller =   wd_this->wd_cpifc_cu_alv( ).
      lv_value = lo_interfacecontroller->get_model( ).
      CALL METHOD lv_value->if_salv_wd_column_settings~get_columns
        RECEIVING
          value = lt_columns.
      LOOP AT lt_columns INTO ls_columns.
        lr_column = ls_columns-r_column.
        CASE ls_columns-id.
          WHEN 'USR_ACT_RT'.
            CREATE OBJECT lr_input_field
              EXPORTING
                value_fieldname = ls_columns-id.
            lr_column->set_cell_editor( value = lr_input_field ).
            lr_input_field->set_read_only_fieldname( value = 'READ_ONLY' ).
        ENDCASE.
      ENDLOOP.
      lr_table_settings ?= lv_value.
      lr_table_settings->set_read_only( abap_false ).
      lv_value->if_salv_wd_column_settings~delete_column( id = 'READ_ONLY' ).
    but instead of changing the particular cell where i have marked READ_ONLY = 'X' it is changing whole column 'USR_ACT_RT'  data as editable .
    If anybody can  please help ASAP

    Hi Tashi,
    Thanks for your reply,i have did the same way u are doing here for setting the READ_ONLY Attribute conditionally.
    here is my code for setting the read only attribute .
    IF NOT lo_nd_nd_cost_rate IS INITIAL.
        lo_nd_nd_cost_rate->get_static_attributes_table( IMPORTING table = lt_nd_cost_rate ).
      ENDIF.
      IF NOT lo_el_nd_cost_rate IS INITIAL.
    * get all declared attributes
        lo_el_nd_cost_rate->get_static_attributes(
          IMPORTING
            static_attributes = ls_nd_cost_rate_sel ).
      ENDIF.
      lv_datum = sy-datum.
      lv_month = lv_datum+4(2).
    ** @TODO handle non existant child
      LOOP AT lt_nd_cost_rate INTO ls_nd_cost_rate WHERE quarter = ls_nd_cost_rate_sel-quarter.
        IF ls_nd_cost_rate-quarter = 'Q1'.
          IF ( lv_month  EQ '01' OR lv_month  EQ '02' OR lv_month  EQ '03' ).
            ls_nd_cost_rate-read_only = 'X'.
          ELSE.
            ls_nd_cost_rate-read_only = ''.
    *   report message
            CALL METHOD lo_message_manager->report_warning
              EXPORTING
                message_text = lv_text.
          ENDIF.
        ELSEIF ls_nd_cost_rate-quarter = 'Q2'.
          IF ( lv_month  EQ '04' OR lv_month  EQ '05' OR lv_month  EQ '06' ).
            ls_nd_cost_rate-read_only = 'X'.
          ELSE.
            ls_nd_cost_rate-read_only = ''.
    *   report message
            CALL METHOD lo_message_manager->report_warning
              EXPORTING
                message_text = lv_text.
          ENDIF.
        ELSEIF ls_nd_cost_rate-quarter = 'Q3'.
          IF ( lv_month  EQ '07' OR lv_month  EQ '08' OR lv_month  EQ '09' ).
            ls_nd_cost_rate-read_only = 'X'.
          ELSE.
            ls_nd_cost_rate-read_only = ''.
    *   report message
            CALL METHOD lo_message_manager->report_warning
              EXPORTING
                message_text = lv_text.
          ENDIF.
        ELSEIF ls_nd_cost_rate-quarter = 'Q4'.
          IF ( lv_month  EQ '10' OR lv_month  EQ '11' OR lv_month  EQ '12' ).
            ls_nd_cost_rate-read_only = 'X'.
          ELSE.
            ls_nd_cost_rate-read_only = ''.
    *   report message
            CALL METHOD lo_message_manager->report_warning
              EXPORTING
                message_text = lv_text.
          ENDIF.
        ENDIF.
        MODIFY lt_nd_cost_rate FROM ls_nd_cost_rate INDEX sy-tabix TRANSPORTING read_only .
        CLEAR ls_nd_cost_rate.
      ENDLOOP.
      lo_nd_nd_cost_rate->bind_table( lt_nd_cost_rate ).
    please see in the below sceen shot the last two cells are editable in the User Actual Rate Column whlie the selected rows cell is not editable. Please revert if u have any input for same.

  • How to compare two excel reports and find the difference in BI Publisher

    Hi All,
    I have a requirement that needs to compare two excel reports in XML Publisher 5.6.2. or BI publisher 10.1.3.4
    If anybody has an idea about this pls help us.
    Thanks,

    Since our customer wants to have this comparison only with BI reports....here is the scenario how the comparison should be..
    Now,we have a parameters called Customer name and version id. Version id list will be refreshed based on the customer selection.
    User can generate the report based on the selected customer name and version id. These data are fetch from the oracle database and we are using Data Template in the BI Publisher.
    Now the requirement is customer wants to compare two version id data. for example, v1.2 and v1.3
    Now they wanna to see both the reports while generating in the same work sheet, like, v1.2report should display in the left side and the v1.3report has to display in the right hand side of the same work sheet.
    Now...If there is any addition happened in v1.3 report,then that cell/data should display as a green color in that report.
    If any deletion happened in v1.3report then that should be in the red color.
    If any modification happened in v1.3 then that should be in the yellow color.
    If there is no difference then that should display as it is.
    the thing is that, the both the reports (v1.2 and v1.3)should display side by side in the same worksheet with the format and everything........only the difference should be highlighted.
    Template is same for both the reports..
    To display the data for both versions i think i can generate the template side by side of both in the same worksheet.
    Now, My question is how to find the difference of data in the RTF Template for both the versions
    Can anybody assist me?
    Thanks,
    Edited by: user753355 on Jun 9, 2009 12:03 AM
    Edited by: user753355 on Jun 9, 2009 12:06 AM
    Edited by: user753355 on Jun 9, 2009 12:16 AM
    Edited by: user753355 on Jun 10, 2009 3:59 AM

  • Good day. Is there into Pages the possibility to compare two documents? In order to reveal changes.

    Good day. Is there into Pages the possibility to compare two documents? In order to reveal changes.

    Hi iMayner,
    I don't know of a way to easily compare two documents in Pages. Maybe there is an app to do this, but I don't know of one.
    What you can do in Pages is to open both documents, resize the windows and drag them side-by-side on the screen. Pages 5 has a limit on how narrow you can make the windows, so this may be a bit of a pain.
    The first step would be to show the Word Count in both documents. (Pages 5.5.1 Menu > View > Show Word Count, or click on the View button in the ToolBar and Show Word Count). If the Word Counts are the same, you have **some** confidence that the documents are identical, but no guarantee.
    An example of two short documents with different word counts:
    Document A (33 words)
    The quick brown fox jumps over the lazy dog.
    Don't count your chickens until they hatch.
    Don't cross your bridges until you come to them.
    An apple a day keeps the doctor away.
    Document B (34 words)
    The quick brown fox jumps over the lazy dog.
    Don't count your chickens until they have hatched.
    Don't cross your bridges until you come to them.
    An apple a day keeps the doctor away.
    To home in on that difference, copy and paste each document into a column in a spreadsheet such as Numbers or Excel, so that each paragraph becomes a cell in a column. Turn on Wrap text in cell.
    The different heights of each cell (paragraph) become apparent.
    Happy Christmas!
    Regards,
    Ian.

  • Problems comparing two Floats

    Hello all,
    I keep getting exceptions using the code for a table cell renderer listed below.
    Basically, the program blows up whenever the renderer is asked to compare two floats.
    Two string values, a string and a float, it does not have the desired effect, but a least it runs.
    "     public Object[][] aaTableValues = {
              { new Float( 700.00 ), new Float( 300.00 ), new Float( 400.00 ), "Fred", "Snead", "inform", "detail" },
              { new Float( 1000.00 ), new Float( 200.00 ), new Float( 800.00 ), "Jane", "Smith", "limit", "detail" },
              { new Float( 500.00 ), new Float( 200.00 ), new Float( 300.00 ), "Mary", "Ellis", "inform", "detail" },
              table1.setDefaultRenderer(Object.class, new DefaultTableCellRenderer() {
                public Component getTableCellRendererComponent(JTable table,
                                                        Object value,
                                                        boolean isSelected,
                                                        boolean hasFocus,
                                                        int row,
                                                        int column) {
                    super.getTableCellRendererComponent(table, value, isSelected,
                            hasFocus, row, column);
                    // Prepare default color        
                    Color color = isSelected ? table.getSelectionForeground(): table.getForeground();
                    if (column == 1) {
                        float val1 = 0.0F;
                            val1 = ((Float)value).floatValue();
                        float val2 = ((Float)table.getValueAt(row, column - 1)).floatValue();
                        if( val1 > val2) {
                            color = isSelected ? Color.red.brighter() : Color.red;
                    setForeground(color);
                    return this;
            });I get the runtime exceptions like the following:
    "Caught exception updating ExitableJFrame[frame0,0,0,618x430,invalid,layout=java.awt.BorderLayout,resizable,title=AccountActivityTable,defaultCloseOperation=,rootPane=javax.swing.JRootPane[,0,0,618x430,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=null,alignmentY=null,border=,flags=2,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true,EXIT_ON_CLOSE]:
    java.lang.NullPointerException
         at FloatRenderer.getTableCellRendererComponent(Compiled Code)
         at javax.swing.JTable.prepareRenderer(JTable.java:2897)
         at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:968)
         at javax.swing.plaf.basic.BasicTableUI.paintRow(BasicTableUI.java:899)
         at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:811)
         at javax.swing.plaf.ComponentUI.update(ComponentUI.java:43)
    Does anyone know how to fix this?

    If you look again at the error message, you'll see it's a NullPointerException. You are using a null reference. Nothing at all to do with comparing two float values. I'd guess that "table.getValueAt(row, column - 1)" is returning null, but it's hard to tell without a line number. You need to do some debugging in that code to see where you are using the null reference.

  • How to merge two cells in a row

    hi freinds,
    how to merge two cells in alv grid using oops.
    for eg ,in the first row there is text premraj
             n in the second row there is cheguri
              my requriment is two merge the two cells ie to remove the horizontal line between them
    thanks & regards,
    premraj

    Well, as a new member you should learn to search the forum first before posting questions. Using keywords like "jtable merge cell" will find other postings on this topic. Some with solutions some without, so you will need to read a few and decide on the approach you want to take.

  • Compare two similar objects

    Do you know about any possible Java bugs with JDK update?
    In my case, my code stopped working.
    Here is what I have. There are two similar objects, but Object 1 has key, and Object 2 (same as Object 1) has no key. I need to compare both, and if they are equal, I need Object 1 to assign key to Object 2.
    It worked before. How I can get around.
    Please help me if you can.
    Respectfully,
    Alex

    Let me change the question:
    "Can we compare two objects one with key and another one without key? How?

  • Compare two Java Objects without Comparable / Comparator

    Hi Friends,
    I would like to compare two java objects (lots o attributes) without using Comparable / Comparator.
    Any suggestion/sample code would be helpful.
    Thanks,
    Sachin

    I suppose you could design another feature to compare Objects... but that would involve a design process, so asking for sample code is definitely premature. And as EJP says, what would be the point?
    At least that's what I would answer if this was one of those stupid interview questions.

  • I have two cell phone, different numbers.  Each has their own apple id.  How can i merge them so apps on one show on the other but keep their emails addresses separate on their own phone?

    Have two cell phones, different numbers.  Each has their own apple id.  How can I merge them so apps purchased on one phone show on the other.  But.as each has their own email address, I want to keep these email addresses separate on their own phone?  Thanks.

    We do this in my family now.  We have one account for purchases, so it is used to share music and apps (I think that is in Settings/iTunes & App Stores).  Each iDevice has this configured.
    Then, each of us has our own iCloud account that is configured under Settings/iCloud.  That then allows us to have our own Mail/Contacts/Calendars/Reminders/Safari Bookmarks/Notes/Passbook/Photo Stream/Documents & Data/Find My iPhone/and Backup.  That Backup piece is pretty sweet and comes in handly if you replace your iDevice.  You can just restore from it.
    So we all share the Apple Store account but we all have our own iCloud accounts to keep the rest seperate or things like you mentioned are a nightmare.
    In answer to what iCloud does for you: http://www.apple.com/icloud/features/
    Think of it as an internet based ("cloud") area for all of those items listed in my response.  What you need to remember is photo stream only maintans the last 1000 pictures so don't count it as a complete backup solution for your pictures.  Even though I rarely sync with a computer these days, I do still try to sync my phone with iPhoto (I have an iMac) so that I have copies of all of my pictures.  1000 may not stretch as far as it sounds.
    Message was edited by: Michael Pardee

  • How to color more than one cell in an ALV line ???

    Hi SDN community,
    I have the following problem:
    I display an internal table with the 'REUSE_ALV_GRID_DISPLAY' function and want to color two cells, not only one cell.
    Coloring one cell is no problem with...
    cell_color1 TYPE lvc_t_scol, " cell color
    DATA  gs_cellcolor    TYPE          lvc_s_scol. " to color a cell
    gs_cellcolor-fname = 'TNAME'.
    gs_cellcolor-color-col = '6'.
    gs_cellcolor-color-int = '1'.
    gs_cellcolor-color-inv = '0'.
    LOOP AT it_result.
      IF it_result-trend EQ 'fast-growing'.
        APPEND gs_cellcolor TO it_result-cell_color1.
        IF sy-subrc EQ 0.
          MODIFY it_result.
        ENDIF.
      ENDIF.
    ENDLOOP.
    and
    ls_layout-coltab_fieldname = 'CELL_COLOR1'.
    , the last one is in the layout building form.
    My problem is that in
    ls_layout-coltab_fieldname = 'CELL_COLOR1'.
    , I can only type in ONE fieldname, but I would like to color more than one field/cell, you got my problem?
    Thank you very much,
    Marius

    I'm pretty sure that the color would be controlled by what records are appended to the CELL_COLOR1 table inside IT_RESULT. . So move the code inside the IF statement, and add addition logic.
    LOOP AT it_result.
      IF it_result-trend EQ 'fast-growing'.
       gs_cellcolor-fname = 'TNAME'.
       gs_cellcolor-color-col = '6'.
       gs_cellcolor-color-int = '1'.
       gs_cellcolor-color-inv = '0'.
        APPEND gs_cellcolor TO it_result-cell_color1.
        IF sy-subrc EQ 0.
          MODIFY it_result.
        ENDIF.
    else.
       gs_cellcolor-fname = 'OTHER_FIELD'.
       gs_cellcolor-color-col = '5'.
       gs_cellcolor-color-int = '1'.
       gs_cellcolor-color-inv = '0'.
        APPEND gs_cellcolor TO it_result-cell_color1.
        IF sy-subrc EQ 0.
          MODIFY it_result.
        ENDIF.
      ENDIF.
    ENDLOOP.
    Regards,
    Rich Heilman

  • How can i compare two excel files with different no. of records.

    Hi
    I am on to a small project that involves us to compare two excel files. i am able to do it but am struck up at a point. When i compare 2 different .csv files with different no. of lines i am only able to compare upto a point till when the number of lines is same in both the files.
    Eg. if source file has 8 lines and target file has 12 lines. The difference is displayed only till 8 lines and the remaining 4 lines in source lines are not shown.
    Can you help me in displaying those extra 4 lines in source file. I am attaching my code snippet below..
    while (((strLine = br.readLine()) != null) && ((strLine1 = br1.readLine())) != null)
                     String delims = "[;,\t,,,|]";
                    String[] tokens = strLine.split(delims);
                    String[] tokens1 = strLine1.split(delims);
                   if (tokens.length > tokens1.length)
                    for (int i = 0; i < tokens.length; i++) {
                        try {
                            if (!tokens.equals(tokens1[i])) {
    System.out.println(tokens[i] + "<----->" + tokens1[i]);
    out.write(sno + " \t" + lineNo1 + " \t\t" + tokens[i] + "\t\t\t\t" + tokens1[i]);
    out.println();
    sno++;
    } catch (Exception exception)
    out.write(sno + " \t" + lineNo1 + " \t\t" + tokens[i] + "\t\t\t\t" + "");
    out.println();
    Thanks & Regards                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    A CSV file is not an Excel file.
    But apart from that your logic makes no sense.
    If the 2 files are of different sizes the files are different by definition, so further comparison isn't needed, you're done.
    If you want to compare individual records, you need to compare all records from one file with all records from the other, unless the order of records is important in which case your current system might work.
    That system however is overly complicated for comparing CSV files.
    As you assume a single record per line, and if one can assume those records to have identical layout (so no leading or trailing whitespace in or between columns in one file that's not in the other) comparing records is simply a matter of comparing the entire lines.

  • Functinality to compare two material price with reference to BOM in CO

    Hi All,
    Is there is any functionality in Controlling which can compare the costing for two FERT materials.
    or
    is there is  any functionality where we can compare two material price with reference to BOM in controlling
    Please help me to compare the material price with reference to BOM
    Regards
    nandu

    Hi,
    You can use this report to compare two itemizations. The report compares the characteristics item number, item category, cost element, resource, material, cost center, plant/work center, cost center/activity type, operation number, BOM item, assembly indicator, and cost component.
    You can access this report as follows:
    Accounting ® Controlling ® Product Cost Controlling ® Product Cost Planning ® Material Costing ® Cost Estimate with Quantity Structure or Cost Estimate Without Quantity Structure ® Compare
    or
    Accounting ® Controlling ® Product Cost Controlling ® Product Cost Planning ® Information System ® Object Comparisons ® For Material ® Itemization Comparison.
    For Detail Please reffer following link:
    http://help.sap.com/saphelp_46c/helpdata/en/56/abd108f1a611d28a950000e8214595/content.htm
    Thanks and Regards
    Binoj M D

Maybe you are looking for