<?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 Problem with cheking a # value in IF statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513878#M1424052</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;        I have to check value of &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;val_tab  = node-&amp;gt;get_value( ).
     do .
----
end do .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;if my val_tab contains '#' or '##' a DO statement below it shoul not get executed . i tried IF with string operations but &lt;/P&gt;&lt;P&gt;its not working . it does not check it for '#' value .  Plz help how can i check it .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Jan 2010 11:01:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-01-19T11:01:08Z</dc:date>
    <item>
      <title>Problem with cheking a # value in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513878#M1424052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;        I have to check value of &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;val_tab  = node-&amp;gt;get_value( ).
     do .
----
end do .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;if my val_tab contains '#' or '##' a DO statement below it shoul not get executed . i tried IF with string operations but &lt;/P&gt;&lt;P&gt;its not working . it does not check it for '#' value .  Plz help how can i check it .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2010 11:01:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513878#M1424052</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-19T11:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with cheking a # value in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513879#M1424053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apparently the text mark behind this # is not encoded correclty, therefore it is shown this way. &lt;/P&gt;&lt;P&gt;It must be some special character most likely from 0-31 ASCII. If you don't know which one you can check if it is not one of them. To get string representation of that ASCII char use fm&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;HR_KR_XSTRING_TO_STRING&lt;/STRONG&gt; i.e passing 'OD' - 31 DEC (line feed ) as input parameter. Then compare this ouput string with you # mark. Do the same for rest of the 0-31 ASCII chars.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This should help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2010 11:41:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513879#M1424053</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-01-19T11:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with cheking a # value in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513880#M1424054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi im getting dump incompatible type when i passed val_tab as input to line feed .&lt;/P&gt;&lt;P&gt;what should be the input .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2010 12:35:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513880#M1424054</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-19T12:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with cheking a # value in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513881#M1424055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this logic&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: i type i,
      x type x,
      xstr type xstring,
      out_str type string,
      mark type string VALUE '#'.  "let's say your mark is here

do 31 times.
  xstr = x = sy-index. "convert to hex value and then to xstring
  CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
    EXPORTING
     in_xstring          = xstr
   IMPORTING
     OUT_STRING          = out_str.
 if out_str = mark.
   write: 'I found it'.
 endif.
enddo.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your &lt;STRONG&gt;val_tab&lt;/STRONG&gt; is probably of table type, right? You can't compare entire table with single mark. What you are excatly comparing, how does your IF condition look like?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2010 12:42:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513881#M1424055</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-01-19T12:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with cheking a # value in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513882#M1424056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ,&lt;/P&gt;&lt;P&gt;    my val_tab is of type string . i just only want to check whether it contains a '#' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if val_tab+0(1) ne '#' .
    .......
........
endif .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;even though val_tab+0(1) contains a '#'  the statements after IF  is executed and not else .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2010 13:46:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513882#M1424056</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-19T13:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with cheking a # value in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513883#M1424057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ujjwal,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The '#' symbol is nothing but a garbage character. I am quite sure the 2 '#' must be for CR_LF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the attribute CL_ABAP_CHAR_UTILITIES=&amp;gt;CR_LF instead of '#'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you get the catch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: You can refer to the class CL_ABAP_CHAR_UTILITIES for further details !!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also faced the same problem as yours &amp;amp; this is how i solved it: [http://wiki.sdn.sap.com/wiki/display/ABAP/Upload&lt;EM&gt;XML&lt;/EM&gt;file&lt;EM&gt;to&lt;/EM&gt;internal&lt;EM&gt;table|http://wiki.sdn.sap.com/wiki/display/ABAP/Upload&lt;/EM&gt;XML&lt;EM&gt;file&lt;/EM&gt;to&lt;EM&gt;internal&lt;/EM&gt;table]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Suhas Saha on Jan 19, 2010 7:27 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2010 13:52:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513883#M1424057</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-01-19T13:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with cheking a # value in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513884#M1424058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I told you this is because this # mark only appreas to be so, if you write&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: my_char type string value '#'.
if my_char = value_tab(1).
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and debug the code you would see that it &lt;EM&gt;my-char&lt;/EM&gt; has different hex representation than your &lt;EM&gt;val_tab(1)&lt;/EM&gt; . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is happening if SAP can't encode this char correctly (as this is one of special character) and presents you with the replacement, which is #. Nevetherless the real value behind it is not what we can see on the screen, it is determined by its hex(binary) representation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use my above code replacing &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
do 31 times.
  xstr = x = sy-index. "convert to hex value and then to xstring
  CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
    EXPORTING
     in_xstring          = xstr
   IMPORTING
     OUT_STRING          = out_str.  "here you have string representation of # with correct hex value behind it

 if out_str = val_tab(1) . "now only compare these two characters
   "....here # was found it means it is one of a special character

 endif.
enddo.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2010 13:56:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513884#M1424058</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2010-01-19T13:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with cheking a # value in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513885#M1424059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi suhas , &lt;/P&gt;&lt;P&gt;      thanks for your reply . you are absolutely right its a garbage .&lt;/P&gt;&lt;P&gt;but when i check my val_tab contains a single '#' and CL_ABAP_CHAR_UTILITIES=&amp;gt;CR_LF  contains 2 '##' so the condition is getting false . What to do ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2010 14:34:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513885#M1424059</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-19T14:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with cheking a # value in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513886#M1424060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks a lot the problem is solved .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2010 15:05:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513886#M1424060</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-01-19T15:05:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with cheking a # value in IF statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513887#M1424061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Post the solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2010 15:16:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-with-cheking-a-value-in-if-statement/m-p/6513887#M1424061</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2010-01-19T15:16:05Z</dc:date>
    </item>
  </channel>
</rss>

