Skip to Content

Abap Objects .

i'm building a new class and i got an srious problem .

here's the code :

CLASS lcl_alv_control DEFINITION .

PUBLIC SECTION.

*Structure to transfer to the Alv Grid

TYPES : BEGIN OF scrdisp ,

ts_icons(30) TYPE c,

dp_icons(30) TYPE c,

symbols(30) TYPE c,

info(4) TYPE c,

colinfo TYPE lvc_t_scol ,

cellstyles TYPE lvc_t_styl ,

  • checkbox,

  • lights,

links TYPE i ,

END OF scrdisp.

DATA:

gtab_scrdisp TYPE TABLE OF scrdisp INITIAL SIZE 0 ,

gstr_scrdisp LIKE LINE OF gtab_scrdisp,

*Field Catalog for the ALV Grid

gt_fieldcat_lvc TYPE TABLE OF lvc_t_fcat INITIAL SIZE 0 ,

gs_fieldcat_lvc LIKE LINE OF gt_fieldcat_lvc ,

*Color Table for handle all the cells colors .

gt_color TYPE TABLE OF lvc_t_scol INITIAL SIZE 0 ,

gs_color LIKE LINE OF gt_color .

*Another Global Data

METHODS:

set_ctl_name ,

build_layout ,

build_fieldcat ,

set_hendlers ,

exclude_toolbar_buttons ,

display ,

build_data ,

on_double_click ,

handle_user_command ,

handle_toolbar_set .

ENDCLASS.

CLASS lcl_alv_control implementation.

method build_layout.

gs_color-fname = 'whatever'. <--- the problematic line

endmethod.

endclass.

in the implementation section when i use the gs_color structure i got error that tells me : "GS_COLOR" is a table without a header line and therefore has no component called "FNAME".

could someone can help with this ??

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2004 at 03:42 PM

    Hi Herzel,

    You have defined gt_color as a table of lvc_t_scol. However, type lvc_t_scol is already a table. As a consequence the definition of gs_color is also a table.

    Suggested correction:

    gt_color TYPE lvc_t_scol,

    gs_color TYPE lvc_s_scol.

    Regards,

    John.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 23, 2004 at 04:24 PM

    gt_color is table type of lvc_t_scol

    and gs_color is like line of gt_color

    so why should be a problem with it ???

    Message was edited by: Herzel Elmalme

    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.