<?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: Format ,write itab to screen in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712273#M1453993</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the dynamic table creation. If this is the case, you can go for ALV, which is the best option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code for dynamic table creation.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FIELD-SYMBOLS: &amp;lt;dyn_table&amp;gt; type standard table,
              &amp;lt;dyn_table1&amp;gt; type standard table,
              &amp;lt;dyn_wa&amp;gt;,
              &amp;lt;dyn_field&amp;gt; TYPE any,
              &amp;lt;l_amt&amp;gt; TYPE faglflexa-hsl.
 data: dy_table type ref to data,
        dy_table1 type ref to data,
         dy_line  type ref to data,
         xfc type lvc_s_fcat,
         ifc type lvc_t_fcat.

xfc-fieldname = 'HEAD1'.
xfc-datatype = 'CHAR'.
xfc-inttype  = 'C'.
xfc-intlen = '50'.
APPEND xfc to ifc.

xfc-fieldname = 'HEAD2'.
APPEND xfc to ifc.

xfc-fieldname = 'HEAD3'.
xfc-intlen = '10'.
APPEND xfc to ifc.

xfc-fieldname = 'HEAD4'.
xfc-intlen = '6'.
APPEND xfc to ifc.

xfc-fieldname = 'HEAD5'.
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
*  EXCEPTIONS
*    generate_subpool_dir_full = 1
*    others                    = 2
       .
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

assign dy_table-&amp;gt;* to &amp;lt;dyn_table&amp;gt;.

* Create dynamic work area and assign to FS
 create data dy_line like line of &amp;lt;dyn_table&amp;gt;.
 assign dy_line-&amp;gt;* to &amp;lt;dyn_wa&amp;gt;.

CONCATENATE 'HEAD' l_col INTO l_text.
     ASSIGN COMPONENT l_text OF STRUCTURE &amp;lt;dyn_wa&amp;gt; TO &amp;lt;dyn_field&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 19 Mar 2010 04:48:01 GMT</pubDate>
    <dc:creator>praveen_hannu</dc:creator>
    <dc:date>2010-03-19T04:48:01Z</dc:date>
    <item>
      <title>Format ,write itab to screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712261#M1453981</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its embarassing as this is a continuation of something from my previous post.But unfortunately I have to do this as Iam new To ABAP and I have to meet a deadline tommorow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have an itab structure as follows(Thanks to marcin)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;TYPES:BEGIN OF t_itab,
      matnr TYPE matnr,
      land  TYPE c,
      month(5) TYPE c,
      qua TYPE p DECIMALS 2,
     END OF t_itab.

TYPES: tt_itab TYPE TABLE OF t_itab WITH KEY matnr land month.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The output of the itab is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;100                A  11.09             5,00
100                A  12.09             0,00
100                A  01.10             5,00
100                A  02.10             4,00
100                A  03.10             5,00
100                B  11.09             0,00
100                B  12.09             5,00
100                B  01.10             0,00
100                B  02.10             0,00
100                B  03.10             0,00
100                C  11.09             4,00
100                C  12.09             0,00
100                C  01.10             0,00
100                C  02.10             0,00
100                C  03.10             0,00&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to write a "header" as follows using "Write" statement(In Bold) and arrange,sum up the values of the itab and show it as below.&lt;/P&gt;&lt;P&gt;The last "Sum" row if possible in bold .&lt;/P&gt;&lt;P&gt;Any thing to make it look better in the screen is welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The idea for me was to get the outputLines into a string(Line) and write the line to screen.Iam working on it but it is a slow process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MaterialNumber  Land   11.09 12.09 01.10  02.10  03.10   Total

100               A      5     0     5      4      5       19
100               B      0     5     0      0      0        5
100               C      4     0     0      0      0        4

		 Sum	 9     5     5      4	   5        28&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: pazzuzu on Mar 18, 2010 11:51 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 10:51:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712261#M1453981</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T10:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: Format ,write itab to screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712262#M1453982</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Pazzuzu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Bold using &lt;STRONG&gt;Write Statement&lt;/STRONG&gt; is not possible, check the bellow Sample Code for some formatting,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT itab.
  WRITE: /1(1)'|', 2(20) itab-matnr CENTERED,22(1)'|', 23(12) itab-land CENTERED, 35(1)'|', 36(8) itab-month CENTERED, 44(1) '|', 45(10) itab-qua LEFT-JUSTIFIED, 55(1) '|'.
ENDLOOP.
WRITE:   /1(55) sy-uline.
TOP-OF-PAGE.
WRITE:  1(1)'|', 2(20)'MATNR' CENTERED COLOR 1,22(1)'|', 23(12)'LAND' CENTERED COLOR 1, 35(1)'|', 36(8)'MONTH' CENTERED COLOR 1, 44(1) '|', 45(10)'QUANTITY' CENTERED COLOR 1, 55(1) '|',
        /1(55) sy-uline.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Faisal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 12:19:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712262#M1453982</guid>
      <dc:creator>faisalatsap</dc:creator>
      <dc:date>2010-03-18T12:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Format ,write itab to screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712263#M1453983</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 result was not as expected(not right) &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It was as follows.&lt;/P&gt;&lt;P&gt;Also The "total" and "sum" values are not in the itab.That I have to calculate... &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;|       MATNR        |    LAND    | MONTH  | QUANTITY |
-------------------------------------------------------
|100                 |     C      | 11.09  |4,00      |
|100                 |     C      | 11.09  |4,00      |
|100                 |     C      | 11.09  |4,00      |
|100                 |     C      | 11.09  |4,00      |
|100                 |     C      | 11.09  |4,00      |
|100                 |     C      | 11.09  |4,00      |
|100                 |     C      | 11.09  |4,00      |
|100                 |     C      | 11.09  |4,00      |
|100                 |     C      | 11.09  |4,00      |
|100                 |     C      | 11.09  |4,00      |
|100                 |     C      | 11.09  |4,00      |
|100                 |     C      | 11.09  |4,00      |
|100                 |     C      | 11.09  |4,00      |
|100                 |     C      | 11.09  |4,00      |
|100                 |     C      | 11.09  |4,00      |
-------------------------------------------------------&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: pazzuzu on Mar 18, 2010 2:06 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: pazzuzu on Mar 18, 2010 2:06 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 13:05:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712263#M1453983</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T13:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Format ,write itab to screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712264#M1453984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi P,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;to bold use like this.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Format intensified on.
write: 'material number' 'land'. "like this 
format intensified off.

loop at itab into wa.
write: wa-matnr wa-land. "like this
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Tanmaya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 13:11:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712264#M1453984</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T13:11:02Z</dc:date>
    </item>
    <item>
      <title>Re: Format ,write itab to screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712265#M1453985</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;you have to clear the wa and then you need to have those number of records in the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps,&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;tanmaya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 13:28:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712265#M1453985</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T13:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Format ,write itab to screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712266#M1453986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tried it.But  not working.&lt;/P&gt;&lt;P&gt;The cosmetics is good but the data is not the way it should be as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MaterialNumber  Land   11.09 12.09 01.10  02.10  03.10   Total
 
100               A      5     0     5      4      5       19
100               B      0     5     0      0      0        5
100               C      4     0     0      0      0        4
 
		 Sum	 9     5     5      4	   5        28&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 13:43:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712266#M1453986</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T13:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Format ,write itab to screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712267#M1453987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi pazzuzu  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try to use 3 structure, 1 for the total and 1 for the sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for write header try to use this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;create une table that contain all the month.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write: 'MaterialNumber'  'Land'.&lt;/P&gt;&lt;P&gt;loop at I_tab.&lt;/P&gt;&lt;P&gt; at new month.&lt;/P&gt;&lt;P&gt;    write: Is_tab-month.&lt;/P&gt;&lt;P&gt;    append   Is_tab-month. to lt_tab_month.&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; write: 'sum'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with the table of months you can cycle with the key month in the table that contains all the data, doing so you can calculate the sum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards.&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 14:11:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712267#M1453987</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T14:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Format ,write itab to screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712268#M1453988</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;For this one you need some exercise to do it; please find the code below;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; data: begin of it_output occurs 0,
matnr type matnr,
land   type land1,
month1 TYPE p DECIMALS 2, "define 30 to 40 colums as per your requirement
month2 type p decimals 2,
'
'
'
month30  type p decimals 2,
end of it_output,

begin of it_fieldinfo,
fname(6),
fval(5),
end of it_fieldinfo.

field-symbols &amp;lt;fs_amt&amp;gt; type p decimals 2.
data: l_name(20).
sort t_tab by matnr land month.
loop at t_tab.
 read table it_fieldinfo with key fval = month.
 if sy-subrc eq 0.
   concatenate 'IT_OUTPUT-' it_fieldinfo-fname into l_name.
   assign (l_name) to &amp;lt;fs_amt&amp;gt;.
   if &amp;lt;fs_amt&amp;gt; is assigned.
      &amp;lt;fs_amt&amp;gt; = t_tab-qua.
  endif.
else.
 describe table it_fieldinfo.
 add 1 to sy-tfill.
 l_name = sy-tfill.
concatenate 'MONTH' l_name into l_name.
shift l_name left deleting leading space.
it_fieldinf0-fname = l_name+0(6).
it_fieldinfo-fval = t_tab-month.
append it_fieldinfo.
concatenate 'IT_OUTPUT-' it_fieldinfo-fname into l_name.
   assign (l_name) to &amp;lt;fs_amt&amp;gt;.
   if &amp;lt;fs_amt&amp;gt; is assigned.
      &amp;lt;fs_amt&amp;gt; = t_tab-qua.
  endif.

endif.
it_output-matnr = t_tab-matnr.
it_output-land  = t_tab-land.
append it_output.
clear: it_output,
          it_fieldinfo,
        t_tab.
endloop.

***write header of the output
write: /2 'Material Number',
          25 'Land'.
data: l_val type i,
        l_no type i.
l_val = 25.
loop at it_fieldinfo.

add 10 to l_Val.
write at pos(10) it_fieldinfo-fval.
 clear it_fieldinfo.
endloop.
         
***write the details
*describe table it_fieldinfo lines l_no.
loop at it_output.
write: /2 it_output-matnr,
          25 it_output-land,
         35 it_output-month1,
         '
         '
        '
       255 it_output-month30.
at last.
sum.
write: / 35 it_output-month1,
         '
         '
        '
       255 it_output-month30.
endat.
clear it_output.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope it will solve issue. Do some logic building to stop the printing month values at exact no.of months exists in the it_fieldinfo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Praveen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 14:33:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712268#M1453988</guid>
      <dc:creator>praveen_hannu</dc:creator>
      <dc:date>2010-03-18T14:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Format ,write itab to screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712269#M1453989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I have mislead you guys..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;From the itab(Example itab output in 1st post) I want to extract each item by land ,append to a string and then use the "write" statement to write this line out.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ofcourse I want to calculate "Sum" and total.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;So each line has to be a string for me.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;MaterialNumber  Land   11.09 12.09 01.10  02.10  03.10   Total
 
100               A      5     0     5      4      5       19
100               B      0     5     0      0      0        5
100               C      4     0     0      0      0        4
 
		 Sum	 9     5     5      4	   5        28&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code is arranged so that i cant create a itab out of it because date headers are created dynamic.So thats why by looping through the itab ,I could store the lines in an string itab and then write it out.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 14:53:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712269#M1453989</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T14:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Format ,write itab to screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712270#M1453990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Trying out praveens code.May be that will help me....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Praveen,I cant create something like the following co's by months are dynamic.The user gives the time period in the selection range at run time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thats why I want to write out the line as a  string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it_output occurs 0,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;matnr type matnr,
land   type land1,
month1 TYPE p DECIMALS 2, "define 30 to 40 colums as per your requirement
month2 type p decimals 2,
'
'
'
month30  type p decimals 2,
end of it_output,
 
begin of it_fieldinfo,
fname(6),
fval(5),
end of it_fieldinfo.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: pazzuzu on Mar 18, 2010 5:10 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 16:01:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712270#M1453990</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T16:01:07Z</dc:date>
    </item>
    <item>
      <title>Re: Format ,write itab to screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712271#M1453991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Praveen,could u supply me with a running code....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: pazzuzu on Mar 18, 2010 5:30 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 16:27:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712271#M1453991</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T16:27:50Z</dc:date>
    </item>
    <item>
      <title>Re: Format ,write itab to screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712272#M1453992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I made a mess out of my question.Using "write" statements helped.But the real question was left unanswered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will make a question regarding only this one....&lt;/P&gt;&lt;P&gt;Thanks a lot guys...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Mar 2010 17:03:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712272#M1453992</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-03-18T17:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: Format ,write itab to screen</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712273#M1453993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the dynamic table creation. If this is the case, you can go for ALV, which is the best option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Code for dynamic table creation.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FIELD-SYMBOLS: &amp;lt;dyn_table&amp;gt; type standard table,
              &amp;lt;dyn_table1&amp;gt; type standard table,
              &amp;lt;dyn_wa&amp;gt;,
              &amp;lt;dyn_field&amp;gt; TYPE any,
              &amp;lt;l_amt&amp;gt; TYPE faglflexa-hsl.
 data: dy_table type ref to data,
        dy_table1 type ref to data,
         dy_line  type ref to data,
         xfc type lvc_s_fcat,
         ifc type lvc_t_fcat.

xfc-fieldname = 'HEAD1'.
xfc-datatype = 'CHAR'.
xfc-inttype  = 'C'.
xfc-intlen = '50'.
APPEND xfc to ifc.

xfc-fieldname = 'HEAD2'.
APPEND xfc to ifc.

xfc-fieldname = 'HEAD3'.
xfc-intlen = '10'.
APPEND xfc to ifc.

xfc-fieldname = 'HEAD4'.
xfc-intlen = '6'.
APPEND xfc to ifc.

xfc-fieldname = 'HEAD5'.
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
*  EXCEPTIONS
*    generate_subpool_dir_full = 1
*    others                    = 2
       .
IF sy-subrc &amp;lt;&amp;gt; 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

assign dy_table-&amp;gt;* to &amp;lt;dyn_table&amp;gt;.

* Create dynamic work area and assign to FS
 create data dy_line like line of &amp;lt;dyn_table&amp;gt;.
 assign dy_line-&amp;gt;* to &amp;lt;dyn_wa&amp;gt;.

CONCATENATE 'HEAD' l_col INTO l_text.
     ASSIGN COMPONENT l_text OF STRUCTURE &amp;lt;dyn_wa&amp;gt; TO &amp;lt;dyn_field&amp;gt;.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Mar 2010 04:48:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/format-write-itab-to-screen/m-p/6712273#M1453993</guid>
      <dc:creator>praveen_hannu</dc:creator>
      <dc:date>2010-03-19T04:48:01Z</dc:date>
    </item>
  </channel>
</rss>

