10-09-2008 7:06 AM
Hi Gurus,
I have a issue of sorting a field in ALV GRID of Type LFA1-LIFNR(Char - 10), which has numbers as well as characters. The requirement is to remove the leading zeroes from the numbers. But when I do so using SHIFT (variable name) LEFT DELETING LEADING ZEROES, the sort order is disrupted in output. Hence following this statement I also included SHIFT (variable name) RIGHT DELETING TRAILING SPACE. But now the filter in ALV GRID does not work for this field. Please find my code below:
SHIFT i_final-vend_num LEFT DELETING LEADING '0'.
SHIFT i_final-vend_num RIGHT DELETING TRAILING space.
Thanks in advance!
10-09-2008 7:09 AM
Hi,
Try using the Fm CONVERSION_EXIT_ALPHA_OUTPUT, to suppress leadinf zeros.
Regards,
Surinder
10-09-2008 7:13 AM
Hi,
Kindly use no_zero parameter in filed catalog. it will omit leading zeros.
ex.
alv_wcat-fieldname = 'MATNR'.
alv_wcat-seltext_m = 'Material Number'.
alv_wcat-no_zero = 'X'
alv_wcat-col_pos = col_pos.
APPEND alv_wcat TO alv_fcat.
CLEAR:alv_wcat.
IF useful ..........
Regards,
S.Senthil kumar
10-09-2008 7:19 AM
I have already tried these. The sort order gets disrupted in the ALV output then.
The sort order becomes:
112
113
2
21
3
34
10-09-2008 7:36 AM
Hi,
Kindly remove all ur shift statements. leave lifnr as its(with leading zeros), then use as i said. Here working fine.
Regards,
senthil kumar.s
10-09-2008 7:45 AM
But then the requirement given by client is to remove leading zeroes. And its somehow possible, because there is an SAP transaction FBL1N that has this kind of output for Account(Characters and numbers both), but still the sorting and filtering works correctly.