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

ALV: Color cells in subtotals. Is it possible?

Hi,

I have an ALV-report which initially shows subtotals only. The users want to see specific colors in specific cells of the subtotals if possible.

Is it?

Regards

Thomas

Add a comment
10|10000 characters needed characters exceeded

Related questions

8 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 17, 2005 at 12:38 PM

    Hi Thomas,

    1 You are right.

    It seems it is not possible

    to

    colour the line of SUBTOTAL

    (Not the normal data lines)

    thru the conventional facility

    provided by ALV Functions.

    2. Using raw home logic,

    one can color it as mentioned in the last answer.

    but not thru the functionality provided by SAP for

    alv purpose.

    This answer may not help your answer,

    but probably it will clarify our doubts

    and probably the DIFFERENT answers

    which many have replied.

    Regards,

    Amit Mittal.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Thanks all. It didn't solve my problem, but I can't spend any more time on this. The users have to accept the facts.

      You all get 2 pts for quick respons.

      If newcomers by any way have a solution, please feel free to post it anytime!

      /Thomas

  • Posted on Nov 17, 2005 at 12:19 PM

    Hi coloring the cells..

    delcare a field in ur internal table.

    cellcolor type lvc_t_scol.

    data: ls_cellcolor type lvc_s_scol.

    and then for that

    while populating the totals

    ls_cellcolor-fname = 'TOTAL' .

    ls_cellcolor-color-col = '7' .

    ls_cellcolor-color-int = '1'

    APPEND ls_cellcolor TO IT_FINAL-cellcolor

    u can get different color for that cell.

    regards

    vijay

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 17, 2005 at 12:20 PM

    Hi Thomas,

    Please check the Demo program ERGP2120.

    It has this feature.

    Step1: define you internal table like below

    DATA: BEGIN OF mylist OCCURS 20, " Internal table for preparing

    zuordnung(8) TYPE c,

    belegnr(10) TYPE c,

    ba(2) TYPE c,

    bldatum TYPE d,

    bs(2) TYPE c,

    s(4) TYPE c VALUE ' ',

    wrg(4) TYPE c,

    betrag TYPE p DECIMALS 2,

    colinfo TYPE slis_t_specialcol_alv,

    END OF mylist.

    Step2:

    LOOP AT lt_mylist.

    REFRESH gt_color.

    CLEAR gt_color.

    IF lt_mylist-betrag > 500000.

    CLEAR gt_color.

    gt_color-fieldname = 'BETRAG'.

    gt_color-color-col = cl_gui_resources=>list_col_positive.

    gt_color-color-int = 0.

    APPEND gt_color.

    ELSEIF lt_mylist-betrag < 100000.

    CLEAR gt_color.

    gt_color-fieldname = 'BETRAG'.

    gt_color-color-col = cl_gui_resources=>list_col_negative.

    gt_color-color-int = 0.

    APPEND gt_color.

    ENDIF.

    lt_mylist-colinfo[] = gt_color[].

    MODIFY lt_mylist.

    ENDLOOP.

    Thanks,

    Ramakrishna

    Message was edited by: Ramakrishna Prasad

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 17, 2005 at 12:25 PM

    Thomas,

    While building the Field Catalog, For the Subtotal field, have a stmt

    waFieldcatalog-fieldname = 'SUBTOTAL'

    <b>waFieldCatalog-emphasize = 'X'.</b>

    append waFieldCatalog to ifieldCatalog

    Thanks

    Kam

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 17, 2005 at 12:26 PM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 17, 2005 at 12:27 PM

    Hi,

    Follow this link...

    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid.htm

    I hope it will work you.

    Thanks.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 17, 2005 at 12:29 PM

    Hi,

    Check this link.

    http://www.geocities.com/mpioud/Abap_programs.html

    http://www.geocities.com/mpioud/Z_ALV_LINE_COLOR.html

    It is about colouring a cell and colouring a line.If so,kindly reward points by clicking the star on the left of reply.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 17, 2005 at 12:33 PM

    hi If it is normal alv u can do it in different ways.

    in end-of-list event

    read the report and modify the line where ever subtotals

    appear.

    i will give a simple code have a look

    *-End of list

    X_EVENTS_DATA-NAME = 'END_OF_LIST'.

    X_EVENTS_DATA-FORM = 'LIST_MODIFY_OUPUT'.

    APPEND X_EVENTS_DATA TO IT_EVENTS_DATA.

    in the form

    READ LINE SY-INDEX INDEX SY-LSIND.

    IF SY-SUBRC = 0.

    MODIFY LINE SY-INDEX INDEX SY-LSIND

    FIELD FORMAT IT_DISPLAY-TOTAL COLOR 4 INVERSE.

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

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.