<?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: problem in Function Module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142172#M1367124</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Venkat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to let you know, SAP has decided to put RANGES in its list of Obsolete Declarations. (Further details through SAP F1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refrain from using (as well as advising to use) RANGES declaration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 Sep 2009 11:54:46 GMT</pubDate>
    <dc:creator>SuhaSaha</dc:creator>
    <dc:date>2009-09-04T11:54:46Z</dc:date>
    <item>
      <title>problem in Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142162#M1367114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear abapers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have created a function module. it works fine when i give all the inputs. but if any of the input field ( Parameter) is left blank, rather than selecting all the data related to that field it shows zero entries. please tell what is wrong with it? and how can it be fixed??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance...&lt;/P&gt;&lt;P&gt;Luthra, Deep.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2009 10:01:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142162#M1367114</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-04T10:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: problem in Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142163#M1367115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is the major difference between parameters and select options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If left blank, sy-subrc will be 4 for  parameters, so no entries wil return&lt;/P&gt;&lt;P&gt;whereas for select options sy-subrc will be 0, it wil take all entries for that field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In case of function modules you should always check the condition before your select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If matnr is not initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;.........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2009 10:04:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142163#M1367115</guid>
      <dc:creator>GauthamV</dc:creator>
      <dc:date>2009-09-04T10:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: problem in Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142164#M1367116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Deep,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM &amp;lt;table&amp;gt; INTO TABLE &amp;lt;int. table&amp;gt; WHERE field = param&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you use '=' operator in WHERE clause, it searches for the entires with &lt;STRONG&gt;field = space(or blank)&lt;/STRONG&gt;. This is why your select is failing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope you understand &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&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, 04 Sep 2009 10:05:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142164#M1367116</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-09-04T10:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: problem in Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142165#M1367117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes i agree with that.... but how can i fix that.... is there any way that it takes blank as 'ALL"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2009 10:09:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142165#M1367117</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-04T10:09:32Z</dc:date>
    </item>
    <item>
      <title>Re: problem in Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142166#M1367118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want it that way, then transfer the parameter to a SELECT-OPTION &amp;amp; proceed with SELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA:
R_SELOPT TYPE STANDARD TABLE OF SELOPT,
ST_SELOPT TYPE SELOPT.

ST_SELOPT-SIGN = 'I'.
ST_SELOPT-OPTION = 'EQ'.
ST_SELOPT-LOW = PARAM. "Your Input Param

APPEND ST_SELOPT TO R_SELOPT.
CLEAR ST_SELOPT.

SELECT * FROM &amp;lt;TABLE&amp;gt; INTO TABLE &amp;lt;INT. TABLE&amp;gt;
WHERE FIELD IN R_SELOPT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will solve your problem &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;)&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, 04 Sep 2009 10:17:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142166#M1367118</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-09-04T10:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: problem in Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142167#M1367119</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;Try this way:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if para1 is initial.
para1 = '%' .
endif.

and select query in this way:

select &amp;lt;field&amp;gt; from &amp;lt;dbtable&amp;gt;
INTO TABLE &amp;lt;internal table&amp;gt;
WHERE field1 like para1.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Swarna Munukoti.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Swarna Munukoti on Sep 4, 2009 12:21 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2009 10:18:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142167#M1367119</guid>
      <dc:creator>former_member217544</dc:creator>
      <dc:date>2009-09-04T10:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: problem in Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142168#M1367120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should add a condition in the code of Suhas:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
IF NOT PARAM IS INITIAL.
  ST_SELOPT-SIGN = 'I'.
  ST_SELOPT-OPTION = 'EQ'.
  ST_SELOPT-LOW = PARAM. "Your Input Param
 
  APPEND ST_SELOPT TO R_SELOPT.
  CLEAR ST_SELOPT.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When PARAM is initial, R_SELOPT must remain empty for selecting ALL.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2009 10:21:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142168#M1367120</guid>
      <dc:creator>former_member194797</dc:creator>
      <dc:date>2009-09-04T10:21:34Z</dc:date>
    </item>
    <item>
      <title>Re: problem in Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142169#M1367121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Henri,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do we need the condition, can you please explain?&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, 04 Sep 2009 10:24:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142169#M1367121</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-09-04T10:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: problem in Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142170#M1367122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Without the condition, in case of empty param, you will fill the range wit 'I', 'EQ', and SPACE. The select will search for a value = SPACE and it is not what you are waiting. With an empty range, the SELECT will take all entries in the table, and that is what you ask. So, in case of PARAM = SPACE, you must let the range empty.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2009 10:30:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142170#M1367122</guid>
      <dc:creator>former_member194797</dc:creator>
      <dc:date>2009-09-04T10:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: problem in Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142171#M1367123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __default_attr="blue" __jive_macro_name="color"&gt;Deep, 
&amp;lt;li&amp;gt; Use ranges concept in the function module. It is same as SELECT-OPTIONS. 
&amp;lt;li&amp;gt; You need to build ranges table like select-options table.
Try this way.
&lt;PRE&gt;&lt;CODE&gt;REPORT ztest_program.

DATA: BEGIN OF it_mard OCCURS 0,
        matnr TYPE mard-matnr,
        werks TYPE mard-werks,
        lgort TYPE mard-lgort,
      END OF it_mard.
RANGES: matnr FOR mard-matnr,
        werks FOR mard-werks,
        lgort FOR mard-lgort.

START-OF-SELECTION.
  matnr-low    = '0001-01-002-A'.
  matnr-sign   = 'I'.
  matnr-option = 'EQ'.
  APPEND matnr.

  matnr-low    = 'EEYE'.
  matnr-sign   = 'I'.
  matnr-option = 'EQ'.
  APPEND matnr.

  matnr-low    = 'EYE1'.
  matnr-sign   = 'I'.
  matnr-option = 'EQ'.
  APPEND matnr.

  SELECT *
  FROM mard
  INTO CORRESPONDING FIELDS OF TABLE it_mard
  WHERE matnr IN matnr
    AND werks IN werks
    AND lgort IN lgort.&lt;/CODE&gt;&lt;/PRE&gt;
Thanks
Venkat.O&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2009 10:34:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142171#M1367123</guid>
      <dc:creator>venkat_o</dc:creator>
      <dc:date>2009-09-04T10:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: problem in Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142172#M1367124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Venkat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to let you know, SAP has decided to put RANGES in its list of Obsolete Declarations. (Further details through SAP F1)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please refrain from using (as well as advising to use) RANGES declaration.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2009 11:54:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142172#M1367124</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-09-04T11:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: problem in Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142173#M1367125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;F1 explains that RANGES: must be replace by DATA: ... LIKE RANGE OF ... or DATA: ... TYPE RANGE OF ... , but the solution remains the same with a different notation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Sep 2009 12:23:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/problem-in-function-module/m-p/6142173#M1367125</guid>
      <dc:creator>former_member194797</dc:creator>
      <dc:date>2009-09-04T12:23:55Z</dc:date>
    </item>
  </channel>
</rss>

