09-23-2015 5:16 PM
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.
09-23-2015 5:26 PM
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
09-23-2015 6:28 PM
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