<?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: populating values to internal table created dynamically in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-values-to-internal-table-created-dynamically/m-p/2576502#M588824</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;Check the code below:&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;&amp;lt;b&amp;gt;Create work area similar to &amp;lt;F_FS&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;  CREATE DATA gv_wa LIKE LINE OF &amp;lt;f_fs&amp;gt;.&lt;/P&gt;&lt;P&gt;  ASSIGN gv_wa-&amp;gt;* TO &amp;lt;fs_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS: &amp;lt;f_fs2&amp;gt; TYPE  itab2, "&lt;/P&gt;&lt;P&gt;                 &amp;lt;f_fs6&amp;gt; TYPE ANY,&lt;/P&gt;&lt;P&gt;                 &amp;lt;f_fs7&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;  DATA: l_quant TYPE p.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT g_itab5 ASSIGNING &amp;lt;f_fs2&amp;gt;. &amp;lt;b&amp;gt;(Data in Final Internal table).&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT 'TKNUM' OF STRUCTURE &amp;lt;f_fs2&amp;gt; TO &amp;lt;f_fs6&amp;gt;.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT 'TKNUM' OF STRUCTURE &amp;lt;fs_wa&amp;gt; TO &amp;lt;f_fs7&amp;gt;.&lt;/P&gt;&lt;P&gt;    &amp;lt;f_fs7&amp;gt; = &amp;lt;f_fs6&amp;gt;.&lt;/P&gt;&lt;P&gt;    CONDENSE &amp;lt;f_fs2&amp;gt;-vhilm NO-GAPS.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT 'VHILM' OF STRUCTURE &amp;lt;f_fs2&amp;gt; TO &amp;lt;f_fs3&amp;gt;.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT 3 OF STRUCTURE &amp;lt;f_fs2&amp;gt; TO &amp;lt;f_fs4&amp;gt;.&lt;/P&gt;&lt;P&gt;    MOVE &amp;lt;f_fs3&amp;gt; TO l_var1.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT l_var1 OF STRUCTURE &amp;lt;fs_wa&amp;gt; TO &amp;lt;f_fs5&amp;gt;.&lt;/P&gt;&lt;P&gt;    &amp;lt;f_fs5&amp;gt; =  &amp;lt;f_fs4&amp;gt;.&lt;/P&gt;&lt;P&gt;    CLEAR total_tab-quantity.&lt;/P&gt;&lt;P&gt;    READ TABLE total_tab WITH KEY tknum = &amp;lt;f_fs6&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      ASSIGN total_tab-quantity TO &amp;lt;f_fs12&amp;gt;.&lt;/P&gt;&lt;P&gt;      ASSIGN COMPONENT 'TOTAL' OF STRUCTURE &amp;lt;fs_wa&amp;gt; TO &amp;lt;f_fs13&amp;gt;.&lt;/P&gt;&lt;P&gt;      &amp;lt;f_fs13&amp;gt; = &amp;lt;f_fs12&amp;gt;.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    L_FILL = L_FILL + 1.&lt;/P&gt;&lt;P&gt;    IF L_FILL = L_TOT.&lt;/P&gt;&lt;P&gt;     ASSIGN L_TOTAL TO &amp;lt;f_fs12&amp;gt;.&lt;/P&gt;&lt;P&gt;      ASSIGN COMPONENT 'TOTAL' OF STRUCTURE &amp;lt;fs_wa&amp;gt; TO &amp;lt;f_fs13&amp;gt;.&lt;/P&gt;&lt;P&gt;      &amp;lt;f_fs13&amp;gt; = &amp;lt;f_fs12&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    AT END OF &amp;lt;f_fs2&amp;gt;-tknum.&lt;/P&gt;&lt;P&gt;      APPEND &amp;lt;fs_wa&amp;gt; TO &amp;lt;f_fs&amp;gt;. &amp;lt;b&amp;gt;(Appending final work area to final structure)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;      CLEAR  &amp;lt;fs_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kannaiah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jul 2007 11:38:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-30T11:38:59Z</dc:date>
    <item>
      <title>populating values to internal table created dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-values-to-internal-table-created-dynamically/m-p/2576498#M588820</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 creating an internal table(it1) dynamically and assigned it to a field symbol. now i want to upload values &lt;/P&gt;&lt;P&gt;which are present in a field of another internal table being populated from a Funct Module.Could you tell me &lt;/P&gt;&lt;P&gt;how to assign those values across the fields of field symbol?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**************&lt;/P&gt;&lt;P&gt;loop at itab_char.&lt;/P&gt;&lt;P&gt;LS_ALV_CAT-FIELDNAME = itab_char-charact.&lt;/P&gt;&lt;P&gt;append LS_ALV_CAT to I_ALV_CAT.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&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 = I_ALV_CAT&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    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;**************&lt;/P&gt;&lt;P&gt;(Above my int tab is generated and now stored in &amp;lt;f_FS&amp;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;loop at itab into w_lifnr.&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CLAF_CLASSIFICATION_OF_OBJECTS'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;   CLASS                      = p_cname&lt;/P&gt;&lt;P&gt;   CLASSTYPE                  = w_ctype&lt;/P&gt;&lt;P&gt;   OBJECT                     = w_lifnr&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    T_CLASS                    = t_class&lt;/P&gt;&lt;P&gt;    T_OBJECTDATA               = t_objectdata&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******************&lt;/P&gt;&lt;P&gt;w-lifnr is vendor number. and here we are populating t_objectdata with that vendor related datas. now i want to pass t_objectdata-ausp1 values for each vendor across the fields in &amp;lt;F_FS&amp;gt;.&lt;/P&gt;&lt;P&gt;&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;Please refer me the solution to this problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 11:26:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-values-to-internal-table-created-dynamically/m-p/2576498#M588820</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T11:26:04Z</dc:date>
    </item>
    <item>
      <title>Re: populating values to internal table created dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-values-to-internal-table-created-dynamically/m-p/2576499#M588821</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;Please check this sample program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;type-pools : abap. &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;               &amp;lt;dyn_field&amp;gt;. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;data: dy_table type ref to data, &lt;/P&gt;&lt;P&gt;      dy_line  type ref to data, &lt;/P&gt;&lt;P&gt;      xfc type lvc_s_fcat, &lt;/P&gt;&lt;P&gt;      ifc type lvc_t_fcat. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;selection-screen begin of block b1 with frame. &lt;/P&gt;&lt;P&gt;parameters: p_table(30) type c default 'T001'. &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;  perform get_structure. &lt;/P&gt;&lt;P&gt;  perform create_dynamic_itab.      &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;form get_structure. &lt;/P&gt;&lt;P&gt;  data : idetails type abap_compdescr_tab, &lt;/P&gt;&lt;P&gt;       xdetails type abap_compdescr. &lt;/P&gt;&lt;P&gt;  data : ref_table_des type ref to cl_abap_structdescr. &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get the structure of the table. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ref_table_des ?=  &lt;/P&gt;&lt;P&gt;      cl_abap_typedescr=&amp;gt;describe_by_name( p_table ). &lt;/P&gt;&lt;P&gt;  idetails[] = ref_table_des-&amp;gt;components[]. &lt;/P&gt;&lt;P&gt;    loop at idetails into xdetails. &lt;/P&gt;&lt;P&gt;    clear xfc. &lt;/P&gt;&lt;P&gt;    xfc-fieldname = xdetails-name . &lt;/P&gt;&lt;P&gt;    xfc-datatype = xdetails-type_kind. &lt;/P&gt;&lt;P&gt;    xfc-inttype = xdetails-type_kind. &lt;/P&gt;&lt;P&gt;    xfc-intlen = xdetails-length. &lt;/P&gt;&lt;P&gt;    xfc-decimals = xdetails-decimals. &lt;/P&gt;&lt;P&gt;    append xfc to ifc. &lt;/P&gt;&lt;P&gt;  endloop. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;*Add your new field(s) into table ifc here.&lt;/P&gt;&lt;P&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;P&gt;form create_dynamic_itab. &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 = ifc &lt;/P&gt;&lt;P&gt;               importing &lt;/P&gt;&lt;P&gt;                  ep_table        = dy_table. &lt;/P&gt;&lt;P&gt;    assign dy_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 dy_line like line of &amp;lt;dyn_table&amp;gt;. &lt;/P&gt;&lt;P&gt;  assign dy_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;Regards,&lt;/P&gt;&lt;P&gt;Sankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 11:30:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-values-to-internal-table-created-dynamically/m-p/2576499#M588821</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T11:30:31Z</dc:date>
    </item>
    <item>
      <title>Re: populating values to internal table created dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-values-to-internal-table-created-dynamically/m-p/2576500#M588822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check below code and try to add in ur code....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF NOT it_bom_expl[] IS INITIAL.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The material number data varies from run to run. For this purpose&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the data is been used to build dynamic internal table which stores the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;material number data along the x-axis&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      PERFORM build_matnr_table.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The material numbers data which is stored in the temp internal table&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;is been assigned to the dynamic internal table created along the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;x-axis for the materials&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      PERFORM assign_matnr_val_fields.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The component data which is stored in the internal table needs to be&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;moved to the dynamic internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      PERFORM move_bom_data_to_matnr_table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  build_matnr_table&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&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;Using the material number data the dynamic internal tables are been&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;built which holds the material number data along x-axis. Here the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;first 3 columns are always constant which are Components-List,&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Description, Count. From 4th column it depends on number of materials&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;FORM build_matnr_table .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: l_val(3) TYPE n,&lt;/P&gt;&lt;P&gt;        lf_mat(18) TYPE c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Moving the Components-List details to the internal table 1st column&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;which will be used for creation of dynamic internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CLEAR gf_xfc.&lt;/P&gt;&lt;P&gt;  gf_xfc-fieldname = text-t03.&lt;/P&gt;&lt;P&gt;  gf_xfc-datatype = c_val_c.&lt;/P&gt;&lt;P&gt;  gf_xfc-inttype = c_val_c.&lt;/P&gt;&lt;P&gt;  gf_xfc-intlen = 18.&lt;/P&gt;&lt;P&gt;  gf_xfc-decimals = 0.&lt;/P&gt;&lt;P&gt;  APPEND gf_xfc TO gf_ifc.&lt;/P&gt;&lt;P&gt;  APPEND gf_xfc TO gf_ipc.&lt;/P&gt;&lt;P&gt;  CLEAR gf_xfc.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Moving the Description details to the internal table 2nd column&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;which will be used for creation of dynamic internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  gf_xfc-fieldname = text-t04.&lt;/P&gt;&lt;P&gt;  gf_xfc-datatype = c_val_c.&lt;/P&gt;&lt;P&gt;  gf_xfc-inttype = c_val_c.&lt;/P&gt;&lt;P&gt;  gf_xfc-intlen = 40.&lt;/P&gt;&lt;P&gt;  gf_xfc-decimals = 0.&lt;/P&gt;&lt;P&gt;  APPEND gf_xfc TO gf_ipc.&lt;/P&gt;&lt;P&gt;  CLEAR gf_xfc.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Moving the Count details to the internal table 3rd column which will&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;be used for creation of dynamic internal table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  gf_xfc-fieldname = text-t05.&lt;/P&gt;&lt;P&gt;  gf_xfc-datatype = c_val_c.&lt;/P&gt;&lt;P&gt;  gf_xfc-inttype = c_val_c.&lt;/P&gt;&lt;P&gt;  gf_xfc-intlen = 5.&lt;/P&gt;&lt;P&gt;  gf_xfc-decimals = 0.&lt;/P&gt;&lt;P&gt;  APPEND gf_xfc TO gf_ifc.&lt;/P&gt;&lt;P&gt;  APPEND gf_xfc TO gf_ipc.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Moving the Material numbers are moved to the internal table from 4th&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;column onwards till all the material numbers are moved to the columns&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;which will be used for creation of dynamic internal table. Here&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;columns will be reffered to as Material001 ..... Materialxxn&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT it_mat.&lt;/P&gt;&lt;P&gt;    CLEAR gf_xfc.&lt;/P&gt;&lt;P&gt;    l_val = l_val + 1.&lt;/P&gt;&lt;P&gt;    CONCATENATE text-t06 l_val INTO lf_mat.&lt;/P&gt;&lt;P&gt;    gf_xfc-fieldname = lf_mat.&lt;/P&gt;&lt;P&gt;    gf_xfc-datatype = c_val_c.&lt;/P&gt;&lt;P&gt;    gf_xfc-inttype = c_val_c.&lt;/P&gt;&lt;P&gt;    gf_xfc-intlen = 18.&lt;/P&gt;&lt;P&gt;    gf_xfc-decimals = 0.&lt;/P&gt;&lt;P&gt;    APPEND gf_xfc TO gf_ifc.&lt;/P&gt;&lt;P&gt;    APPEND gf_xfc TO gf_ipc.&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;Using the above data dynamic internal table is been created&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 = gf_ifc&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      ep_table        = gf_table.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The dynamic internal table which is created is been assigned to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;field-symbol which holds the data of the columns of X-axis&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ASSIGN gf_table-&amp;gt;* TO &amp;lt;fs_dyn_table&amp;gt;.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Dynamic work area is been created usng the reference to the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;field-symbol which has the data and the line item is been assign to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;field-symbol to hold line item data for reading purposes line by line&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE DATA gf_line LIKE LINE OF &amp;lt;fs_dyn_table&amp;gt;.&lt;/P&gt;&lt;P&gt;  ASSIGN gf_line-&amp;gt;* TO &amp;lt;fs_dyn_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Using the above data dynamic internal table is been created&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 = gf_ipc&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      ep_table        = gf_table1.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The dynamic internal table which is created is been assigned to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;field-symbol which holds the data of the columns of X-axis&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ASSIGN gf_table1-&amp;gt;* TO &amp;lt;fs_dyn_table1&amp;gt;.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Dynamic work area is been created usng the reference to the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;field-symbol which has the data and the line item is been assign to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;field-symbol to hold line item data for reading purposes line by line&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE DATA gf_line1 LIKE LINE OF &amp;lt;fs_dyn_table1&amp;gt;.&lt;/P&gt;&lt;P&gt;  ASSIGN gf_line1-&amp;gt;* TO &amp;lt;fs_dyn_wa1&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Using the above data dynamic internal table is been created&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 = gf_ifc&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      ep_table        = gf_table2.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The dynamic internal table which is created is been assigned to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;field-symbol which holds the data of the columns of X-axis&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ASSIGN gf_table2-&amp;gt;* TO &amp;lt;fs_dyn_table2&amp;gt;.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Dynamic work area is been created usng the reference to the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;field-symbol which has the data and the line item is been assign to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;field-symbol to hold line item data for reading purposes line by line&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CREATE DATA gf_line2 LIKE LINE OF &amp;lt;fs_dyn_table2&amp;gt;.&lt;/P&gt;&lt;P&gt;  ASSIGN gf_line2-&amp;gt;* TO &amp;lt;fs_dyn_wa2&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " build_matnr_table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  assign_matnr_val_fields&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&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;The material numbers data stored in the temp internal table needs to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;be assigned to the dynamic internal table along x-axis as the first&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;record. The temp internal table is been looped and using the field&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;symbol concept the data is moved to the dynamic internal table&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;FORM assign_matnr_val_fields .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA: l_cnt(3) TYPE n,&lt;/P&gt;&lt;P&gt;        l_nam(12),&lt;/P&gt;&lt;P&gt;        g_total(3) TYPE n.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DESCRIBE TABLE it_mat LINES g_total.&lt;/P&gt;&lt;P&gt;  CLEAR l_cnt.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Looping the temp internal table and concatenating material as&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;material001 and the same is been checked against the dynamic&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;internal table and the material number value is moved to the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;internal table. Finally, the data is been appened as first record.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT it_mat.&lt;/P&gt;&lt;P&gt;    l_nam = c_mat.&lt;/P&gt;&lt;P&gt;    l_cnt = l_cnt + 1.&lt;/P&gt;&lt;P&gt;    CONCATENATE l_nam l_cnt INTO l_nam.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Material which is in form Materialxxn is been assigned 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 value of the Material Number is been passed to the dynamic&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;internal table field value.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;After all materials are been assigned the record is been appended&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;to the dynamic internal table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ASSIGN COMPONENT l_nam OF STRUCTURE &amp;lt;fs_dyn_wa&amp;gt; TO &amp;lt;fs_field&amp;gt;.&lt;/P&gt;&lt;P&gt;    &amp;lt;fs_field&amp;gt; = it_mat-matnr.&lt;/P&gt;&lt;P&gt;    IF l_cnt = g_total.&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;    ENDIF.&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;Looping the temp internal table and concatenating material as&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;material001 and the same is been checked against the dynamic&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;internal table and the material number value is moved to the&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;internal table. Finally, the data is been appened as first record.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;This is been used for downloading of data to excel sheet as it&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;contains additional field which is Description field.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  CLEAR l_cnt.&lt;/P&gt;&lt;P&gt;  LOOP AT it_mat.&lt;/P&gt;&lt;P&gt;    l_nam = c_mat.&lt;/P&gt;&lt;P&gt;    l_cnt = l_cnt + 1.&lt;/P&gt;&lt;P&gt;    CONCATENATE l_nam l_cnt INTO l_nam.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Material which is in form Materialxxn is been assigned 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 value of the Material Number is been passed to the dynamic&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;internal table field value.&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;After all materials are been assigned the record is been appended&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;to the dynamic internal table.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ASSIGN COMPONENT l_nam OF STRUCTURE &amp;lt;fs_dyn_wa1&amp;gt; TO &amp;lt;fs_field&amp;gt;.&lt;/P&gt;&lt;P&gt;    &amp;lt;fs_field&amp;gt; = it_mat-matnr.&lt;/P&gt;&lt;P&gt;    IF l_cnt = g_total.&lt;/P&gt;&lt;P&gt;      INSERT &amp;lt;fs_dyn_wa1&amp;gt; INTO TABLE &amp;lt;fs_dyn_table1&amp;gt;.&lt;/P&gt;&lt;P&gt;    ENDIF.&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;The contents of one internal table is passed on to other internal&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;table for use while moving the component data for count purposes.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  &amp;lt;fs_dyn_table2&amp;gt;[] = &amp;lt;fs_dyn_table&amp;gt;[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " assign_matnr_val_fields&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  move_bom_data_to_matnr_table&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&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;The component data is been appended to the dynamic internal table&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The component is checked against a material and if exists the corresp-&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;onding level is been appended to the record&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The total count is derived as the in how many materials the component&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;exists&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;FORM move_bom_data_to_matnr_table .&lt;/P&gt;&lt;P&gt;&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;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Looping the component internal table. This is used for the additional&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Description field which is shown in the excel sheet&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_wa1&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_wa1&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_wa1&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;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The description is moved to the field symbol which is checked against&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the field of dynamic internal table and the count is been passed to&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the dynamic internal table field value.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    ASSIGN COMPONENT c_description OF STRUCTURE &amp;lt;fs_dyn_wa1&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-ojtxp.&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;    AT END OF bom_comp.&lt;/P&gt;&lt;P&gt;      ASSIGN COMPONENT c_count OF STRUCTURE &amp;lt;fs_dyn_wa1&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_wa1&amp;gt; INTO TABLE &amp;lt;fs_dyn_table1&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;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.                    " move_bom_data_to_matnr_table&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 11:30:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-values-to-internal-table-created-dynamically/m-p/2576500#M588822</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T11:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: populating values to internal table created dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-values-to-internal-table-created-dynamically/m-p/2576501#M588823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Here is the example Program &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;report ztest_0003.
 
&amp;lt;b&amp;gt;field-symbols: &amp;lt;dyn_table&amp;gt; type standard table,
               &amp;lt;dyn_wa&amp;gt;.
 
data: new_table type ref to data,
      new_line  type ref to data,
      is_fieldcat type lvc_s_fcat,
      it_fieldcat type lvc_t_fcat..
 
data: i type i.
data: date1 type sy-datum.
 
parameters: P_SPBUP type SPBUP.
parameters: n type i.&amp;lt;/b&amp;gt;
is_fieldcat-fieldname = 'BEZEI'.
&amp;lt;b&amp;gt;*is_fieldcat-ref_field = 'BEZEI'.
*is_fieldcat-ref_table = 'S858'.&amp;lt;/b&amp;gt;
is_fieldcat-scrtext_l = 'CSR'.
is_fieldcat-scrtext_m = 'CSR'.
is_fieldcat-scrtext_s = 'CSR'.
 
append is_fieldcat to it_fieldcat.
 
do n times.
  is_fieldcat-fieldname = p_SPBUP.
&amp;lt;b&amp;gt;*  is_fieldcat-ref_field = 'SPBUP'.
*  is_fieldcat-ref_table = 'S858'.&amp;lt;/b&amp;gt;
  is_fieldcat-scrtext_l = p_SPBUP.
  is_fieldcat-scrtext_m = p_SPBUP.
  is_fieldcat-scrtext_s = p_SPBUP.
  append is_fieldcat to it_fieldcat.
 
&amp;lt;b&amp;gt;  p_SPBUP+4(2) = p_SPBUP+4(2) + 1.
  if p_SPBUP+4(2) = 13.
    p_SPBUP+0(4) = p_SPBUP+0(4) + 1.
    p_SPBUP+4(2) = '01'.
  endif.
 
*  if date+4(2) = 12.
*    date+3(1) = date+3(1) + 1.
*    date+4(2) = '00'.
*  endif.
*  date+4(2) = date+4(2) + i.
*  date1+4(1) = date+4(1).
*  if date+5(1) = ' '.
*    date+4(1) = 0.
*    date+5(1) = date1+4(1).
*  endif.&amp;lt;/b&amp;gt;
enddo.
 
is_fieldcat-fieldname = 'TOTALS'.
&amp;lt;b&amp;gt;*is_fieldcat-ref_field = 'UMNETWR'.
*is_fieldcat-ref_table = 'S858'.&amp;lt;/b&amp;gt;
is_fieldcat-scrtext_l = 'TOTALS'.
is_fieldcat-scrtext_m = 'TOTALS'.
is_fieldcat-scrtext_s = 'TOTALS'.
append is_fieldcat to it_fieldcat.
 
&amp;lt;b&amp;gt;*FIELD-SYMBOLS : &amp;lt;new_table&amp;gt; TYPE REF TO data.
*DATA : lt_data TYPE REF TO data.
*ASSIGN lt_data TO &amp;lt;new_table&amp;gt;.&amp;lt;/b&amp;gt;
call method cl_alv_table_create=&amp;gt;create_dynamic_table
        exporting
              it_fieldcatalog = it_fieldcat
        importing
              ep_table = &amp;lt;b&amp;gt;new_table.&amp;lt;/b&amp;gt;
 
&amp;lt;b&amp;gt;
assign new_table-&amp;gt;* to &amp;lt;dyn_table&amp;gt;.
 
* Create dynamic work area and assign to FS
create data new_line like line of &amp;lt;dyn_table&amp;gt;.
assign new_line-&amp;gt;* to &amp;lt;dyn_wa&amp;gt;.&amp;lt;/b&amp;gt;&lt;/CODE&gt;&lt;/PRE&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; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 11:32:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-values-to-internal-table-created-dynamically/m-p/2576501#M588823</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T11:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: populating values to internal table created dynamically</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/populating-values-to-internal-table-created-dynamically/m-p/2576502#M588824</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;Check the code below:&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;&amp;lt;b&amp;gt;Create work area similar to &amp;lt;F_FS&amp;gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;  CREATE DATA gv_wa LIKE LINE OF &amp;lt;f_fs&amp;gt;.&lt;/P&gt;&lt;P&gt;  ASSIGN gv_wa-&amp;gt;* TO &amp;lt;fs_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS: &amp;lt;f_fs2&amp;gt; TYPE  itab2, "&lt;/P&gt;&lt;P&gt;                 &amp;lt;f_fs6&amp;gt; TYPE ANY,&lt;/P&gt;&lt;P&gt;                 &amp;lt;f_fs7&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;  DATA: l_quant TYPE p.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT g_itab5 ASSIGNING &amp;lt;f_fs2&amp;gt;. &amp;lt;b&amp;gt;(Data in Final Internal table).&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT 'TKNUM' OF STRUCTURE &amp;lt;f_fs2&amp;gt; TO &amp;lt;f_fs6&amp;gt;.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT 'TKNUM' OF STRUCTURE &amp;lt;fs_wa&amp;gt; TO &amp;lt;f_fs7&amp;gt;.&lt;/P&gt;&lt;P&gt;    &amp;lt;f_fs7&amp;gt; = &amp;lt;f_fs6&amp;gt;.&lt;/P&gt;&lt;P&gt;    CONDENSE &amp;lt;f_fs2&amp;gt;-vhilm NO-GAPS.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT 'VHILM' OF STRUCTURE &amp;lt;f_fs2&amp;gt; TO &amp;lt;f_fs3&amp;gt;.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT 3 OF STRUCTURE &amp;lt;f_fs2&amp;gt; TO &amp;lt;f_fs4&amp;gt;.&lt;/P&gt;&lt;P&gt;    MOVE &amp;lt;f_fs3&amp;gt; TO l_var1.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT l_var1 OF STRUCTURE &amp;lt;fs_wa&amp;gt; TO &amp;lt;f_fs5&amp;gt;.&lt;/P&gt;&lt;P&gt;    &amp;lt;f_fs5&amp;gt; =  &amp;lt;f_fs4&amp;gt;.&lt;/P&gt;&lt;P&gt;    CLEAR total_tab-quantity.&lt;/P&gt;&lt;P&gt;    READ TABLE total_tab WITH KEY tknum = &amp;lt;f_fs6&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      ASSIGN total_tab-quantity TO &amp;lt;f_fs12&amp;gt;.&lt;/P&gt;&lt;P&gt;      ASSIGN COMPONENT 'TOTAL' OF STRUCTURE &amp;lt;fs_wa&amp;gt; TO &amp;lt;f_fs13&amp;gt;.&lt;/P&gt;&lt;P&gt;      &amp;lt;f_fs13&amp;gt; = &amp;lt;f_fs12&amp;gt;.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    L_FILL = L_FILL + 1.&lt;/P&gt;&lt;P&gt;    IF L_FILL = L_TOT.&lt;/P&gt;&lt;P&gt;     ASSIGN L_TOTAL TO &amp;lt;f_fs12&amp;gt;.&lt;/P&gt;&lt;P&gt;      ASSIGN COMPONENT 'TOTAL' OF STRUCTURE &amp;lt;fs_wa&amp;gt; TO &amp;lt;f_fs13&amp;gt;.&lt;/P&gt;&lt;P&gt;      &amp;lt;f_fs13&amp;gt; = &amp;lt;f_fs12&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    AT END OF &amp;lt;f_fs2&amp;gt;-tknum.&lt;/P&gt;&lt;P&gt;      APPEND &amp;lt;fs_wa&amp;gt; TO &amp;lt;f_fs&amp;gt;. &amp;lt;b&amp;gt;(Appending final work area to final structure)&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;      CLEAR  &amp;lt;fs_wa&amp;gt;.&lt;/P&gt;&lt;P&gt;    ENDAT.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kannaiah&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jul 2007 11:38:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/populating-values-to-internal-table-created-dynamically/m-p/2576502#M588824</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-30T11:38:59Z</dc:date>
    </item>
  </channel>
</rss>

