on 05-06-2008 7:38 AM
I have a Web Dynpro application with an ALV Grid. One of the fields has a dictionary object with three decimals. I want to display this field only with 2 decimals. How can I format this field?
Another field is NUMC(10). When there is no code entered you will see all zeroes '0000000000' in the cells. Can I format this to display nothing. I want to surpress (leading) zeroes.
Hi ,
for suppressing the zeroes u can use this method in wddoinit of view or comp for the node attribute....
DATA: lo_nd_name TYPE REF TO if_wd_context_node,
lo_nd_info type ref to if_wd_context_node_info
.
DATA : ls_properties TYPE wdy_attribute_format_prop.
lo_nd_name = wd_context->get_child_node( name = 'node name' ).
lo_node_info = lo_nd_name->get_node_info( ).
ls_properties-null_as_blank = 'X'.
ls_properties-sign_pos = if_wd_context_node_info=>c_format_signpos_left .
lr_node_info->set_attribute_format_props( EXPORTING name = 'attribute name' format_properties = ls_properties ).
for suppressing the trailing zeroes there is no way in wd-abap
workaround is to use datatype of 2 decimal.
Regards
Yash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
to supress the leading zeros u can use this "convertion exit"
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = lv_max_no_hits
IMPORTING
OUTPUT = lv_max_no_hits.
first u read the attribut, pass it to convertion exit.
and thn u set the returned value back to attribute.
hope this helps
regards
chythanya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.