Application Development 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: 

in alv grid display if no values present for particular field,then it shouldn't populate default value instead field should should be blank,how can we achieve this using alv grid display?

0 Kudos

in alv grid display if no values present for particular field,then it shouldn't populate default value instead field should be blank,how can we achieve this using alv grid display?

help me out ,thanks in advance.

2 REPLIES 2

roberto_vacca2
Active Contributor
0 Kudos

Hi.

It depends on what type of field.

For NUMC default value is INITIAL, for numbers default value is 0,00

If you don't want zeros you need to put a X flag in fieldcatalog option NO_ZERO for the field you need.

Formatting Column Contents - ALV Grid Control - SAP Library

If others type of default value, you need to correct value before output.

Hope to help

Bye

AbhishekSharma
Active Contributor
0 Kudos

Hi Jai,

You can show numeric fields as blank by populating the NO_ZERO field of field catalog for that field with 'X'. This will suppress the zero.

wa_fcat-no_zero = 'X'

Field Catalog Example:

fcat-fieldname = '<fieldname>'.

  fcat-hotspot = ' '.

  fcat-outputlen = '<outputlength>'.

  fcat-just = 'L'.

  fcat-seltext_m = 'CRATE'.

  fcat-ddictxt = 'M'.

  fcat-inttype = 'Q'.

  fcat-datatype = '<data type>'.

  fcat-do_sum   = 'X'.

  fcat-just     = 'R'.

  fcat-no_zero  = 'X'.

* fcat-decimals_out = 0.

  APPEND fcat.

  CLEAR fcat.

If you want to show a user friendly message when there are no records available in ALV.

cr_config     TYPE REF TO cl_salv_wd_config_table,            "Configuration


cr_config will be the Model object of ALV.


*--> Set empty grid message

     CALL METHOD cr_config->if_salv_wd_table_settings~set_empty_table_text

       EXPORTING

         value = zcl_report_constants=>gc_no_records.    "No Records Available to display

Hope this helps..

Thanks-

Abhishek