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 grid

Former Member
0 Likes
1,317

hi,

req : remove the prfix 'zeros' eg: 00000223344 in the alv grid display.

Thanks,

Vind

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,104

before displaying it into alv....

use '

shift text left deleting leading ' 0'.

reward if useful.

5 REPLIES 5
Read only

Former Member
0 Likes
1,104

Hi

in the field catalog set no_zero = 'X'.

reward points to all helpful answers

kiran.M

Read only

Former Member
0 Likes
1,105

before displaying it into alv....

use '

shift text left deleting leading ' 0'.

reward if useful.

Read only

Former Member
0 Likes
1,104

Hi

You will have to use a conv exit

<b>

CONVERSION_EXIT_ALPHA_OUTPUT</b>

<b>Using the Conversion Exit</b>

Purpose

You use a conversion exit to define a jump to a conversion routine for a column of your output table. As the exit you specify the <conv> part of a function module called CONVERSION_EXIT_<conv>_OUTPUT. For example, you can use conversion exit ALPHA (see function module CONVERSION_EXIT_ALPHA_OUTPUT) to suppress leading zeros of account numbers.

The conversion exit is implemented through WRITE addition USING EDIT MASK.

Prerequisites

So that the ALV Grid Control can perform the conversion, it must know the internal and the external length of the field, which is the same as the length before and the length after the conversion.

The following example that uses editing template EDIT MASK for the WRITE command shows you how these lengths are specified:

DATA TIME TYPE T VALUE '154633'. WRITE (8) TIME USING EDIT MASK '__:__:__'. "Output: 15:46:33

In this example, the internal length (of type T) is six characters, while the output length is eight.

The column width (which can be set using the current layout) does not depend on these values and needs not be adjusted accordingly.

Process Flow

1. Declare the internal and the external length of the field to the ALV Grid Control.

• For fields with DDIC reference, the ALV Grid Control automatically uses the internal and the external length.

• For fields without DDIC reference, you must specify the internal length using field INTLEN and the external length using field DD_OUTLEN of the field catalog (see Parameters for Fields Without DDIC Reference [Page 153]).

2. Specify the conversion exit using field EDIT_MASK of the field catalog (see Formatting Column Contents [Page 148]).

3. Pass the field catalog with method set_table_for_first_display [Page 100] before the list is displayed for the first time.

Result

The values of the columns are run through the conversion routine before display.

Regards

Ravish

<i><b>

Reward if useful</b></i>

Read only

Former Member
0 Likes
1,104

Hi,

you can use the function module

conversion_exit_alpha_input

if it is not helping you

then go

shift itab-field left deleting leading '0'.

and modify your internal table and display this internal table in your grid display

thanks & regards,

Venkatesh

Read only

Former Member
0 Likes
1,104

Hello,

in fieldcatalog for that field try this

wa_fieldcatalog-no_zero = 'X'.

Regards,

Deepu.K