2009 Sep 25 10:18 AM
I want to hide zeros for currenzy columns. I have used CL_SALV_TABLE for my ALV display.
like we do NO_ZERO = 'X' in REUSE_ALV_
I want to do the same using class alv CL_SALV_TABLE
I want to hide zeros for currenzy columns. I have used CL_SALV_TABLE for my ALV display.
like we do NO_ZERO = 'X' in REUSE_ALV_
I want to do the same using class alv CL_SALV_TABLE
2009 Sep 25 10:22 AM
maybe there is such an option in SALV, tho i rather do it manually, and have no numbers in my outputz structure but just chars.
When filling them from a number field you can use the statement: "write var_num to var_char NO-ZERO.".
2009 Sep 25 11:15 AM
write stmt accepts char data type but my amount is in currency.
please let me know if ther is any method in CL_SALV_TABLE to supress zeros.
give me any inputs.
2009 Sep 25 11:41 AM
Hello Milind,
That is what exactly Florian wants to put across. May be in CL_SALV_TABLE you donot find any NO-ZERO stuff.
But you can try a workaround make all the fields in your output table as character & before output try to pass the values from the curr field to the character field using NO-ZERO.
DATA:
V_AMT1 TYPE DMBTR,
V_AMT2 TYPE CHAR20.
WRITE V_AMT1 TO V_AMT2 NO-ZERO.
2009 Sep 25 11:48 AM
Hi Suhas,
thanks for ur reply.
I have tried for the same converting my output columns in char data type.
but the above method is not possible for FLTP data type ,also i m getting dump for certain set of currency values to be converted to char data type using above method.
2009 Sep 25 11:54 AM
Hello
Class CL_SALV_COLUMN_TABLE have method IS_ZERO. Check this.
data: lo_column type ref to CL_SALV_COLUMN_TABLE.
...
lo_column ?= lo_columns->get_column( 'PRICE' ).
lo_column->set_long_text( 'Price Price Price' ).
lo_column->set_medium_text( 'Price Price' ).
lo_column->set_short_text( 'Price' ).
lo_column->set_tooltip( 'Price Price Price' ).
lo_column->is_zero( 'X' ).
...
2009 Sep 26 7:56 AM
Example:-
wa_celltab-fieldname = 'KUNNR'.
wa_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
INSERT wa_celltab INTO TABLE itab-celltab.
Edited by: krupa jani on Sep 26, 2009 8:57 AM
2009 Sep 27 12:47 PM
Hi Milind,
it is interesting but not necessarily helpful what people post here.
Class CL_SALV_COLUMN has a method SET_ZERO (Specify Empty Cell Display). There is a documentation which says
Specify Empty Cell Display
Functionality
By default, a zero is displayed in cells that contain no value.
You use the SET_ZERO method to set whether these rows should contain a blank instead of a zero.
Parameters
VALUE
optional
Set zeros; SAP_BOOL type
Output Constant Value
with a zero ABAP_TRUE 'X'
with a blank ABAP_FALSE ' '
Notes
Concerns:
CL_SALV_COLUMN
CL_SALV_COLUMN_LIST
CL_SALV_COLUMN_TABLE
You may try something like
METHOD grid_columns.
DATA:
lo_salv_columns_table TYPE REF TO cl_salv_columns_table,
lt_column_ref TYPE salv_t_column_ref.
FIELD-SYMBOLS:
<column_ref> TYPE LINE OF salv_t_column_ref.
lo_salv_columns_table = io_salv->get_columns( ).
lt_column_ref = lo_salv_columns_table->get( ).
LOOP AT lt_column_ref ASSIGNING <column_ref>.
<column_ref>->SET_ZERO( ABAP_FALSE ).
ENDLOOP.
ENDMETHOD.Regards,
Clemens