Application Development and Automation 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: 
Read only

remove 0

Former Member
0 Likes
1,256

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,214

in the fieldcatalog mention the NO_ZERO equal to 'X'.

fieldcat-no_zero = 'X'.

11 REPLIES 11
Read only

Former Member
0 Likes
1,215

in the fieldcatalog mention the NO_ZERO equal to 'X'.

fieldcat-no_zero = 'X'.

Read only

0 Likes
1,214

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.

Read only

0 Likes
1,214

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.

Read only

0 Likes
1,214

what error you are getting..?

i think you are doing some thing wrong.

Read only

0 Likes
1,214

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

Read only

0 Likes
1,214

hi there.

it is not error but it is dump error when it reach to the FM of the alv.

Read only

0 Likes
1,214

that means you declared your parameters or fieldcatalog wrongly. show your fieldcatalog declartion, and population.

Read only

0 Likes
1,214

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.

Read only

0 Likes
1,214

Can you please brief on the dump??

Regards

Farzan

Read only

0 Likes
1,214

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.

Read only

0 Likes
1,214

Hi Vijay.

Thank you very much for the nice and kind reply.

regards,

s.saravannan