<?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>excel &#8211; SAP EWM Help</title>
	<atom:link href="https://www.sapewmhelp.com/question-tag/excel/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.sapewmhelp.com</link>
	<description>SAP EWM questions answered by experts — ABAP, S/4HANA, warehouse management</description>
	<lastBuildDate>Sat, 18 Oct 2025 20:33:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>
	<item>
		<title>create an Excel file with styling (colors, fonts, etc.) using the XCO Library in ABAP.</title>
		<link>https://www.sapewmhelp.com/question/create-an-excel-file-with-styling-colors-fonts-etc-using-the-xco-library-in-abap/</link>
					<comments>https://www.sapewmhelp.com/question/create-an-excel-file-with-styling-colors-fonts-etc-using-the-xco-library-in-abap/#respond</comments>
		
		<dc:creator><![CDATA[DPM125]]></dc:creator>
		<pubDate>Sat, 18 Oct 2025 20:33:36 +0000</pubDate>
				<guid isPermaLink="false">https://www.sapewmhelp.com/?question=create-an-excel-file-with-styling-colors-fonts-etc-using-the-xco-library-in-abap</guid>

					<description><![CDATA[Create an Excel file called employees.xlsx containing employee data, where: Header row has bold white text on a blue background Data rows have standard black font Salary column is formatted as currency CLASS zcl_create_excel_xco DEFINITION PUBLIC FINAL CREATE PUBLIC. PUBLIC SECTION. METHODS create_employee_excel. ENDCLASS. CLASS zcl_create_excel_xco IMPLEMENTATION. METHOD create_employee_excel. &#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- &#8221; Step 1: Define data [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Create an Excel file called <code>employees.xlsx</code> containing employee data, where:</p>
<ul>
<li>
<p>Header row has <strong>bold white text</strong> on a <strong>blue background</strong></p>
</li>
<li>
<p>Data rows have standard black font</p>
</li>
<li>
<p>Salary column is <strong>formatted as currency<br />
</strong></p>
</li>
</ul>
<p>CLASS zcl_create_excel_xco DEFINITION<br />
PUBLIC<br />
FINAL<br />
CREATE PUBLIC.</p>
<p>PUBLIC SECTION.<br />
METHODS create_employee_excel.<br />
ENDCLASS.</p>
<p>CLASS zcl_create_excel_xco IMPLEMENTATION.</p>
<p>METHOD create_employee_excel.</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8221; Step 1: Define data<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
TYPES: BEGIN OF ty_employee,<br />
empid TYPE string,<br />
name TYPE string,<br />
department TYPE string,<br />
salary TYPE p DECIMALS 2,<br />
END OF ty_employee.</p>
<p>DATA(lt_employees) = VALUE STANDARD TABLE OF ty_employee(<br />
( empid = &#8216;E001&#8217; name = &#8216;Alice&#8217; department = &#8216;IT&#8217; salary = &#8216;65000&#8217; )<br />
( empid = &#8216;E002&#8217; name = &#8216;Bob&#8217; department = &#8216;HR&#8217; salary = &#8216;55000&#8217; )<br />
( empid = &#8216;E003&#8217; name = &#8216;Carol&#8217; department = &#8216;Finance&#8217; salary = &#8216;72000&#8217; )<br />
).</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8221; Step 2: Create Excel document<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
DATA(lo_doc) = xco_cp_xlsx=&gt;document-&gt;create( ).</p>
<p>&#8221; Add sheet<br />
DATA(lo_sheet) = lo_doc-&gt;sheets-&gt;add( &#8216;Employees&#8217; ).</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8221; Step 3: Define styles<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
DATA(lo_styles) = lo_doc-&gt;styles.</p>
<p>&#8221; Header style: bold + white text + blue background<br />
DATA(lo_style_header) = lo_styles-&gt;add( ).<br />
lo_style_header-&gt;font-&gt;name-&gt;set( &#8216;Calibri&#8217; ).<br />
lo_style_header-&gt;font-&gt;bold-&gt;set( abap_true ).<br />
lo_style_header-&gt;font-&gt;color-&gt;set_rgb( &#8216;FFFFFF&#8217; ).<br />
lo_style_header-&gt;fill-&gt;color-&gt;set_rgb( &#8216;4472C4&#8217; ). &#8221; Blue background<br />
lo_style_header-&gt;alignment-&gt;horizontal-&gt;set( xco_cp_xlsx_alignment=&gt;horizontal-&gt;center ).</p>
<p>&#8221; Normal cell style<br />
DATA(lo_style_normal) = lo_styles-&gt;add( ).<br />
lo_style_normal-&gt;font-&gt;name-&gt;set( &#8216;Calibri&#8217; ).<br />
lo_style_normal-&gt;font-&gt;size-&gt;set( 11 ).</p>
<p>&#8221; Salary style (number format)<br />
DATA(lo_style_salary) = lo_styles-&gt;add( ).<br />
lo_style_salary-&gt;font-&gt;name-&gt;set( &#8216;Calibri&#8217; ).<br />
lo_style_salary-&gt;number_format-&gt;set( xco_cp_xlsx_number_format=&gt;builtin-&gt;currency_2 ).</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8221; Step 4: Write header row<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
DATA(lo_header_row) = lo_sheet-&gt;rows-&gt;add( 1 ).</p>
<p>lo_header_row-&gt;cells-&gt;add( 1 )-&gt;value-&gt;set( &#8216;EmpID&#8217; )-&gt;style-&gt;set( lo_style_header ).<br />
lo_header_row-&gt;cells-&gt;add( 2 )-&gt;value-&gt;set( &#8216;Name&#8217; )-&gt;style-&gt;set( lo_style_header ).<br />
lo_header_row-&gt;cells-&gt;add( 3 )-&gt;value-&gt;set( &#8216;Department&#8217; )-&gt;style-&gt;set( lo_style_header ).<br />
lo_header_row-&gt;cells-&gt;add( 4 )-&gt;value-&gt;set( &#8216;Salary&#8217; )-&gt;style-&gt;set( lo_style_header ).</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8221; Step 5: Fill data rows<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
DATA(lv_row_index) = 2.</p>
<p>LOOP AT lt_employees INTO DATA(ls_emp).<br />
DATA(lo_row) = lo_sheet-&gt;rows-&gt;add( lv_row_index ).</p>
<p>lo_row-&gt;cells-&gt;add( 1 )-&gt;value-&gt;set( ls_emp-empid )-&gt;style-&gt;set( lo_style_normal ).<br />
lo_row-&gt;cells-&gt;add( 2 )-&gt;value-&gt;set( ls_emp-name )-&gt;style-&gt;set( lo_style_normal ).<br />
lo_row-&gt;cells-&gt;add( 3 )-&gt;value-&gt;set( ls_emp-department )-&gt;style-&gt;set( lo_style_normal ).<br />
lo_row-&gt;cells-&gt;add( 4 )-&gt;value-&gt;set( ls_emp-salary )-&gt;style-&gt;set( lo_style_salary ).</p>
<p>lv_row_index += 1.<br />
ENDLOOP.</p>
<p>&#8221; Auto-fit columns<br />
lo_sheet-&gt;columns-&gt;auto_fit( ).</p>
<p>&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
&#8221; Step 6: Export as XSTRING and save to frontend<br />
&#8220;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
DATA(lv_xstring) = lo_doc-&gt;to_binary( ).</p>
<p>&#8221; Save file to frontend<br />
DATA(lv_file_name) = &#8216;C:\Temp\employees.xlsx&#8217;.</p>
<p>TRY.<br />
cl_gui_frontend_services=&gt;gui_download(<br />
EXPORTING<br />
bin_filesize = xstrlen( lv_xstring )<br />
filename = lv_file_name<br />
filetype = &#8216;BIN&#8217;<br />
CHANGING<br />
data_tab = cl_bcs_convert=&gt;xstring_to_solix( lv_xstring )<br />
).<br />
WRITE: / &#8216;Excel file created successfully:&#8217;, lv_file_name.<br />
CATCH cx_root INTO DATA(lx_err).<br />
WRITE: / &#8216;Error saving file:&#8217;, lx_err-&gt;get_text( ).<br />
ENDTRY.</p>
<p>ENDMETHOD.</p>
<p>ENDCLASS.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sapewmhelp.com/question/create-an-excel-file-with-styling-colors-fonts-etc-using-the-xco-library-in-abap/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>create an XSL (Extensible Stylesheet Language) transformation using the XCO Library in SAP (ABAP)</title>
		<link>https://www.sapewmhelp.com/question/create-an-xsl-extensible-stylesheet-language-transformation-using-the-xco-library-in-sap-abap/</link>
					<comments>https://www.sapewmhelp.com/question/create-an-xsl-extensible-stylesheet-language-transformation-using-the-xco-library-in-sap-abap/#respond</comments>
		
		<dc:creator><![CDATA[DPM125]]></dc:creator>
		<pubDate>Sat, 18 Oct 2025 20:28:10 +0000</pubDate>
				<guid isPermaLink="false">https://www.sapewmhelp.com/?question=create-an-xsl-extensible-stylesheet-language-transformation-using-the-xco-library-in-sap-abap</guid>

					<description><![CDATA[The XCO Library (ABAP Cloud) — part of SAP’s modern ABAP RESTful programming model — allows you to programmatically create and manipulate repository objects like CDS views, classes, and transformations (including XSLT). CLASS zcl_create_xsl_demo DEFINITION PUBLIC FINAL CREATE PUBLIC. PUBLIC SECTION. METHODS create_xsl. ENDCLASS. CLASS zcl_create_xsl_demo IMPLEMENTATION. METHOD create_xsl. &#8221; Get the package where the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>The <strong>XCO Library (ABAP Cloud)</strong> — part of SAP’s modern ABAP RESTful programming model — allows you to programmatically create and manipulate repository objects like CDS views, classes, and transformations (including XSLT).</p>
<p>CLASS zcl_create_xsl_demo DEFINITION<br />
PUBLIC<br />
FINAL<br />
CREATE PUBLIC.</p>
<p>PUBLIC SECTION.<br />
METHODS create_xsl.<br />
ENDCLASS.</p>
<p>CLASS zcl_create_xsl_demo IMPLEMENTATION.</p>
<p>METHOD create_xsl.<br />
&#8221; Get the package where the object will be created<br />
DATA(lo_package) = xco_cp_abap_repository=&gt;package-&gt;for( &#8216;Z_MY_PACKAGE&#8217; ).</p>
<p>&#8221; Define the transformation name<br />
DATA(lo_xsl_name) = xco_cp_abap_repository=&gt;object_name-&gt;for( &#8216;Z_MY_XSLT&#8217; ).</p>
<p>&#8221; Define the transformation source code<br />
DATA(lv_xsl_source) = |&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;UTF-8&#8243;?&gt;| &amp;&amp;<br />
|\n&lt;xsl:stylesheet version=&#8221;1.0&#8243; xmlns:xsl=&#8221;http://www.w3.org/1999/XSL/Transform&#8221;&gt;| &amp;&amp;<br />
|\n &lt;xsl:template match=&#8221;/&#8221;&gt;| &amp;&amp;<br />
|\n &lt;output&gt;| &amp;&amp;<br />
|\n &lt;xsl:value-of select=&#8221;/root/value&#8221;/&gt;| &amp;&amp;<br />
|\n &lt;/output&gt;| &amp;&amp;<br />
|\n &lt;/xsl:template&gt;| &amp;&amp;<br />
|\n&lt;/xsl:stylesheet&gt;|.</p>
<p>&#8221; Create a new transformation object<br />
DATA(lo_xsl_object) =<br />
xco_cp_abap_repository=&gt;object-&gt;transformation-&gt;create(<br />
object_name = lo_xsl_name<br />
package = lo_package<br />
).</p>
<p>&#8221; Set the source code of the transformation<br />
lo_xsl_object-&gt;source-&gt;set( lv_xsl_source ).</p>
<p>&#8221; Persist (activate) the transformation in the repository<br />
lo_xsl_object-&gt;save( xco_cp_abap_repository=&gt;activation_mode-&gt;active ).</p>
<p>WRITE: / &#8216;XSL Transformation Z_MY_XSLT created and activated successfully.&#8217;.<br />
ENDMETHOD.</p>
<p>ENDCLASS.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sapewmhelp.com/question/create-an-xsl-extensible-stylesheet-language-transformation-using-the-xco-library-in-sap-abap/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
