How to color it ?

Hello everybody,
I am just new learner about Java programming. Could anybody help me this:
I want to make two different colors for statements
System.out.println("What is your name?");
String answer = keyboard.readLine(); // assume i type "My name is John"
How to make a color for " What is your name ?" when it shows on the screen ?
And how to make a different color for input from keyboard when i type:"My Name is John"
Thank you very much in advance. I really appreciate.
still_learn

An example under Unix :
System.out.println( "\u001b[1;44m Hello World \u001b[m" );
Denis                                                                                                                                                                                                           

Similar Messages

  • How to color the text  elements in script?

    how to color the text  elements in script?
    byeeeee
    plz send the answers

    Hi,
    Please go through my blog to know how to do color printing in SAP scripts.
    White Paper on 'Color Printing in SAP Scripts'
    Regards,
    Sireesha Ch

  • How to color a text(font) in GRID?

    hii..can i color a <b>tex</b>t(not cell using slis_layout_alv-info_fieldname) in GRID display..if so please give me an idea or  sample code... thanks in advance..

    Check out these threads.
    Color Cells in ALV Grid
    Change Color of Cell in ALV Grid
    How to color a row of  alv grid
    Reward points for useful Answers
    Regards
    Karthik

  • How to color the background of a text line in mail

    How to color the background of a text line in mail
    The forum has a message dated 2005 that this cannot be done, has the recent OS made this a feature.
    I still caanot seem to see any where it is available.
    Thanks
    Greg

    greg1424 wrote:
    Does pages do that?
    Yes.
    I also have Office for MAC but rarely use it as it is too cumbersome for me.
    Microsoft Office does it also.  So does Libre Office, Open Office and just about any full function word processor app.
    Dan

  • HSB Color Space Question - How Many Colors Are There In Photoshop

    Hello guys, I have a sort of basic question that I have been trying to figure out for a few days.
    I am trying to find out how many colors there are in the Color Picker  when the Hue radio button is selected.
    I know there are 256^3 RGB (#Hex) colors, and I am trying to find some relationship when I am coloring with HSB color space in Photoshop.
    It just confuses me because the Hue slider goes from 0-359 and the S and B goes from 0-99...
    So how many HSB colors in Photoshop are there?  Am I missing out on some colors by using HSB color space in Photoshop as oposed to using RGB?
    Are there the exact same amount?  Are there more and there are duplicates in HSB space mode?
    Thank you all for all your help, much appreciated
    Travis

    misterfowly wrote:
    I know there are 256^3 RGB (#Hex) colors, and I am trying to find some relationship when I am coloring with HSB color space in Photoshop.
    It just confuses me because the Hue slider goes from 0-359 and the S and B goes from 0-99...
    So how many HSB colors in Photoshop are there?  Am I missing out on some colors by using HSB color space in Photoshop as oposed to using RGB?
    The deficiency of such mathematical models is that they do not take into account noise and human perception. In an 24 bit RGB space (8 bits per channel) there may be 16 million colors, but this assumes that there are 256 discrete levels in each color channel. You could increase the number of colors by using a 48 bit space. In practice, noise will reduce the number of discrete levels, and this will vary with the camera and ISO used in that camera. For example, consider the Nikon D5000 as evaluated by DXO. At  base ISO the camera can resolve only 21.8 bits of color information and this decreases to 15.6 bits at an effective ISO of 2079 (camera ISO setting of 3200).
    http://www.dxomark.com/index.php/eng/Image-Quality-Database/Nikon/D5000
    Then you have to consider how many of these colors can actually be differentiated by the human visual system. If you can't see a difference, it really doesn't matter.These differences are difficult to quantitate. One such effort uses MacAdam ellipses shown in this Wikipedia article on a CIE 1931 xy plot. How many of these ellipses are contained in the CIE xy space? The DXO site has similar ellipses for real world camera images.
    http://en.wikipedia.org/wiki/MacAdam_ellipse
    See this RIT FAQ for a more sober real world analysis. The actual number of colors is in the millions, but likely not 16 million.
    http://www.cis.rit.edu/mcsl/outreach/faq.php?catnum=1#219
    In a real world situation, I would not be overly concerned about differences between the RGB and HSB spaces, but one could increase precision by using a 48 bit space.

  • 24" iMac - How many colors?

    The specs. for the 24" iMac display state simply "millions of colors." At the same time the specs. for, for example, a 23" cinema display state very specifically "16.7 million colors" (which I believe would be 24 bit color). So my question is, specifically, how many colors will the 24" iMac display really produce?

    Magnitude15 wrote:
    Do you know (or does anyone else know) how to tell if a monitor uses the 8-bit S-IPS panels?
    Is there a label on the monitor or is there a software test available to determine this?
    There are several possibilities:
    1) tftcentral.co.uk has an extensive database that lists LCD panel part numbers
    for many popular monitors. They also have a listing of panel specs -- sorted by
    manufacturer's part number.
    2) The monitor's "viewing angle" specs are a strong clue. 160 degrees or less is
    a fairly sure sign of a TN panel. 178 degrees generally indicates an S-IPS panel;
    panels in the 170-175 degree range are likely to be S-PVA or a similar type of
    high-quality panel. If it's not TN, it's almost certainly an 8-bit panel.
    3) For iMacs, you can download a copy of SwitchResX.app and interrogate the
    panel type with "Export DDC." The last few lines of the DDC information block
    indicate the manufacturer's part number of the panel -- and with that, you can
    find the specs on tftcentral.co.uk.
    4) Google. Online reviews by Xbitlabs.com, tomshardware.com, tftcentral.co.uk,
    etc. often reveal the panel type.
    Looby

  • How to color data in EXCEL while sending to email?

    Dear Friends,
    I have a doubt.
    I have a internal table IT_MARA.
    I sent  this data via EMAIL to the user by using the Function Module -'SO_NEW_DOCUMENT_ATT_SEND_API1' as EXCEL fortmat.
    My question is How to color this data in EXCEL while i am sending to email?
    Regards
    Moosa

    Hi,
    Try these link
    http://www.saptechies.com/how-to-send-some-abap-data-to-an-excel-sheet-using-ole-automation/
    http://www.sap-img.com/abap/download-to-excel-with-format-border-color-cell-etc.htm
    Regards,
    Manish

  • How change color on form SAP 7.5

    How change color on the form when the form load (Form Partners or Invoice form). I can use SDK UI-API programing interface.
    OR
    how change color cell on matrix (matrix chose PH)

    You can use something like this as the custom validation script of the
    drop-down:
    if (event.value=="Customer A") event.target.textColor = color.red;
    else event.target.textColor = color.black;
    Make sure you tick the option to commit the selected value immediately
    (under Properties - Options), so that it will change as soon as a selection
    is made.

  • How to color the mandatory fields in a Adobe WebDynpro Java form

    Hi Experts,
    How to color the mandatory fields in a Adobe WebDynpro Java form?
    This will avoid any confusion to he end user while filling the form as he would try to type something in field which is set as Read nlybut stil the cursor appears there.
    Regards,
    Shobhit

    Hi Shobhit,
    you can write something like xfa.host.setFocus(<text field name>). to set the focus or
    <text field name>.fillColor = "120,120,123";
    <text field name>.resolveNode"ui.#textEdit").border.edge.fill.color.value="120,150.200";
    to fill the color.
    Refer to adobe dev centger scripting samples to learn more on these.
    Hope these helps.
    Thanks and Regards,
    - anto.

  • How much color in cardridge?

    Hi,
    I have a big problem. I bought a HP Deskjet 5650. First I installed it on my computer. It worked good, but after month it didn´t work. If I want print sth, it will give me a message, that no printer avaliable.
    So, I reinstall drivers for printer, but it was same - no printer avaliable. Than I uninstall all software for this printer and install only driver for printer. It work good.
    But, my problem is, that I don´t know, how much color in cardridge I have. Have someone any idea? Some software or something like this with which I can find how much color I have. Thank you very much for any idea.

    Oops!! IOS 6

  • Please guide me how PMS Colors can be done in DUOTONE?

    Hello,
    Good Day
    I have job having 7 Colors and I have been asked to done it in 5 Colors.
    (1) Pantone 485CVC (RED)
    (2) Pantone 356CVC (GREEN)
    (3) Pantone 116CVC (YELLOW)
    (4) Pantone 301CV (D-BLUE)
    (5) Pantone 279C (L-BLUE)
    (6) Pantone 732C (D-BROWN)
    (7) Pantone 730C (L-BROWN)
    I can use Red, Green and Yellow on separate screens where as remaining
    “FOUR COLORS” are Dark Blue, Light Blue, Dark Brown and Light Brown.
    Please guide me how I can finish the job in five colors as my boss advised
    me to do it in duotone. The job is on Illustrator CS2 and Colors are PMS.
    Please guide me how PMS Colors can be done in DUOTONE.
    I have been working in filled of screen print for many years but unaware
    about duotone in Illustrator.
    I would sincerely grateful for your reply and Guidance.
    With Best Regards
    Ahmed Ali
    [email protected]

    Since this is (evidently) being prepared for screen printing, your options will be affected by answers to these questions:
    Are halftone dots going to be allowed? Screen printing setups (especially in common T-shirt shops) often require solids only.
    If the screen printing setup can accommodate halftoning, at what halftone ruling? When a particular screen printing setup is limited to very course (ugly) halftone ruling--commonly 30 lpi or less--one often opts for textures or grain to achieve the effect of shading.
    Are the inks going to be opaque? Opaque inks are most common, but limit the possible results when overlapped. Translucent inks are only suitable for white or very light substrate colors. If the screen setup is sophisticated enough to support decent halftone ruling, and will be printed on a white substrate, then the colors you have listed could be accomplished simply building the file as ordinary four-color process, instead of with 5 colors. (None of the colors you've listed—red, green, yellow, two blues, two browns—suggest requiring a 5th spot ink.)
    Illustrator does not support multi-ink swatches. You can use multiple fills and/or strokes set to overprint to replicate it in output. But Illustrator cannot properly display overprinting of opaque inks in its interface. Overprint preview always assumes the translucent inks of offset printing.
    All the above is why it is common to build screen printing projects in Photoshop as multichannel documents, saved as DCS 2 EPS, or printed to Adobe PDF as separations. It's more intuitive because you have a Channel (not to be confused with Layers) for each ink, and the program is able to properly preview the printed results because you can simulate opacity, including the color of the substrate.
    Working this way, it is common to create vector objects in Illustrator and then paste them into the appropriate Channel in Photoshop.
    ...my boss advised me to do it in duotone...
    I suspect your boss doesn't know what a duotone is. Duotone (and tritone, quadtone) print multiple separations of the same grayscale channel. Duotone in Photoshop is the modern analog of the process darkroom technique of making two separation plates from the same image, using different screen angles and exposures. In Photoshop, you can do this for up to four inks, optionally applying different grayscale curves to each ink, not different channels (different artwork) to each ink. Traditionally, this was done to impart a bit of "color interest" to black-and-white photos being printed in a 2-ink job.
    Your boss is saying "duotone," but he's thinking of the functionality of a multichannel file using spot inks. Even Photoshop's quadtone would not give you five inks.
    JET

  • Plz can anybody tell me how to color the whole UIButton

    Plz can anybody tell me how to color the whole UIButton

    You can set image on your button (just change an image with the color which you want)
    [button setBackgroundImage:newImage forState:UIControlStateNormal];      
    [button setBackgroundImage:oldImage forState:UIControlStateHighlighted];

  • How to color row in ALV report?

    hi
    I am creating an ALV report using factory method.
    my report is based on itab which contain 3 coulms, 1 column is ERROR_TYPE . how can i color all the rows which contain E in error_type ???
    thanks
    Ami

    TABLES:LFA1.
    SELECT-OPTIONS:LIFNR FOR LFA1-LIFNR.
    DATA:BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    LAND1 LIKE LFA1-LAND1,
    ORT01 LIKE LFA1-ORT01,
    REGIO LIKE LFA1-REGIO,
    SORTL LIKE LFA1-SORTL,
    CFIELD(4) TYPE C,
    END OF ITAB.
    data:col(4).
    data:num value '1'.
    SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE LIFNR
    IN LIFNR.
    LOOP AT ITAB.
    concatenate 'C' num '10' into col .
    ITAB-CFIELD = col.
    num = num + 1.
    if num = '8'.
    num = '1'.
    endif.
    MODIFY ITAB.
    ENDLOOP.
    TYPE-POOLS:SLIS.
    DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA:LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA:SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE.
    DATA:EVE TYPE SLIS_T_EVENT WITH HEADER LINE.
    LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    LAYOUT-WINDOW_TITLEBAR = 'VENDORS DETAILS SCREEN'.
    LAYOUT-EDIT = 'X'.
    LAYOUT-info_fieldname = 'CFIELD'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = SY-REPID
    I_INTERNAL_TABNAME = 'ITAB'
    I_INCLNAME = SY-REPID
    CHANGING
    CT_FIELDCAT = FCAT.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    this is for coloring cols
    REPORT ZBHCOLOR_COLS.
    TABLES:LFA1.
    SELECT-OPTIONS:C_LIFNR FOR LFA1-LIFNR. " FOR GRID ONLY
    PARAMETERS:LIST RADIOBUTTON GROUP ALV DEFAULT 'X',
    GRID RADIOBUTTON GROUP ALV.
    DATA:BEGIN OF ITAB OCCURS 0,
    LIFNR LIKE LFA1-LIFNR,
    NAME1 LIKE LFA1-NAME1,
    LAND1 LIKE LFA1-LAND1,
    ORT01 LIKE LFA1-ORT01,
    SORTL LIKE LFA1-SORTL,
    REGIO LIKE LFA1-REGIO,
    COL TYPE LVC_T_SCOL,
    END OF ITAB.
    DATA:COLR TYPE LVC_S_SCOL.
    SELECT * FROM LFA1 INTO CORRESPONDING FIELDS OF TABLE ITAB.
    LOOP AT ITAB.
    IF ITAB-LIFNR IN C_LIFNR.
    COLR-FNAME = 'NAME1'.
    COLR-COLOR-COL = '5'.
    COLR-COLOR-INT = '1'.
    COLR-COLOR-INV = '0'.
    COLR-NOKEYCOL = 'X'.
    APPEND COLR TO ITAB-COL.
    COLR-FNAME = 'LIFNR'.
    APPEND COLR TO ITAB-COL.
    MODIFY ITAB.
    ENDIF.
    ENDLOOP.
    TYPE-POOLS:SLIS.
    DATA:FCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA:LAYOUT TYPE SLIS_LAYOUT_ALV.
    LAYOUT-ZEBRA = 'X'.
    layout-coltab_fieldname = 'COL'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    I_PROGRAM_NAME = SY-REPID
    I_INTERNAL_TABNAME = 'ITAB'
    I_INCLNAME = SY-REPID
    CHANGING
    CT_FIELDCAT = FCAT.
    IF LIST = 'X'.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    ELSEIF GRID = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    IS_LAYOUT = LAYOUT
    IT_FIELDCAT = FCAT
    TABLES
    T_OUTTAB = ITAB.
    ENDIF.
    Reward points if useful.

  • How do colors work _&_ Open?

    I feel Frustrated by Pages, sadly!  :-(  Do you wonder, "By what?"
    I keep a Journal, which is a daily record of events in my life.  [I endured a Severe Closed Head Injury on 11 September 1993 _&_ my memory suffers, forever.  Keeping a Journal helps me.  :-) ]
    Again please, "I feel Frustrated by Pages."  Say I have the Colors array open.  When I Highlight a word then select a color to Change the color of that word, it as well-as Refuses to change.
    Here is a Second, un-related complaint.  When I _start_ Pages, I miss seeing the Open dialog box right-away.  So when I start Pages each-time, I need to hit the keystroke [Command] + O _each_ time.  This might not sound like much, but I notice the extra time it takes.
    P. S.  Old AppleWorks behaved Well in these _2_ ways of Color _&_ Open a File. So again I wonder Apple, "Why the Downgrade, hmmm?"  Thank you.

    In Pages ’09 v4.3 and Pages v5(.2), the text must remain selected to receive color changes from the color panel. Providing the preceding is true, I can make multiple color changes in the color panel, whether from saved swatches, or by slider interaction, and these changes apply immediately.
    If however, I have the text selected, and leave Pages v5(.2) pointer focus to do something in another application, when I return to the color panel and invoke a change, no color changes are applied, even though the text remains selected. You will have to quit the color panel, select the text again, and click on the color panel again, before color changes can be applied to the selected text. Arrgggh. Pages ’09 allows you to change colors upon return to pointer focus on the color panel.
    Both of the mentioned application versions on my OS X 10.9.4 machine, when launched from /Applications directly, the Dock, or LaunchPad — open to the file chooser. If you double-click an existing document icon, or request an application from the right-click, open with submenu, there will be no open dialog.
    There is no special Pages preference setting that controls this open behavior. It also makes no difference how the For New Documents preference is configured. The same open dialog behaviour occurs whether requesting the Template Chooser, or specifying a custom template via Use Template preference setting. And, it is indifferent to whether you open to iCloud, or On My Mac settings in the open dialog.

  • How to color specific row in a table....

    Hi all,
    I created a table out of an Array[]. The table is successfully filled up by array's elements. Each element is a row.
    I want to be able to color specific row; instead of every row. How do I do that?
    I was looking rendering to color a row or a string; but not successfull.
    Thank you for your time and assistence.

    My favorite way of doing this is to use CSS. You plan on giving the row you want colored an id attribute, then provide a style like this:
    <style type="text/css">
      tr#colorMe td {
        background-color:blue;
    </style>Then, when you want to color the row, you make the HTML output like this:
    <table ...>
      <tr> //normal row
        <td></td><td></td><td></td>
      </tr>
      <tr id="colorMe"> //colored row
        <td></td><td></td><td></td>
      </tr>
      <tr> //normal row
        <td></td><td></td><td></td>
      </tr>
    </table>

  • How to color a particular cell in ALV.

    hi,
       I have a requirement where i need to select a particular cell of a column in ALV and upon selection , i need to change the color of the selected cell. I choose the color from the dropdown toolbar created by me.
    plz help, thanks.

       REPORT  ZTEST_DHR.
    TYPE-POOLS : SLIS.
    TYPES: BEGIN OF TY_MARA,
            FLAG  TYPE CHAR1,
            MATNR TYPE MARA-MATNR,
            ERSDA TYPE MARA-ERSDA,
            ERNAM TYPE MARA-ERNAM,
            WESCH TYPE MARA-WESCH,
            STYLE TYPE LVC_T_STYL,
            CELLCOLR TYPE LVC_T_SCOL,
          END OF TY_MARA.
    DATA : IT_MARA TYPE STANDARD TABLE OF TY_MARA.
    DATA : IT_MARA1 TYPE STANDARD TABLE OF TY_MARA,
           WA_MARA TYPE TY_MARA,
           WA_MARA1 TYPE TY_MARA.
    * for reuse alv grid display
    *DATA : IT_FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV,
    *        WA_FIELDCATALOG TYPE SLIS_FIELDCAT_ALV,
    *        WA_LAYOUT       TYPE SLIS_LAYOUT_ALV,
    *        GV_REPID      TYPE SY-REPID.
    *for LVC Display
    DATA : WA_SETTINGS TYPE LVC_S_GLAY.
    DATA : WA_LAYOUT TYPE LVC_S_LAYO.
    DATA : IT_FIELDCATALOG TYPE LVC_T_FCAT,
            WA_FIELDCATALOG TYPE LVC_S_FCAT.
    DATA REF1 TYPE REF TO CL_GUI_ALV_GRID.
    DATA: LS_EDIT TYPE LVC_S_STYL,
          LT_EDIT TYPE LVC_T_STYL.
    DATA : LS_CELL_COLOR TYPE LVC_S_SCOL.
    DATA : LT_CELL_COLOR TYPE LVC_T_SCOL.
    START-OF-SELECTION.
      SELECT MATNR ERSDA ERNAM WESCH
        FROM MARA INTO CORRESPONDING FIELDS OF TABLE IT_MARA
      UP TO 10 ROWS.
    END-OF-SELECTION.
      PERFORM BUILD_FIELDCATALOG.
      PERFORM BUILD_LAYOUT.
      PERFORM DISPLAY_ALV_REPORT.
    *&      Form  BUILD_FIELDCATALOG
    *       text
    FORM BUILD_FIELDCATALOG .
      WA_FIELDCATALOG-FIELDNAME = 'FLAG'.
      WA_FIELDCATALOG-OUTPUTLEN =  6.
      WA_FIELDCATALOG-CHECKBOX  = 'X'.           "as checkbox
      WA_FIELDCATALOG-EDIT      = 'X'.
      WA_FIELDCATALOG-SELTEXT = 'Check box'.
      APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
      CLEAR  WA_FIELDCATALOG.
      WA_FIELDCATALOG-FIELDNAME = 'MATNR'.
      WA_FIELDCATALOG-OUTPUTLEN =  20.
      WA_FIELDCATALOG-SELTEXT = 'Mat no'.
    *  wa_fieldcatalog-input = 'X'.
      wa_fieldcatalog-edit = 'X'.
      APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
      CLEAR  WA_FIELDCATALOG.
      WA_FIELDCATALOG-FIELDNAME = 'ERSDA'.
      WA_FIELDCATALOG-OUTPUTLEN =  15.
      WA_FIELDCATALOG-SELTEXT = 'Creation Date'.
    *  wa_fieldcatalog-input = 'X'.
    *  wa_fieldcatalog-edit = 'X'.
      APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
      CLEAR  WA_FIELDCATALOG.
      WA_FIELDCATALOG-FIELDNAME = 'ERNAM'.
      WA_FIELDCATALOG-OUTPUTLEN =  20.
      WA_FIELDCATALOG-SELTEXT = 'Creation Time'.
    *  wa_fieldcatalog-input = 'X'.
    *  wa_fieldcatalog-edit = 'X'.
      APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
      CLEAR  WA_FIELDCATALOG.
      WA_FIELDCATALOG-FIELDNAME = 'WESCH'.
      WA_FIELDCATALOG-OUTPUTLEN =  20.
      WA_FIELDCATALOG-SELTEXT = 'Quantity'.
    *  wa_fieldcatalog-input = 'X'.
    *  wa_fieldcatalog-edit = 'X'.
      APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
      CLEAR  WA_FIELDCATALOG.
    ENDFORM.                    "build_fieldcatalog
    *&      Form  BUILD_LAYOUT
    *       text
    FORM BUILD_LAYOUT .
      CONSTANTS : LC_X TYPE CHAR1 VALUE 'X'.
    *  WA_LAYOUT-NO_INPUT          = LC_X.
      WA_LAYOUT-CWIDTH_OPT = LC_X.
      WA_LAYOUT-ZEBRA             = LC_X.
      WA_LAYOUT-STYLEFNAME = 'STYLE'.
      WA_LAYOUT-CTAB_FNAME = 'CELLCOLR'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
    *       text
    FORM DISPLAY_ALV_REPORT .
      LS_EDIT-FIELDNAME = 'FLAG'.
      LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
      INSERT LS_EDIT INTO TABLE LT_EDIT.
      INSERT LINES OF LT_EDIT INTO TABLE WA_MARA1-STYLE.
      LS_CELL_COLOR-FNAME = 'MATNR'.
      LS_CELL_COLOR-COLOR-COL = '7'.
      LS_CELL_COLOR-COLOR-INT = '1'.
      INSERT LS_CELL_COLOR into table LT_CELL_COLOR.
      INSERT LINES OF LT_CELL_COLOR into TABLE WA_MARA1-CELLCOLR.
      LOOP AT IT_MARA INTO WA_MARA.
        IF WA_MARA-ERSDA EQ '20080625'.
          MODIFY IT_MARA INDEX SY-TABIX FROM WA_MARA1 TRANSPORTING STYLE CELLCOLR.
        ENDIF.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
       EXPORTING
    *      I_INTERFACE_CHECK                 = ' '
    *      I_BYPASSING_BUFFER                =
    *      I_BUFFER_ACTIVE                   =
         I_CALLBACK_PROGRAM                = SY-REPID
         I_CALLBACK_PF_STATUS_SET          = 'F_SET_STATUS'
         I_CALLBACK_USER_COMMAND           = 'F_USER_COMMAND'
    *      I_CALLBACK_TOP_OF_PAGE            = ' '
    *      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *      I_CALLBACK_HTML_END_OF_LIST       = ' '
    *      I_STRUCTURE_NAME                  =
    *      I_BACKGROUND_ID                   = ' '
         I_GRID_TITLE                      = 'Example of select and deselect'
    *      I_GRID_SETTINGS                   =
          IS_LAYOUT_LVC                     = WA_LAYOUT
         IT_FIELDCAT_LVC                   = IT_FIELDCATALOG
        TABLES
          T_OUTTAB                          = IT_MARA
    *    EXCEPTIONS
    *      PROGRAM_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.
    *  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    *    EXPORTING
    *      I_CALLBACK_PROGRAM       = GV_REPID
    *      I_CALLBACK_PF_STATUS_SET = 'F_SET_STATUS'
    *      I_CALLBACK_USER_COMMAND  = 'F_USER_COMMAND'
    *      I_GRID_TITLE             = 'Example of select and deselect'
    *      I_GRID_SETTINGS          = WA_SETTINGS
    *      IS_LAYOUT                = WA_LAYOUT
    *      IT_FIELDCAT              = IT_FIELDCATALOG[]
    *    TABLES
    *      T_OUTTAB                 = IT_MARA.
    *  IF SY-SUBRC <> 0.
    *    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *  ENDIF.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  f_set_status
    *       text
    FORM F_SET_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'STATUS1'.
    ENDFORM.                    " f_set_status
    *&      Form  f_user_command
    *       text
    FORM F_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                            RS_SELFIELD TYPE SLIS_SELFIELD.
    * BREAK-POINT.
      CASE R_UCOMM.
        WHEN 'ASEL'.
          LOOP AT IT_MARA INTO WA_MARA.
            WA_MARA-FLAG = 'X'.
            MODIFY IT_MARA FROM WA_MARA.
          ENDLOOP.
          RS_SELFIELD-REFRESH = 'X'.
        WHEN 'DSEL'.
          LOOP AT IT_MARA INTO WA_MARA.
            WA_MARA-FLAG = ' '.
            MODIFY IT_MARA FROM WA_MARA.
          ENDLOOP.
          RS_SELFIELD-REFRESH = 'X'.
        WHEN 'DELETE'.
    *      BREAK-POINT.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            IMPORTING
              E_GRID = REF1.
          CALL METHOD REF1->CHECK_CHANGED_DATA.
          DELETE IT_MARA
                   WHERE FLAG = 'X'.
          RS_SELFIELD-REFRESH = 'X'.
        WHEN 'INSERT'.
          CLEAR WA_MARA.
          APPEND WA_MARA TO IT_MARA.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            IMPORTING
              E_GRID = REF1.
          CALL METHOD REF1->REFRESH_TABLE_DISPLAY.
        WHEN 'SAVEDB'.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            IMPORTING
              E_GRID = REF1.
          CALL METHOD REF1->CHECK_CHANGED_DATA.
    * CODE TO BE WRITTEN TO SAVE in DB just an insert statement
    *ENDLOOP.
      ENDCASE.
    ENDFORM.
       REPORT  ZTEST_DHR.
    TYPE-POOLS : SLIS.
    TYPES: BEGIN OF TY_MARA,
            FLAG  TYPE CHAR1,
            MATNR TYPE MARA-MATNR,
            ERSDA TYPE MARA-ERSDA,
            ERNAM TYPE MARA-ERNAM,
            WESCH TYPE MARA-WESCH,
            STYLE TYPE LVC_T_STYL,
            CELLCOLR TYPE LVC_T_SCOL,
          END OF TY_MARA.
    DATA : IT_MARA TYPE STANDARD TABLE OF TY_MARA.
    DATA : IT_MARA1 TYPE STANDARD TABLE OF TY_MARA,
           WA_MARA TYPE TY_MARA,
           WA_MARA1 TYPE TY_MARA.
    * for reuse alv grid display
    *DATA : IT_FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV,
    *        WA_FIELDCATALOG TYPE SLIS_FIELDCAT_ALV,
    *        WA_LAYOUT       TYPE SLIS_LAYOUT_ALV,
    *        GV_REPID      TYPE SY-REPID.
    *for LVC Display
    DATA : WA_SETTINGS TYPE LVC_S_GLAY.
    DATA : WA_LAYOUT TYPE LVC_S_LAYO.
    DATA : IT_FIELDCATALOG TYPE LVC_T_FCAT,
            WA_FIELDCATALOG TYPE LVC_S_FCAT.
    DATA REF1 TYPE REF TO CL_GUI_ALV_GRID.
    DATA: LS_EDIT TYPE LVC_S_STYL,
          LT_EDIT TYPE LVC_T_STYL.
    DATA : LS_CELL_COLOR TYPE LVC_S_SCOL.
    DATA : LT_CELL_COLOR TYPE LVC_T_SCOL.
    START-OF-SELECTION.
      SELECT MATNR ERSDA ERNAM WESCH
        FROM MARA INTO CORRESPONDING FIELDS OF TABLE IT_MARA
      UP TO 10 ROWS.
    END-OF-SELECTION.
      PERFORM BUILD_FIELDCATALOG.
      PERFORM BUILD_LAYOUT.
      PERFORM DISPLAY_ALV_REPORT.
    *&      Form  BUILD_FIELDCATALOG
    *       text
    FORM BUILD_FIELDCATALOG .
      WA_FIELDCATALOG-FIELDNAME = 'FLAG'.
      WA_FIELDCATALOG-OUTPUTLEN =  6.
      WA_FIELDCATALOG-CHECKBOX  = 'X'.           "as checkbox
      WA_FIELDCATALOG-EDIT      = 'X'.
      WA_FIELDCATALOG-SELTEXT = 'Check box'.
      APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
      CLEAR  WA_FIELDCATALOG.
      WA_FIELDCATALOG-FIELDNAME = 'MATNR'.
      WA_FIELDCATALOG-OUTPUTLEN =  20.
      WA_FIELDCATALOG-SELTEXT = 'Mat no'.
    *  wa_fieldcatalog-input = 'X'.
      wa_fieldcatalog-edit = 'X'.
      APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
      CLEAR  WA_FIELDCATALOG.
      WA_FIELDCATALOG-FIELDNAME = 'ERSDA'.
      WA_FIELDCATALOG-OUTPUTLEN =  15.
      WA_FIELDCATALOG-SELTEXT = 'Creation Date'.
    *  wa_fieldcatalog-input = 'X'.
    *  wa_fieldcatalog-edit = 'X'.
      APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
      CLEAR  WA_FIELDCATALOG.
      WA_FIELDCATALOG-FIELDNAME = 'ERNAM'.
      WA_FIELDCATALOG-OUTPUTLEN =  20.
      WA_FIELDCATALOG-SELTEXT = 'Creation Time'.
    *  wa_fieldcatalog-input = 'X'.
    *  wa_fieldcatalog-edit = 'X'.
      APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
      CLEAR  WA_FIELDCATALOG.
      WA_FIELDCATALOG-FIELDNAME = 'WESCH'.
      WA_FIELDCATALOG-OUTPUTLEN =  20.
      WA_FIELDCATALOG-SELTEXT = 'Quantity'.
    *  wa_fieldcatalog-input = 'X'.
    *  wa_fieldcatalog-edit = 'X'.
      APPEND WA_FIELDCATALOG TO IT_FIELDCATALOG.
      CLEAR  WA_FIELDCATALOG.
    ENDFORM.                    "build_fieldcatalog
    *&      Form  BUILD_LAYOUT
    *       text
    FORM BUILD_LAYOUT .
      CONSTANTS : LC_X TYPE CHAR1 VALUE 'X'.
    *  WA_LAYOUT-NO_INPUT          = LC_X.
      WA_LAYOUT-CWIDTH_OPT = LC_X.
      WA_LAYOUT-ZEBRA             = LC_X.
      WA_LAYOUT-STYLEFNAME = 'STYLE'.
      WA_LAYOUT-CTAB_FNAME = 'CELLCOLR'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
    *       text
    FORM DISPLAY_ALV_REPORT .
      LS_EDIT-FIELDNAME = 'FLAG'.
      LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
      INSERT LS_EDIT INTO TABLE LT_EDIT.
      INSERT LINES OF LT_EDIT INTO TABLE WA_MARA1-STYLE.
      LS_CELL_COLOR-FNAME = 'MATNR'.
      LS_CELL_COLOR-COLOR-COL = '7'.
      LS_CELL_COLOR-COLOR-INT = '1'.
      INSERT LS_CELL_COLOR into table LT_CELL_COLOR.
      INSERT LINES OF LT_CELL_COLOR into TABLE WA_MARA1-CELLCOLR.
      LOOP AT IT_MARA INTO WA_MARA.
        IF WA_MARA-ERSDA EQ '20080625'.
          MODIFY IT_MARA INDEX SY-TABIX FROM WA_MARA1 TRANSPORTING STYLE CELLCOLR.
        ENDIF.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
       EXPORTING
    *      I_INTERFACE_CHECK                 = ' '
    *      I_BYPASSING_BUFFER                =
    *      I_BUFFER_ACTIVE                   =
         I_CALLBACK_PROGRAM                = SY-REPID
         I_CALLBACK_PF_STATUS_SET          = 'F_SET_STATUS'
         I_CALLBACK_USER_COMMAND           = 'F_USER_COMMAND'
    *      I_CALLBACK_TOP_OF_PAGE            = ' '
    *      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *      I_CALLBACK_HTML_END_OF_LIST       = ' '
    *      I_STRUCTURE_NAME                  =
    *      I_BACKGROUND_ID                   = ' '
         I_GRID_TITLE                      = 'Example of select and deselect'
    *      I_GRID_SETTINGS                   =
          IS_LAYOUT_LVC                     = WA_LAYOUT
         IT_FIELDCAT_LVC                   = IT_FIELDCATALOG
        TABLES
          T_OUTTAB                          = IT_MARA
    *    EXCEPTIONS
    *      PROGRAM_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.
    *  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    *    EXPORTING
    *      I_CALLBACK_PROGRAM       = GV_REPID
    *      I_CALLBACK_PF_STATUS_SET = 'F_SET_STATUS'
    *      I_CALLBACK_USER_COMMAND  = 'F_USER_COMMAND'
    *      I_GRID_TITLE             = 'Example of select and deselect'
    *      I_GRID_SETTINGS          = WA_SETTINGS
    *      IS_LAYOUT                = WA_LAYOUT
    *      IT_FIELDCAT              = IT_FIELDCATALOG[]
    *    TABLES
    *      T_OUTTAB                 = IT_MARA.
    *  IF SY-SUBRC <> 0.
    *    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *  ENDIF.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  f_set_status
    *       text
    FORM F_SET_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'STATUS1'.
    ENDFORM.                    " f_set_status
    *&      Form  f_user_command
    *       text
    FORM F_USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
                            RS_SELFIELD TYPE SLIS_SELFIELD.
    * BREAK-POINT.
      CASE R_UCOMM.
        WHEN 'ASEL'.
          LOOP AT IT_MARA INTO WA_MARA.
            WA_MARA-FLAG = 'X'.
            MODIFY IT_MARA FROM WA_MARA.
          ENDLOOP.
          RS_SELFIELD-REFRESH = 'X'.
        WHEN 'DSEL'.
          LOOP AT IT_MARA INTO WA_MARA.
            WA_MARA-FLAG = ' '.
            MODIFY IT_MARA FROM WA_MARA.
          ENDLOOP.
          RS_SELFIELD-REFRESH = 'X'.
        WHEN 'DELETE'.
    *      BREAK-POINT.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            IMPORTING
              E_GRID = REF1.
          CALL METHOD REF1->CHECK_CHANGED_DATA.
          DELETE IT_MARA
                   WHERE FLAG = 'X'.
          RS_SELFIELD-REFRESH = 'X'.
        WHEN 'INSERT'.
          CLEAR WA_MARA.
          APPEND WA_MARA TO IT_MARA.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            IMPORTING
              E_GRID = REF1.
          CALL METHOD REF1->REFRESH_TABLE_DISPLAY.
        WHEN 'SAVEDB'.
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            IMPORTING
              E_GRID = REF1.
          CALL METHOD REF1->CHECK_CHANGED_DATA.
    * CODE TO BE WRITTEN TO SAVE in DB just an insert statement
    *ENDLOOP.
      ENDCASE.
    ENDFORM.
    About Selecting a Color From Dropdown?  even i need to check for now this is the how u do cell color in alv

Maybe you are looking for

  • Is there a way to recover iCal data from computer or iPhone backup through iTunes?

    I  synched my iPad  with my computer and my ALL of my iCal information disappeared from my computer. I tried put my calendar information back on my computer from my iPhone, but instead the reverse happened, and all of my calendar information disappea

  • Please help me figure out a certain function in iTunes.

    I'm a new Mac user so in Windows, I am used to holding down ctrl and then clicking a whole bunch of files and then moving them as one whole unit to a new location. How can I do this on a Mac? Transferring songs from iTunes to my iPod is a bit of a ch

  • From an Oracle form, I want to read a text file.

    From an Oracle form, I want to read a text file. In the form on a button press I have: declare in_file Text_IO.File_Type; linebuf VARCHAR2(1800); filename VARCHAR2(30); BEGIN filename:=GET_FILE_NAME('U:\ora_devl\pps\work\a.txt', File_Filter=>'Text Fi

  • How can I change the email my itunes Gift Card was sent to?

    I'm very frustrated. I called your support, the gentleman that helped me talked so fast I couldn't understand him. I asked him to repeat it he said it the same speed, couldn't understand him. Anyways, he went on to tell me that anything to do with iT

  • Imovie playback

    I have created an imovie with still photos and have my Mac mini connected to a TV and would really like to loop the movie. Does anyone know anyway to have a movie continuously play over and over again?