<?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 Function Module Problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-problem/m-p/8335052#M1638541</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a  question to ask.&lt;/P&gt;&lt;P&gt;Have declared an internal table as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;types:tt_gps type table of ukv_gps with key ebeln.
data: gt_gps type tt_gps,
      gs_gps like line of gt_gps.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The Ebeln field is filled with values say 10 numbers.Now I want to use a select statement to put the corresponding Lieferant values into the itab gt_gps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;function zgps_read.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  TABLES
*"      GPS_TAB STRUCTURE  /BMW/UKV_GPS
*"  EXCEPTIONS
*"      SYSTEM_FAILURE
*"      COMMUNICATION_FAILURE
*"      NO_DATA
*"----------------------------------------------------------------------

  select /bmw/ukv_gps~llief into corresponding fields of table gps_tab  from /bmw/ukv_gps for all entries in
   gps_tab where ebeln = gps_tab-ebeln.
  if sy-subrc &amp;lt;&amp;gt; 0.
    message 'Nicht gefunden' type 'I' raising no_data.
    exit.
  endif.

endfunction.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Iam using in the FB,the same gps_tab as input and also filling the same gps_tab accordingly.&lt;/P&gt;&lt;P&gt;Thats not working properly.The gps_tab is getting filled with more than the needed values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Dec 2011 14:47:07 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2011-12-05T14:47:07Z</dc:date>
    <item>
      <title>Function Module Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-problem/m-p/8335052#M1638541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a  question to ask.&lt;/P&gt;&lt;P&gt;Have declared an internal table as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;types:tt_gps type table of ukv_gps with key ebeln.
data: gt_gps type tt_gps,
      gs_gps like line of gt_gps.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The Ebeln field is filled with values say 10 numbers.Now I want to use a select statement to put the corresponding Lieferant values into the itab gt_gps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;function zgps_read.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*"  TABLES
*"      GPS_TAB STRUCTURE  /BMW/UKV_GPS
*"  EXCEPTIONS
*"      SYSTEM_FAILURE
*"      COMMUNICATION_FAILURE
*"      NO_DATA
*"----------------------------------------------------------------------

  select /bmw/ukv_gps~llief into corresponding fields of table gps_tab  from /bmw/ukv_gps for all entries in
   gps_tab where ebeln = gps_tab-ebeln.
  if sy-subrc &amp;lt;&amp;gt; 0.
    message 'Nicht gefunden' type 'I' raising no_data.
    exit.
  endif.

endfunction.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Iam using in the FB,the same gps_tab as input and also filling the same gps_tab accordingly.&lt;/P&gt;&lt;P&gt;Thats not working properly.The gps_tab is getting filled with more than the needed values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 14:47:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-problem/m-p/8335052#M1638541</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-05T14:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-problem/m-p/8335053#M1638542</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you couldl try something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function zgps_read.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Lokale Schnittstelle:&lt;/P&gt;&lt;P&gt;*"  TABLES&lt;/P&gt;&lt;P&gt;*"      GPS_TAB STRUCTURE  /BMW/UKV_GPS&lt;/P&gt;&lt;P&gt;*"  EXCEPTIONS&lt;/P&gt;&lt;P&gt;*"      SYSTEM_FAILURE&lt;/P&gt;&lt;P&gt;*"      COMMUNICATION_FAILURE&lt;/P&gt;&lt;P&gt;*"      NO_DATA&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;field-symbols &amp;lt;lfs_g&amp;gt; type /bmw/ukv_gps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at gps_tab assigning &amp;lt;lfs_g&amp;gt;.&lt;/P&gt;&lt;P&gt;if &amp;lt;lfs_g&amp;gt; is assigned.&lt;/P&gt;&lt;P&gt;  select llief into &amp;lt;lfs_g&amp;gt;-llief up to 1 rows  "can select single instead?&lt;/P&gt;&lt;P&gt;    from  /bmw/ukv_gps &lt;/P&gt;&lt;P&gt;where vbeln eq &amp;lt;lfs_g&amp;gt;-vbeln.&lt;/P&gt;&lt;P&gt;endselect.   "if can't do a select single (what is primary key?)&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;at this point, gps_tab now contains the 2nd field for all VBELN entries that were found in the db table.  &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;endfunction.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 15:05:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-problem/m-p/8335053#M1638542</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-05T15:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-problem/m-p/8335054#M1638543</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think you can use the "FOR ALL ENTRIES IN" and "INTO CORRESPONDING FIELD OF TABLE" clauses on the same internal table gps_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try using different internal table for the INTO clause of the same type as gps_tab&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 15:07:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-problem/m-p/8335054#M1638543</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-12-05T15:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Function Module Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-problem/m-p/8335055#M1638544</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 to build a range-table and than modify during loop with field-symbols:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

FIELD-SYMBOLS:
  &amp;lt;line&amp;gt;         TYPE /bmw/ukv_gps,
  &amp;lt;gps_line&amp;gt;  TYPE /bmw/ukv_gps.
DATA:
  lt_table  TYPE tt_gps,
  lrt_range TYPE RANGE OF ebeln.
  lr_range  LIKE LINE OF lrt_range.

lr_range-sign = 'I'.
lr_range-option = 'EQ'.
LOOP AT gps_tab ASSIGNING &amp;lt;gps_line&amp;gt;
  lr_range-low = &amp;lt;gps_line&amp;gt;-ebeln.
  append lr_range TO lrt_range.
ENDLOOP.

SELECT llief ebeln INTO CORRESPONDING FIELDS OF lt_table
  FROM /bmw/ukv_gps
 WHERE ebeln IN lrt_range.
IF sy-subrc &amp;lt;&amp;gt; 0.
  LOOP AT lt_table ASSIGNING &amp;lt;line&amp;gt;.
     READ TABLE gps_tab ASSIGNING &amp;lt;gps_line&amp;gt;
       WITH KEY ebeln = &amp;lt;line&amp;gt;-ebeln.
     if SY-subrc = 0.
* Modify directly the value in tab gps_tab
       &amp;lt;gps_line&amp;gt;-llief = &amp;lt;line&amp;gt;-llief.
     ENDIF:
  ENDLOOP.
ENDIF.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Hendrik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Dec 2011 16:01:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-problem/m-p/8335055#M1638544</guid>
      <dc:creator>hendrik_brandes</dc:creator>
      <dc:date>2011-12-05T16:01:36Z</dc:date>
    </item>
  </channel>
</rss>

