04-14-2016 2:15 PM
Hi everyone,
I have one report which is written by SALV Factory Method, and main table is created dynamic.
I need to color one specific row , I couldnt still achieve this.
I tried to add field one field which has type of 'lvc_s_scol' but I couldnt see it in my dynamic internal table,
thats way I couldnt fill the values for lvc_s_scol field.
Is there any solution to color a specific row in dynamic internal table which report was written by salv factory method?
,
any help will be apprecited ,
thank you
best regards.
04-14-2016 3:24 PM
You wrote:
How to Color Specific Row
(...)
I tried to add field one field which has type of 'lvc_s_scol' but I couldnt see it in my dynamic internal table,
Which tool did you use to create the itab, which error did you get when adding an element with either type LVC_T_SCOL for cell colot or a single CHAR length 4 field for row color (and not a LVC_S_SCOL?)
Ref: Look for Coloring Rows and/or Coloring Cells in online help.
Regards,
Raymond
04-14-2016 3:24 PM
You wrote:
How to Color Specific Row
(...)
I tried to add field one field which has type of 'lvc_s_scol' but I couldnt see it in my dynamic internal table,
Which tool did you use to create the itab, which error did you get when adding an element with either type LVC_T_SCOL for cell colot or a single CHAR length 4 field for row color (and not a LVC_S_SCOL?)
Ref: Look for Coloring Rows and/or Coloring Cells in online help.
Regards,
Raymond
04-14-2016 3:36 PM
Hi,
I used the method of create_dynamic_table as u see in the below,
I didnt get any error, when I added the field 'lvc_t_scol' in my internal table,
after creating dynamic itab ,the field doesnt seem on my dynamic table.
Does dynamic table support the field which type is table type(lvc_s_scol)?
thanks
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = gt_lvcfcat
IMPORTING
ep_table = gt_newtable.
ASSIGN gt_newtable->* TO <gt_newtable> .
04-14-2016 3:56 PM
You should use RTTS instead of the method cl_alv_table_create=>create_dynamic_table. Refer to Dynamic Internal Table with Deep structure - ABAP Help Blog for creating deep dynamic table using RTTS.
For color:
ls_s_color-color-col = col_positive.
ls_s_color-color-int = 0.
ls_s_color-color-inv = 0.
APPEND ls_s_color TO lt_s_color.
CLEAR ls_s_color.
* Modify that data back to the output table
la_vbak-t_color = lt_s_color.
* COLUMNS tab reference for the specific colors
TRY.
lo_cols_tab->set_color_column( 'T_COLOR' ).
CATCH cx_salv_data_error. "#EC NO_HANDLER
ENDTRY.
Refer to http://zevolving.com/2008/10/salv-table-9-apply-colors/ for applying the color at row level on SALV.
Regards,
Naimesh Patel
04-14-2016 4:00 PM
Try to add a break-point at statement "generate subroutine pool" of include "LSKBHF06", look at generated values in lt_source.
Regards,
Raymond