12-19-2008 12:00 PM
Hello Everybody!
I have a problem and I hope you can help me
What I have:
1. ALV (hier)
2. Char field 'DEBIT' type SAKNR.
3. Field catalog TYPE slis_t_fieldcat_alv,
created by FUNCTION MODULE 'REUSE_ALV_FIELDCATALOG_MERGE'.
The problem is: i need to show leading zeros in ALV.
For example: an account '07110000' (in the inner table) is shown as '7110000'.
What I've done:
1. ls_fieldcat-lzero = 'X'.
ls_fieldcat-no_convext = 'X'.
2. CLEAR ls_fieldcat-ref_tabname.
ls_fieldcat-lzero = 'X'.
( ls_fieldcat-ref_fieldname was clear after filling by the function module)
I'm realy waiting for your advice!
12-19-2008 12:24 PM
12-19-2008 12:03 PM
Hi
LZERO works rlevant only to fields of data type NUMC. In the default setting, the ALV Grid Control displays these fields right justified without leading zeros. If you set LZERO, leading zeros are displayed.
SAKNR is having conversion exit CONVERSION_EXIT_ALPHA_OUTPUT.
Regards
Shiva
12-19-2008 12:11 PM
I know that SAKNR has conversion exit CONVERSION_EXIT_ALPHA_OUTPUT, but what shall I do with it to cancel this conversion??
12-19-2008 12:24 PM
12-19-2008 12:31 PM
Try this may work:
ls_fieldcat-lzero = 'X'.
ls_fieldcat-datatype = 'NUMC'.
12-19-2008 12:46 PM
>
> Hi
>
> try this way, you will get.
> SAKNR(10) TYPE n,
>
>
> Regs
>
> Srinivas
It's impossible, because SAKNR can be 'Z0070000'.
12-19-2008 12:28 PM
Hi,
try to give refernce table name and reference field name for the field after the fieldcatalog merge FM.
i mean to say modify the fieldcatalog for that particluar field by giving refernce table name and reference field name .
or use conversion_exit_alpha_input to add zero's to it.
Regards,
Nagaraj
12-19-2008 12:54 PM
>
> Hi,
>
> try to give refernce table name and reference field name for the field after the fieldcatalog merge FM.
>
> i mean to say modify the fieldcatalog for that particluar field by giving refernce table name and reference field name .
I've tried it, but it doesn't work:
ls_fieldcat-outputlen = 8.
ls_fieldcat-lzero = 'X'.
ls_fieldcat-no_convext = 'X'.
ls_fieldcat-ref_tabname = 'T599I'.
ls_fieldcat-ref_fieldname = 'PARAM'.
ls_fieldcat-datatype = 'NUMC'.
ls_fieldcat-inttype = 'N'.
>
> or use conversion_exit_alpha_input to add zero's to it.
>
> Regards,
> Nagaraj
How can I use conversion_exit_alpha_input? I have no idea...
12-19-2008 1:15 PM
Hi,
The reference table and field name u specified are wrong
try this
ls_fieldcat-outputlen = 8.
ls_fieldcat-lzero = 'X'.
ls_fieldcat-no_convext = 'X'.
ls_fieldcat-ref_tabname = 'SKA1'.
ls_fieldcat-ref_fieldname = 'SAKNR'.
Regards,
Nagaraj
12-19-2008 1:44 PM
>
> Hi,
>
> The reference table and field name u specified are wrong
>
> try this
>
> ls_fieldcat-outputlen = 8.
> ls_fieldcat-lzero = 'X'.
> ls_fieldcat-no_convext = 'X'.
> ls_fieldcat-ref_tabname = 'SKA1'.
> ls_fieldcat-ref_fieldname = 'SAKNR'.
>
> Regards,
> Nagaraj
Thanks for advice, but I referenced to...
ls_fieldcat-ref_tabname = 'T599I'.
ls_fieldcat-ref_fieldname = 'PARAM'.
...because I tried to cancel conversion exit CONVERSION_EXIT_ALPHA_OUTPUT.
Field 'PARAM' doesn't have conversion exit and has the same type like 'SAKNR'.
12-19-2008 1:46 PM
ACTUALLY, I'm very embarrassed now, because ALL YOU, who advised me to use NO_CONVEXT was RIGHT!!!
This way is correct:
LOOP AT gt_fieldcat INTO ls_fieldcat
WHERE fieldname = 'DEBIT' OR fieldname = 'CREDIT'.
ls_fieldcat-no_convext = 'X'.
MODIFY gt_fieldcat FROM ls_fieldcat. "TRANSPORTING fieldname lzero outputlen ref_tabname.
ENDLOOP
.
My mistake was: I used TRANSPORTING (you can see it from my code) and I had forgoten about it. Sorry! If only I wasn't so absent-minded today...:(
Thank YOU very very much!!!
Edited by: Svetlana Bykova on Dec 22, 2008 6:46 AM
12-19-2008 1:53 PM