<?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: Itab creation on runtime in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723711#M1455878</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have found that the field catalog field inside my loop is causing the dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT gt_monthcalc INTO gs_monthcalc.
  
  TRANSLATE gs_monthcalc-month to UPPER CASE.
  xfc-fieldname = gs_monthcalc-month.
  xfc-datatype = 'CHAR'.
  xfc-inttype = 'C'.
  xfc-intlen = '10'.
  "xfc-tabname = 'ITAB'.
  APPEND xfc TO ifc.
  CLEAR xfc.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES : BEGIN OF gty_monthcalc,&lt;/P&gt;&lt;P&gt;          month TYPE  c length 10,&lt;/P&gt;&lt;P&gt;        END OF gty_monthcalc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA gt_monthcalc TYPE TABLE OF gty_monthcalc.&lt;/P&gt;&lt;P&gt;DATA gs_monthcalc LIKE LINE OF gt_monthcalc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No idea until now..still working...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: pazzuzu on Mar 16, 2010 4:15 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: pazzuzu on Mar 16, 2010 4:22 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: pazzuzu on Mar 16, 2010 4:22 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 16 Mar 2010 15:12:28 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-03-16T15:12:28Z</dc:date>
    <item>
      <title>Itab creation on runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723708#M1455875</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have run into to trouble trying to create a dynamic structure as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Material Land Nov.09 Dez.09 Jan.10 Feb.10 Mar.10 TotalCount"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The dates are created dynamically with regard to the time period entered in the select options.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first 2 fields("Material","Land" and the last field "TotalCount") will always be there.The date fields have to change according to the dates entered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Runtime error - "Load_PROGRAM_NOT_FOUND"&lt;/P&gt;&lt;P&gt;Exception - CX_SY_PROGRAM_NOT_FOUND&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;on calling&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
  EXPORTING
    it_fieldcatalog = ifc
  IMPORTING
    ep_table        = dy_table.

Have filled by field catalog as follows:

xfc-fieldname = 'Material'.
xfc-datatype = 'CHAR'.
xfc-intlen = '15'.
APPEND xfc TO ifc.
CLEAR xfc.

xfc-fieldname = 'Opco'.
xfc-datatype = 'CHAR'.
xfc-intlen = '15'.
APPEND xfc TO ifc.
CLEAR xfc.

LOOP AT gt_monthcalc INTO gs_monthcalc.

  xfc-fieldname = gs_monthcalc-month.
  xfc-datatype = 'CHAR'.
  xfc-intlen = '10'.
  APPEND xfc TO ifc.
  CLEAR xfc.
ENDLOOP.

xfc-fieldname = 'Totalcount'.
xfc-datatype = 'CHAR'.
xfc-intlen = '15'.
APPEND xfc TO ifc.
CLEAR xfc.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Please advice what iam doing wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&amp;gt;If the dynamic itab is created ,how to fill it with values.&lt;/P&gt;&lt;P&gt;For example.- I want to access specifically the field names like itab-dez.09 or itab-Feb.10 to put values in it.Is it possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-&amp;gt;If I write this itab using "Write" statement - Will the field names be written&lt;/P&gt;&lt;P&gt;For example - the following field names.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"Material Land Nov.09 Dez.09 Jan.10 Feb.10 Mar.10 TotalCount"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;P&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Mar 2010 13:42:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723708#M1455875</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-16T13:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Itab creation on runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723709#M1455876</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;The field name should be Upper Case, try to indicate:&lt;/P&gt;&lt;P&gt;- the internal type: xfc-inttype = 'C&lt;/P&gt;&lt;P&gt;- the table name: xfc-tabname = 'ITAB'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U need to use the field-symbol in order' to fill it:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT XFC.
   ASSIGN COMPONENT XFC-FIELDNAME OF STRCUTURE &amp;lt;WA&amp;gt; TO &amp;lt;VALUE&amp;gt;.
   
   CASE XFC-FIELDNAME.
     WHEN '........'.  &amp;lt;VALUE&amp;gt; = ...... 
     WHEN '........'.  &amp;lt;VALUE&amp;gt; = ...... 
     WHEN '........'.  &amp;lt;VALUE&amp;gt; = ...... &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;WA&amp;gt; has to be a field-symbol structured like your dynamic table:&lt;/P&gt;&lt;P&gt;ASSIGN dy_table-&amp;gt;* to &amp;lt;itab&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE DATA DY_WA LIKE LINE OF &amp;lt;ITAB&amp;gt;.&lt;/P&gt;&lt;P&gt;ASSIGN DY_WA-&amp;gt;* TO &amp;lt;WA&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All caharacteristics of your table are in XFC, u can use it to write the header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Mar 2010 14:04:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723709#M1455876</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-16T14:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Itab creation on runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723710#M1455877</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code creates still the dump on calling &lt;/P&gt;&lt;P&gt;"cl_alv_table_create=&amp;gt;create_dynamic_table".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What should I give here &lt;/P&gt;&lt;P&gt;xfc-tabname = 'ITAB'. Have commented it out in the code.Without comment also it gives the same dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what should be given in the field xfc-tabname.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have changed the code as follows according to the suggestion&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;xfc-fieldname = 'MAT'.
xfc-datatype = 'CHAR'.
xfc-inttype = 'C'.
xfc-intlen = '15'.
"xfc-tabname = 'ITAB'.
APPEND xfc TO ifc.
CLEAR xfc.

xfc-fieldname = 'OPCO'.
xfc-datatype = 'CHAR'.
xfc-inttype = 'C'.
xfc-intlen = '15'.
"xfc-tabname = 'ITAB'.
APPEND xfc TO ifc.
CLEAR xfc.

LOOP AT gt_monthcalc INTO gs_monthcalc.
  
  TRANSLATE gs_monthcalc-month to UPPER CASE.
  xfc-fieldname = gs_monthcalc-month.
  xfc-datatype = 'CHAR'.
  xfc-inttype = 'C'.
  xfc-intlen = '10'.
  "xfc-tabname = 'ITAB'.
  APPEND xfc TO ifc.
  CLEAR xfc.
ENDLOOP.

xfc-fieldname = 'TOTALCOUNT'.
xfc-datatype = 'CHAR'.
xfc-inttype = 'C'.
xfc-intlen = '15'.
"xfc-tabname = 'ITAB'.
APPEND xfc TO ifc.
CLEAR xfc.



CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
  EXPORTING
    it_fieldcatalog = ifc
  IMPORTING
    ep_table        = dy_table.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Mar 2010 14:33:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723710#M1455877</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-16T14:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: Itab creation on runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723711#M1455878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have found that the field catalog field inside my loop is causing the dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT gt_monthcalc INTO gs_monthcalc.
  
  TRANSLATE gs_monthcalc-month to UPPER CASE.
  xfc-fieldname = gs_monthcalc-month.
  xfc-datatype = 'CHAR'.
  xfc-inttype = 'C'.
  xfc-intlen = '10'.
  "xfc-tabname = 'ITAB'.
  APPEND xfc TO ifc.
  CLEAR xfc.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES : BEGIN OF gty_monthcalc,&lt;/P&gt;&lt;P&gt;          month TYPE  c length 10,&lt;/P&gt;&lt;P&gt;        END OF gty_monthcalc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA gt_monthcalc TYPE TABLE OF gty_monthcalc.&lt;/P&gt;&lt;P&gt;DATA gs_monthcalc LIKE LINE OF gt_monthcalc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No idea until now..still working...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: pazzuzu on Mar 16, 2010 4:15 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: pazzuzu on Mar 16, 2010 4:22 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: pazzuzu on Mar 16, 2010 4:22 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Mar 2010 15:12:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723711#M1455878</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-16T15:12:28Z</dc:date>
    </item>
    <item>
      <title>Re: Itab creation on runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723712#M1455879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are u meaning?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Mar 2010 15:39:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723712#M1455879</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-16T15:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Itab creation on runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723713#M1455880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Max,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I comment out the field catalog in the loop &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the call to 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 = ifc&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    ep_table        = dy_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;doesnt cause any dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it has to do with this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; xfc-fieldname = gs_monthcalc-month.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;statement inside the loop&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;gs_monthcalc-month is declared as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES : BEGIN OF gty_monthcalc,
          month TYPE  c length 30,
        END OF gty_monthcalc.

DATA gt_monthcalc TYPE TABLE OF gty_monthcalc.
DATA gs_monthcalc LIKE LINE OF gt_monthcalc.


xfc-fieldname = 'MAT'.
xfc-datatype = 'CHAR'.
xfc-inttype = 'C'.
xfc-intlen = 10.
xfc-decimals = 0.
"xfc-tabname = 'ITAB'.
APPEND xfc TO ifc.
CLEAR xfc.

xfc-fieldname = 'OPCO'.
xfc-datatype = 'CHAR'.
xfc-inttype = 'C'.
xfc-intlen = 10.
xfc-decimals = 0.
"xfc-tabname = 'ITAB'.
APPEND xfc TO ifc.
CLEAR xfc.

"LOOP AT gt_monthcalc INTO gs_monthcalc.
"
"  xfc-fieldname = gs_monthcalc-month.
"  xfc-datatype = 'CHAR'.
"  xfc-inttype = 'C'.
"  xfc-intlen = 10.
"  xfc-decimals = 0.
"  "xfc-tabname = 'ITAB'.
"  APPEND xfc TO ifc.
"  CLEAR xfc.
"
"ENDLOOP.

xfc-fieldname = 'TOTALCOUNT'.
xfc-datatype = 'CHAR'.
xfc-inttype = 'C'.
xfc-intlen = 10.
xfc-decimals = 0.
"xfc-tabname = 'ITAB'.
APPEND xfc TO ifc.
CLEAR xfc.



CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table
  EXPORTING
    it_fieldcatalog = ifc
  IMPORTING
    ep_table        = dy_table.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: pazzuzu on Mar 16, 2010 4:47 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Mar 2010 15:46:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723713#M1455880</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-16T15:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Itab creation on runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723714#M1455881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think the problem can be on how u call the field for the month: don't use the dot (so NOV.09, but NOV09), this sample works fine:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES : BEGIN OF GTY_MONTHCALC,
          MONTH TYPE  C LENGTH 30,
        END OF GTY_MONTHCALC.

DATA GT_MONTHCALC TYPE TABLE OF GTY_MONTHCALC.
DATA GS_MONTHCALC LIKE LINE OF GT_MONTHCALC.


DATA IFC TYPE LVC_T_FCAT.
DATA XFC TYPE LVC_S_FCAT.

DATA DY_TABLE TYPE REF TO DATA.
DATA DY_WA    TYPE REF TO DATA.

FIELD-SYMBOLS: &amp;lt;FS_ITAB&amp;gt; TYPE TABLE,
               &amp;lt;FS_WA&amp;gt;   TYPE ANY,
               &amp;lt;FS_VAL&amp;gt;  TYPE ANY.

GS_MONTHCALC-MONTH = 'NOV09'. APPEND GS_MONTHCALC TO GT_MONTHCALC.
GS_MONTHCALC-MONTH = 'DIC09'. APPEND GS_MONTHCALC TO GT_MONTHCALC.
GS_MONTHCALC-MONTH = 'GEN10'. APPEND GS_MONTHCALC TO GT_MONTHCALC.
GS_MONTHCALC-MONTH = 'FEB10'. APPEND GS_MONTHCALC TO GT_MONTHCALC.
GS_MONTHCALC-MONTH = 'MAR10'. APPEND GS_MONTHCALC TO GT_MONTHCALC.
GS_MONTHCALC-MONTH = 'APR10'. APPEND GS_MONTHCALC TO GT_MONTHCALC.
GS_MONTHCALC-MONTH = 'MAY10'.  APPEND GS_MONTHCALC TO GT_MONTHCALC.

XFC-FIELDNAME = 'MAT'.
XFC-INTTYPE   = 'C'.
XFC-INTLEN    = '15'.
APPEND XFC TO IFC.

CLEAR XFC.
XFC-FIELDNAME = 'OPCO'.
XFC-DATATYPE  = 'CHAR'.
XFC-INTTYPE   = 'C'.
XFC-INTLEN    = '15'.
APPEND XFC TO IFC.

LOOP AT GT_MONTHCALC INTO GS_MONTHCALC.
  CLEAR XFC.
  XFC-FIELDNAME = GS_MONTHCALC-MONTH.
  XFC-INTTYPE = 'C'.
  XFC-INTLEN = '10'.
  APPEND XFC TO IFC.
ENDLOOP.


XFC-FIELDNAME = 'TOTALCOUNT'.
XFC-INTTYPE   = 'C'.
XFC-INTLEN    = '15'.
APPEND XFC TO IFC.



CALL METHOD CL_ALV_TABLE_CREATE=&amp;gt;CREATE_DYNAMIC_TABLE
  EXPORTING
    IT_FIELDCATALOG = IFC
  IMPORTING
    EP_TABLE        = DY_TABLE.

ASSIGN DY_TABLE-&amp;gt;* TO &amp;lt;FS_ITAB&amp;gt;.

CREATE DATA DY_WA LIKE LINE OF &amp;lt;FS_ITAB&amp;gt;.
ASSIGN DY_WA-&amp;gt;*    TO &amp;lt;FS_WA&amp;gt;.

LOOP AT IFC INTO XFC.
  ASSIGN COMPONENT XFC-FIELDNAME OF STRUCTURE &amp;lt;FS_WA&amp;gt; TO &amp;lt;FS_VAL&amp;gt;.
  READ TABLE GT_MONTHCALC TRANSPORTING NO FIELDS
    WITH KEY MONTH = XFC-FIELDNAME.
  IF SY-SUBRC = 0.
    &amp;lt;FS_VAL&amp;gt; = 'Month'.
  ELSE.
    &amp;lt;FS_VAL&amp;gt; = 'No Month'.
  ENDIF.
ENDLOOP.
APPEND &amp;lt;FS_WA&amp;gt; TO &amp;lt;FS_ITAB&amp;gt;.

LOOP AT &amp;lt;FS_ITAB&amp;gt; ASSIGNING &amp;lt;FS_WA&amp;gt;.
  WRITE: &amp;lt;FS_WA&amp;gt;.
ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Mar 2010 16:30:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723714#M1455881</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-16T16:30:23Z</dc:date>
    </item>
    <item>
      <title>Re: Itab creation on runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723715#M1455882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;max, Thank you very mucht....You almost made my day:).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 1 more question.Iam not going home until it is done....Will post in a few minutes&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Mar 2010 17:04:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723715#M1455882</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-16T17:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: Itab creation on runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723716#M1455883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;mAX thank you very much.......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still I have 1 question in my mind....&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I have the dynamic itab .is it posible to fill it like normal static itabs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example like a static one as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: gt_tab TYPE TABLE OF gty_cum_opco,
      gs_tab LIKE LINE OF gt_itab.

CLEAR gs_tab.
gs_tab-matnummer = '2001898892'.
gs_tab-soldto = 'A'.
gs_tab-month = 'Nov'.
gs_tab-dqty =  4.
gs_tab-kunnr =  '123'.
gs_tab-liefers =  '345'.
APPEND gs_tab TO gt_tab.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have some quantities stored in the above itab for the month of "Nov".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When Iam Looping through this itab I have to write the Quantity into the corresponding month field of the dynamic tab.In this case the "Nov" Field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have to do some thing like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop gt_tab into gs_tab.

if gs_tab-month = 'Nov'.

dynITAB-nOV = 4.

endif.

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your previous code you said something as follows, but as the months are dynamic(It could be in different years as well) so when calling &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"when" statement in the following code what is the field name.Its dynamic I dont know.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT XFC.
   ASSIGN COMPONENT XFC-FIELDNAME OF STRCUTURE &amp;lt;WA&amp;gt; TO &amp;lt;VALUE&amp;gt;.
   
   CASE XFC-FIELDNAME.
     WHEN '........'.  &amp;lt;VALUE&amp;gt; = ...... 
     WHEN '........'.  &amp;lt;VALUE&amp;gt; = ...... 
     WHEN '........'.  &amp;lt;VALUE&amp;gt; = ......&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Mar 2010 17:16:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723716#M1455883</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-16T17:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Itab creation on runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723717#M1455884</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;The way to fill your dynamic table it depends on howo you've defined it, so a possible solution can be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop gt_tab into gs_tab.
    CLEAR &amp;lt;FS_WA&amp;gt;.
* Move material code
    PERFORM MOVE_VALUE USING 'MAT' GS_TAB-MATNR.
* Get month field
    TRANSLATE GS_TAB-MONTH TO UPPER CASE.
* I suppose the 3 first character are the month name, the other 2 char are the year
    LOOP AT GT_MONTHCALC INTO GS_MONTHCALC    
         WHERE MONTH(3) = GS_TAB-MONTH.
    ENDLOOP.
    PERFORM MOVE_VALUE USING GS_MONTHCALC-MONTH gs_tab-dqty. 
    APPEND &amp;lt;FS_WA&amp;gt; TO &amp;lt;FS_ITAB&amp;gt;.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM MOVE_VALUE  USING    P_FIELD
                          P_VALUE.
  ASSIGN COMPONENT P_FIELD OF STRUCTURE &amp;lt;FS_WA&amp;gt; TO &amp;lt;FS_VAL&amp;gt;.
  MOVE P_VALUE TO &amp;lt;FS_VAL&amp;gt;.
ENDFORM. &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Mar 2010 17:37:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723717#M1455884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-16T17:37:03Z</dc:date>
    </item>
    <item>
      <title>Re: Itab creation on runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723718#M1455885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Max,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Iam confused now.....&lt;/P&gt;&lt;P&gt;Iam referring to the  dynamic table you defined in your sample code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your code  for me the FS_iTAB is the itab and FS_WA is the work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "GT_MONTHCALC" itab we dont need anymore,as It was used only to fill in the fieldcatalog with months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop gt_tab into gs_tab.
 
if gs_tab-month = 'Nov'.
 
FS_WA-nOV = 4. //I want to do this!! 

MODIFY FS_WA TO fS_itab. //This as well.
 
endif.
 
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: pazzuzu on Mar 16, 2010 6:50 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Mar 2010 17:50:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723718#M1455885</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-16T17:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: Itab creation on runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723719#M1455886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now my head is getting clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an itab structure as follows filled with values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Only 1 row is filled in this case as an example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: gt_tab TYPE TABLE OF gty_cum_opco,
      gs_tab LIKE LINE OF gt_itab.
 
CLEAR gs_tab.
gs_tab-matnummer = '2001898892'.
gs_tab-soldto = 'A'.
gs_tab-month = 'Nov'.
gs_tab-dqty =  4.
gs_tab-kunnr =  '123'.
gs_tab-liefers =  '345'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;APPEND gs_tab TO gt_tab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I want to &lt;/P&gt;&lt;P&gt;copy  the contents of the field "matnummer" to "mat" in fS_itab&lt;/P&gt;&lt;P&gt;copy  the contents of the field "soldto" to "OPCO" in fS_itab&lt;/P&gt;&lt;P&gt;copy  the contents of the field "dqty" to "NOV" in fS_itab&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thats what I need....:=)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Mar 2010 18:06:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723719#M1455886</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-16T18:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Itab creation on runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723720#M1455887</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 thought my sample was clear:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;The "GT_MONTHCALC" itab we dont need anymore,as It was used only to fill in the fieldcatalog with months.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I rember a your requisition is to create the name of the month concatening the short name and the year, something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOV09 DEC09 GEN10 FEB10 MAR10 APR10 ..........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case the fieldname of month of your dynamic table doesn't corrispond to value in  gs_tab-month as here you have stored the short name of the month only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suppose if gs_tab-month is &lt;STRONG&gt;nov&lt;/STRONG&gt;, the quantity has to move in the field called &lt;STRONG&gt;NOV09&lt;/STRONG&gt;, if it's so it needs to get a link in order to know the real name of the moth field of dynamic table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This link can be in GT_MONTHCALC only, because you've used it to create dynamic table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I've create a routine to transfer the value from GS_TAN to &amp;lt;FS_WA&amp;gt;:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FORM MOVE_VALUE  USING    P_FIELD
                          P_VALUE.
  ASSIGN COMPONENT P_FIELD OF STRUCTURE &amp;lt;FS_WA&amp;gt; TO &amp;lt;FS_VAL&amp;gt;.
  MOVE P_VALUE TO &amp;lt;FS_VAL&amp;gt;.
ENDFORM.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P_FIELD is the name of dynamic table field&lt;/P&gt;&lt;P&gt;P_VALUE is the value to be transfered&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Now I want to 
copy the contents of the field "matnummer" to "mat" in fS_itab
copy the contents of the field "soldto" to "OPCO" in fS_itab
................................................................................................&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This requirement is easy because the name of the dynamic table are constant:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop gt_tab into gs_tab.
    CLEAR &amp;lt;FS_WA&amp;gt;.
* Move material code
    PERFORM MOVE_VALUE USING 'MAT' GS_TAB-MATNUMMER.
*  Move soldto
   PERFORM MOVE_VALUE USING 'OPCO' GS_TAB-SOLDTO.
....................................&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;....................
copy the contents of the field "dqty" to "NOV" in fS_itab&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case you need to move the value to FS_ITAB-NOV09, so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;......................
Found the name of dynamic table:
TRANSLATE FS_ITAB-MONTH TO UPPER CASE.

LOOP AT GT_MONTHCALC INTO GS_MONTHCALC.
   IF GS_MONTHCALC-MONTH(3) = FS_ITAB-MONTH.
* I found the right name
     EXIT.
  ENDIF.
ENDLOOP.
* Move qty 
PERFORM MOVE_VALUE USING GS_MONTHCALC-MONTH GS_TAB-DQTY.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it's clear now&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Mar 2010 09:32:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723720#M1455887</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-17T09:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: Itab creation on runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723721#M1455888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Max... Thanks a lot for all the effort...Iam closing this thread . These things look a bit complicated as a beginner for me.Dont feel taken aback when I say something like that. Yesterday I was working late and today morning I thought abt a much simpler idea.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But sill I need help on that one.&lt;/P&gt;&lt;P&gt;I will be making a post on it soon.If time please have a look....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Mar 2010 13:02:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/itab-creation-on-runtime/m-p/6723721#M1455888</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-17T13:02:00Z</dc:date>
    </item>
  </channel>
</rss>

