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: 

Output length in ALV

Former Member
0 Kudos

Hi,

I currently have an ALV with 37 fields.

The user has requested that 2 of the fields have a limited output length.

For example, vendor is usually Char 10, output 10.

I want it to remain char 10 (the field itself holding the full 10 chars) but the output length should be 6.

Is this done by creating a custom domain with an output length of 6 and char 10 or can this be done by using the alv field catalog and how?

Thanks,

John

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

All you need to do is set the OUTPUTLEN field in the fieldcatalog,

....
xfc-outputlen = '6'.
append xfc to ifc.

Regards,

Rich Heilman

4 REPLIES 4

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

All you need to do is set the OUTPUTLEN field in the fieldcatalog,

....
xfc-outputlen = '6'.
append xfc to ifc.

Regards,

Rich Heilman

0 Kudos

Hi,

Thanks. However, how do i get say the last 7 digits to come out? The 2 fields, vendor and material, show many zeros, which they don't want to see. However, i can't delete this zero's, since many calculation in the program depend on the whole value. So instead, they only want to see 6 of vendor and 7 of matnr. But right now, its showing the 1st 6 zeros.

0 Kudos

Actually forget it. There is a field in the field catalog called 'no_zero.'

If marked with 'x', no leading zero's are displayed for the associated field.

former_member194669
Active Contributor
0 Kudos

Hi,

Use field catalog-COL_OPT = 'X'.