<?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: Variable in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable/m-p/2081128#M431744</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;The statement LIKE 'XXXX%' will give you only the matching records thats been mentioned. i.e. for example if you give the condition LIKE 'QM%' it gives you all the records which starts with QM. In your case if you have given it as LIKE 'yyyymm%' and it will search to get the records which starts with yyyymm. SO you are not getting any output. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope its clear how to use the LIKE statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls reward points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Apr 2007 06:23:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-09T06:23:29Z</dc:date>
    <item>
      <title>Variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable/m-p/2081124#M431740</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Expert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a problem when I try to use a variable with LIKE command at SQL command.&lt;/P&gt;&lt;P&gt;The ABAP source code as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM get_sales_forecast.&lt;/P&gt;&lt;P&gt;  DATA:  yyyymm(6)  TYPE  C.&lt;/P&gt;&lt;P&gt;  yyyymm  =  sy-datum+0(6).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT pbim&lt;SUB&gt;werks pbim&lt;/SUB&gt;matnr pbim&lt;SUB&gt;bedae pbim&lt;/SUB&gt;versb pbim~pbdnr&lt;/P&gt;&lt;P&gt;         pbim&lt;SUB&gt;bdzei pbed&lt;/SUB&gt;pdatu pbed&lt;SUB&gt;plnmg pbed&lt;/SUB&gt;meins&lt;/P&gt;&lt;P&gt;  INTO TABLE t_pbim_ed&lt;/P&gt;&lt;P&gt;  FROM pbim INNER JOIN pbed ON&lt;/P&gt;&lt;P&gt;       pbim&lt;SUB&gt;bdzei  =  pbed&lt;/SUB&gt;bdzei&lt;/P&gt;&lt;P&gt;  FOR ALL ENTRIES IN t_marc&lt;/P&gt;&lt;P&gt;  WHERE pbim~matnr =  t_marc-matnr&lt;/P&gt;&lt;P&gt;    AND pbim~werks =  p_werks&lt;/P&gt;&lt;P&gt;    AND pbim~loevr =  SPACE&lt;/P&gt;&lt;P&gt;    AND pbed~loevr =  SPACE&lt;/P&gt;&lt;P&gt;    AND pbed~pdatu LIKE  'yyyymm%'.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I use a Variable&lt;/P&gt;&lt;P&gt;pbed~pdatu LIKE  'yyyymm%'. give me zero record&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try to use a Literal&lt;/P&gt;&lt;P&gt;pbed~pdatu LIKE  '200704%'. give me some records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anyone please tell me how to use a variable in LIKE command?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Tiwa Noitawee.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2007 06:16:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variable/m-p/2081124#M431740</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-09T06:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: Variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable/m-p/2081125#M431741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TRY LIKE THIS..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : MONYR(6) TYPE C,&lt;/P&gt;&lt;P&gt;           PAT(7).&lt;/P&gt;&lt;P&gt;MONYR = SY-DATUM+0(6).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE MONYR '%' INTO PAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT pbim&lt;SUB&gt;werks pbim&lt;/SUB&gt;matnr pbim&lt;SUB&gt;bedae pbim&lt;/SUB&gt;versb pbim~pbdnr&lt;/P&gt;&lt;P&gt;pbim&lt;SUB&gt;bdzei pbed&lt;/SUB&gt;pdatu pbed&lt;SUB&gt;plnmg pbed&lt;/SUB&gt;meins&lt;/P&gt;&lt;P&gt;INTO TABLE t_pbim_ed&lt;/P&gt;&lt;P&gt;FROM pbim INNER JOIN pbed ON&lt;/P&gt;&lt;P&gt;pbim&lt;SUB&gt;bdzei = pbed&lt;/SUB&gt;bdzei&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN t_marc&lt;/P&gt;&lt;P&gt;WHERE pbim~matnr = t_marc-matnr&lt;/P&gt;&lt;P&gt;AND pbim~werks = p_werks&lt;/P&gt;&lt;P&gt;AND pbim~loevr = SPACE&lt;/P&gt;&lt;P&gt;AND pbed~loevr = SPACE&lt;/P&gt;&lt;P&gt;AND &amp;lt;b&amp;gt;pbed~pdatu LIKE PAT&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REGARDS&lt;/P&gt;&lt;P&gt;SHIBA DUTTA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2007 06:20:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variable/m-p/2081125#M431741</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-09T06:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable/m-p/2081126#M431742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;YYYYMM% it has no meaning , &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so u have&lt;/P&gt;&lt;P&gt;concatenate YYYYMM with % into X.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then call &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;no sytax checks please.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Prabhu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2007 06:21:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variable/m-p/2081126#M431742</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-09T06:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable/m-p/2081127#M431743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do as below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: yyyymm(7) TYPE C.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;concatenate sy-datum+0(6) '%' into yyyymm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT pbim&lt;SUB&gt;werks pbim&lt;/SUB&gt;matnr pbim&lt;SUB&gt;bedae pbim&lt;/SUB&gt;versb pbim~pbdnr&lt;/P&gt;&lt;P&gt;pbim&lt;SUB&gt;bdzei pbed&lt;/SUB&gt;pdatu pbed&lt;SUB&gt;plnmg pbed&lt;/SUB&gt;meins&lt;/P&gt;&lt;P&gt;INTO TABLE t_pbim_ed&lt;/P&gt;&lt;P&gt;FROM pbim INNER JOIN pbed ON&lt;/P&gt;&lt;P&gt;pbim&lt;SUB&gt;bdzei = pbed&lt;/SUB&gt;bdzei&lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN t_marc&lt;/P&gt;&lt;P&gt;WHERE pbim~matnr = t_marc-matnr&lt;/P&gt;&lt;P&gt;AND pbim~werks = p_werks&lt;/P&gt;&lt;P&gt;AND pbim~loevr = SPACE&lt;/P&gt;&lt;P&gt;AND pbed~loevr = SPACE&lt;/P&gt;&lt;P&gt;AND pbed~pdatu LIKE yyyymm.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2007 06:21:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variable/m-p/2081127#M431743</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-09T06:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: Variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable/m-p/2081128#M431744</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;The statement LIKE 'XXXX%' will give you only the matching records thats been mentioned. i.e. for example if you give the condition LIKE 'QM%' it gives you all the records which starts with QM. In your case if you have given it as LIKE 'yyyymm%' and it will search to get the records which starts with yyyymm. SO you are not getting any output. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope its clear how to use the LIKE statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls reward points if helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2007 06:23:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variable/m-p/2081128#M431744</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-09T06:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Variable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/variable/m-p/2081129#M431745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem has already resolved.&lt;/P&gt;&lt;P&gt;Thanks everyone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Tiwa Noitawee&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Apr 2007 07:04:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/variable/m-p/2081129#M431745</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-09T07:04:07Z</dc:date>
    </item>
  </channel>
</rss>

