<?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 that accepts a  SQL query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-that-accepts-a-sql-query/m-p/4926739#M1149355</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just copy this program check the working through debuging and you will be able to resolve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:v_fieldname&lt;/P&gt;&lt;P&gt;TYPE fieldname,&lt;/P&gt;&lt;P&gt;l_PROG TYPE string,&lt;/P&gt;&lt;P&gt;v_mess TYPE string,&lt;/P&gt;&lt;P&gt;l_sid TYPE string,&lt;/P&gt;&lt;P&gt;wa_ddfields TYPE dntab.&lt;/P&gt;&lt;P&gt;DATA i_tab TYPE STANDARD TABLE OF string.&lt;/P&gt;&lt;P&gt;DATA:l_str TYPE string,&lt;/P&gt;&lt;P&gt;l_str1 TYPE string.&lt;/P&gt;&lt;P&gt;PARAMETERS matnr type marc-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end-of-SELECTION.&lt;/P&gt;&lt;P&gt;*build the subroutine pool&lt;/P&gt;&lt;P&gt;APPEND 'PROGRAM subpool.' TO i_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND `LOAD-OF-PROGRAM.` TO i_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND `DATA i_tab1 TYPE TABLE OF vbak.`      TO i_tab.&lt;/P&gt;&lt;P&gt;APPEND `DATA l_rows TYPE i.`      TO i_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND `select * into table i_tab1 from vbak.` To i_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append 'DESCRIBE TABLE i_tab1 LINES l_rows.' to i_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append 'Write :  l_rows .' to i_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GENERATE SUBROUTINE POOL i_tab NAME l_PROG&lt;/P&gt;&lt;P&gt;MESSAGE v_mess&lt;/P&gt;&lt;P&gt;SHORTDUMP-ID l_sid.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;PERFORM ('LOOP_AT_TAB') IN PROGRAM (l_PROG) IF FOUND.&lt;/P&gt;&lt;P&gt;ELSEIF sy-subrc = 4.&lt;/P&gt;&lt;P&gt;MESSAGE v_mess TYPE 'I'.&lt;/P&gt;&lt;P&gt;ELSEIF sy-subrc = 8.&lt;/P&gt;&lt;P&gt;MESSAGE l_sid TYPE 'I'.&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;I guess this will resolve your question.if you want more help i will be there&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 01 Jan 2009 17:05:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-01-01T17:05:28Z</dc:date>
    <item>
      <title>Function module that accepts a  SQL query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-that-accepts-a-sql-query/m-p/4926734#M1149350</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;   I would like to know if there is a FM to which I can pass a query string which it can execute and show the results. &lt;/P&gt;&lt;P&gt;The requirement is that I need to execute queries on a set of tables such as KNA1, ARDC, etc (depending on the user's choice and hence is decided at runtime) and extract values based on the join conditions. So is there a module to which I can pass the query string? if not, has anyone written a similar ABAP program which does the same? Can you please share the code if possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, which T code can i use to perform joins on tables and view data(to verify the result of the code)?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2008 11:06:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-that-accepts-a-sql-query/m-p/4926734#M1149350</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-11T11:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Function module that accepts a  SQL query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-that-accepts-a-sql-query/m-p/4926735#M1149351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Function module: RFC_READ_TABLE&lt;/P&gt;&lt;P&gt;Transaction SQVi (query viewer to create joins).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2008 12:07:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-that-accepts-a-sql-query/m-p/4926735#M1149351</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2008-12-11T12:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: Function module that accepts a  SQL query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-that-accepts-a-sql-query/m-p/4926736#M1149352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Micky,&lt;/P&gt;&lt;P&gt;   Thanks for the pointer wrt SQVi. However, i also need an RFC that can accept entire query as an input. Since RFC_READ_TABLE works on only one table, this will not help me. I need to perform joins on many tables, depending on the users input. Is there an RFC which can do this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Dec 2008 13:12:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-that-accepts-a-sql-query/m-p/4926736#M1149352</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-11T13:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Function module that accepts a  SQL query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-that-accepts-a-sql-query/m-p/4926737#M1149353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Monica,&lt;/P&gt;&lt;P&gt;Check the follwing FM:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TH_SERVER_LIST u2013 List of RFC servers&lt;/P&gt;&lt;P&gt;CAT_CHECK_RFC_DESTINATION u2013 Checks the RFC destinations and connections&lt;/P&gt;&lt;P&gt;CAT_PING u2013 Checks RFC system and configuration&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kanika&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Dec 2008 04:05:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-that-accepts-a-sql-query/m-p/4926737#M1149353</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-12T04:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: Function module that accepts a  SQL query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-that-accepts-a-sql-query/m-p/4926738#M1149354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kanika,&lt;/P&gt;&lt;P&gt;  Perhaps i used the wrong term . what i wnat is an ABAP progam or a BAPI that accepts a SQL query (that works on table )as an input and returns the result. Is this available?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Dec 2008 05:28:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-that-accepts-a-sql-query/m-p/4926738#M1149354</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-16T05:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: Function module that accepts a  SQL query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-that-accepts-a-sql-query/m-p/4926739#M1149355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just copy this program check the working through debuging and you will be able to resolve your problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:v_fieldname&lt;/P&gt;&lt;P&gt;TYPE fieldname,&lt;/P&gt;&lt;P&gt;l_PROG TYPE string,&lt;/P&gt;&lt;P&gt;v_mess TYPE string,&lt;/P&gt;&lt;P&gt;l_sid TYPE string,&lt;/P&gt;&lt;P&gt;wa_ddfields TYPE dntab.&lt;/P&gt;&lt;P&gt;DATA i_tab TYPE STANDARD TABLE OF string.&lt;/P&gt;&lt;P&gt;DATA:l_str TYPE string,&lt;/P&gt;&lt;P&gt;l_str1 TYPE string.&lt;/P&gt;&lt;P&gt;PARAMETERS matnr type marc-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;end-of-SELECTION.&lt;/P&gt;&lt;P&gt;*build the subroutine pool&lt;/P&gt;&lt;P&gt;APPEND 'PROGRAM subpool.' TO i_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND `LOAD-OF-PROGRAM.` TO i_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND `DATA i_tab1 TYPE TABLE OF vbak.`      TO i_tab.&lt;/P&gt;&lt;P&gt;APPEND `DATA l_rows TYPE i.`      TO i_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND `select * into table i_tab1 from vbak.` To i_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append 'DESCRIBE TABLE i_tab1 LINES l_rows.' to i_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append 'Write :  l_rows .' to i_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;GENERATE SUBROUTINE POOL i_tab NAME l_PROG&lt;/P&gt;&lt;P&gt;MESSAGE v_mess&lt;/P&gt;&lt;P&gt;SHORTDUMP-ID l_sid.&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;PERFORM ('LOOP_AT_TAB') IN PROGRAM (l_PROG) IF FOUND.&lt;/P&gt;&lt;P&gt;ELSEIF sy-subrc = 4.&lt;/P&gt;&lt;P&gt;MESSAGE v_mess TYPE 'I'.&lt;/P&gt;&lt;P&gt;ELSEIF sy-subrc = 8.&lt;/P&gt;&lt;P&gt;MESSAGE l_sid TYPE 'I'.&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;I guess this will resolve your question.if you want more help i will be there&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jan 2009 17:05:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/function-module-that-accepts-a-sql-query/m-p/4926739#M1149355</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-01-01T17:05:28Z</dc:date>
    </item>
  </channel>
</rss>

