<?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: dynamic allocation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-allocation/m-p/1967120#M397120</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;could you pls amplify:-&lt;/P&gt;&lt;P&gt;"Use this and try to create a filed dynamically. Based on a field i am retrieving the data and filling the created "&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Sujoy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Feb 2007 15:29:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-02-15T15:29:13Z</dc:date>
    <item>
      <title>dynamic allocation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-allocation/m-p/1967118#M397118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;please explain dynamic memory allocation with respect to "SPECIFYING THE SOURCE  FIELD DYNAMICALLY"   using WRITE TO  in simple terms&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 13:23:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-allocation/m-p/1967118#M397118</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T13:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic allocation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-allocation/m-p/1967119#M397119</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;  Follwing  Function module is an example for creating a table dynamically. Use this and try to create a filed dynamically. Based on a field i am retrieving the data and filling the created table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unction yrel_copy_data_req.&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;STRONG&gt;"&lt;/STRONG&gt;"Local interface:&lt;/P&gt;&lt;P&gt;*"  IMPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(REQ_NO) TYPE  YREL_REQNO&lt;/P&gt;&lt;P&gt;*"     VALUE(DEST) TYPE  ADRTP&lt;/P&gt;&lt;P&gt;*"  EXPORTING&lt;/P&gt;&lt;P&gt;*"     VALUE(RET_CODE) TYPE  CHAR1&lt;/P&gt;&lt;P&gt;*"  EXCEPTIONS&lt;/P&gt;&lt;P&gt;*"      INVALID_REQ_NO&lt;/P&gt;&lt;P&gt;*"      INVALID_TABLE_NAME&lt;/P&gt;&lt;P&gt;*"      FIELD_NOT_FOUND_IN_TABLE&lt;/P&gt;&lt;P&gt;*"----&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Function Module Name : YREL_COPY_DATA_REQ                            *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Start Date           :                                 *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Developer            :                                         *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;CR#                  :                                          *&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Description          : To create a table dynacally and fill the data          *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;************************************************************************&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Modification Log                                                     *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;ChangeReq    Date        DevID       * Description                   *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- Tables&lt;/P&gt;&lt;P&gt;  tables : dd03l,&lt;/P&gt;&lt;P&gt;*-Adding table in place of Tab_name parameter.&lt;/P&gt;&lt;P&gt;           yrel_tables. " YREL Table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Field symbols&lt;/P&gt;&lt;P&gt;  field-symbols:  &amp;lt;f_fs&amp;gt; type table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*--Global variables&lt;/P&gt;&lt;P&gt;  data: g_repid      like sy-repid,&lt;/P&gt;&lt;P&gt;        g_tabname    like dcobjdef-name,&lt;/P&gt;&lt;P&gt;        g_ucomm      like sy-ucomm,&lt;/P&gt;&lt;P&gt;        g_destin(10) type c,&lt;/P&gt;&lt;P&gt;        g_alvtab     type  slis_tabname,&lt;/P&gt;&lt;P&gt;        g_batch(10)  type c,&lt;/P&gt;&lt;P&gt;        g_ret_code   type char1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*-- Internal tables&lt;/P&gt;&lt;P&gt;  data: d_ref      type ref to data,&lt;/P&gt;&lt;P&gt;        d_ref2     type ref to data,&lt;/P&gt;&lt;P&gt;        d_ref1     type ref to data,&lt;/P&gt;&lt;P&gt;        new_table  type ref to data,&lt;/P&gt;&lt;P&gt;        new_line   type ref to data,&lt;/P&gt;&lt;P&gt;        tb_alv_cat  type table of lvc_s_fcat,&lt;/P&gt;&lt;P&gt;        tb_alv_cat1 type table of lvc_s_fcat,&lt;/P&gt;&lt;P&gt;        ls_alv_cat like line of tb_alv_cat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: tb_data like zuptab occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: begin of tb_dd03l occurs 0,&lt;/P&gt;&lt;P&gt;          tabname type tabname,&lt;/P&gt;&lt;P&gt;          fieldname type fieldname,&lt;/P&gt;&lt;P&gt;        end of tb_dd03l.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: begin of tb_header occurs 0.&lt;/P&gt;&lt;P&gt;          include structure dntab.&lt;/P&gt;&lt;P&gt;  data: end of tb_header.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data: begin of tb_request occurs 0,&lt;/P&gt;&lt;P&gt;          whereclause(72),&lt;/P&gt;&lt;P&gt;        end of tb_request.&lt;/P&gt;&lt;P&gt;*-Table to hold YREL_TABLE data.&lt;/P&gt;&lt;P&gt;  data: begin of i_yrel_tables occurs 0,&lt;/P&gt;&lt;P&gt;          tabname like yrel_tables-tabname,&lt;/P&gt;&lt;P&gt;        end of i_yrel_tables.&lt;/P&gt;&lt;P&gt;*- Fetching Table contents .&lt;/P&gt;&lt;P&gt;  select tabname into table i_yrel_tables&lt;/P&gt;&lt;P&gt;  from yrel_tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Check for the table name&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  loop at i_yrel_tables.&lt;/P&gt;&lt;P&gt;    select tabname fieldname into table tb_dd03l&lt;/P&gt;&lt;P&gt;                             from dd03l&lt;/P&gt;&lt;P&gt;                            where tabname = i_yrel_tables-tabname.&lt;/P&gt;&lt;P&gt;    if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      raise  invalid_table_name.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  Check for the reqno field&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    read table tb_dd03l with key fieldname = 'REQNO'.&lt;/P&gt;&lt;P&gt;    if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;      raise field_not_found_in_table.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the table name&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    g_tabname = i_yrel_tables-tabname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the fields of the table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    refresh tb_header.&lt;/P&gt;&lt;P&gt;    call function 'NAMETAB_GET'&lt;/P&gt;&lt;P&gt;         exporting&lt;/P&gt;&lt;P&gt;              langu          = sy-langu&lt;/P&gt;&lt;P&gt;              tabname        = g_tabname&lt;/P&gt;&lt;P&gt;         tables&lt;/P&gt;&lt;P&gt;              nametab        = tb_header&lt;/P&gt;&lt;P&gt;         exceptions&lt;/P&gt;&lt;P&gt;              no_texts_found = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at tb_header .&lt;/P&gt;&lt;P&gt;      ls_alv_cat-fieldname = tb_header-fieldname.&lt;/P&gt;&lt;P&gt;      ls_alv_cat-ref_table = i_yrel_tables-tabname.&lt;/P&gt;&lt;P&gt;      ls_alv_cat-ref_field = tb_header-fieldname.&lt;/P&gt;&lt;P&gt;      append ls_alv_cat to tb_alv_cat.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Build the internal table&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 it_fieldcatalog = tb_alv_cat&lt;/P&gt;&lt;P&gt;    importing ep_table = d_ref .&lt;/P&gt;&lt;P&gt;    assign d_ref-&amp;gt;* to &amp;lt;f_fs&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    concatenate 'REQNO' 'EQ' req_no into tb_request-whereclause&lt;/P&gt;&lt;P&gt;                                       separated by space.&lt;/P&gt;&lt;P&gt;    append tb_request.&lt;/P&gt;&lt;P&gt;    select * from (i_yrel_tables-tabname)&lt;/P&gt;&lt;P&gt;      into corresponding fields of table &amp;lt;f_fs&amp;gt;&lt;/P&gt;&lt;P&gt;      where (tb_request).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the destination&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    case dest.&lt;/P&gt;&lt;P&gt;      when 'D48'.&lt;/P&gt;&lt;P&gt;        g_destin = c_dest_d48.&lt;/P&gt;&lt;P&gt;      when 'M08'.&lt;/P&gt;&lt;P&gt;        g_destin = c_dest_m08.&lt;/P&gt;&lt;P&gt;      when 'P08'.&lt;/P&gt;&lt;P&gt;        g_destin = c_dest_p08.&lt;/P&gt;&lt;P&gt;      when 'T48'.&lt;/P&gt;&lt;P&gt;        g_destin = c_dest_t48.&lt;/P&gt;&lt;P&gt;    endcase.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Assign the data to the internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    tb_data[] = &amp;lt;f_fs&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Update the data in the given destination&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    call function 'YREL_COPY_DATA_REQ_DEST' destination g_destin&lt;/P&gt;&lt;P&gt;         exporting&lt;/P&gt;&lt;P&gt;               tabname  = i_yrel_tables-tabname&lt;/P&gt;&lt;P&gt;        importing&lt;/P&gt;&lt;P&gt;             ret_code  = g_ret_code&lt;/P&gt;&lt;P&gt;        tables&lt;/P&gt;&lt;P&gt;             data     = &amp;lt;f_fs&amp;gt;.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Pass the return code&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    if g_ret_code = 0.&lt;/P&gt;&lt;P&gt;      ret_code = 'S'.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      ret_code = 'F'.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;*-Depending upon RET_CODE we need to raise an event.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;endfunction.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;  Jayaram...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 14:13:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-allocation/m-p/1967119#M397119</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T14:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic allocation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-allocation/m-p/1967120#M397120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;could you pls amplify:-&lt;/P&gt;&lt;P&gt;"Use this and try to create a filed dynamically. Based on a field i am retrieving the data and filling the created "&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Sujoy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Feb 2007 15:29:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-allocation/m-p/1967120#M397120</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-02-15T15:29:13Z</dc:date>
    </item>
  </channel>
</rss>

