<?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: Amount value corrupted in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203499#M1521597</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sam,&lt;/P&gt;&lt;P&gt;you can assign the input string parameter to a type-P variable, and catch whether there's a conversion exception.&lt;/P&gt;&lt;P&gt;Please try the following code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: l_amt_bal_as_amount type dmbtr.

catch system-exceptions convt_no_number = 1.
  l_amt_bal_as_amount = i_amt_bal.
endcatch.
if sy-subrc &amp;lt;&amp;gt; 0.
  write: / 'Error while converting amount string to number'.
else.
  if l_amt_bal_as_amount &amp;lt; 0.
    post_type = '40'.
  else.
    post_type = '50'.
  endif.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I hope this helps. Kind regards,&lt;/P&gt;&lt;P&gt;Alvaro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Aug 2010 06:17:33 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-08-13T06:17:33Z</dc:date>
    <item>
      <title>Amount value corrupted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203493#M1521591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have amount balance say amt_bal coming from ftp server file and I have developed function module to derive Posting_type_key based on the amount balance (amt_bal).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sometimes i_amt_bal value contians alphabets as 'T234567'.&lt;/P&gt;&lt;P&gt;In that case, my code isfailing/dumping &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I  coded the Function module with &lt;/P&gt;&lt;P&gt;IMPORTparameter as&lt;/P&gt;&lt;P&gt;I_AMT_BAL  TYPE CHAR16.&lt;/P&gt;&lt;P&gt;EXPORT paramater as&lt;/P&gt;&lt;P&gt;POST_TYPE TYPE CHAR02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Source code is below&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local Interface:&lt;/P&gt;&lt;P&gt;*"  IMPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(I_AMT_BAL) TYPE  CHAR16&lt;/P&gt;&lt;P&gt;*"  EXPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(POST_TYPE) TYPE  CHAR_02&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;  IF i_amt_bal &amp;lt; 0.  (  here it is failing if the amt_bal contians 'T234567' )&lt;/P&gt;&lt;P&gt;    post_type = '40'.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    post_type= '50'.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;=======================&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to make sure the i_amt_val's  value is only numericals and if and only if numerical then pass posting type code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Aug 2010 23:35:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203493#M1521591</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-05T23:35:22Z</dc:date>
    </item>
    <item>
      <title>Re: Amount value corrupted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203494#M1521592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What's so complicated about it ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Define the IMPORTing param I_AMT_BAL as some currency type (viz., DMBTR, WRBTR etc). Is there any specific reason you've defined it as CHAR16 ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Aug 2010 01:34:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203494#M1521592</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-08-06T01:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Amount value corrupted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203495#M1521593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Even If I declare i_amt_bal  as NETWR the value comes as 'T234567'.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;So, can I check that the i_amt_bal  contains only number of  0 yo 9...?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why because, If i_amt_bal contains other than number, then I won't check Lessthan (&amp;lt;) or greater than (&amp;gt;) check.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANKS,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Aug 2010 18:05:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203495#M1521593</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-06T18:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Amount value corrupted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203496#M1521594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;      Use the below statement to solve this problem . I have tried and it is working for me. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      Replace all occurrences of 'T' in v_amt_bal with '0' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabakaran.S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Aug 2010 18:22:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203496#M1521594</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-06T18:22:30Z</dc:date>
    </item>
    <item>
      <title>Re: Amount value corrupted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203497#M1521595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mean the value may come with alphabets mix (like T36YH789 )incase the file sent with wrong values , that's why how can I check the  i_amt_bal shud contain only numbers and comma and full stop. &lt;/P&gt;&lt;P&gt;My intension of asking is &lt;/P&gt;&lt;P&gt; IF  i_amt_bal  contain only numbers and comma and full stop, then, I will proceed &lt;/P&gt;&lt;P&gt;other wise I will error message&lt;/P&gt;&lt;P&gt;Can anybody help me?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 04:43:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203497#M1521595</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-13T04:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Amount value corrupted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203498#M1521596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write your whole code in the following IF statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF  I_AMT_BAL CA '0123456789' AND I_AMT_BAL IS NOT INITIAL.
. . .
&amp;lt; your code &amp;gt;
. . .
ELSE.
&amp;lt; error message &amp;gt;
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ateet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 06:10:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203498#M1521596</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-13T06:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: Amount value corrupted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203499#M1521597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sam,&lt;/P&gt;&lt;P&gt;you can assign the input string parameter to a type-P variable, and catch whether there's a conversion exception.&lt;/P&gt;&lt;P&gt;Please try the following code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: l_amt_bal_as_amount type dmbtr.

catch system-exceptions convt_no_number = 1.
  l_amt_bal_as_amount = i_amt_bal.
endcatch.
if sy-subrc &amp;lt;&amp;gt; 0.
  write: / 'Error while converting amount string to number'.
else.
  if l_amt_bal_as_amount &amp;lt; 0.
    post_type = '40'.
  else.
    post_type = '50'.
  endif.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I hope this helps. Kind regards,&lt;/P&gt;&lt;P&gt;Alvaro&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 06:17:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203499#M1521597</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-13T06:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: Amount value corrupted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203500#M1521598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My requirement is to check&lt;/P&gt;&lt;P&gt;i_amt_bal MUST contain only numbers and comma and full stop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YOUR below synstax will also pass  if the I_AMT_BAL  has a value of 'T678YR906'.&lt;/P&gt;&lt;P&gt;IF  I_AMT_BAL CA '0123456789' AND I_AMT_BAL IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I dont' want that.  I want to make sure the amount value should contains only numbers and comma and full stop, to proceed further.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 06:30:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203500#M1521598</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-13T06:30:49Z</dc:date>
    </item>
    <item>
      <title>Re: Amount value corrupted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203501#M1521599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try with&lt;/P&gt;&lt;P&gt; IF I_AMT_BAL CO '0123456789.,' AND I_AMT_BAL IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It shall work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Contains Only: True, if operand1 only contains characters from operand2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Selva K.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 07:01:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203501#M1521599</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-13T07:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Amount value corrupted</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203502#M1521600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sam,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go through this link&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_sm40/helpdata/en/fc/eb3516358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_sm40/helpdata/en/fc/eb3516358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will help you with comaprison strings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ateet&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Aug 2010 07:10:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/amount-value-corrupted/m-p/7203502#M1521600</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-08-13T07:10:58Z</dc:date>
    </item>
  </channel>
</rss>

