Skip to Content
author's profile photo Former Member
Former Member

How to change the Field color in Table Control

Hi,

I have to change the particular field color based on some condition. I tried with following code. How to go about ?

Loop at Screen.

if screen-name = 'F1'.

screen-color = 123.

modify screen.

endif.

Endloop.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Posted on Sep 08, 2004 at 07:24 AM

    Hi Giri,

    Did u try with these screen fields

    INTENSIFIED(affects the background color)

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 08, 2004 at 09:53 AM

    Hi Giri

    As far as I know, it is not possible to set color attributes for fields. You may mark it as to be "Bright" at the Screen Painter which makes the text in the field displayed in blue. But I think this is not what you want.

    *--Serdar

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 08, 2004 at 02:58 PM

    You might want to create a subscreen in your dynpro where you want it colored. Then in the PBO of that subscreen, do a LEAVE TO LIST-PROCESSING command. Then you can use FORMAT COLOR command to display stuff in color.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 09, 2004 at 06:33 AM

    See BC410 example:

    type-pools:

    cxtab.

    controls:

    tab_control TYPE TABLEVIEW USING SCREEN <screen>.

    data:

    wa type CXTAB_COLUMN.

    PBO

    module change_table.

    module change_table.

    loop at tab_control-cols into wa.

    if wa-index between 1 and 3.

    wa-screen-intensified = 1.

    else.

    wa-screen-intensified = 0.

    endif.

    endloop.

    endmodule.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 10, 2004 at 07:31 AM

    Hi Giri,

    Sorry but it is not possible to change the color in a

    table control.

    If You want to do that, you have to use the cl_gui_alv_grid class or the FM: REUSE_ALV_GRID_DISPLAY.

    BR

    Michael

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hai,

      In Screen attributes sap has provided the option in the SCREEN structure there is a field called COLOR. I would like to know how to make use of this field in our module pool program.

      Giri

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.