Application Development and Automation 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: 
Read only

field name problem in oops

Former Member
0 Likes
818

hi friends,

i am working on a lav list display program and im using the class cl_salv_table to display my itab

now i have given specific field heading to certain fields

DATA: lr_columns TYPE REF TO cl_salv_columns,

lo_columns TYPE REF TO cl_salv_columns_table,

lo_column TYPE REF TO cl_salv_column.

lr_columns = alv->get_columns( ).

lo_columns = alv->get_columns( ).

lo_column = lo_columns->get_column( 'SETS' ).

lo_column->set_technical( '' ).

lo_column->set_medium_text( 'sets shipped' ).

my problem is for column SETS i cant give short text since 'sets shipped' doesnt fit in,also if i use medium text that is not reflected in the output until i stretch the column.

wat do to 2 get the heading without strecthing the column

1 ACCEPTED SOLUTION
Read only

abhijitzope
Active Participant
0 Likes
729

Hi Amit,

Just add the following line in your code.

lr_columns->set_optimize( if_salv_c_bool_sap=>true ).

hope it will help you.

regards,

ABHIJIT ZOPE

5 REPLIES 5
Read only

abhijitzope
Active Participant
0 Likes
730

Hi Amit,

Just add the following line in your code.

lr_columns->set_optimize( if_salv_c_bool_sap=>true ).

hope it will help you.

regards,

ABHIJIT ZOPE

Read only

0 Likes
729

i have done that already,

any other thing which i can do to get the desired output

Read only

0 Likes
729

Hi Amit,

ok means you want the default size of column..then remove this line from you code...

regards,

ABHIJIT ZOPE

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
729

Not exactly sure what you are reaching for here, but you can set the column width to what ever you want.

DATA: lr_columns TYPE REF TO cl_salv_columns,
lo_columns TYPE REF TO cl_salv_columns_table,
lo_column TYPE REF TO cl_salv_column.

lr_columns = alv->get_columns( ). 
lo_columns = alv->get_columns( ).
lo_column = lo_columns->get_column( 'SETS' ).
lo_column->set_technical( '' ).
lo_column->set_short_text( 'Sets Shp').
lo_column->set_medium_text( 'Sets Shipped' ).
lo_column->set_long_text( 'Sets Shipped' ).
lo_column->set_output_length( '15' ).

Regards,

Rich Heilman

Read only

0 Likes
729

hello sir,

i will tell u wat exactly my problem is, in my internal i have field called

sets type mseg menge

now i have use lo_column->set_medium_text( 'Sets Shipped' ).

i cant use short text bcoz Sets Shipped doesnt fit in.

but wen i run the report the heading for my column is "Quanity" ( which is for mseg-menge),only wen i increase the width of the column i can see Sets Shipped.

i also tried lo_column->set_output_length( '15' ) but even after doing the heading remains "Quantity".

i have also used lo_column->set_technical( '' ).