<?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: Methods in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/methods/m-p/2750189#M639560</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;Just one idea:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why don't u create 2 reports? The first one (the one that collects information from selection screen) creates another report that selects and outputs the selection, and then call the new report (with submit statement)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can allways delete (on the first report) the new report (2nd one)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works, but is it worth the effort?&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;Carlos Constantino&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Aug 2007 10:03:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-31T10:03:05Z</dc:date>
    <item>
      <title>Methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/methods/m-p/2750185#M639556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;      I have written a method which will ask the values in the runtime and it will work as per the values..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a query is there like---&lt;/P&gt;&lt;P&gt;SELECT * from ekko into table itab where ebeln = 3000000004.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I will give the table name ,internal table name and the value in the selectiuon screen..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to put the that values in the query like]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * from &amp;lt;Tablename&amp;gt; into &amp;lt;Int table&amp;gt; where ebeln = &amp;lt;Value name&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2007 06:36:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/methods/m-p/2750185#M639556</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-31T06:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/methods/m-p/2750186#M639557</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;You have to use a dynamic select in this case:&lt;/P&gt;&lt;P&gt;Try the Code below.. you will get the Solution&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  ZSEL_BGJOB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: L_TABNAME TYPE DD02L-TABNAME VALUE 'EKPO'.&lt;/P&gt;&lt;P&gt;DATA : REF_TAB TYPE REF TO DATA.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;FTAB&amp;gt; TYPE TABLE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**Create the ITAB dynamically and Assign to Field symbol&lt;/P&gt;&lt;P&gt;CREATE DATA REF_TAB TYPE TABLE OF (L_TABNAME).&lt;/P&gt;&lt;P&gt;ASSIGN REF_TAB-&amp;gt;* TO &amp;lt;FTAB&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**Construct the Select statement dynamically..&lt;/P&gt;&lt;P&gt;SELECT * FROM (L_TABNAME) INTO TABLE  &amp;lt;FTAB&amp;gt;.&lt;/P&gt;&lt;P&gt;DESCRIBE TABLE &amp;lt;FTAB&amp;gt;.&lt;/P&gt;&lt;P&gt;WRITE:/ SY-TFILL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward if Helpful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2007 06:45:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/methods/m-p/2750186#M639557</guid>
      <dc:creator>varma_narayana</dc:creator>
      <dc:date>2007-08-31T06:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/methods/m-p/2750187#M639558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Mahesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its not at all possible. Why because, control will consider the word after &amp;lt;b&amp;gt;from&amp;lt;/b&amp;gt; as a table name. and with that table name it will search in datadictionary. So you have to pass only valid table names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can not give table name dynamically for select statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward If Useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;--&lt;/P&gt;&lt;P&gt;Sasidhar Reddy Matli.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2007 06:49:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/methods/m-p/2750187#M639558</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-31T06:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/methods/m-p/2750188#M639559</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If we give an internal table of only having two fields of the table means how we cn procees to it&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2007 07:56:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/methods/m-p/2750188#M639559</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-31T07:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/methods/m-p/2750189#M639560</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;Just one idea:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why don't u create 2 reports? The first one (the one that collects information from selection screen) creates another report that selects and outputs the selection, and then call the new report (with submit statement)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can allways delete (on the first report) the new report (2nd one)...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It works, but is it worth the effort?&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;Carlos Constantino&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2007 10:03:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/methods/m-p/2750189#M639560</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-31T10:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Methods</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/methods/m-p/2750190#M639561</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;amp;---------------------------------------------------------------------*
*&amp;amp; Report  ZCAC_TRETA_DYN_SELECT                                       *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;                                                                     *
*&amp;amp;                                                                     *
*&amp;amp;---------------------------------------------------------------------*

REPORT  ZCAC_TRETA_DYN_SELECT         .

SELECTION-SCREEN BEGIN OF BLOCK B1.
  PARAMETER P_TABLE TYPE CHAR32 DEFAULT 'SFLIGHT'.
SELECTION-SCREEN END OF BLOCK B1.

DATA: G_LINE TYPE CHAR255,
      GT_REPORT TYPE STANDARD TABLE OF CHAR255,
      G_FIELD TYPE STRING.

  CONCATENATE 'gt_' P_TABLE INTO G_FIELD.

*create new report:
  MOVE 'REPORT TRETA.' TO G_LINE.
  APPEND G_LINE TO GT_REPORT.
  CLEAR G_LINE.
  CONCATENATE 'Data:' G_FIELD
              ' type standard table of ' P_TABLE
              ' with header line.' INTO G_LINE SEPARATED BY SPACE.
  APPEND G_LINE TO GT_REPORT.
  CLEAR G_LINE.
  CONCATENATE 'select * from ' P_TABLE ' into table' G_FIELD '.'
              INTO G_LINE SEPARATED BY SPACE.
  APPEND G_LINE TO GT_REPORT.
  CLEAR G_LINE.
  CONCATENATE 'loop at' G_FIELD '.' INTO G_LINE SEPARATED BY SPACE.
  APPEND G_LINE TO GT_REPORT.
  CLEAR G_LINE.
  CONCATENATE 'write:/,' G_FIELD'.' INTO G_LINE SEPARATED BY SPACE.
  APPEND G_LINE TO GT_REPORT.
  CLEAR G_LINE.
  MOVE 'endloop.' TO G_LINE.
  APPEND G_LINE TO GT_REPORT.

  INSERT REPORT 'ZCAC_TRETA_DYN_TRETA' FROM GT_REPORT.
  SUBMIT ZCAC_TRETA_DYN_TRETA.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Aug 2007 10:37:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/methods/m-p/2750190#M639561</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-31T10:37:06Z</dc:date>
    </item>
  </channel>
</rss>

