<?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: Function module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/3538976#M851426</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check your table vbak (in se16/se11) by giving erdat &lt;/P&gt;&lt;P&gt;as initial (i.e. no values) ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In select you have where condition as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where a~erdat BETWEEN p_stdate AND p_eddate &lt;/P&gt;&lt;P&gt;It is checking if any records exist with erdat = initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERDAT(Date on which the record was created) will not be initial&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Mar 2008 08:54:38 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-13T08:54:38Z</dc:date>
    <item>
      <title>Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/3538974#M851424</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls can you help me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have created function module &lt;/P&gt;&lt;P&gt;import parameters are&lt;/P&gt;&lt;P&gt;p_stdate&lt;/P&gt;&lt;P&gt;p_eddate&lt;/P&gt;&lt;P&gt;p_vbeln&lt;/P&gt;&lt;P&gt;all are optionals&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the select query is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA lr_vbeln TYPE RANGE OF vbak-vbeln.&lt;/P&gt;&lt;P&gt;DATA l_rvbeln LIKE LINE OF lr_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF P_vbeln IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;  l_rvbeln-sign = 'I'.&lt;/P&gt;&lt;P&gt;  l_rvbeln-option = 'EQ'.&lt;/P&gt;&lt;P&gt;  l_rvbeln-low = p_vbeln.&lt;/P&gt;&lt;P&gt;  APPEND l_rvbeln TO lr_vbeln.&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;  select a~vbeln&lt;/P&gt;&lt;P&gt;         a~erdat&lt;/P&gt;&lt;P&gt;         a~auart&lt;/P&gt;&lt;P&gt;         a~vkorg&lt;/P&gt;&lt;P&gt;         a~vtweg&lt;/P&gt;&lt;P&gt;         a~spart&lt;/P&gt;&lt;P&gt;         a~kunnr&lt;/P&gt;&lt;P&gt;         b~posnr&lt;/P&gt;&lt;P&gt;         b~matnr&lt;/P&gt;&lt;P&gt;         b~werks&lt;/P&gt;&lt;P&gt;         b~lgort&lt;/P&gt;&lt;P&gt;         b~kwmeng&lt;/P&gt;&lt;P&gt;         INTO CORRESPONDING FIELDS OF TABLE it_inquiry&lt;/P&gt;&lt;P&gt;         FROM  vbak AS a inner join vbap as b on b&lt;SUB&gt;vbeln = a&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;         where a&lt;SUB&gt;erdat BETWEEN p_stdate AND p_eddate AND A&lt;/SUB&gt;AUART = 'AF' AND a~vbeln IN lr_vbeln .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. when i was giving  start date and enddate , it working fine.&lt;/P&gt;&lt;P&gt;2. with start date , end date and sales order number, its working fine.&lt;/P&gt;&lt;P&gt;3. but i was given only sales order number with out giving start date and end date ,its not working&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;pls can you tell me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;mars&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 08:41:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/3538974#M851424</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-13T08:41:05Z</dc:date>
    </item>
    <item>
      <title>Re: Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/3538975#M851425</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 reason you are not getting data when you dont mention date is because you have used :&lt;/P&gt;&lt;P&gt;where a&lt;SUB&gt;erdat BETWEEN p_stdate AND p_eddate AND A&lt;/SUB&gt;AUART = 'AF' AND a~vbeln etc...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here you should use queries seperately like:&lt;/P&gt;&lt;P&gt;If p_stdate is not initial and p_eddate is not initial.&lt;/P&gt;&lt;P&gt;   then go for as now.&lt;/P&gt;&lt;P&gt;elseif p_stdate is not initial and p_eddate is initial&lt;/P&gt;&lt;P&gt;  then : where a~erdat &amp;gt; p_stdate&lt;/P&gt;&lt;P&gt;elseif p_stdate is initial and p_eddate is not initial&lt;/P&gt;&lt;P&gt;  then : where a~erdat &amp;lt; p_eddate&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;  then : do not include erdat in select query.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please reward if useful,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ramesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Ramesh Jakkula on Mar 13, 2008 9:53 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 08:53:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/3538975#M851425</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-13T08:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/3538976#M851426</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check your table vbak (in se16/se11) by giving erdat &lt;/P&gt;&lt;P&gt;as initial (i.e. no values) ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In select you have where condition as&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where a~erdat BETWEEN p_stdate AND p_eddate &lt;/P&gt;&lt;P&gt;It is checking if any records exist with erdat = initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ERDAT(Date on which the record was created) will not be initial&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 08:54:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/3538976#M851426</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-13T08:54:38Z</dc:date>
    </item>
    <item>
      <title>Re: Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/3538977#M851427</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, &lt;/P&gt;&lt;P&gt;Because when you leave them blank it is only looking for values that are beteen blanks which fetches you no data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;change the query in case the values for the parameter are initial and it would work fine .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Himanshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 08:57:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/3538977#M851427</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-13T08:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Function module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/3538978#M851428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;DATA lr_erdat TYPE RANGE OF vbak-erdat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA lr_vbeln TYPE RANGE OF vbak-vbeln.&lt;/P&gt;&lt;P&gt;DATA l_rvbeln LIKE LINE OF lr_vbeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF P_vbeln IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;l_rvbeln-sign = 'I'.&lt;/P&gt;&lt;P&gt;l_rvbeln-option = 'EQ'.&lt;/P&gt;&lt;P&gt;l_rvbeln-low = p_vbeln.&lt;/P&gt;&lt;P&gt;APPEND l_rvbeln TO lr_vbeln.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;lr_erdat-options = 'EQ'.&lt;/P&gt;&lt;P&gt;lr_erdat-sign = 'I'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not p_stdate is initial.&lt;/P&gt;&lt;P&gt;   lr_erdat-low = p_stdate.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not p_eddate is initial.&lt;/P&gt;&lt;P&gt;   lr_erdat-high = p_eddate.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;append lr_erdat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select a~vbeln&lt;/P&gt;&lt;P&gt;a~erdat&lt;/P&gt;&lt;P&gt;a~auart&lt;/P&gt;&lt;P&gt;a~vkorg&lt;/P&gt;&lt;P&gt;a~vtweg&lt;/P&gt;&lt;P&gt;a~spart&lt;/P&gt;&lt;P&gt;a~kunnr&lt;/P&gt;&lt;P&gt;b~posnr&lt;/P&gt;&lt;P&gt;b~matnr&lt;/P&gt;&lt;P&gt;b~werks&lt;/P&gt;&lt;P&gt;b~lgort&lt;/P&gt;&lt;P&gt;b~kwmeng&lt;/P&gt;&lt;P&gt;INTO CORRESPONDING FIELDS OF TABLE it_inquiry&lt;/P&gt;&lt;P&gt;FROM vbak AS a inner join vbap as b on b&lt;SUB&gt;vbeln = a&lt;/SUB&gt;vbeln&lt;/P&gt;&lt;P&gt;where a~erdat in lr_erdat &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND p_eddate AND A&lt;SUB&gt;AUART = 'AF' AND a&lt;/SUB&gt;vbeln IN lr_vbeln .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Mar 2008 08:58:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module/m-p/3538978#M851428</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-13T08:58:47Z</dc:date>
    </item>
  </channel>
</rss>

