<?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 how to generate a program dynamically using FM 'RSS_TEMPLATE_INSTANTIATE' in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-generate-a-program-dynamically-using-fm-rss-template-instantiate/m-p/2061937#M426295</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;i am trying to generate a program dynamically using function module 'RSS_TEMPLATE_INSTANTIATE'.&lt;/P&gt;&lt;P&gt;can any one help me by sending simple example code to understand this concept.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Mar 2007 06:38:30 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-12T06:38:30Z</dc:date>
    <item>
      <title>how to generate a program dynamically using FM 'RSS_TEMPLATE_INSTANTIATE'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-generate-a-program-dynamically-using-fm-rss-template-instantiate/m-p/2061937#M426295</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;i am trying to generate a program dynamically using function module 'RSS_TEMPLATE_INSTANTIATE'.&lt;/P&gt;&lt;P&gt;can any one help me by sending simple example code to understand this concept.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Mar 2007 06:38:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-generate-a-program-dynamically-using-fm-rss-template-instantiate/m-p/2061937#M426295</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-12T06:38:30Z</dc:date>
    </item>
    <item>
      <title>Re: how to generate a program dynamically using FM 'RSS_TEMPLATE_INSTANTIATE'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-generate-a-program-dynamically-using-fm-rss-template-instantiate/m-p/2061938#M426296</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;Herewith i am sending the sample dynamic alv report. Kindly go through it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  YMS_DYNAMICALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type-pools: slis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;dyn_table&amp;gt; type standard table,&lt;/P&gt;&lt;P&gt;               &amp;lt;dyn_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: alv_fldcat type slis_t_fieldcat_alv,&lt;/P&gt;&lt;P&gt;      it_fldcat type lvc_t_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin of block b1 with frame title text-001.&lt;/P&gt;&lt;P&gt;parameters: p_flds(5) type c.&lt;/P&gt;&lt;P&gt;selection-screen end of block b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;build the dynamic internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform build_dyn_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;write 5 records to the alv grid&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  do 5 times.&lt;/P&gt;&lt;P&gt;    perform build_report.&lt;/P&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;call the alv grid.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform call_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Build_dyn_itab&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;form build_dyn_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: new_table type ref to data,&lt;/P&gt;&lt;P&gt;        new_line  type ref to data,&lt;/P&gt;&lt;P&gt;        wa_it_fldcat type lvc_s_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create fields .&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  do p_flds times.&lt;/P&gt;&lt;P&gt;    clear wa_it_fldcat.&lt;/P&gt;&lt;P&gt;    wa_it_fldcat-fieldname = sy-index.&lt;/P&gt;&lt;P&gt;    wa_it_fldcat-datatype = 'CHAR'.&lt;/P&gt;&lt;P&gt;    wa_it_fldcat-intlen = 5.&lt;/P&gt;&lt;P&gt;    append wa_it_fldcat to it_fldcat .&lt;/P&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create dynamic internal table and assign to FS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method cl_alv_table_create=&amp;gt;create_dynamic_table&lt;/P&gt;&lt;P&gt;               exporting&lt;/P&gt;&lt;P&gt;                  it_fieldcatalog = it_fldcat&lt;/P&gt;&lt;P&gt;               importing&lt;/P&gt;&lt;P&gt;                  ep_table        = new_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  assign new_table-&amp;gt;* to &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create dynamic work area and assign to FS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  create data new_line like line of &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;  assign new_line-&amp;gt;* to &amp;lt;dyn_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     Form  build_report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*********************************************************************&lt;/P&gt;&lt;P&gt;form build_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: fieldname(20) type c.&lt;/P&gt;&lt;P&gt;  data: fieldvalue(5) type c.&lt;/P&gt;&lt;P&gt;  data: index(3) type c.&lt;/P&gt;&lt;P&gt;  field-symbols: &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  do p_flds times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    index = sy-index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Set up fieldvalue&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    concatenate 'FLD' index into&lt;/P&gt;&lt;P&gt;             fieldvalue.&lt;/P&gt;&lt;P&gt;    condense   fieldvalue no-gaps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  &amp;lt;b&amp;gt; assign component  index  of structure &amp;lt;dyn_wa&amp;gt; to &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   &amp;lt;fs1&amp;gt; =  fieldvalue.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Append to the dynamic internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  append &amp;lt;dyn_wa&amp;gt; to &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; CALL_ALV&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;form call_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: wa_cat like line of alv_fldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  do p_flds times.&lt;/P&gt;&lt;P&gt;    clear wa_cat.&lt;/P&gt;&lt;P&gt;    wa_cat-fieldname = sy-index.&lt;/P&gt;&lt;P&gt;    wa_cat-seltext_s = sy-index.&lt;/P&gt;&lt;P&gt;    wa_cat-outputlen = '5'.&lt;/P&gt;&lt;P&gt;    append wa_cat to alv_fldcat.&lt;/P&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Call ABAP List Viewer (ALV)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call function 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;       exporting&lt;/P&gt;&lt;P&gt;            it_fieldcat = alv_fldcat&lt;/P&gt;&lt;P&gt;       tables&lt;/P&gt;&lt;P&gt;            t_outtab    = &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Mar 2007 06:53:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-generate-a-program-dynamically-using-fm-rss-template-instantiate/m-p/2061938#M426296</guid>
      <dc:creator>p291102</dc:creator>
      <dc:date>2007-03-12T06:53:26Z</dc:date>
    </item>
    <item>
      <title>Re: how to generate a program dynamically using FM 'RSS_TEMPLATE_INSTANTIATE'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-generate-a-program-dynamically-using-fm-rss-template-instantiate/m-p/2061939#M426297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Bharat,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the following code; it is really useful to understand the concept:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*&amp;amp;---------------------------------------------------------------------*
*&amp;amp;       Form  generate_program
*&amp;amp;---------------------------------------------------------------------*
FORM generate_program CHANGING p_program TYPE program
                               syst_info TYPE syst.

  DATA: text_line TYPE line.

  DATA: t_codings TYPE STANDARD TABLE OF rssource,
        ls_coding TYPE rssource,
        t_txtpool TYPE STANDARD TABLE OF textpool WITH HEADER LINE.

* constructe program name
  WHILE p_program IS INITIAL OR sy-subrc = 0.
    WAIT UP TO 1 SECONDS.
    p_program+00(5) = 'SBDLS'.
    p_program+05(3) = sy-mandt.
    p_program+08(8) = sy-datum.
    p_program+16(6) = sy-uzeit.
    CALL FUNCTION 'SWY_PROGRAM_EXISTS'
      EXPORTING
        program                  = p_program
*     IMPORTING
*       TRDIR_ENTRY              =
     EXCEPTIONS
       program_not_exists       = 1
       OTHERS                   = 2.
  ENDWHILE.

  text_line = 'Programm &amp;amp; wird gerade generiert'(a00).
  REPLACE '&amp;amp;' WITH p_program INTO text_line.
  CONDENSE text_line.
  CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
    EXPORTING
      text = text_line.

  CALL FUNCTION 'RSS_TEMPLATE_INSTANTIATE'
   EXPORTING
       i_template                  = c_template
       i_program_name              = p_program
       i_program_type              = 'S'
       i_meta_object               = p_program
*       I_UNI_IDC25                 = ''
*       I_CLIENT                    = SY-MANDT
*       I_GLOBAL_CHECK              = ' '
       i_global_program            = 'X'
       i_force_compilation         = 'X'
       i_no_program_check          = ' '
*       I_DEBUG_LEVEL               =
*     IMPORTING
*       O_ERROR_LINE                =
*       O_ERROR_MESSAGE             =
*       E_ERROR_LINE                =
*       E_ERROR_MESSAGE             =
*       E_T_CODE                    =
*       E_UCCHECK                   =
   TABLES
       e_t_program_source          = t_codings
*     CHANGING
*       C_TX_TEXTPOOL               =
   EXCEPTIONS
       template_not_found          = 1
       template_syntax_error       = 2
       program_syntax_error        = 3
       internal_error              = 4
       invalid_input               = 5
       generation_error            = 6
       OTHERS                      = 7
            .
  IF sy-subrc &amp;lt;&amp;gt; 0.
    IF sy-subrc = 3.
      sy-tabix = syst-msgv2.
      READ TABLE t_codings INTO ls_coding INDEX sy-tabix.
* Syntaxfehler im Programm &amp;amp; Zeile &amp;amp;
      syst_info-msgid = 'B1'.
      syst_info-msgty = 'E'.
      syst_info-msgno = '458'.
      syst_info-msgv1 = p_program.
      SHIFT ls_coding-line LEFT DELETING LEADING SPACE.
      syst_info-msgv2 = ls_coding-line.
    ELSE.
      MOVE-CORRESPONDING syst TO syst_info.
    ENDIF.
    EXIT.
  ENDIF.

  CHECK NOT t_codings[] IS INITIAL.

  CALL FUNCTION 'PRETTY_PRINTER'
    EXPORTING
      inctoo                        = ''
*     IMPORTING
*       INDENTATION_MAYBE_WRONG       =
    TABLES
      ntext                         = t_codings
      otext                         = t_codings
   EXCEPTIONS
     enqueue_table_full            = 1
     include_enqueued              = 2
     include_readerror             = 3
     include_writeerror            = 4
     OTHERS                        = 5
            .
  IF sy-subrc &amp;lt;&amp;gt; 0.
    MOVE-CORRESPONDING syst TO syst_info.
    EXIT.
  ENDIF.

  INSERT REPORT p_program FROM t_codings PROGRAM TYPE 'S'.
  IF sy-subrc &amp;lt;&amp;gt; 0.
    syst_info-msgty = 'E'.
    syst_info-msgno = 457.
    syst_info-msgid = 'B1'.
    syst_info-msgv1 = p_program.
* Fehler beim Anlegen des Programms &amp;amp;
    EXIT.
  ENDIF.

  t_txtpool-id = 'R'.
  t_txtpool-key = ''.
  t_txtpool-length = '40'.
  t_txtpool-entry = 'Umsetzung logischer Systemnamen'(a01).
  APPEND t_txtpool.
  INSERT TEXTPOOL p_program FROM t_txtpool LANGUAGE sy-langu.
  IF sy-subrc &amp;lt;&amp;gt; 0.
    syst_info-msgty = 'E'.
    syst_info-msgno = 457.
    syst_info-msgid = 'B1'.
    syst_info-msgv1 = p_program.
* Fehler beim Anlegen des Programms &amp;amp;
    EXIT.
  ENDIF.

  DATA: output_text(72),
        error_line(5) TYPE n,
        error_word(72).

  SYNTAX-CHECK FOR t_codings MESSAGE output_text
                                 LINE error_line
                                 WORD error_word
                              PROGRAM p_program.
  IF sy-subrc &amp;lt;&amp;gt; 0.
    syst_info-msgty = 'E'.
    syst_info-msgno = 458.
    syst_info-msgid = 'B1'.
    syst_info-msgv1 = p_program.
    syst_info-msgv2 = error_line.
* Syntaxfehler im Programm &amp;amp; Zeile &amp;amp;
    EXIT.
  ENDIF.

ENDFORM.                               " generate_program

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Sajan Joseph.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Mar 2007 06:55:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-generate-a-program-dynamically-using-fm-rss-template-instantiate/m-p/2061939#M426297</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-12T06:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: how to generate a program dynamically using FM 'RSS_TEMPLATE_INSTANTIATE'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-generate-a-program-dynamically-using-fm-rss-template-instantiate/m-p/2061940#M426298</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;Herewith i am sending the sample coding for the DYNAMIC ALV report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kindly go through it that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  YMS_DYNAMICALV.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type-pools: slis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field-symbols: &amp;lt;dyn_table&amp;gt; type standard table,&lt;/P&gt;&lt;P&gt;               &amp;lt;dyn_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: alv_fldcat type slis_t_fieldcat_alv,&lt;/P&gt;&lt;P&gt;      it_fldcat type lvc_t_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;selection-screen begin of block b1 with frame title text-001.&lt;/P&gt;&lt;P&gt;parameters: p_flds(5) type c.&lt;/P&gt;&lt;P&gt;selection-screen end of block b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;build the dynamic internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform build_dyn_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;write 5 records to the alv grid&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  do 5 times.&lt;/P&gt;&lt;P&gt;    perform build_report.&lt;/P&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;call the alv grid.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  perform call_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; Build_dyn_itab&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;form build_dyn_itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: new_table type ref to data,&lt;/P&gt;&lt;P&gt;        new_line  type ref to data,&lt;/P&gt;&lt;P&gt;        wa_it_fldcat type lvc_s_fcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create fields .&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  do p_flds times.&lt;/P&gt;&lt;P&gt;    clear wa_it_fldcat.&lt;/P&gt;&lt;P&gt;    wa_it_fldcat-fieldname = sy-index.&lt;/P&gt;&lt;P&gt;    wa_it_fldcat-datatype = 'CHAR'.&lt;/P&gt;&lt;P&gt;    wa_it_fldcat-intlen = 5.&lt;/P&gt;&lt;P&gt;    append wa_it_fldcat to it_fldcat .&lt;/P&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create dynamic internal table and assign to FS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call method cl_alv_table_create=&amp;gt;create_dynamic_table&lt;/P&gt;&lt;P&gt;               exporting&lt;/P&gt;&lt;P&gt;                  it_fieldcatalog = it_fldcat&lt;/P&gt;&lt;P&gt;               importing&lt;/P&gt;&lt;P&gt;                  ep_table        = new_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  assign new_table-&amp;gt;* to &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Create dynamic work area and assign to FS&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  create data new_line like line of &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;  assign new_line-&amp;gt;* to &amp;lt;dyn_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*********************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;     Form  build_report&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*********************************************************************&lt;/P&gt;&lt;P&gt;form build_report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: fieldname(20) type c.&lt;/P&gt;&lt;P&gt;  data: fieldvalue(5) type c.&lt;/P&gt;&lt;P&gt;  data: index(3) type c.&lt;/P&gt;&lt;P&gt;  field-symbols: &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  do p_flds times.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    index = sy-index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Set up fieldvalue&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    concatenate 'FLD' index into&lt;/P&gt;&lt;P&gt;             fieldvalue.&lt;/P&gt;&lt;P&gt;    condense   fieldvalue no-gaps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  &amp;lt;b&amp;gt; assign component  index  of structure &amp;lt;dyn_wa&amp;gt; to &amp;lt;fs1&amp;gt;.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   &amp;lt;fs1&amp;gt; =  fieldvalue.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Append to the dynamic internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  append &amp;lt;dyn_wa&amp;gt; to &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; CALL_ALV&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;P&gt;form call_alv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: wa_cat like line of alv_fldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  do p_flds times.&lt;/P&gt;&lt;P&gt;    clear wa_cat.&lt;/P&gt;&lt;P&gt;    wa_cat-fieldname = sy-index.&lt;/P&gt;&lt;P&gt;    wa_cat-seltext_s = sy-index.&lt;/P&gt;&lt;P&gt;    wa_cat-outputlen = '5'.&lt;/P&gt;&lt;P&gt;    append wa_cat to alv_fldcat.&lt;/P&gt;&lt;P&gt;  enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Call ABAP List Viewer (ALV)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  call function 'REUSE_ALV_GRID_DISPLAY'&lt;/P&gt;&lt;P&gt;       exporting&lt;/P&gt;&lt;P&gt;            it_fieldcat = alv_fldcat&lt;/P&gt;&lt;P&gt;       tables&lt;/P&gt;&lt;P&gt;            t_outtab    = &amp;lt;dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endform.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Mar 2007 06:56:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-generate-a-program-dynamically-using-fm-rss-template-instantiate/m-p/2061940#M426298</guid>
      <dc:creator>p291102</dc:creator>
      <dc:date>2007-03-12T06:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to generate a program dynamically using FM 'RSS_TEMPLATE_INSTANTIATE'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-generate-a-program-dynamically-using-fm-rss-template-instantiate/m-p/2061941#M426299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sajan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if we r using this FM the generated program will be saved in any program?&lt;/P&gt;&lt;P&gt;can we see the generated code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Bharat.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Mar 2007 08:50:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-generate-a-program-dynamically-using-fm-rss-template-instantiate/m-p/2061941#M426299</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-12T08:50:09Z</dc:date>
    </item>
  </channel>
</rss>

