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

Dynamic table with field type table

Hi,

I´m using "cl_alv_table_create=>create_dynamic_table" to create a dynamic table for ALV Grid.

But...I need to use colors in ALV, then I need to declare a field type LVC_S_SCOL in dynamic table from "cl_alv_table_create=>create_dynamic_table".

How can I declare this in fieldcat?

The code:

  • Creating dynamic table

DATA: table_agrup TYPE REF TO data,

line_agrup TYPE REF TO data.

CALL METHOD cl_alv_table_create=>create_dynamic_table

EXPORTING

it_fieldcatalog = t_fieldcat

IMPORTING

ep_table = table_agrup

EXCEPTIONS

generate_subpool_dir_full = 1

OTHERS = 2.

ASSIGN table_agrup->* TO .

........

  • Printing ALV

CALL METHOD obj_grid->set_table_for_first_display

EXPORTING

is_variant = w_variant

i_save = 'A'

is_layout = w_layout

CHANGING

it_outtab =

it_fieldcatalog = t_fieldcat

it_sort = t_sort

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

Thanks.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 29, 2007 at 07:07 PM

    As far as I know, thse are the things you will need to do:

    1. In your structure w_layout, there should be field called INFO_FIELDNAME which should be set to 'COLOR'.

    2. In the the final output internal table that you are outputting using the field catalog add an additional field called COLOR defined as char 3.

    3. Set the value of and this color parameter to be 'C20' ex: t_final-color = 'C20'.

    Note: C20 is only an example color, you may want to change the number based on what color you want.

    Try this, it worked for me for multiple list ALV.. it should work for the grid too..

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 29, 2007 at 07:07 PM

    As far as I know, thse are the things you will need to do:

    1. In your structure w_layout, there should be field called INFO_FIELDNAME which should be set to 'COLOR'.

    2. In the the final output internal table that you are outputting using the field catalog add an additional field called COLOR defined as char 3.

    3. Set the value of and this color parameter to be 'C20' ex: t_final-color = 'C20'.

    Note: C20 is only an example color, you may want to change the number based on what color you want.

    Try this, it worked for me for multiple list ALV.. it should work for the grid too..

    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.