2008 Aug 22 2:32 AM
Who can help with this report.I want to color the rows.I just can not make it.
REPORT ZCOLORTEST.
data: grid type ref to cl_gui_alv_grid,
container type ref to cl_gui_custom_container,
gs_layout type lvc_s_layo,
gt_fcat type lvc_t_fcat,
ok_code type sy-ucomm.
data:begin of tab_sflight occurs 0.
include structure sflight.
data:linecolor(4) type c.
data:end of tab_sflight.
call screen 100.
module status_0100 output.
select * from sflight into corresponding fields of table tab_sflight.
perform fillcolor.
set pf-status 'STATUS1'.
if container is initial.
create object container
exporting
container_name = 'CONTAINER'.
create object grid
exporting
i_parent = container.
perform prepare_field_catalog changing gt_fcat.
gs_layout-info_fname = 'linecolor'.
call method grid->set_table_for_first_display
exporting
is_layout = gs_layout
changing
it_outtab = tab_sflight[]
it_fieldcatalog = gt_fcat.
endif.
endmodule.
module user_command_0100 input.
case sy-ucomm.
when 'EXIT'.
leave program.
endcase.
endmodule.
form fillcolor.
loop at tab_sflight.
tab_sflight-linecolor = 'C300'.
modify tab_sflight.
endloop.
endform.
form prepare_field_catalog changing pt_fieldcat type lvc_t_fcat.
data ls_fcat type lvc_s_fcat.
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'SFLIGHT'
changing
ct_fieldcat = pt_fieldcat[].
ls_fcat-fieldname = 'linecolor'.
append ls_fcat to pt_fieldcat.
endform.
Edited by: Alex Zhang on Aug 22, 2008 3:52 AM
2008 Aug 22 2:58 AM
Who can help with this report.I want to color the rows.I just can not make it.
REPORT ZCOLORTEST.
data: grid type ref to cl_gui_alv_grid,
container type ref to cl_gui_custom_container,
gs_layout type lvc_s_layo,
gt_fcat type lvc_t_fcat,
ok_code type sy-ucomm.
data:begin of tab_sflight occurs 0.
include structure sflight.
data:linecolor(4) type c.
data:end of tab_sflight.
call screen 100.
module status_0100 output.
select * from sflight into corresponding fields of table tab_sflight.
perform fillcolor.
set pf-status 'STATUS1'.
if container is initial.
create object container
exporting
container_name = 'CONTAINER'.
create object grid
exporting
i_parent = container.
perform prepare_field_catalog changing gt_fcat.
gs_layout-info_fname = 'linecolor'.
call method grid->set_table_for_first_display
exporting
is_layout = gs_layout
changing
it_outtab = tab_sflight[]
it_fieldcatalog = gt_fcat.
endif.
endmodule.
module user_command_0100 input.
case sy-ucomm.
when 'EXIT'.
leave program.
endcase.
endmodule.
form fillcolor.
loop at tab_sflight.
tab_sflight-linecolor = 'C300'.
modify tab_sflight.
endloop.
endform.
form prepare_field_catalog changing pt_fieldcat type lvc_t_fcat.
data ls_fcat type lvc_s_fcat.
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'SFLIGHT'
changing
ct_fieldcat = pt_fieldcat[].
ls_fcat-fieldname = 'linecolor'.
append ls_fcat to pt_fieldcat.
endform.
Edited by: Alex Zhang on Aug 22, 2008 3:52 AM
2008 Aug 22 2:58 AM
2008 Aug 22 4:31 AM
"Make this line change , it shoulbe in caps.
gs_layout-info_fname = 'LINECOLOR'.
form prepare_field_catalog changing pt_fieldcat type lvc_t_fcat.
data ls_fcat type lvc_s_fcat.
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'SFLIGHT'
changing
ct_fieldcat = pt_fieldcat[].
"this is not required you can delete this code
*ls_fcat-fieldname = 'linecolor'.
*append ls_fcat to pt_fieldcat.
endform.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |