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

ALV - Fields has to be expanded

Former Member
0 Likes
1,911

Hi Experts ,

I have an ALV list with 15 fields.

There are some fields compressed when the output is displayed.

For ex ( Vendor only 6 characters are displayed .When I double click on the vendor column it gets expanded).

I want to display all the fields with full length by default ....

Is it possible?

Please suggest in this regard.

Thanks in advance.

BR,

Jaga.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,585

HI,

In the Layout pass blank to cwidth_opt field. and in fieldcalalog set value for the OUTPUTLEN field.

7 REPLIES 7
Read only

Former Member
0 Likes
1,586

HI,

In the Layout pass blank to cwidth_opt field. and in fieldcalalog set value for the OUTPUTLEN field.

Read only

0 Likes
1,585

Hi ,

After giving the output length I can view the fields.

Thanks for your valuable comments but when I go for print preview again the fields are compresssed.

Please help in this regard.

Thanks,

Jaga

Read only

Former Member
0 Likes
1,585

Hi,

Make use of the below code :


gs_fieldcat-outputlen = ' ' "Length of the field.

Thanks,

Sriram POnna.

Read only

Former Member
0 Likes
1,585

When i go for print preview the field compression is still there.

Read only

Former Member
0 Likes
1,585

Hi jagadish,

You can set the output length in the fieldcat for that field.

for ex:

wa_fieldcat-outputlen = 200.

this will make your field upto 200 characters long

Read only

Former Member
0 Likes
1,585

Hi Jagdish,

This may be a restriction ALV Grid puts. My recommendation will be that, split some fields and generate more than one rows with the same key (you should then add a new key field which will hold line numbers specific to one definite key). When you sort with ALV Grid's sort option the keys will vertically merged (if you do not turn off this feature via layout or field catalog settings). I know this is not so pretty but ALV is not intended to show that kind of stuff.

Regards

Flavya

www.sdn.sap.com:443/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2b...; BC [/url]

Read only

Former Member
0 Likes
1,585

example:

counter = counter + 1.

wa_fieldcat-col_pos = counter.

wa_fieldcat-fieldname = 'LIFNR'.

wa_fieldcat-tabname = 'I_DATA'.

wa_fieldcat-seltext_l = 'Vendor'.

wa_fieldcat-outputlen = 10.

wa_fieldcat-no_zero = 'X'.

APPEND wa_fieldcat TO it_fieldcat.

CLEAR wa_fieldcat.