In ALV  I need to color the records when ever material number changes

Hi ,
I need to color the records in alv when ever the material changes.
for ex : I have 10 records .
1 to 3 records same material number so yellow color
4 to 8 records same material numberso blue color
9 to 10 recrods same material number  so yellow color.
Please do the favour..
thank you.
karthik.

Hi,
Have one more column in the final table as
         ROWCOLOR(4),              "reqd only if row is color
Do the coding like this.
Keep canging the Row number to get different colors. Like C410 etc.
  LOOP AT T_FINAL.
    IF T_FINAL-NUMBER = 'XXX'. " <b>Do your comparison operation here</b>.
      T_FINAL-ROWCOLOR = 'C510'.
      MODIFY T_FINAL TRANSPORTING ROWCOLOR.
    ENDIF.
  ENDLOOP.
Also modify the layout giving the field as
DATA : W_LAYOUT TYPE SLIS_LAYOUT_ALV.
  W_LAYOUT-INFO_FIELDNAME = 'ROWCOLOR'.
Hope this helps you.
Regards,
Subbu.

Similar Messages

  • Need to color the  different textfield with different color in J2ME

    hi
    i am developing an application where i need to color the different textfield in the form with different color. but i am not able to do this even with the canvas class also. Can you please help me ? Thanks in advance..

    In J2ME, I don't think you can do that easily by setting color. If you want to use specific color in a text field, you need to construct the text box your own. Use Graphics object to draw text field (as image) and here specify a color of your choice.
    Hope this helps.
    Thanks,
    Mrityunjoy

  • Vertical scrollbar not showing all the records when I scroll down.

    Vertical scrollbar not showing all the records when I scroll down.
    Using Oracle forms 10g , operating system windows
    I have two fields with number of items dispayed = 15.
    I have a vertical scroll bar with them. There are 34 records in the table but the scrollbar only shows 15 records.
    Here are the properties for block / scrollbar.
    WORK_CATEGORY
    - Subclass Information                           
    - Comments                                       
    * Navigation Style                                Same Record
    - Previous Navigation Data Block                 
    - Next Navigation Data Block                     
    - Current Record Visual Attribute Group          
    - Query Array Size                                0
    - Number of Records Buffered                      0
    * Number of Records Displayed                     60
    * Query All Records                               No
    - Record Orientation                              Vertical
    * Single Record                                   No
    - Database Data Block                             Yes
    - Enforce Primary Key                             No
    - Query Allowed                                   Yes
    - Query Data Source Type                          Table
    * Query Data Source Name                          WORK_CATEGORY
    * Query Data Source Columns                      
    * Column Name                                   JOB_TYPE
    * Column Type                                   VARCHAR2
    - Column Type Name                             
    - Parent Column                                
    * Length                                        30
    * Precision                                     0
    * Scale                                         0
    * Mandatory                                     Yes
    * Column Name                                   WORK_CATEGORY
    * Column Type                                   VARCHAR2
    - Column Type Name                             
    - Parent Column                                
    * Length                                        30
    * Precision                                     0
    * Scale                                         0
    * Mandatory                                     Yes
    - Query Data Source Arguments                    
    - Alias                                          
    - Include REF Item                                No
    * WHERE Clause                                   
    * ORDER BY Clause                                 job_type
    - Optimizer Hint                                 
    - Insert Allowed                                  Yes
    - Update Allowed                                  Yes
    - Locking Mode                                    Automatic
    - Delete Allowed                                  Yes
    - Key Mode                                        Automatic
    - Update Changed Columns Only                     No
    - Enforce Column Security                         No
    - Maximum Query Time                              0
    * Maximum Records Fetched                         0
    - DML Data Target Type                            Table
    - DML Data Target Name                           
    - Insert Procedure Name                          
    - Insert Procedure Result Set Columns            
    - Insert Procedure Arguments                     
    - Update Procedure Name                          
    - Update Procedure Result Set Columns            
    - Update Procedure Arguments                     
       Don't know where am I going wrong. I'll really appreciate if you can help me in this.
    Thanks.
    Edited by: 831050 on Sep 14, 2011 8:05 AM

    One of the items is a list item.. here are it's properties:
    * Name                                          JOB_TYPE
    * Item Type                                     List Item
    - Subclass Information                         
    - Comments                                     
    - Help Book Topic                              
    - Enabled                                       Yes
    * Elements in List                             
    * Label                                      
    * List Item Value                             LIST20
    * List Style                                    Combo Box
    - Mapping of Other Values                      
    - Implementation Class                         
    - Case Restriction                              Mixed
    - Popup Menu                                   
    - Keyboard Navigable                            Yes
    - Mouse Navigate                                Yes
    - Previous Navigation Item                     
    - Next Navigation Item                         
    - Data Type                                     Char
    - Data Length Semantics                         Null
    - Maximum Length                                30
    - Initial Value                                
    * Required                                      Yes
    * Copy Value from Item                         
    - Synchronize with Item                        
    - Calculation Mode                              None
    - Formula                                      
    - Summary Function                              None
    - Summarized Block                             
    - Summarized Item                              
    - Current Record Visual Attribute Group        
    - Distance Between Records                      0
    * Number of Items Displayed                     15
    - Database Item                                 Yes
    * Column Name                                   JOB_TYPE
    - Primary Key                                   No
    - Query Only                                    No
    - Query Allowed                                 Yes
    - Insert Allowed                                Yes
    - Update Allowed                                Yes
    - Update Only if NULL                           No
    - Visible                                       Yes
    * Canvas                                        CANVAS2
    - Tab Page                                     
    * X Position                                    47
    * Y Position                                    137
    * Width                                         187
    * Height                                        18
    - Visual Attribute Group                        DEFAULT
    - Prompt Visual Attribute Group                 DEFAULT
    - Foreground Color                             
    * Background Color                              white
    - Fill Pattern                                 
    - Font                                         
    * Font Name                                     Tahoma
    * Font Size                                     10
    * Font Weight                                   Demilight
    * Font Style                                    Plain
    * Font Spacing                                  Normal
    * Prompt                                        Job Type
    - Prompt Display Style                          First Record
    * Prompt Justification                          Start
    * Prompt Attachment Edge                        Top
    - Prompt Alignment                              Start
    * Prompt Attachment Offset                      10
    * Prompt Alignment Offset                       0
    - Prompt Reading Order                          Default
    - Prompt Foreground Color                      
    - Prompt Font                                  
    * Prompt Font Name                              Tahoma
    * Prompt Font Size                              10
    * Prompt Font Weight                            Bold
    * Prompt Font Style                             Plain
    * Prompt Font Spacing                           Normal
    - Hint                                         
    - Display Hint Automatically                    No
    - Tooltip                                      
    - Tooltip Visual Attribute Group               
    - Direction                                     Default
    - Initial Keyboard State                        Default
    - Keyboard State                                Any
        

  • Why I can not unlock the record when close a page?

    I develop a jsp page as client,the jsp application use a business componment with statefull application module.i call a database rowset's lock function in jsp page to lock a record,now,after i close the jsp page without commit and rollback,the record is not unlocked,until i restart the oc4j application server.how can i unlock the record when close the page without commit and rollback?????

    Li Ping:
    If you lock a row in the course of a transaction, you cannot unlock the row until the end of transaction (either rollback or commit). DBMS doesn't allow this.
    Alternatively, you can try to delay locking of the row. E.g., you can try using optimistic locking. Please see the Java Doc for oracle.jbo.Transaction if you're interested in optimistic locking.
    Thanks.
    Sung

  • HT3964 I am getting the error message "No AirPort card installed" Restarting my iMac desktop does not solve this (Apple help says I need to reset the SMC this way, but nothing changes. Can somebody advise, please?

    I am getting the error message "No AirPort card installed" Restarting my iMac desktop does not solve this (Apple help says I need to reset the SMC this way, but nothing changes). Can somebody advise, please?

    Thanks for the flag J.K. - they contaced me and solved my problem.  On this account (which I created just to ask this question), I log in with my email rather than my user name (mtalldud). On the account that I was having trouble with, they told me to use my user ID instead of my email to log in and it worked. This is a bit confusing and seems a bit inconsistent but at least I don't need this temporary account any more to get into this community and find answers!

  • Commiting all the records when one is change  --Help Please

    Hi,
    I have a problem. I have got a form to do some changes. (original form was not done by me). This is a base table form. If I query for a particular criteria, and say it returns 5 rows and then if i modify just something only in one record and save, it commits all 5 records.
    But for the second time (without exist form the form), then if I query for the same criteria which returns the same 5 records and at that time when changing something in 1 record will commit only that record... Any idea what property has got wrong...
    The problem is I am supposed to keep a history table and to track the changes done to main table. so in above case as it commits even the records that has not being changed, that also get writes to the history...
    There are some display fields as well which display values from LOVs.
    Any one, ... any idea where the problem is...

    No Mohan,
    I haven't written any code.. I also cannot find how this happens.. because its a form that someone else has done..iam also trying to find why & how this is happening. There is no trigger to update, it is a base table block.
    But I saw a field now which populates from a LOV. There is a description field displayed on the form but actually the field that is on the table is the code, so when selecting from the LOV the code field is getting populated... Is this a problem

  • Do I need to recreate the View when the underlying field changes?

    Re: Do I need to recreate the View when the underlying field changes?
    I did an ALTER TABLE1 to change FIELD1 from varchar(5) to varchar(7). TABLE1.FIELD1 is in VIEW1. When I do a SELECT * FROM VIEW1 it shows 7 characters. But when I look at VIEW1 in object explorer (after refreshing), FIELD1 is varchar(5). Do I care?
    Should I recreate the VIEW1?

    If you have refreshed using sp_refreshview stored procedure then you are good, if not then here you go...
    The metadata for the view is not automatically updated when the tables are modified.
    The fix is to either drop and re-create or alter the view or to use the sp_refreshview stored procedure.
    Example :
    EXEC sp_RefreshView View_Tablename
    GO
    http://msdn.microsoft.com/en-us/library/ms187821.aspx
    Raju Rasagounder Sr MSSQL DBA

  • [svn:fx-trunk] 14009: DataGroup.getVirtualElementAt() needs to revalidate the element when the IR already exists but the data changes .

    Revision: 14009
    Revision: 14009
    Author:   [email protected]
    Date:     2010-02-05 12:53:05 -0800 (Fri, 05 Feb 2010)
    Log Message:
    DataGroup.getVirtualElementAt() needs to revalidate the element when the IR already exists but the data changes. 
    The element also needs to revalidate if it is resized, whether or not the IR existed before.  This wasn't part of the bug but Hans realized this when he did the code review.
    QE notes:
    Doc notes:
    Bugs: SDK-25354
    Reviewer: Hans
    Tests run: checkintests
    Is noteworthy for integration:
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-25354
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/DataGroup.as

    Please can u answer it fast

  • How to split the IDOCS based on document number change whit out BPM

    Hi all,
    Thanks,for giving the responce..
    Scenario:File to IDoc.
    Problum1 : How to Split the IDocs based on document number change in the source file with out BPM.My file contains document numbers like
    20000092
    20000092
    20000092
    50000050
    50000050
    50000065
    I want 3 IDocs in target system.i.e 1 for 20000092,20000092,20000092
                                                       2 for 50000050,50000050
                                                       3 for 5000006
    By using external definations i am getting 6 IDOCs insted of 3.
    Problum 2:Is there any chnges/modifications in Directory when we are using external definations.
    Could u plz provide me the step by step process(Repository/Directory) with using of external definations.
    Thanks in advance.
    Regards,
    KP

    HI,
    for this no need of BPM.
    You can think of Idoc bundling concept to acheive this-just you need to do the external definition to change the idoc occurence
    /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change
    to achieve for each document no, one idoc, you can write small user defined function in the mapping with context handling you an achieve this.
    For this e.g
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6bd6f69a-0701-0010-a88b-adbb6ee89b34
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/877c0d53-0801-0010-3bb0-e38d5ecd352c
    Regards,
    Moorthy

  • New computer at work and all my song are on the server-when I try to change the folder location under preferences to the server, it still won't show my songs in Itunes?? please help!

    I have a new computer at work and all my song are on the server-when I try to change the folder location under preferences to the server, it still won't show my songs in Itunes?? please help!

    Howdy carpetjim,
    When you change the folder location like that, it changes where new songs and media are stored. To actually load the library you need to do this:
    Steps to create or choose a different iTunes Library file
    If iTunes is running, quit iTunes.
    If you are using Windows, hold down the Shift key and from the Start menu and choose All Programs > iTunes > iTunes.
    If you are using the Mac, open iTunes and immediately hold down the Option key.
    You should see one of the following screens:
    Additional information
    If you do not see one of the screens above, then you did not hold the correct key at the correct time. You may want to try again. Note that if you pinned iTunes to the Start menu programs, and open it that way, it may not work.
    From: iTunes: How to open an alternate iTunes Library file or create a new one
         http://support.apple.com/kb/ht1589
    Take care,
    Sterling

  • I recently upgraded to Mavericks and now don't have access to iphoto.  I cannot find my iphoto library to back the photos up before upgrading the iphoto but see the photos when I try to change screensaver?  Where are my photos so I can back them up?

    I recently upgraded to Mavericks and now don't have access to iphoto.  I cannot find my iphoto library to back the photos up before upgrading the iphoto but see the photos when I try to change screensaver?  Where are my photos so I can back them up?

    The iPhoto library should be in your user folder/Pictures unless it was moved.

  • How to avoid updating the data when ever we refresh the page

    I want to avoid updating the data to the server when ever we refresh the web page.
    Thanks in advance.

    You could potentially do it by using a redirect instead of a forward to the result page.
    That will essentially do it in two requests. 1 to request the save, another to display the result of the save.
    If the user then requests a refresh, it won't incur a save call.
    Of course, that doesn't stop them going back in the browser, and refreshing that page, but it at least makes it a little harder.
    Cheers,
    evnafets

  • HT201263 My iphone 5s fell from my hand and went off, It refused coming up again. I always got the massage when ever i plug it on itune( iphone recorvery mode) Please what can i do?

    My iphone 5s fell from my hand and went off, It refused coming up again. I always got the massage when ever i plug it on itune( iphone recorvery mode) Please what can i do?
    <E-mail Edited by Host>

    Did you already try to reset the phone by holding the sleep and home button for about 10sec, until the Apple logo comes back again? You will not lose data by resetting.
    If this does not help, try to connect in recovery mode, explained here:
    iOS: Unable to update or restore
    If still no luck, you'll have to contact Apple Support to get it serviced:
    iPhone - Contact Support - Apple Support

  • Need to process the records that are selected using checkbox in an ALV

    Hi ..
    I am displaying some data in an ALV using the Parent-child relation, the parent records has a check box which is input enabled.
    On click of a button on the toolbar, i need the checked records to be fetched and processed.
    Please help me on how to fetch the records that are checked..
    Thanks,
    Derek

    Hello Derek,
    Is ALV created using OOPS or using conventional FM?
    If you are making use of OOPS technique, then call this method:
    CALL METHOD <grid_name>->get_selected_rows.
    BR,
    Vishal.

  • Need to delete the record based on the checkbox xselected

    I am displaying the data from tables vbrk and vbrp.along   with that  data i am displaying the checkbox also.
    here my requirement is when ever the user checks the checkboxes and click on delete button  the checkbox selected items should deleted and  need to display the remaining.
    please any send me the example  how to process it.
    thanks and regards
    vamsi
    [email protected]

    Hi,
    Herewith i am sending the sample coding for checkbox alv report. Kindly go through it. U can get some idea for your requirement.
    REPORT  YMS_CHECKBOXALV.
    TYPE-POOLS: slis.
    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.
    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
    DATA: s_layout TYPE slis_layout_alv.
    DATA: BEGIN OF itab OCCURS 0,
    icon TYPE icon-id,
    vbeln TYPE vbeln,
    kunnr TYPE kunnr,
    erdat TYPE erdat,
    box TYPE c,
    END OF itab.
    DATA: v_repid TYPE syrepid.
    START-OF-SELECTION.
    Get the data.
    SELECT vbeln kunnr erdat UP TO 100 ROWS
    FROM vbak
    INTO CORRESPONDING FIELDS OF TABLE itab.
    IF sy-subrc <> 0.
    MESSAGE s208(00) WITH 'No data found'.
    LEAVE LIST-PROCESSING.
    ENDIF.
    Modify the record with red light.
    itab-icon = '@0A@'.
    MODIFY itab TRANSPORTING icon WHERE NOT vbeln IS initial.
    v_repid = sy-repid.
    Get the field catalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '1'.
    s_fieldcatalog-fieldname = 'ICON'.
    s_fieldcatalog-tabname = 'ITAB'.
    s_fieldcatalog-seltext_l = 'Status'.
    s_fieldcatalog-icon = 'X'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '2'.
    s_fieldcatalog-fieldname = 'VBELN'.
    s_fieldcatalog-tabname = 'ITAB'.
    s_fieldcatalog-rollname = 'VBELN'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '3'.
    s_fieldcatalog-fieldname = 'KUNNR'.
    s_fieldcatalog-tabname = 'ITAB'.
    s_fieldcatalog-rollname = 'KUNNR'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    CLEAR: s_fieldcatalog.
    s_fieldcatalog-col_pos = '4'.
    s_fieldcatalog-fieldname = 'ERDAT'.
    s_fieldcatalog-tabname = 'ITAB'.
    s_fieldcatalog-rollname = 'ERDAT'.
    APPEND s_fieldcatalog TO t_fieldcatalog.
    Set the layout.
    s_layout-box_fieldname = 'BOX'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    i_callback_program = v_repid
    is_layout = s_layout
    i_callback_pf_status_set = 'SET_PF_STATUS'
    i_callback_user_command = 'USER_COMMAND'
    it_fieldcat = t_fieldcatalog[]
    TABLES
    t_outtab = itab.
    FORM SET_PF_STATUS *
    --> EXTAB *
    FORM set_pf_status USING extab TYPE slis_t_extab.
    SET PF-STATUS 'TEST2'.
    ENDFORM.
    FORM user_command *
    --> UCOMM *
    --> SELFIELD *
    FORM user_command USING ucomm LIKE sy-ucomm
    selfield TYPE slis_selfield.
    Check the ucomm.
    IF ucomm = 'DETAIL'.
    LOOP AT itab WHERE box = 'X'.
    itab-icon = '@08@'.
    MODIFY itab TRANSPORTING icon.
    ENDLOOP.
    ENDIF.
    selfield-refresh = 'X'.
    ENDFORM.
    Thanks,
    Shankar

Maybe you are looking for