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: 

Filter on ALV

Former Member
0 Kudos
1,183

When i use filter for character fields on ALV, the data is not populating without leading zeros.

How to eliminate the leading zeros to work for the filter.

-Vinod

11 REPLIES 11

former_member223537
Active Contributor
0 Kudos
766

Hi,

You can use FM CONVERSION_EXIT_ALPHA_OUTPUT.

Best regards,

Prashant

0 Kudos
766

This filter(which is like a tunnel icon) is related to field catalog in ALV. Is there any parameter to pass to supress leading zeros to the field catalog so that i can get the selected data thru filter.

0 Kudos
766

it_fieldcat-lzero = "".

if this is 'X', then leading zeroes will be displayed , but this is applicable only for NUMC

if solved pls reward points

Message was edited by: chandrasekhar jagarlamudi

0 Kudos
766

Is there any method for character type.

0 Kudos
766

i dont think it is there

may be u can do like this

it_fieldcat-inttype = 'NUM'.

it_fieldcat-lzero = ''.

0 Kudos
766

I need only for character fields...

0 Kudos
766

U can use the field type as <b>NUMC</b>.

This will work out. make a try.

Kindly reward points if u find the answers are helpful.

Former Member
0 Kudos
766

Hi ,

I have an ALV report which gives me short dump when I filter any of the 'P' type field. I tried to implement sap note 839839 in debug mode but in vain. Should I implement this note first and then check the chnage?

the short dump error "..........

Error in ASSIGN: Memory protection error.

The current program "SAPLSSEL " uses the ASSIGN statement.

However, the offset of the segment (20208) plus the length (69)

is greater than the length of the segment (20264).

This is not allowed.

If the error is in one of your own ABAP programs or an SAP program that

you have modified, try to correct it.

Reduce the offset and/or length that you are using.

If the error occurred in a non-modified SAP program, you may be

able to find a solution in the SAP note system.

If you have access to the note system yourself, use the following

search criteria:

"ASSIGN_OFFSET+LENGTH_TOOLARGE"

"SAPLSSEL " or "LSSELFDI "

"FILL_DYN_FROM_FIELD_SEL" ........."

I appreciate ur inputs.

thanks in advance,

regards,

shan

Former Member
0 Kudos
766

Hi vinod,

1. usually this does not happen,

if we have defined the field in the internal table

like

<b> matnr like mara-matnr.</b>

2. The ZEROES are automatically taken care of.

3. ie. if there is a material number

with

0000000000000023

and in FILTER if we just enter

23,

it will show that material.

4. I just tried it with a sample program.

U can just copy paste and get a feel of it.

5.

REPORT ZTRN_ALV.

*----


type-pools : slis.

*----


Data Declaration

data : fc type SLIS_T_FIELDCAT_ALV.

data : begin of itab occurs 0.

include structure mara.

data : end of itab.

*----


Start of Selection

select *

from mara

into table itab

package size 500

where matnr like '0%'.

endselect.

*----


field catalogue

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = sy-repid

I_INTERNAL_TABNAME = 'ITAB'

I_INCLNAME = sy-repid

CHANGING

CT_FIELDCAT = fc

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3.

*----


CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

IT_FIELDCAT = fc

TABLES

T_OUTTAB = itab

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

regards,

amit m.

Former Member
0 Kudos
766

Hi,

You can use the keyword SHIFT fieldname DELETING LEADIN '0'.

This works for datatype C, N, D, T and CHAR, NUMC etc.

Regards,

Arun S

Weiwei_z
Newcomer
0 Kudos
737

when the fieldcatalog-no_zero is set to X, the field is displayed without leading zeros, but in the filter you must input leading zeros; the other way around, if it is not set, the field is displayed with leading zeros, but in the filter you don't have to input leading zeros. very strange setting.