Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

field catalog for factory method

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

Hello Amit

Have a look at my sample report <b>ZUS_SDN_CL_SALV_TABLE_INTERACT</b> in thread

The method you are looking for is (CL_SALV_COLUMN) <b>SET_TECHNICAL</b>.

Regards

Uwe

7 REPLIES 7

uwe_schieferstein
Active Contributor
0 Kudos

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

0 Kudos

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

uwe_schieferstein
Active Contributor
0 Kudos

Hello Amit

Have a look at my sample report <b>ZUS_SDN_CL_SALV_TABLE_INTERACT</b> in thread

The method you are looking for is (CL_SALV_COLUMN) <b>SET_TECHNICAL</b>.

Regards

Uwe

0 Kudos

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

0 Kudos

hi,

Message was edited by:

Amit Sawant

0 Kudos

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

0 Kudos

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