2010 Jan 19 6:19 AM
Hi experts,
I have an ALV output, in which one of the fields is equipment number (equi-equnr).
There are some leading zero's that I need to truncate from the ALV output.
How can I achieve this? The code is as given below:
fieldcatalog-fieldname = 'EQUIPMENT_NUMBER'.
fieldcatalog-seltext_m = 'Equipment Number'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
Thanks,
Ajay.
2010 Jan 19 6:33 AM
Hello,
Your requirement is that you need to display the equipment number in the ALV without the leading zeroes.
Ypur code is
fieldcatalog-fieldname = 'EQUIPMENT_NUMBER'.
fieldcatalog-seltext_m = 'Equipment Number'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
Just before append statement add the following
fieldcatalog-no_zero = 'X'.
.
Now try the same it should solve your problem.
Regards,
Sachin
Edited by: Sachin Dargan on Jan 19, 2010 7:34 AM
2010 Jan 19 6:23 AM
lzero field in the field catlog should be marked 'X'
hope this solves your problem
Edited by: Anup Deshmukh on Jan 19, 2010 7:23 AM
2010 Jan 19 6:32 AM
Hi Anup,
I did this:
fieldcatalog-fieldname = 'EQUIPMENT_NUMBER'.
fieldcatalog-seltext_m = 'Equipment Number'.
fieldcatalog-col_pos = 5.
fieldcatalog-lzero = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
Unfortunately, it does not work....
Any other way out?
Thanks,
Ajay.
2010 Jan 19 6:23 AM
for leading Zero's use this function module.
CONVERSION_EXIT_ALPHA_OUTPUT
lzero(1) type c, field catalog
Edited by: dharma raj on Jan 19, 2010 11:54 AM
2010 Jan 19 6:25 AM
Hi,
Try by passung
FS_FIELDCAT-edit_mask = '==ALPHA'. to fieldcatalog.
Nag
2010 Jan 19 6:26 AM
Hi,
Look the below example
*--replace wa_itab-matnr to equi-equnr
call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
input = wa_itab-matnr
IMPORTING
output = wa_itab-matnr.
regards,
Amit
2010 Jan 19 6:33 AM
Hello,
Your requirement is that you need to display the equipment number in the ALV without the leading zeroes.
Ypur code is
fieldcatalog-fieldname = 'EQUIPMENT_NUMBER'.
fieldcatalog-seltext_m = 'Equipment Number'.
fieldcatalog-col_pos = 5.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
Just before append statement add the following
fieldcatalog-no_zero = 'X'.
.
Now try the same it should solve your problem.
Regards,
Sachin
Edited by: Sachin Dargan on Jan 19, 2010 7:34 AM
2010 Jan 19 6:38 AM
Hi Friends,
The solution provided by Sachin has worked:
fieldcatalog-no_zero = 'X'.
I do not understand why the lzero thing is not working
Anyways, thanks all for the valuable suggestions.
Thanks,
Ajay.
2010 Jan 19 6:34 AM
Hi Ajay,
In field catalog there is a optionlzeron for removing leading zero
fieldcatalog-lzero = 'X'.
or you can use FM for removing leading zero.
CONVERSION_EXIT_ALPHA_OUTPUT
Thanks & Rgds,
Arpit
2010 Jan 19 6:36 AM
Hi Ajay,
In fieldcat pass ref_fieldname = 'EQUNR' and ref_tabname = 'AFIH'.
It will work fine.
Thanks,
Vinod.
2010 Jan 19 6:41 AM
Hi
Loop at internal table and do SHIFT <field_name> LEFT DELETING LEADING 0 and store it in a temp_variable and display this temp_variable in the field catalog.
Thanks
Subha