<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Displaying type dec when value = 0 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-type-dec-when-value-0/m-p/7587509#M1566909</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have come with an approach but to be honest I think your original is probably better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have basically worked with character fields but created them in the dictionary and used&lt;/P&gt;&lt;P&gt;conversion exits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a data element ZNRW_CHAR5 using a domain of the same name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The domain ZNRW_CHAR5 is type CAHR length 5 but has an output length of 6 and uses a convers routine of ZNRW5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a local function group which contained two function modules which have the same interface:&lt;/P&gt;&lt;P&gt;an untyped importing parameter 'input' and a simlar exporting parameter 'output'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONVERSION_EXIT_ZNRW5_INPUT...the only code in this is: output = input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONVERSION_EXIT_ZNRW5_OUTPUT...has a bit more code&lt;/P&gt;&lt;P&gt;data l52(3) type p decimals 2.&lt;/P&gt;&lt;P&gt;data l_string(6) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear output.&lt;/P&gt;&lt;P&gt;if input co ' 1234567890.'&lt;/P&gt;&lt;P&gt;and input is not initial.&lt;/P&gt;&lt;P&gt;write input to l_string.&lt;/P&gt;&lt;P&gt;l52 = l_string.&lt;/P&gt;&lt;P&gt;output = l52.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a test abap:&lt;/P&gt;&lt;P&gt;REPORT  ZNRW_TEST_CONV_EXIT.&lt;/P&gt;&lt;P&gt;parameters: p_char type ZNRW_CHAR5.&lt;/P&gt;&lt;P&gt;write:/ '''' no-gap,p_char no-gap,''''.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works but I think it's messier than your origianl. Maybe it could be cleaned up a bit??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Feb 2011 05:04:19 GMT</pubDate>
    <dc:creator>former_member186741</dc:creator>
    <dc:date>2011-02-15T05:04:19Z</dc:date>
    <item>
      <title>Displaying type dec when value = 0</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-type-dec-when-value-0/m-p/7587506#M1566906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a variable which is of type dec. When 0 is entered as a value, the value displays as a blank field whereas I want to display as 0.0 - but only if 0 has been entered as a value. Can this be done?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Dec 2010 09:20:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-type-dec-when-value-0/m-p/7587506#M1566906</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-12-30T09:20:48Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying type dec when value = 0</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-type-dec-when-value-0/m-p/7587507#M1566907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt; Can you be more specific  - as in where do you want to display this field. Is it in an alv report or module pool screen etc ?&lt;/P&gt;&lt;P&gt;There are a couple of operations for ALV reports that can get this output.&lt;/P&gt;&lt;P&gt;Please specify your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Titus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2011 07:38:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-type-dec-when-value-0/m-p/7587507#M1566907</guid>
      <dc:creator>titus_thomas2</dc:creator>
      <dc:date>2011-02-11T07:38:44Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying type dec when value = 0</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-type-dec-when-value-0/m-p/7587508#M1566908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is a module pool screen. I have got round the problem by declaring the type as char (with a range stipulating numeric values only) and writing the dec value or clearing the field as appropriate. It is a rather messy solution though and if there is another way I would like to know what it is.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2011 08:18:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-type-dec-when-value-0/m-p/7587508#M1566908</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-11T08:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying type dec when value = 0</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-type-dec-when-value-0/m-p/7587509#M1566909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have come with an approach but to be honest I think your original is probably better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have basically worked with character fields but created them in the dictionary and used&lt;/P&gt;&lt;P&gt;conversion exits.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a data element ZNRW_CHAR5 using a domain of the same name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The domain ZNRW_CHAR5 is type CAHR length 5 but has an output length of 6 and uses a convers routine of ZNRW5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a local function group which contained two function modules which have the same interface:&lt;/P&gt;&lt;P&gt;an untyped importing parameter 'input' and a simlar exporting parameter 'output'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONVERSION_EXIT_ZNRW5_INPUT...the only code in this is: output = input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONVERSION_EXIT_ZNRW5_OUTPUT...has a bit more code&lt;/P&gt;&lt;P&gt;data l52(3) type p decimals 2.&lt;/P&gt;&lt;P&gt;data l_string(6) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear output.&lt;/P&gt;&lt;P&gt;if input co ' 1234567890.'&lt;/P&gt;&lt;P&gt;and input is not initial.&lt;/P&gt;&lt;P&gt;write input to l_string.&lt;/P&gt;&lt;P&gt;l52 = l_string.&lt;/P&gt;&lt;P&gt;output = l52.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created a test abap:&lt;/P&gt;&lt;P&gt;REPORT  ZNRW_TEST_CONV_EXIT.&lt;/P&gt;&lt;P&gt;parameters: p_char type ZNRW_CHAR5.&lt;/P&gt;&lt;P&gt;write:/ '''' no-gap,p_char no-gap,''''.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works but I think it's messier than your origianl. Maybe it could be cleaned up a bit??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Feb 2011 05:04:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/displaying-type-dec-when-value-0/m-p/7587509#M1566909</guid>
      <dc:creator>former_member186741</dc:creator>
      <dc:date>2011-02-15T05:04:19Z</dc:date>
    </item>
  </channel>
</rss>

