10-23-2007 7:17 AM
hi friends,
i am using factory method to display my alv. now some of the fields in my internal table i have declared them as char fields, i want certain type of headings for these fields,so where can i give heading to these fields.
where exactly do we create a field catalog for factory method.
pls advice me on this
10-24-2007 12:44 PM
10-23-2007 11:00 AM
Hello Amit
I think very few people (me included) understand what you mean by <i>"...factory method to display ALV...".</i>
However, if you are using class CL_GUI_ALV_GRID then you have to call method GET_FRONTEND_FIELDCATALOG, modify the required columns ( e.g. ls_fcat-coltext), and afterwards call SET_FRONTEND_FIELDCATALOG.
If you are already using the new object model (CL_SALV_TABLE) then call method GET_COLUMNS and loop over the required column (CL_SALV_COLUMN) and modify them accordingly.
Regards
Uwe
10-24-2007 12:39 PM
im using the class CL_SALV_TABLE to display my alv,
which method this class i can use to change the field headings in field catalog.
also wen i use this class ( i use method factory of this class to display my alv) all the field are coming, i want to hide certain fields,how to do this
10-24-2007 12:44 PM
10-24-2007 12:59 PM
thank you sir,
i have got a clue of wat i need to do,thanks for ur help,i wil get back 2u if im goin wrong anywhere
10-24-2007 3:13 PM
10-24-2007 3:25 PM
You need to do something like this for each field that you want to change. Get the COLUMN object and call the methods to set the labels at short medium and long.
data: lr_columns type ref to cl_salv_columns_table,
lr_column type ref to cl_salv_column_table.
lr_columns = gr_table->get_columns( ).
try.
lr_column ?= lr_columns->get_column( 'YOUR_FIELD_NAME' ).
lr_column->set_short_text( 'Your Field').
lr_column->set_medium_text( 'Your Field Name').
lr_column->set_long_text( 'Your Long Field Name').
catch cx_salv_not_found.
endtry.
Regards,
Rich Heilman
12-13-2007 6:01 AM
hi friends;
my requirement i want to dispay the output fields depending upon the input in selection screen.now i displayed
using field catalog to generate 8 fields at a time in output screen.
ex. if 4 fields having value that to be dispalyed along with 8 fields. remaining 4 fields(not having value)also displayed.the fields remains empty to be displayed.
****
i need to display only fields having values... remaining fields no need to be displayed....
any ideas give me...
regards
k.s.kannan