<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ABAP Tutorials &#187; Formatting</title>
	<atom:link href="http://www.abap-tutorials.com/category/formatting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.abap-tutorials.com</link>
	<description>ABAP Tutorials, Guides, Training, Manuals</description>
	<lastBuildDate>Thu, 17 Nov 2011 07:43:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>ABAP Programs for Beginners</title>
		<link>http://www.abap-tutorials.com/2010/05/07/abap-programs-for-beginners/</link>
		<comments>http://www.abap-tutorials.com/2010/05/07/abap-programs-for-beginners/#comments</comments>
		<pubDate>Fri, 07 May 2010 07:11:06 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[ABAP]]></category>
		<category><![CDATA[DDIC]]></category>
		<category><![CDATA[Formatting]]></category>
		<category><![CDATA[Function Modules]]></category>
		<category><![CDATA[Quick Reference]]></category>
		<category><![CDATA[Report]]></category>
		<category><![CDATA[Sample Code]]></category>
		<category><![CDATA[Selection-Screen]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[ABAP codes]]></category>
		<category><![CDATA[codes]]></category>
		<category><![CDATA[programs]]></category>
		<category><![CDATA[samples]]></category>

		<guid isPermaLink="false">http://www.abap-tutorials.com/?p=1597</guid>
		<description><![CDATA[The code book contain the beginners level programs for new ABAPers. The book covers almost every basic aspect that a programer in this domain should know.   Some of the programs that the book covers are: How to define types and data objects A Few Simple Examples Working with database tables and internal tables Designing a report Three [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">The code book contain the beginners level programs for new ABAPers. The book covers almost every basic aspect that a programer in this domain should know.</p>
<p style="text-align: justify;"> </p>
<div style="width: 100%; float: left;">
<p style="text-align: justify;"><a href="http://www.abap-tutorials.com/wp-content/uploads/2010/05/code_book.jpg"><img class="aligncenter size-full wp-image-1600" title="Code Book" src="http://www.abap-tutorials.com/wp-content/uploads/2010/05/code_book.jpg" alt="Code Book" width="122" height="144" /></a></p>
</div>
<p style="text-align: justify;"><span id="more-1597"></span></p>
<p style="text-align: justify;">Some of the programs that the book covers are:</p>
<ul style="text-align: justify;">
<li>How to define types and data objects</li>
<li>A Few Simple Examples</li>
<li>Working with database tables and internal tables</li>
<li>Designing a report</li>
<li>Three approaches to define data objects</li>
<li>Complex Non-Elementary Types and Data Objects</li>
<li>Type-Specific Output Options</li>
<li>External flow of control (events)</li>
<li>Using internal tables as snapshots of database tables</li>
<li>Working with get events</li>
<li>Dynamic sort command with several sort criteria</li>
<li>Working with Field Symbols</li>
<li>Transferring data to a file</li>
<li>Reading data from a file</li>
</ul>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Download Link: <a href="http://www.abap-tutorials.com/wp-content/uploads/2010/05/abapcodebook.pdf">ABAP Code Book</a></p>


<p>You might also be interested in these posts:<ol><li><a href='http://www.abap-tutorials.com/2009/07/15/my-inactive-programs/' rel='bookmark' title='ABAP Program to show My Inactive Programs'>ABAP Program to show My Inactive Programs</a></li>
<li><a href='http://www.abap-tutorials.com/2009/11/19/logical-database-in-sap-a-must-for-abap-hr-programmer/' rel='bookmark' title='Logical Database in SAP &#8211; a must for ABAP HR programmer'>Logical Database in SAP &#8211; a must for ABAP HR programmer</a></li>
<li><a href='http://www.abap-tutorials.com/2009/07/25/list-of-programs-without-t-codes/' rel='bookmark' title='ABAP Program to List Programs without T-Codes'>ABAP Program to List Programs without T-Codes</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.abap-tutorials.com/2010/05/07/abap-programs-for-beginners/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Saving Custom Layouts in SAP ALV</title>
		<link>http://www.abap-tutorials.com/2010/04/17/saving-custom-layouts-in-sap-alv/</link>
		<comments>http://www.abap-tutorials.com/2010/04/17/saving-custom-layouts-in-sap-alv/#comments</comments>
		<pubDate>Sat, 17 Apr 2010 06:07:35 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[ABAP]]></category>
		<category><![CDATA[Formatting]]></category>
		<category><![CDATA[Quick Reference]]></category>
		<category><![CDATA[SAP]]></category>
		<category><![CDATA[ALV]]></category>
		<category><![CDATA[ALV grid]]></category>
		<category><![CDATA[custom layout]]></category>
		<category><![CDATA[layout in ALV]]></category>
		<category><![CDATA[saving layout]]></category>

		<guid isPermaLink="false">http://www.abap-tutorials.com/?p=1471</guid>
		<description><![CDATA[When using a progam or report dealing in ALV, user sometimes does not get the proper display at the time of output in ALV. The reason is non-customising of the layout by the user or the default layout set by other user. Following process will help you to store your own customized layout.  When displaying the ALV result, adjust the [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">When using a progam or report dealing in ALV, user sometimes does not get the proper display at the time of output in ALV. The reason is non-customising of the layout by the user or the default layout set by other user.</p>
<div style="width: 100%; float: left;">
<p style="text-align: justify;"><a href="http://www.abap-tutorials.com/wp-content/uploads/2010/04/alv_grid.png"><img class="aligncenter size-full wp-image-1472" title="ALV Grid" src="http://www.abap-tutorials.com/wp-content/uploads/2010/04/alv_grid.png" alt="" width="410" height="314" /></a></p>
</div>
<p style="text-align: justify;">Following process will help you to store your own customized layout.</p>
<p style="text-align: justify;"><span id="more-1471"></span></p>
<p style="text-align: justify;"> When displaying the ALV result, adjust the layout according to your need. Now save the layout by navigating to Settings -&gt; Layout -&gt; Savings.</p>
<div style="width: 100%; float: left;">
<p style="text-align: center;"><a href="http://www.abap-tutorials.com/wp-content/uploads/2010/04/saving_custom_layout.jpg"><img class="aligncenter size-full wp-image-1473" title="save Layout" src="http://www.abap-tutorials.com/wp-content/uploads/2010/04/saving_custom_layout.jpg" alt="" width="423" height="317" /></a></p>
</div>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Enter the layout Code and layout Name name that you want to save. Check the checkbox &#8216;User-Specific&#8217; to make the layout specific to your login. You can also set one of the layout as your default layout by checking the checkbox &#8216;Default Setting&#8217;.</p>
<div style="width:100%;float:left">
<p style="text-align: center;"> <a href="http://www.abap-tutorials.com/wp-content/uploads/2010/04/saving_custom_layout2.jpg"><img class="aligncenter size-full wp-image-1477" title="Save Custom Layout" src="http://www.abap-tutorials.com/wp-content/uploads/2010/04/saving_custom_layout2.jpg" alt="" width="349" height="284" /></a></p>
</div>
<p style="text-align: justify;">
<p style="text-align: justify;">
<strong>Points to remember:</strong><br />
1. The name of your layout must not start with a number, because this type of name is reserved for the standard layouts delivered by SAP.<br />
2. Non-user-specific layouts (client-specific standard layouts) must begin with &#8220;/&#8221;.</p>


<p>You might also be interested in these posts:<ol><li><a href='http://www.abap-tutorials.com/2009/07/17/assign-a-t-code-to-maintenance-view/' rel='bookmark' title='Assign a T-code to Maintenance View in SAP'>Assign a T-code to Maintenance View in SAP</a></li>
<li><a href='http://www.abap-tutorials.com/2009/07/20/abap-editor-create-custom-pattern/' rel='bookmark' title='ABAP Editor: Create custom Pattern'>ABAP Editor: Create custom Pattern</a></li>
<li><a href='http://www.abap-tutorials.com/2009/07/11/add-custom-button-onto-alv-grid/' rel='bookmark' title='Add custom button onto ALV Grid in SAP'>Add custom button onto ALV Grid in SAP</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.abap-tutorials.com/2010/04/17/saving-custom-layouts-in-sap-alv/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Complete Reference to ABAP Basics</title>
		<link>http://www.abap-tutorials.com/2010/03/16/complete-reference-to-abap-basics/</link>
		<comments>http://www.abap-tutorials.com/2010/03/16/complete-reference-to-abap-basics/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 18:16:32 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[ABAP]]></category>
		<category><![CDATA[Abap Objects]]></category>
		<category><![CDATA[ALV]]></category>
		<category><![CDATA[BDC / LSMW]]></category>
		<category><![CDATA[DDIC]]></category>
		<category><![CDATA[Enhancement/Modification]]></category>
		<category><![CDATA[Formatting]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[Function Modules]]></category>
		<category><![CDATA[Module Pool]]></category>
		<category><![CDATA[Quick Reference]]></category>
		<category><![CDATA[SAP]]></category>
		<category><![CDATA[SAP Query]]></category>
		<category><![CDATA[ABAP Basics]]></category>
		<category><![CDATA[Complete Reference]]></category>

		<guid isPermaLink="false">http://www.abap-tutorials.com/?p=1393</guid>
		<description><![CDATA[The following ebook is for the ABAP beginners giving an overview of basic topics in ABAP. This reference guide focuses on following topics: ENTERPRISE RESOURCE PLANNING (ERP) SAP ADVANTAGES Role of ABAPer R/3 ARCHITECTURE COMPONENTS WHAT IS CLIENT IN SAP Developemt Obects -  REPOSITORY OBJECTS and  DATA DICTIONARY OBJECTS ABAP GUI DATA DICTIONARY INTERNAL TABLES SUBROUTINES [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">The following ebook is for the ABAP beginners giving an overview of basic topics in ABAP.</p>
<p style="text-align: justify;">
<div style="float: left; width: 100%;"><img class="aligncenter size-full wp-image-1398" title="References" src="http://www.abap-tutorials.com/wp-content/uploads/2010/03/references.jpg" alt="" width="288" height="285" /></div>
</p>
<p style="text-align: justify;">This reference guide focuses on following topics:</p>
<ul>
<li>
<div style="text-align: justify;">ENTERPRISE RESOURCE PLANNING (ERP)</div>
</li>
<li>
<div style="text-align: justify;">SAP ADVANTAGES</div>
</li>
<li>
<div style="text-align: justify;">Role of ABAPer</div>
</li>
<li>
<div style="text-align: justify;">R/3 ARCHITECTURE COMPONENTS</div>
</li>
<li>
<div style="text-align: justify;">WHAT IS CLIENT IN SAP</div>
</li>
<li style="text-align: justify;">Developemt Obects -  REPOSITORY OBJECTS and  DATA DICTIONARY OBJECTS</li>
<li style="text-align: justify;">ABAP GUI</li>
<li style="text-align: justify;">DATA DICTIONARY</li>
<li style="text-align: justify;">INTERNAL TABLES</li>
<li style="text-align: justify;">SUBROUTINES</li>
<li style="text-align: justify;">Reports</li>
<li style="text-align: justify;">MODULE POOL PROGRAMMING</li>
<li style="text-align: justify;">Menu Painter</li>
<li style="text-align: justify;">BATCH DATA COMMUNICATION</li>
<li style="text-align: justify;">LSMW ( Legacy System Migration Workbench)</li>
<li style="text-align: justify;">SAPSCRIPTS</li>
<li style="text-align: justify;">SMARTFORMS</li>
</ul>
<p style="text-align: justify;"> <span id="more-1393"></span></p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Link : <a href="http://www.abap-tutorials.com/wp-content/uploads/pdfs/Complete_Reference_to_ABAP_Basics.pdf" target="_blank">Complete Reference to ABAP Basics</a></p>


<p>You might also be interested in these posts:<ol><li><a href='http://www.abap-tutorials.com/2009/07/28/display-se78-pictures-on-screen/' rel='bookmark' title='ABAP Program to Display SE78 pictures on Screen'>ABAP Program to Display SE78 pictures on Screen</a></li>
<li><a href='http://www.abap-tutorials.com/2010/05/07/abap-programs-for-beginners/' rel='bookmark' title='ABAP Programs for Beginners'>ABAP Programs for Beginners</a></li>
<li><a href='http://www.abap-tutorials.com/2009/08/19/lock-objects-in-sap/' rel='bookmark' title='Lock Objects in SAP'>Lock Objects in SAP</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.abap-tutorials.com/2010/03/16/complete-reference-to-abap-basics/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ABAP HR Program to list maintained Infotypes in SAP</title>
		<link>http://www.abap-tutorials.com/2009/11/18/abap-hr-program-to-list-maintained-infotypes-in-sap/</link>
		<comments>http://www.abap-tutorials.com/2009/11/18/abap-hr-program-to-list-maintained-infotypes-in-sap/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 12:13:59 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[ABAP HR]]></category>
		<category><![CDATA[Abap Objects]]></category>
		<category><![CDATA[Formatting]]></category>
		<category><![CDATA[Function Modules]]></category>
		<category><![CDATA[Report]]></category>
		<category><![CDATA[Sample Code]]></category>
		<category><![CDATA[Infotypes]]></category>
		<category><![CDATA[SAP]]></category>

		<guid isPermaLink="false">http://www.abap-tutorials.com/?p=1051</guid>
		<description><![CDATA[Following ABAP HR program is used to display a list of all the Infotype structures maintaine in the SAP. The program generates an ALV Grid which lists all the infotypes in the system. ABAP Code: *&#38;---------------------------------------------------------------------* *&#38; Report ZINFOTYPE * *&#38;---------------------------------------------------------------------* *&#38; * *&#38; This program lists all the infotypes maintained in SAP system * *&#38;---------------------------------------------------------------------* REPORT [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">Following ABAP HR program is used to display a list of all the Infotype structures maintaine in the SAP. The program generates an ALV Grid which lists all the infotypes in the system.</p>
<p style="text-align: center;">
<div style="float: left; width: 100%;"><img class="aligncenter size-full wp-image-1052" title="list_of_infotype_structure" src="http://www.abap-tutorials.com/wp-content/uploads/2009/11/list_of_infotype_structure.jpg" alt="list_of_infotype_structure" width="614" height="445" /></div>
<p><span id="more-1051"></span></p>
<p><strong><span style="color: #0000ff;">ABAP Code:</span></strong></p>
<pre lang="ABAP">*&amp;---------------------------------------------------------------------*
*&amp; Report  ZINFOTYPE                                                   *
*&amp;---------------------------------------------------------------------*
*&amp;                                                                     *
*&amp; This program lists all the infotypes maintained in SAP system       *
*&amp;---------------------------------------------------------------------*
REPORT  zinfotype NO STANDARD PAGE HEADING line-size 255.
TYPE-POOLS : slis.
*Structure declaration for Infotypes for customer
TYPES : BEGIN OF ty_table,
        infty TYPE infty,
        pnnnn TYPE pnnnn_d,
        END OF ty_table.
*Structure for infotype text
TYPES : BEGIN OF ty_itext,
        infty TYPE infty,
        itext TYPE intxt,
        sprsl TYPE sprsl,
        END OF ty_itext.
*Structure for output display
TYPES : BEGIN OF ty_output,
        infty TYPE infty,
        itext TYPE intxt,
        pnnnn TYPE pnnnn_d,
       END OF ty_output.
*internal table and work area declarations
DATA : it_table TYPE STANDARD TABLE OF ty_table INITIAL SIZE 0,
       it_output TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
       it_ittext TYPE STANDARD TABLE OF ty_itext INITIAL SIZE 0,
       wa_table TYPE ty_table,
       wa_output TYPE ty_output,
       wa_ittext TYPE ty_itext.
*Data declarations for ALV
DATA: c_ccont TYPE REF TO cl_gui_custom_container,   "Custom container
*object
      c_alvgd         TYPE REF TO cl_gui_alv_grid,   "ALV grid object
      it_fcat            TYPE lvc_t_fcat,            "Field catalogue
      it_layout          TYPE lvc_s_layo.
"Layout

INITIALIZATION.

START-OF-SELECTION.
*select the infotypes maintained
  SELECT infty
          pnnnn
          FROM t582a
          INTO TABLE it_table.
*Select the infotype texts
  IF it_table[] IS NOT INITIAL.
    SELECT itext
  infty
  sprsl
  FROM t582s
  INTO CORRESPONDING FIELDS OF TABLE it_ittext
  FOR ALL ENTRIES IN it_table
  WHERE infty = it_table-infty
  AND sprsl = 'E'.
  ENDIF.
*Apppending the data to the internal table of ALV output
  LOOP AT it_table INTO wa_table.
    wa_output-infty = wa_table-infty.
    wa_output-pnnnn = wa_table-pnnnn.
* For texts
    READ TABLE it_ittext INTO wa_ittext WITH KEY infty = wa_table-infty.
    wa_output-itext = wa_ittext-itext.    APPEND wa_output TO it_output.
    CLEAR wa_output.
  ENDLOOP.
* Calling the ALV screen with custom container
  CALL SCREEN 0600.
*On this statement double click it takes you to the screen painter SE51.
*Enter the attributes
*Create a Custom container and name it CC_CONT and OK code as OK_CODE.
*Save check and Activate the screen painter.
*Now a normal screen with number 600 is created which holds the ALV
*grid. PBO of the actual screen , Here we can give a title and
*customized menus.
*&amp;---------------------------------------------------------------------*
*&amp;      Module  STATUS_0600  OUTPUT
*&amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module STATUS_0600 output.
  SET PF-STATUS '0600'.
  SET TITLEBAR '0600'.
endmodule.                 " STATUS_0600OUTPUT
* calling the PBO module ALV_GRID.
*&amp;---------------------------------------------------------------------*
*&amp;      Module  ALV_GRID  OUTPUT
*&amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE alv_grid OUTPUT.
  CREATE OBJECT c_ccont
    EXPORTING
      container_name = 'CC_CONT'.
  CREATE OBJECT c_alvgd
    EXPORTING
      i_parent = c_ccont.
* Set field for ALV
  PERFORM alv_build_fieldcat.
* Set ALV attributes FOR LAYOUT
  PERFORM alv_report_layout.  CHECK NOT c_alvgd IS INITIAL.
* Call ALV GRID
  CALL METHOD c_alvgd-&gt;set_table_for_first_display
    EXPORTING
      is_layout                     = it_layout
    CHANGING
      it_outtab                     = it_output
      it_fieldcatalog               = it_fcat
    EXCEPTIONS
      invalid_parameter_combination = 1
      program_error                 = 2
      too_many_lines                = 3
      OTHERS                        = 4.
  IF sy-subrc &lt;&gt; 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
ENDMODULE.                 " ALV_GRID  OUTPUT
*&amp;---------------------------------------------------------------------*
*&amp;      Form  alv_build_fieldcat
*&amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      &lt;--P_IT_FCAT  text
*----------------------------------------------------------------------*
FORM alv_build_fieldcat.
  DATA lv_fldcat TYPE lvc_s_fcat.  CLEAR
lv_fldcat.
  lv_fldcat-row_pos   = '1'.
  lv_fldcat-col_pos   = '1'.
  lv_fldcat-fieldname = 'INFTY'.
  lv_fldcat-tabname   = 'IT_OUTPUT'.
  lv_fldcat-outputlen = 8.
  lv_fldcat-scrtext_m = 'Infotype'.
  lv_fldcat-icon = 'X'.
  APPEND lv_fldcat TO it_fcat.  CLEAR lv_fldcat.
  lv_fldcat-row_pos   = '1'.
  lv_fldcat-col_pos   = '2'.
  lv_fldcat-fieldname = 'PNNNN'.
  lv_fldcat-tabname   = 'IT_OUTPUT'.
  lv_fldcat-outputlen = 15.
  lv_fldcat-scrtext_m = 'Structure'.
  lv_fldcat-icon = ''.
  APPEND lv_fldcat TO it_fcat.  CLEAR lv_fldcat.  lv_fldcat-row_pos
= '1'.
  lv_fldcat-col_pos   = '3'.
  lv_fldcat-fieldname = 'ITEXT'.
  lv_fldcat-tabname   = 'IT_OUTPUT'.
  lv_fldcat-outputlen = 60.
  lv_fldcat-scrtext_m = 'Description'.
  lv_fldcat-icon = ''.
  APPEND lv_fldcat TO it_fcat.  CLEAR lv_fldcat.
ENDFORM.                    " alv_build_fieldcat
*&amp;---------------------------------------------------------------------*
*&amp;      Form  alv_report_layout
*&amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      &lt;--P_IT_LAYOUT  text
*----------------------------------------------------------------------*
FORM alv_report_layout.
  it_layout-cwidth_opt = 'X'.
  it_layout-zebra = 'X'.
ENDFORM.                    " alv_report_layout
* PAI module of the screen created. In case we use an interactive ALV or
*for additional functionalities we can create OK codes
*and based on the user command we can do the coding.
*&amp;---------------------------------------------------------------------*
*&amp;      Module  USER_COMMAND_0600  INPUT
*&amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
module USER_COMMAND_0600 input.
endmodule.                 "USER_COMMAND_0600  INPUT
*&amp;---------------------------------------------------------------------*
*&amp;      Module  EXIT  INPUT
*&amp;---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE EXIT INPUT.
  LEAVE to SCREEN 0.
ENDMODULE.                 " EXIT  INPUT</pre>
<p><strong><span style="color: #3366ff;">Steps to be followed:</span></strong></p>
<p>1. Assign PNP as Logical Database in Program Attributes.</p>
<p>2. Create screen (0600) and write following code in its flow logic.<br />
PROCESS BEFORE OUTPUT.<br />
MODULE STATUS_0600.<br />
MODULE alv_grid.</p>
<p>PROCESS AFTER INPUT.<br />
MODULE exit AT EXIT-COMMAND.<br />
MODULE USER_COMMAND_0600.</p>
<p>3. Place a custom container on the screen with name CC_CONT and also assign OK_CODE name to OK type. (both in Element List &#8211; &gt; General Attributes).</p>
<p>4. Create PBO elements (PF Status, Titlebar).</p>
<p>5. Activate and execute the program.</p>


<p>You might also be interested in these posts:<ol><li><a href='http://www.abap-tutorials.com/2009/07/28/edit-alv-grid-contents/' rel='bookmark' title='ABAP Program with Editable ALV Grid Contents'>ABAP Program with Editable ALV Grid Contents</a></li>
<li><a href='http://www.abap-tutorials.com/2009/07/25/list-of-programs-without-t-codes/' rel='bookmark' title='ABAP Program to List Programs without T-Codes'>ABAP Program to List Programs without T-Codes</a></li>
<li><a href='http://www.abap-tutorials.com/2009/11/18/list-of-sap-hr-and-infotypes-tables/' rel='bookmark' title='List of SAP HR and Infotypes Tables'>List of SAP HR and Infotypes Tables</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.abap-tutorials.com/2009/11/18/abap-hr-program-to-list-maintained-infotypes-in-sap/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ABAP program to create Formatted Excel File using XML</title>
		<link>http://www.abap-tutorials.com/2009/11/18/abap-program-to-create-formatted-excel-using-xml/</link>
		<comments>http://www.abap-tutorials.com/2009/11/18/abap-program-to-create-formatted-excel-using-xml/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 10:39:36 +0000</pubDate>
		<dc:creator>Admin</dc:creator>
				<category><![CDATA[ABAP]]></category>
		<category><![CDATA[Abap Objects]]></category>
		<category><![CDATA[Formatting]]></category>
		<category><![CDATA[Quick Reference]]></category>
		<category><![CDATA[Sample Code]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Upload Download]]></category>
		<category><![CDATA[transformation]]></category>
		<category><![CDATA[XML transformation]]></category>

		<guid isPermaLink="false">http://www.abap-tutorials.com/?p=1021</guid>
		<description><![CDATA[From release 620, ABAP has provided us a way to transform our data using the XML transformation. We can very use the XML to generate the formatted Excel File. The advantages of the XML technique over the OLE: Using XML technique, File can be generated in Background processing. It would not be possible with OLE [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">From release 620, ABAP has provided us a way to transform our data using the XML transformation. We can very use the XML to generate the formatted Excel File.</p>
<p style="text-align: justify;"><strong>The advantages of the XML technique over the OLE:</strong></p>
<ul style="text-align: justify;">
<li>Using XML technique, File can be generated in Background processing. It would not be possible with OLE technique to generate the Formatted excel file because it needs the active connection with the windows.</li>
<li>Using XML we can send the fancy generated file as an Email Attachment.</li>
<li>We can create formatted excel file using the XML technique from the Web applications generated using Web Dynpro or BSP.</li>
<li style="text-align: justify;">It’s faster when compared to OLE technique.</li>
</ul>
<p style="text-align: justify;"><span id="more-1021"></span></p>
<p style="text-align: justify;"><strong><span style="color: #0000ff;">ABAP Program Code:</span></strong></p>
<p style="text-align: justify;"> </p>
<pre lang="ABAP">*&amp;---------------------------------------------------------------------*
*&amp; Report  ZTEST_NP_EXCEL_XML
*&amp;
*&amp; Download the formatted excel file using XML
*&amp;---------------------------------------------------------------------*

REPORT  ztest_np_excel_xml.

TYPES: BEGIN OF ty_mara,
       matnr TYPE matnr,
       maktx TYPE char30,
       END   OF ty_mara.

DATA: itab TYPE STANDARD TABLE OF ty_mara,
      la_tab LIKE LINE OF itab,
      xmlstr TYPE string.

START-OF-SELECTION.

*---------
* Test table
*---------
  la_tab-matnr = 'TEST1'.
  la_tab-maktx = 'Test description'.
  APPEND la_tab TO itab.

  la_tab-matnr = 'TEST2'.
  la_tab-maktx = 'Test description 2'.
  APPEND la_tab TO itab.

*---------
* Get the XML data excel
*---------
  CALL TRANSFORMATION ztest_np_xls
    SOURCE table = itab
    RESULT XML xmlstr.

*---------
* Download the file
*---------

* Fill the table
  DATA: xml_table TYPE STANDARD TABLE OF string.

  APPEND xmlstr TO xml_table.

  DATA: window_title TYPE string,
        fullpath TYPE string,
        path TYPE string,
        user_action TYPE i,
        default_extension TYPE string,
        default_file_name TYPE string,
        file_filter TYPE  string,
        filename TYPE string,
        initialpath TYPE string.

* File selection
  MOVE '.XLS' TO default_extension.
  MOVE 'XLS files (*.XLS)|*.XLS' TO file_filter.

  CALL METHOD cl_gui_frontend_services=&gt;file_save_dialog
    EXPORTING
      default_extension = default_extension
      default_file_name = default_file_name
      file_filter       = file_filter
      initial_directory = initialpath
    CHANGING
      filename          = filename
      path              = path
      fullpath          = fullpath
      user_action       = user_action
    EXCEPTIONS
      cntl_error        = 1
      error_no_gui      = 2
      OTHERS            = 3.
  IF sy-subrc &lt;&gt; 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

* download file
  CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename                = fullpath
      filetype                = 'ASC'
    TABLES
      data_tab                = xml_table
    EXCEPTIONS
      file_write_error        = 1
      no_batch                = 2
      gui_refuse_filetransfer = 3
      invalid_type            = 4
      OTHERS                  = 5.
  IF sy-subrc &lt;&gt; 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.</pre>
<p><strong><span style="color: #0000ff;">Code for XML Transformation ( Double click on the name ztest_np_xls after statement Call Transformation) :</span></strong><br />
 </p>
<div><span style="font-size: x-small;">&lt;?sap.transform simple?&gt;</span></div>
<div><span style="font-size: x-small;">&lt;?mso-application progid=&#8221;Excel.Sheet&#8221;?&gt;</span></div>
<p><span style="font-size: x-small;">&lt;tt:transform xmlns:tt=&#8221;http://www.sap.com/transformation-templates&#8221;&gt;</span><br />
This test program will generate the formatted excel like this:</p>
<p>&lt;tt:root name=&#8221;table&#8221;/&gt;</p>
<p>&lt;tt:template&gt;</p>
<p>&lt;Workbook xmlns=&#8221;urn:schemas-microsoft-com:office:spreadsheet&#8221; xmlns:o=&#8221;urn:schemas-microsoft-com:office:office&#8221; xmlns:x=&#8221;urn:schemas-microsoft-com:office:excel&#8221; xmlns:ss=&#8221;urn:schemas-microsoft-com:office:spreadsheet&#8221; xmlns:html=</p>
<p>&#8220;http://www.w3.org/TR/REC-html40&#8243;&gt;</p>
<p>&lt;DocumentProperties xmlns=&#8221;urn:schemas-microsoft-com:office:office&#8221;&gt;</p>
<p>&lt;Author&gt;npatel&lt;/Author&gt;</p>
<p>&lt;LastAuthor&gt;npatel&lt;/LastAuthor&gt;</p>
<p>&lt;Created&gt;2009-01-01T22:27:09Z&lt;/Created&gt;</p>
<p>&lt;Company&gt;&lt;/Company&gt;</p>
<p>&lt;Version&gt;11.8132&lt;/Version&gt;</p>
<p>&lt;/DocumentProperties&gt;</p>
<p>&lt;ExcelWorkbook xmlns=&#8221;urn:schemas-microsoft-com:office:excel&#8221;&gt;</p>
<p>&lt;WindowHeight&gt;12660&lt;/WindowHeight&gt;</p>
<p>&lt;WindowWidth&gt;19980&lt;/WindowWidth&gt;</p>
<p>&lt;WindowTopX&gt;480&lt;/WindowTopX&gt;</p>
<p>&lt;WindowTopY&gt;120&lt;/WindowTopY&gt;</p>
<p>&lt;ProtectStructure&gt;False&lt;/ProtectStructure&gt;</p>
<p>&lt;ProtectWindows&gt;False&lt;/ProtectWindows&gt;</p>
<p>&lt;/ExcelWorkbook&gt;</p>
<p>&lt;Styles&gt;</p>
<p>&lt;Style ss:ID=&#8221;Default&#8221; ss:Name=&#8221;Normal&#8221;&gt;</p>
<p>&lt;Alignment ss:Vertical=&#8221;Bottom&#8221;&gt;&lt;/Alignment&gt;</p>
<p>&lt;Borders&gt;&lt;/Borders&gt;</p>
<p>&lt;Font&gt;&lt;/Font&gt;</p>
<p>&lt;Interior&gt;&lt;/Interior&gt;</p>
<p>&lt;NumberFormat/&gt;</p>
<p>&lt;Protection&gt;&lt;/Protection&gt;</p>
<p>&lt;/Style&gt;</p>
<p>&lt;Style ss:ID=&#8221;s23&#8243;&gt;</p>
<p>&lt;Font ss:Bold=&#8221;1&#8243; ss:Size=&#8221;26&#8243; x:Family=&#8221;Swiss&#8221;&gt;&lt;/Font&gt;</p>
<p>&lt;Interior ss:Color=&#8221;#FFFF99&#8243; ss:Pattern=&#8221;Solid&#8221;&gt;&lt;/Interior&gt;</p>
<p>&lt;/Style&gt;</p>
<p>&lt;/Styles&gt;</p>
<p>&lt;Worksheet ss:Name=&#8221;Sheet1&#8243;&gt;</p>
<p>&lt;Table ss:ExpandedColumnCount=&#8221;3&#8243; ss:ExpandedRowCount=&#8221;25&#8243; x:FullColumns=&#8221;1&#8243; x:FullRows=&#8221;1&#8243;&gt;</p>
<p>&lt;Column ss:Width=&#8221;152.25&#8243;/&gt;</p>
<p>&lt;Column ss:Width=&#8221;180&#8243;/&gt;</p>
<p>&lt;Column ss:Width=&#8221;117&#8243;/&gt;</p>
<p>&lt;Row&gt;</p>
<p>&lt;Cell ss:StyleID=&#8221;s23&#8243;&gt;</p>
<p>&lt;Data ss:Type=&#8221;String&#8221;&gt;Material No&lt;/Data&gt;</p>
<p>&lt;/Cell&gt;</p>
<p>&lt;Cell ss:StyleID=&#8221;s23&#8243;&gt;</p>
<p>&lt;Data ss:Type=&#8221;String&#8221;&gt;Material Desc&lt;/Data&gt;</p>
<p>&lt;/Cell&gt;</p>
<p>&lt;/Row&gt;</p>
<p>&lt;tt:loop ref=&#8221;.table&#8221;&gt;</p>
<p>&lt;Row&gt;</p>
<p>&lt;Cell&gt;</p>
<p>&lt;Data ss:Type=&#8221;String&#8221;&gt;</p>
<p>&lt;tt:value ref=&#8221;MATNR&#8221;/&gt;</p>
<p>&lt;/Data&gt;</p>
<p>&lt;/Cell&gt;</p>
<p>&lt;Cell&gt;</p>
<p>&lt;Data ss:Type=&#8221;String&#8221;&gt;</p>
<p>&lt;tt:value ref=&#8221;MAKTX&#8221;/&gt;</p>
<p>&lt;/Data&gt;</p>
<p>&lt;/Cell&gt;</p>
<p>&lt;/Row&gt;</p>
<p>&lt;/tt:loop&gt;</p>
<p>&lt;/Table&gt;</p>
<p>&lt;WorksheetOptions xmlns=&#8221;urn:schemas-microsoft-com:office:excel&#8221;&gt;</p>
<p>&lt;Selected/&gt;</p>
<p>&lt;Panes&gt;</p>
<p>&lt;Pane&gt;</p>
<p>&lt;Number&gt;3&lt;/Number&gt;</p>
<p>&lt;ActiveRow&gt;4&lt;/ActiveRow&gt;</p>
<p>&lt;ActiveCol&gt;1&lt;/ActiveCol&gt;</p>
<p>&lt;/Pane&gt;</p>
<p>&lt;/Panes&gt;</p>
<p>&lt;ProtectObjects&gt;False&lt;/ProtectObjects&gt;</p>
<p>&lt;ProtectScenarios&gt;False&lt;/ProtectScenarios&gt;</p>
<p>&lt;/WorksheetOptions&gt;</p>
<p>&lt;/Worksheet&gt;</p>
<p>&lt;Worksheet ss:Name=&#8221;Sheet2&#8243;&gt;</p>
<p>&lt;WorksheetOptions xmlns=&#8221;urn:schemas-microsoft-com:office:excel&#8221;&gt;</p>
<p>&lt;ProtectObjects&gt;False&lt;/ProtectObjects&gt;</p>
<p>&lt;ProtectScenarios&gt;False&lt;/ProtectScenarios&gt;</p>
<p>&lt;/WorksheetOptions&gt;</p>
<p>&lt;/Worksheet&gt;</p>
<p>&lt;Worksheet ss:Name=&#8221;Sheet3&#8243;&gt;</p>
<p>&lt;WorksheetOptions xmlns=&#8221;urn:schemas-microsoft-com:office:excel&#8221;&gt;</p>
<p>&lt;ProtectObjects&gt;False&lt;/ProtectObjects&gt;</p>
<p>&lt;ProtectScenarios&gt;False&lt;/ProtectScenarios&gt;</p>
<p>&lt;/WorksheetOptions&gt;</p>
<p>&lt;/Worksheet&gt;</p>
<p>&lt;/Workbook&gt;</p>
<p>&lt;/tt:template&gt;</p>
<p>&lt;/tt:transform&gt;</p>
<p> </p>
<p> </p>
<p> The output of the program ( including XML Transormation) is shown below.</p>
<p> <img class="aligncenter size-full wp-image-1026" title="xml_trans" src="http://www.abap-tutorials.com/wp-content/uploads/2009/11/xml_trans1.jpg" alt="xml_trans" width="535" height="309" /></p>
<p> </p>
<p><strong>Note:</strong> It works fine with MS Excel. For others package like Open Office, it wont work.</p>


<p>You might also be interested in these posts:<ol><li><a href='http://www.abap-tutorials.com/2011/08/06/upload-file-from-application-server-into-abap-internal-table-in-sa/' rel='bookmark' title='Upload File from Application Server into ABAP Internal Table in SAP'>Upload File from Application Server into ABAP Internal Table in SAP</a></li>
<li><a href='http://www.abap-tutorials.com/2009/07/28/edit-alv-grid-contents/' rel='bookmark' title='ABAP Program with Editable ALV Grid Contents'>ABAP Program with Editable ALV Grid Contents</a></li>
<li><a href='http://www.abap-tutorials.com/2011/07/01/sap-abap-transferring-internal-table-contents-to-a-file-on-the-application-server/' rel='bookmark' title='SAP ABAP Transferring Internal Table Contents to a file on the Application Server'>SAP ABAP Transferring Internal Table Contents to a file on the Application Server</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.abap-tutorials.com/2009/11/18/abap-program-to-create-formatted-excel-using-xml/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

