<?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 Dynamic itab in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab/m-p/3337864#M800103</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting error while trying to build dynamic internal table for the database table having packed integer fields (like QUAN, DEC), saying that &amp;#147;work-area is less than the target database table&amp;#148;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While debugging, I observed that, the fields having above data types are getting truncated to half the length of the field. (for ex: MARA~VOLUM (13) is reduced to 7).  But, I&amp;#146; don&amp;#146;t have any problem for any other data-types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you guess why the length is truncating and how to avoid the same?&lt;/P&gt;&lt;P&gt;Your inputs are highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Jan 2008 06:56:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-29T06:56:59Z</dc:date>
    <item>
      <title>Dynamic itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab/m-p/3337864#M800103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting error while trying to build dynamic internal table for the database table having packed integer fields (like QUAN, DEC), saying that &amp;#147;work-area is less than the target database table&amp;#148;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While debugging, I observed that, the fields having above data types are getting truncated to half the length of the field. (for ex: MARA~VOLUM (13) is reduced to 7).  But, I&amp;#146; don&amp;#146;t have any problem for any other data-types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you guess why the length is truncating and how to avoid the same?&lt;/P&gt;&lt;P&gt;Your inputs are highly appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 06:56:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab/m-p/3337864#M800103</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T06:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab/m-p/3337865#M800104</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;Hope it wil help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Pls reward if help.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dynamic internal table is internal table that we create on the fly with flexible column numbers. &lt;/P&gt;&lt;P&gt;For sample code, please look at this code tutorial. Hopefully it can help you &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this link:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.saptechnical.com/Tutorials/ABAP/DynamicInternaltable/DynamicInternalTable.htm" target="test_blank"&gt;http://www.saptechnical.com/Tutorials/ABAP/DynamicInternaltable/DynamicInternalTable.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample code:&lt;/P&gt;&lt;P&gt;DATA: l_cnt(2) TYPE n,&lt;/P&gt;&lt;P&gt;l_cnt1(3) TYPE n,&lt;/P&gt;&lt;P&gt;l_nam(12),&lt;/P&gt;&lt;P&gt;l_con(18) TYPE c,&lt;/P&gt;&lt;P&gt;l_con1(18) TYPE c,&lt;/P&gt;&lt;P&gt;lf_mat TYPE matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT it_bom_expl BY bom_comp bom_mat level.&lt;/P&gt;&lt;P&gt;CLEAR: l_cnt1, &amp;lt;fs_dyn_wa&amp;gt;.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Looping the component internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LOOP AT it_bom_expl INTO gf_it_bom_expl.&lt;/P&gt;&lt;P&gt;CLEAR: l_cnt1.&lt;/P&gt;&lt;P&gt;AT NEW bom_comp.&lt;/P&gt;&lt;P&gt;CLEAR: l_cnt, &amp;lt;fs_dyn_wa&amp;gt;, lf_mat.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;For every new bom component the material data is moved to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;temp material table which will be used for assigning the levels&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;checking the count&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;it_mat_temp[] = it_mat[].&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Component data is been assigned to the field symbol which is checked&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;against the field of dynamic internal table and the value of the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;component number is been passed to the dynamic internal table field&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;value.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ASSIGN COMPONENT c_comp_list OF STRUCTURE &amp;lt;fs_dyn_wa&amp;gt; TO&lt;/P&gt;&lt;P&gt;&amp;lt;fs_check&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;lt;fs_check&amp;gt; = gf_it_bom_expl-bom_comp.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;AT NEW bom_mat.&lt;/P&gt;&lt;P&gt;CLEAR l_con.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;lf_mat = gf_it_bom_expl-bom_mat.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Looping the temp internal table and looping the dynamic internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*by reading line by line into workarea, the materialxxn is been assigned&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;to field symbol which will be checked and used.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LOOP AT it_mat_temp.&lt;/P&gt;&lt;P&gt;l_nam = c_mat.&lt;/P&gt;&lt;P&gt;l_cnt1 = l_cnt1 + 1.&lt;/P&gt;&lt;P&gt;CONCATENATE l_nam l_cnt1 INTO l_nam.&lt;/P&gt;&lt;P&gt;LOOP AT &amp;lt;fs_dyn_table2&amp;gt; ASSIGNING &amp;lt;fs_dyn_wa2&amp;gt;.&lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT l_nam OF STRUCTURE &amp;lt;fs_dyn_wa2&amp;gt; TO &amp;lt;fs_xy&amp;gt;.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;IF &amp;lt;fs_xy&amp;gt; = lf_mat.&lt;/P&gt;&lt;P&gt;CLEAR lf_mat.&lt;/P&gt;&lt;P&gt;l_con1 = l_con.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Checking whether the material exists for a component and if so it is&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;been assigned to the field symbol which is checked against the field&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;of dynamic internal table and the level of the component number&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;against material is been passed to the dynamic internal table field&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;value.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;IF &amp;lt;fs_xy&amp;gt; = gf_it_bom_expl-bom_mat.&lt;/P&gt;&lt;P&gt;ASSIGN COMPONENT l_nam OF STRUCTURE &amp;lt;fs_dyn_wa&amp;gt; TO &amp;lt;fs_check&amp;gt;.&lt;/P&gt;&lt;P&gt;CLEAR l_con.&lt;/P&gt;&lt;P&gt;MOVE gf_it_bom_expl-level TO l_con.&lt;/P&gt;&lt;P&gt;CONCATENATE c_val_l l_con INTO l_con.&lt;/P&gt;&lt;P&gt;CONDENSE l_con NO-GAPS.&lt;/P&gt;&lt;P&gt;IF l_con1 NE space.&lt;/P&gt;&lt;P&gt;CONCATENATE l_con1 l_con INTO l_con SEPARATED BY c_comma.&lt;/P&gt;&lt;P&gt;CLEAR l_con1.&lt;/P&gt;&lt;P&gt;l_cnt = l_cnt - 1.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&amp;lt;fs_check&amp;gt; = l_con.&lt;/P&gt;&lt;P&gt;l_cnt = l_cnt + 1.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AT END OF bom_comp.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;At end of every new bom component the count is moved to the field&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;symbol which is checked against the field of dynamic internal table&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;and the count is been passed to the dynamic internal table field&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;value.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ASSIGN COMPONENT c_count OF STRUCTURE &amp;lt;fs_dyn_wa&amp;gt; TO &amp;lt;fs_check&amp;gt;.&lt;/P&gt;&lt;P&gt;&amp;lt;fs_check&amp;gt; = l_cnt.&lt;/P&gt;&lt;P&gt;INSERT &amp;lt;fs_dyn_wa&amp;gt; INTO TABLE &amp;lt;fs_dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;ENDAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2008 07:02:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-itab/m-p/3337865#M800104</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-29T07:02:04Z</dc:date>
    </item>
  </channel>
</rss>

