on 10-13-2014 9:50 AM
Hi Dear All,
When I go through this tutorial to get the knowledge of ALV, I encounter some issues. Could any one give me some hints. Thank you so much.
I do not find ' Method Call' in Wizard in the method WDDOINIT. As the screen shot below, in my code wizard I can not find it.
So I write the codes as in the tutorial, like
DATA: lv_columns TYPE salv_wd_t_column_ref.
DATA: wa_cols TYPE salv_wd_s_column_ref.
CALL METHOD lv_value->if_salv_wd_column_settings~get_columns
RECEIVING
value = lv_columns.
But when I tried to change the color of the column it informs me the error message 'Type "CL_WD_TABLE_COLMUN" is unknown'
LOOP AT lv_columns INTO wa_cols.
CASE wa_cols-id.
WHEN 'MATNR'.
CALL METHOD wa_cols-r_column->set_cell_design
EXPORTING
value = cl_wd_table_colmun=>e_cell_design-one.
ENDCASE.
ENDLOOP.
Regards
Jay
Hi Jay,
There is spelling mistake, So the error
CALL METHOD wa_cols-r_column->set_cell_design
EXPORTING
value = cl_wd_table_colmun=>e_cell_design-one.
Modify as below
CALL METHOD wa_cols-r_column->set_cell_design
EXPORTING
value = cl_wd_table_column=>e_cell_design-one.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rama,
Thank you for your help. You are right, it is a spelling mistake. May I ask you one more question. I set the itab to have three fields to be displayed. Also in the context of componentcontroler, I just put three fields, but when I test it, it has all the fileds of MARA. I'm not sure anything I missed?
Regards
Jay
Hi Jay,
As you are used MARA structure for context node creation, alv component picks up all its fields as columns.
I suggest you the below points
Option1:
Now, alv should have only the attributes which you have added in the context node.
Option 2:
You can hide other columns by using code while alv configuration
Sample:
LOOP AT lv_columns INTO wa_cols.
CASE wa_cols-id.
WHEN 'MATNR'.
CALL METHOD wa_cols-r_column->set_cell_design
EXPORTING
value = cl_wd_table_colmun=>e_cell_design-one.
WHEN 'MTART' OR 'MATKL'.
WHEN others.
wa_cols-r_column->set_visible( value = CL_WD_UIELEMENT=>E_VISIBLE-NONE ).
ENDCASE.
ENDLOOP.
The above code hides which are not required.
Hope this helps you.
Regards,
Rama
Hi,
Which Netweaver version you are on?
use the type of column as cl_salv_wd_column
data lr_column type ref to cl_salv_wd_column.
LOOP AT lv_columns INTO wa_cols.
lr_column = wa_cols-r_column. " Convert ref to cl_salv_wd_column
CASE wa_cols-id.
WHEN 'MATNR'.
CALL METHOD lr_column->set_cell_design
EXPORTING
value = cl_wd_table_column=>e_cell_design-one.
ENDCASE.
ENDLOOP.
hope this helps,
Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.