<?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: Syntax for Remote select stmt? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-remote-select-stmt/m-p/1610725#M273804</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can be more clear on your requirement "Remote Select Stmt"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe your option would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;1. Create an RFC with 
   Import Parameters: Mat. Doc, Mat Doc Year.
   Export Parameter: Transaction Code/ Return

2. Source Code:

   select single tcode2 into out_tcode2
          from mkpf 
          where mblnr = in_mblnr
          and   mjahr = in_mjahr.
   if sy-subrc ne 0.
      move: 'Unable to retreive details for material document' to return.     
   endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 06 Oct 2006 01:05:49 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-10-06T01:05:49Z</dc:date>
    <item>
      <title>Syntax for Remote select stmt?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-remote-select-stmt/m-p/1610723#M273802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;   How to write a remote select statement.?&lt;/P&gt;&lt;P&gt;       I have to write remote slect stmt and get the details from MKPF table based on Material document number and year ,which  should return TCODE2 data.&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Gopi.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 01:01:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-remote-select-stmt/m-p/1610723#M273802</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T01:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for Remote select stmt?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-remote-select-stmt/m-p/1610724#M273803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gopi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to create a RFC ( Remote Function Call ) which would fetch the data and return the parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Goto SE80. Create a function group.&lt;/P&gt;&lt;P&gt;Goto SE37. Create a Function Module and in the Attributes TAB, tick Remote Function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Import Tab, mention MBLNR&lt;/P&gt;&lt;P&gt;MJAHR&lt;/P&gt;&lt;P&gt;In the Export tab, mention TCODE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Write a select query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT TCODE&lt;/P&gt;&lt;P&gt;       from MKPF&lt;/P&gt;&lt;P&gt;       into TCODE&lt;/P&gt;&lt;P&gt;       where MBLNR = MBLNR&lt;/P&gt;&lt;P&gt;              MJAHR = MJAHR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Activate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls. mark points for helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 01:05:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-remote-select-stmt/m-p/1610724#M273803</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T01:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for Remote select stmt?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-remote-select-stmt/m-p/1610725#M273804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can be more clear on your requirement "Remote Select Stmt"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe your option would be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;1. Create an RFC with 
   Import Parameters: Mat. Doc, Mat Doc Year.
   Export Parameter: Transaction Code/ Return

2. Source Code:

   select single tcode2 into out_tcode2
          from mkpf 
          where mblnr = in_mblnr
          and   mjahr = in_mjahr.
   if sy-subrc ne 0.
      move: 'Unable to retreive details for material document' to return.     
   endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 01:05:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-remote-select-stmt/m-p/1610725#M273804</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-10-06T01:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for Remote select stmt?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-remote-select-stmt/m-p/1610726#M273805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;"Remote" select statement?  Do you mean getting the data from a remote system?  If so you can use the function module RFC_READ_TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REgards,&lt;/P&gt;&lt;P&gt;RIch Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 01:06:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-remote-select-stmt/m-p/1610726#M273805</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-10-06T01:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for Remote select stmt?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-remote-select-stmt/m-p/1610727#M273806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For example, this code works pretty good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

report zrich_0001.

data: iopt type table of rfc_db_opt with header line.
data: ifld type table of rfc_db_fld with header line.
data: idat type table of tab512 with header line.

parameters: p_mblnr type mkpf-mblnr,
            p_mjahr type mkpf-mjahr.

* Where clause
concatenate 'MBLNR = ' p_mblnr '.' into iopt-text separated by space.
append iopt .
concatenate 'and MJAHR = ' p_mjahr '.'
        into iopt-text separated by space.
append iopt .

* Return Fields
ifld-fieldname = 'TCODE2'. append ifld.

call function 'RFC_READ_TABLE'
 destination 'PRD'      "  &amp;lt;---- Your RFC Destination
  exporting
    query_table                = 'MKPF'
    delimiter                  = ','
*   NO_DATA                    = ' '
*   ROWSKIPS                   = 0
*   ROWCOUNT                   = 0
  tables
    options                    = iopt
    fields                     = ifld
    data                       = idat
 exceptions
   table_not_available        = 1
   table_without_data         = 2
   option_not_valid           = 3
   field_not_valid            = 4
   not_authorized             = 5
   data_buffer_exceeded       = 6
   others                     = 7.

* Write return data.
loop at idat.
  write:/ idat.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No need to create a custom RFC.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 01:21:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-remote-select-stmt/m-p/1610727#M273806</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-10-06T01:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: Syntax for Remote select stmt?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-remote-select-stmt/m-p/1610728#M273807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Gopi, did this solve your problem?  Please make sure to award points for helpful answers and mark as solved when solved completely.  Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Oct 2006 12:51:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/syntax-for-remote-select-stmt/m-p/1610728#M273807</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-10-06T12:51:45Z</dc:date>
    </item>
  </channel>
</rss>

