cancel
Showing results for 
Search instead for 
Did you mean: 

How can we change the input field on a view stop showing zeros

Former Member
0 Kudos

Hello,

To make screen look consistent with other character input field. How can we change the input field on the view stop displaying zeros even though the data type is NUMC and data type should not be change?

Edited by: sap_learner on Mar 25, 2010 5:44 PM

Edited by: sap_learner on Mar 25, 2010 5:49 PM

Edited by: sap_learner on Mar 25, 2010 5:55 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

In the attribute context, select the following formatting option-

Display Leading Zeros - Zeros as Blanks

Hope this fixes the issue.

Cheers,

Ravikiran.

[My Articles|http://divulgesap.com/profile.php?u=Mg==]

Former Member
0 Kudos

hello Ravikiran,

I don't see how can it be done under context tab when it does not allow you to set the default value, Can you explain it further?

Former Member
0 Kudos

Hi

Check this [pic|http://picasaweb.google.com/lh/photo/rNaiJ9MJ2t88j5XX4O8Dwg?feat=directlink]

Attributes of underlying data type NUMC, DEC etc will have this option of DisplayLeadingZeroes in formatting section available.

You can also set the same in code by using method SET_ATTRIBUTE_FORMAT_PROPS of interface if_wd_context_node_info.

Regards

Manas Dua

Former Member
0 Kudos

Hi,

Refer to this below link for more details-

http://www.divulgesap.com/blog.php?p=OTY=

Hope this solves your issue.

Cheers,

Ravikiran

Former Member
0 Kudos

hello Manas Dua,

Thanks for your help. I am able to resolve my problem.

My code will help the future comers to resolve this kind of issues.

*The code is applied to method WDDOINIT of the default view.

DATA lo_nd_terms_input TYPE REF TO if_wd_context_node.

DATA lo_nd_terms_input_i TYPE REF TO if_wd_context_node_info.

DATA lv_zeros TYPE wdy_attribute_format_prop.

lv_zeros-null_as_blank = 'X'.

lo_nd_terms_input = wd_context->get_child_node( name = wd_this->wdctx_input ).

lo_nd_terms_input_i = lo_nd_terms_input->get_node_info( ).

lo_nd_terms_input_i->set_attribute_format_props(

EXPORTING

name = `ENTER THE ATTRIBUTE NAME`

format_properties = lv_zeros ).

Edited by: sap_learner on Mar 26, 2010 5:02 PM

Answers (0)