‎2008 Sep 19 3:59 AM
hi experts,
I have one requirement that in my zreport one column i have taken quantity field which is a neumeric field. but when there is no quantity in report it shows 0. but my customer want it should be ' ' <blank> bcz 0 indicates some different meaning . so how can i do this
This is an ALV report.
‎2008 Sep 19 4:05 AM
in the fieldcatalog mention the NO_ZERO equal to 'X'.
fieldcat-no_zero = 'X'.
‎2008 Sep 19 4:05 AM
in the fieldcatalog mention the NO_ZERO equal to 'X'.
fieldcat-no_zero = 'X'.
‎2008 Sep 19 4:08 AM
HI friend.
I have tried that but it is giving error.
data : gd_field type slis_fieldcat_main0.
perform field.
perform alv.
form field .
gd_field-no_zero = 'X'.
endform. " field
form alv.
REUSE_ALV_GRID_DISPLAY
IT_FIELDCAT = gd_field
endform.
I tried this method but it is giving error.
Please guide me.
Thank you very much.
regards.
‎2008 Sep 19 4:11 AM
FIELDCAT-NO_ZERO = 'X'.
No_zero (suppress zeros): Only relevant for value fields.
Value set: SPACE, 'X'.
'X' = suppress zeros.
The decimal places are displayed with the proper unit.
- An initial value field with reference to a non-initial unit is displayed as '0' (provided that FIELDCAT-NO_ZERO is initial). If unit-specific totals are calculated for this value field, the unit is considered in the analysis of whether homogeneous units exist.
- An initial value field with reference to an initial unit is displayed as SPACE. If unit-specific totals are calculated for this value field, the unit SPACE has no effect on the homogeneity of the unit if the value field is initial.
- For non-initial value fields with initial unit, the unit SPACE is considered as a unit when unit-specific totals are calculated.
‎2008 Sep 19 4:31 AM
what error you are getting..?
i think you are doing some thing wrong.
‎2008 Sep 19 4:46 AM
Hello Sarvanan,
What error you are getting? Vijay's solution should work.
While you are creating the field catalogue, for the value fields which you don't want to show zeroes just give the field no_zero as 'X' and append to field catalogue internal table.
Regards
Farzan
‎2008 Sep 19 5:17 AM
hi there.
it is not error but it is dump error when it reach to the FM of the alv.
‎2008 Sep 19 5:20 AM
that means you declared your parameters or fieldcatalog wrongly. show your fieldcatalog declartion, and population.
‎2008 Sep 19 5:21 AM
hi vijay.
data : gd_field type slis_fieldcat_main0.
perform field.
perform alv.
form field .
gd_field-no_zero = 'X'.
endform. " field
form alv.
REUSE_ALV_GRID_DISPLAY
IT_FIELDCAT = gd_field
endform.
this is how i declared.
‎2008 Sep 19 5:30 AM
‎2008 Sep 19 5:31 AM
if you do like this it never work...
Do you know how to work on ALV..?
report ztest_alv.
type-pools: slis.
data: it_data type table of sflight.
data:
it_fieldcat type slis_t_fieldcat_alv, "Fieldcatalog declarion should be like this
wa_fcat like line of it_fieldcat.
select * from sflight into table it_data
up to 20 rows.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy-repid
i_structure_name = 'SFLIGHT'
i_inclname = sy-repid
changing
ct_fieldcat = it_fieldcat
exceptions
inconsistent_interface = 1
program_error = 2.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
it_fieldcat = it_fieldcat
tables
t_outtab = it_data
exceptions
program_error = 1.
‎2008 Sep 19 5:37 AM
Hi Vijay.
Thank you very much for the nice and kind reply.
regards,
s.saravannan