<?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: Code with string syntax &amp;quot;cn&amp;quot; in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-string-syntax-quot-cn-quot/m-p/6757294#M1461081</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your developer is initially checking transaction code. if the transaction code either VL02 or VL02N then he is proceeding to check the weights.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first checking the sales order in header and item level. if it is equal then &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;he is checking volume(GEWEI). if it is empty and checking net weight(NTGEW) and gross weight(BRGEW). if any of weights is not empty then he is displaying the error message stating that "Unit of Measure is missing".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: subas  Bose on Mar 31, 2010 6:56 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 31 Mar 2010 16:55:45 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-03-31T16:55:45Z</dc:date>
    <item>
      <title>Code with string syntax "cn"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-string-syntax-quot-cn-quot/m-p/6757292#M1461079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A developer put this custom code inside a DocSave rtn for deliveries in SAP. During my interface build I am trying to update a delivery, and nothing I put in sy-tcode here in debug prevents it from dropping into the loop?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This part of the SAP logic does not have uom in field xlips-GEWEI so I always get this err msg. Anybody have an idea what the developer was trying to accomplish here before I change it. And, what would sy-tcode have to be equal to in order to avoid going into this logic?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank-You&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;if sy-tcode cn 'VL02*'.
    loop at xlikp.
      loop at xlips where vbeln = xlikp-vbeln.
        if xlips-gewei is initial and
           ( not xlips-ntgew is initial or
           not xlips-brgew is initial ).
          message id 'VL' type 'A' number '001'
              with 'UNIT OF MEASURE MISSING'.
        endif.
      endloop.
    endloop.
  endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Mar 2010 16:38:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-string-syntax-quot-cn-quot/m-p/6757292#M1461079</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-31T16:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Code with string syntax "cn"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-string-syntax-quot-cn-quot/m-p/6757293#M1461080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  This is the standard SAP documentation for 'CN'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CO (Contains Only): &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c1 contains only characters from the string c2. &lt;/P&gt;&lt;P&gt;If c1 or c2 is of type C, the comparison takes into account the full length of the field, including blanks at the end. &lt;/P&gt;&lt;P&gt;comparison. &lt;/P&gt;&lt;P&gt;If c1 is of type STRING and empty, the result of the comparison is always positive. &lt;/P&gt;&lt;P&gt;If c2 is of type STRING and empty, the result of the comparison is always negative, unless c1 is also an empty string. &lt;/P&gt;&lt;P&gt;If the result of the comparison is negative, the field SY-FDPOS contains the offset of the first character in c1 which is not also included in c2. &lt;/P&gt;&lt;P&gt;If the result of the comparison is positive, the system field SY-FDPOS contains the length of c1. &lt;/P&gt;&lt;P&gt;The comparison is case-sensitive. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Examples: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'ABCDE' CO 'XYZ' is false; SY-FDPOS = 0. &lt;/P&gt;&lt;P&gt;'ABCDE' CO 'AB' is false; SY-FDPOS = 2. &lt;/P&gt;&lt;P&gt;'ABCDE' CO 'ABCDE' is true; SY-FDPOS = 5. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CN (Contains Not only): &lt;/P&gt;&lt;P&gt;"c1 CN c2" is equivalent to " NOT ( c1 CO c2 )". &lt;/P&gt;&lt;P&gt;c1 contains not only characters from c2. &lt;/P&gt;&lt;P&gt;If the result of the comparison is positive, the system field SY-FDPOS contains the offset of the first character in c1 which is not also in c2. &lt;/P&gt;&lt;P&gt;If the result of the comparison is negative, the system field SY-FDPOS contains the length of c1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logic will be executed for all tcodes. It will not execute if tcode contains 'VL02*'. &lt;SPAN __jive_emoticon_name="confused"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Mar 2010 16:50:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-string-syntax-quot-cn-quot/m-p/6757293#M1461080</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-31T16:50:31Z</dc:date>
    </item>
    <item>
      <title>Re: Code with string syntax "cn"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-string-syntax-quot-cn-quot/m-p/6757294#M1461081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your developer is initially checking transaction code. if the transaction code either VL02 or VL02N then he is proceeding to check the weights.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first checking the sales order in header and item level. if it is equal then &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;he is checking volume(GEWEI). if it is empty and checking net weight(NTGEW) and gross weight(BRGEW). if any of weights is not empty then he is displaying the error message stating that "Unit of Measure is missing".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: subas  Bose on Mar 31, 2010 6:56 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Mar 2010 16:55:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-string-syntax-quot-cn-quot/m-p/6757294#M1461081</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-31T16:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Code with string syntax "cn"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-string-syntax-quot-cn-quot/m-p/6757295#M1461082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Subas,&lt;/P&gt;&lt;P&gt;  Its a hard value 'VL02*'. If the developer wanted to execute the logic for VL02 or VL02N, he should have used "CS" instead of CN. Isn't it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-tcode CS 'VL02'.&lt;/P&gt;&lt;P&gt;  execute logic.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would execute for both VL02 and VL02N.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Mar 2010 17:02:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-string-syntax-quot-cn-quot/m-p/6757295#M1461082</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-31T17:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Code with string syntax "cn"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-string-syntax-quot-cn-quot/m-p/6757296#M1461083</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The user is aborting the processing if there is some weight (net weight - &lt;STRONG&gt;ntgew&lt;/STRONG&gt; or gross weight - &lt;STRONG&gt;brgew&lt;/STRONG&gt; )&lt;/P&gt;&lt;P&gt;and the unit of measure( &lt;STRONG&gt;gewei&lt;/STRONG&gt; ) is missing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the if condition is for CN(Contains not only).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The correct way to avoid the block for 'VL02' is:&lt;/P&gt;&lt;P&gt;data: lv_tcode type tcode value 'VL02'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if sy-tcode cn lv_tcode.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Chandra Indukuri&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Mar 2010 17:20:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-string-syntax-quot-cn-quot/m-p/6757296#M1461083</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-31T17:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Code with string syntax "cn"</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-string-syntax-quot-cn-quot/m-p/6757297#M1461084</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My main concern was the cn 'VL03*' as I understand the wt and uom parts. However, I do not care what is in sy-tcode, everything will validate past that, it was, as some of you have said, I believe coded incorrectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Thanks, Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Mar 2010 19:19:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-with-string-syntax-quot-cn-quot/m-p/6757297#M1461084</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-31T19:19:23Z</dc:date>
    </item>
  </channel>
</rss>

