<?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: Accepting Dynamic  Values in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/accepting-dynamic-values/m-p/4271602#M1019233</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;Select the data from the Db table inot an internal table and Assign the Internal table to ALV list Function Module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use Query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * from &amp;lt;DBtable&amp;gt;&lt;/P&gt;&lt;P&gt;into table &amp;lt;itab&amp;gt;&lt;/P&gt;&lt;P&gt;where &amp;lt;field &amp;gt; EQ &amp;lt;p_val&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This Query will store Data in the Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sumit Agarwal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 02 Aug 2008 04:41:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-02T04:41:17Z</dc:date>
    <item>
      <title>Accepting Dynamic  Values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/accepting-dynamic-values/m-p/4271601#M1019232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hai! Experts!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to get a data from table based on the users choice (for this i have a created a parameter on selection screen) and i want to display the table contents on the list....how to do it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Aug 2008 04:24:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/accepting-dynamic-values/m-p/4271601#M1019232</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-02T04:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Accepting Dynamic  Values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/accepting-dynamic-values/m-p/4271602#M1019233</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;Select the data from the Db table inot an internal table and Assign the Internal table to ALV list Function Module.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use Query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * from &amp;lt;DBtable&amp;gt;&lt;/P&gt;&lt;P&gt;into table &amp;lt;itab&amp;gt;&lt;/P&gt;&lt;P&gt;where &amp;lt;field &amp;gt; EQ &amp;lt;p_val&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This Query will store Data in the Internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sumit Agarwal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Aug 2008 04:41:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/accepting-dynamic-values/m-p/4271602#M1019233</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-02T04:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Accepting Dynamic  Values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/accepting-dynamic-values/m-p/4271603#M1019234</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;For fetching data from Dynamic database table and disply it into list you can use field -symbol concept.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Refer the link for the ceoncept-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/ab030.htm" target="test_blank"&gt;http://www.sap-img.com/ab030.htm&lt;/A&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;Sujit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Aug 2008 04:54:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/accepting-dynamic-values/m-p/4271603#M1019234</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-02T04:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: Accepting Dynamic  Values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/accepting-dynamic-values/m-p/4271604#M1019235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;refer to the link for sample code on dynamic table selection:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sap-img.com/abap/how-can-we-give-dynamic-table-name-in-select-statement.htm" target="test_blank"&gt;http://www.sap-img.com/abap/how-can-we-give-dynamic-table-name-in-select-statement.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With luck,&lt;/P&gt;&lt;P&gt;Pritam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Aug 2008 05:14:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/accepting-dynamic-values/m-p/4271604#M1019235</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-02T05:14:58Z</dc:date>
    </item>
    <item>
      <title>Re: Accepting Dynamic  Values</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/accepting-dynamic-values/m-p/4271605#M1019236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1.First Get the components from the table(fields)&lt;/P&gt;&lt;P&gt;2.Create the fieldcatalog &lt;/P&gt;&lt;P&gt;3.Create the Dynamic Table using the CL_ALV_TABLE_CREATE&lt;/P&gt;&lt;P&gt;4. Now use the select&lt;/P&gt;&lt;P&gt;5. Display the data&lt;/P&gt;&lt;P&gt;Check the sample code.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  ytest_dynamic.

TYPE-POOLS : abap.
DATA : table_des TYPE REF TO cl_abap_structdescr.
DATA : ifields TYPE abap_compdescr_tab,
          wa_field LIKE LINE OF ifields.
DATA: it_fieldcat TYPE lvc_t_fcat,
          wa_fieldcat TYPE lvc_s_fcat.
DATA: i_tab TYPE REF TO data.

FIELD-SYMBOLS: &amp;lt;fs&amp;gt; TYPE STANDARD TABLE.

PARAMETERS: p_table(30) TYPE c DEFAULT 'SFLIGHT'.


"Table definiton using the table name
table_des ?= cl_abap_typedescr=&amp;gt;describe_by_name( p_table ).
"Now Read all the fields to a table.
ifields = table_des-&amp;gt;components.


LOOP AT ifields INTO wa_field.
  CLEAR wa_fieldcat.
  wa_fieldcat-fieldname = wa_field-name .
  wa_fieldcat-datatype = wa_field-type_kind.
  wa_fieldcat-inttype = wa_field-type_kind.
  wa_fieldcat-intlen = wa_field-length.
  wa_fieldcat-decimals = wa_field-decimals.
  wa_fieldcat-coltext = wa_field-name.
  wa_fieldcat-outputlen = wa_field-length.

  APPEND  wa_fieldcat TO it_fieldcat.
ENDLOOP.

CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
  EXPORTING
    it_fieldcatalog           = it_fieldcat
  IMPORTING
    ep_table                  = i_tab
*    e_style_fname             =
  EXCEPTIONS
    generate_subpool_dir_full = 1
    OTHERS                    = 2
        .
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

ASSIGN i_tab-&amp;gt;* TO &amp;lt;fs&amp;gt;.

*-fill the data
APPEND INITIAL LINE TO &amp;lt;fs&amp;gt;.

SELECT  *
INTO TABLE &amp;lt;fs&amp;gt;
FROM (p_table)
UP TO 20 ROWS.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
  EXPORTING
    i_callback_program = sy-repid
    it_fieldcat_lvc    = it_fieldcat
  TABLES
    t_outtab           = &amp;lt;fs&amp;gt;
  EXCEPTIONS
    program_error      = 1
    OTHERS             = 2.
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Aug 2008 05:25:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/accepting-dynamic-values/m-p/4271605#M1019236</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-02T05:25:20Z</dc:date>
    </item>
  </channel>
</rss>

