<?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>smartforms &#8211; SAP EWM Help</title>
	<atom:link href="https://www.sapewmhelp.com/question-tag/smartforms/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>Fri, 12 Sep 2025 20:13:22 +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>Generating SAP Smart Form PDFs and Serving Them to Fiori/UI5 via OData</title>
		<link>https://www.sapewmhelp.com/question/generating-sap-smart-form-pdfs-and-serving-them-to-fiori-ui5-via-odata/</link>
					<comments>https://www.sapewmhelp.com/question/generating-sap-smart-form-pdfs-and-serving-them-to-fiori-ui5-via-odata/#respond</comments>
		
		<dc:creator><![CDATA[DPM125]]></dc:creator>
		<pubDate>Fri, 12 Sep 2025 20:13:22 +0000</pubDate>
				<guid isPermaLink="false">https://www.sapewmhelp.com/?question=generating-sap-smart-form-pdfs-and-serving-them-to-fiori-ui5-via-odata</guid>

					<description><![CDATA[Scenario: Business wants to generate an invoice Smart Form (based on VBAK/VBAP) and send the PDF to an SAPUI5/Fiori frontend via OData. The frontend should receive the Smart Form PDF as binary content to display or download. High level flow Frontend (Fiori/UI5) → OData Service → ABAP Backend → Call Smart Form → Convert to [&#8230;]]]></description>
										<content:encoded><![CDATA[<h3 data-start="186" data-end="205"><strong>Scenario:</strong></h3>
<ul>
<li>
<p>Business wants to <strong>generate an invoice Smart Form</strong> (based on VBAK/VBAP) and <strong>send the PDF to an SAPUI5/Fiori frontend</strong> via OData.</p>
</li>
<li>
<p>The frontend should receive the <strong>Smart Form PDF as binary content</strong> to display or download.</p>
</li>
</ul>
<p><strong>High level flow</strong></p>
<p>Frontend (Fiori/UI5) → OData Service → ABAP Backend → Call Smart Form → Convert to PDF → Return Binary to Frontend</p>
<p><strong>Step 1: Create Smart Form</strong></p>
<ul>
<li>
<p>Transaction <strong>SMARTFORMS</strong> → Create form (e.g., <code>Z_INVOICE_SF</code>)</p>
</li>
<li>
<p>Define nodes for <strong>header (VBAK)</strong> and <strong>items (VBAP)</strong></p>
</li>
<li>
<p>Activate form</p>
</li>
</ul>
<p><strong>Step 2: Create ABAP Class / Function Module</strong></p>
<ul>
<li>
<p>This module will <strong>call the Smart Form and capture output as PDF</strong></p>
</li>
</ul>
<p>DATA: lv_formname TYPE tdsfname VALUE &#8216;Z_INVOICE_SF&#8217;,<br />
lv_fm_name TYPE rs38l_fnam,<br />
lv_pdf TYPE solix_tab,<br />
lv_pdf_size TYPE so_obj_len.</p>
<p>&#8221; Get generated function module for Smart Form<br />
CALL FUNCTION &#8216;SSF_FUNCTION_MODULE_NAME&#8217;<br />
EXPORTING<br />
formname = lv_formname<br />
IMPORTING<br />
fm_name = lv_fm_name<br />
EXCEPTIONS<br />
no_form = 1<br />
no_function_module = 2<br />
OTHERS = 3.</p>
<p>IF sy-subrc = 0.<br />
&#8221; Call Smart Form<br />
CALL FUNCTION lv_fm_name<br />
EXPORTING<br />
control_parameters = VALUE ssfctrlop( device = &#8216;PRINTER&#8217; )<br />
user_settings = space<br />
vbak = ls_vbak<br />
TABLES<br />
vbap = lt_vbap<br />
pdfoutput = lv_pdf<br />
EXCEPTIONS<br />
OTHERS = 1.<br />
ENDIF.</p>
<p>&nbsp;</p>
<p><strong>Step 3: Return PDF via OData</strong></p>
<ul>
<li>
<p>Create an <strong>OData Service</strong> (Transaction SEGW)</p>
</li>
<li>
<p>Define an <strong>Entity Type</strong> (e.g., InvoicePDF) with a <strong>Binary Stream property</strong></p>
</li>
<li>
<p>In <strong>DPC_EXT class</strong>, map the Smart Form PDF to the property:</p>
</li>
</ul>
<p>METHOD invoicepdf_get_entity.<br />
&#8221; Call Smart Form as shown above<br />
io_data_provider-&gt;read_entry_data( )-&gt;* &#8221; fetch data from backend tables</p>
<p>es_entity-pdf_data = lv_pdf. &#8221; SOLIX table converted to xstring<br />
ENDMETHOD.</p>
<ul>
<li>
<p>The frontend will receive <strong>PDF as binary</strong> (<code>xstring</code>)</p>
</li>
<li>
<p>Fiori/UI5 can display with <strong>PDF.js</strong> or offer download</p>
</li>
</ul>
<p>&nbsp;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.sapewmhelp.com/question/generating-sap-smart-form-pdfs-and-serving-them-to-fiori-ui5-via-odata/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
