
<?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/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>pascal renet &#187; SAP</title>
	<atom:link href="http://www.renet-web.net/category/sap/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.renet-web.net</link>
	<description>The ramblings of a frog in Oz</description>
	<lastBuildDate>Sun, 05 Sep 2010 11:37:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<!-- podcast_generator="podPress/8.8" - maintenance_release="8.8.6.3" -->
	<copyright>Copyright &#xA9; 2010 pascal renet </copyright>
	<managingEditor>wordpress@renet-web.net</managingEditor>
	<webMaster>wordpress@renet-web.net</webMaster>
	<category>posts</category>
	<image>
		<url>http://www.renet-web.net/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>pascal renet &#187; SAP</title>
		<link>http://www.renet-web.net</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle></itunes:subtitle>
	<itunes:summary>Just not another WordPress weblog</itunes:summary>
	<itunes:keywords></itunes:keywords>
	<itunes:category text="Society &amp; Culture" />
	<itunes:author></itunes:author>
	<itunes:owner>
		<itunes:name></itunes:name>
		<itunes:email>wordpress@renet-web.net</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://www.renet-web.net/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<item>
		<title>Mastering Supply Chain Management with SAP</title>
		<link>http://www.renet-web.net/2010/07/15/mastering-supply-chain-management-with-sap/</link>
		<comments>http://www.renet-web.net/2010/07/15/mastering-supply-chain-management-with-sap/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 13:21:20 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
				<category><![CDATA[SAP]]></category>

		<guid isPermaLink="false">http://www.renet-web.net/?p=679</guid>
		<description><![CDATA[<p><img src="http://www.renet-web.net/wp-content/uploads/2010/07/SAPSCMBIG2.jpg" alt="" title="SAPSCMBIG2" width="500" height="312" class="aligncenter size-full wp-image-690" /><br />
I will be a <a href="http://www.masteringsap.com/scm/speakers">guest speaker</a> at the <a href="http://www.masteringsap.com/scm">Mastering Supply Chain Management with SAP</a> conference (Sep 13 to 15) that will be held in Melbourne at the Grand Hyatt Hotel.</p>
<p>I will be talking about &#8216;Enabling Reporting&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.renet-web.net/wp-content/uploads/2010/07/SAPSCMBIG2.jpg" alt="" title="SAPSCMBIG2" width="500" height="312" class="aligncenter size-full wp-image-690" /><br />
I will be a <a href="http://www.masteringsap.com/scm/speakers">guest speaker</a> at the <a href="http://www.masteringsap.com/scm">Mastering Supply Chain Management with SAP</a> conference (Sep 13 to 15) that will be held in Melbourne at the Grand Hyatt Hotel.</p>
<p>I will be talking about &#8216;Enabling Reporting and Analytics for your Supply Chain. I will be delivering this presentation with Geoff Armstrong &#8211; National Service Line Lead Business Intelligence, <a href="http://www.plaut.com.au/">Plaut IT Australia Pty Ltd</a>.<span id="more-679"></span></p>
<p>All together there will be 34 presentations and the highlights include:</p>
<ul>
<li>Most up to date SAP product releases available in the market</li>
<li>Access More Supply Chain Data with SAP BusinessObjects to Extend Your Reporting Capabilities</li>
<li>Take Control of Master Data by Centralising Control, Addressing Change Management Issues and Training Staff</li>
<li>Rethink Services Procurement in Mining: Lessons for Other Spend Categories and Industries</li>
<li>Get Past &#8220;We’re Different&#8221; and Standardise BI Reports Across Your Enterprise</li>
<li>How Coca-Cola Manages Direct Store Deliveries Using Strategic Route Optimisation and Vehicle Space Optimisation Solutions</li>
<li>The Future Direction of Sales and Operations Planning in SAP</li>
<li>Make Warehouses and Logistics More Efficient Through Voice Picking</li>
<li>Integrate APO to Drive the S&#038;OP Process</li>
<li>Automate Employee-Facing Transactions in the Supply Chain</li>
<li>Get Your Inventory Basics Right with WMS</li>
<li>Use SAP Solutions for Enterprise Contract Management</li>
<li>Use Outline Agreements for Service Contracts</li>
<li>Initiate Cultural Change in Supplier and Operations Relationships with Invoice Automation</li>
<li>Sell the Proposition of Procurement Beyond Just Reducing Costs &#8211; Into Delivering Higher Value and Generating Revenue</li>
<li>Analyse Supplier Enablement Solutions in Conjunction with Your SAP Solution and How to Determine ROI for Such an Implementation</li>
</ul>
<p><a href="https://register.eventfulmanagement.com/registerme/scm/register.php">Register</a> today to be part of this great event.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.renet-web.net/2010/07/15/mastering-supply-chain-management-with-sap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Protected: Upload of Planned Independent Requirements made easy</title>
		<link>http://www.renet-web.net/2009/08/06/upload-of-planned-independent-requirements-made-easy/</link>
		<comments>http://www.renet-web.net/2009/08/06/upload-of-planned-independent-requirements-made-easy/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 03:47:28 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
				<category><![CDATA[SAP]]></category>
		<category><![CDATA[ERP]]></category>
		<category><![CDATA[MD61]]></category>
		<category><![CDATA[MD62]]></category>
		<category><![CDATA[PIR]]></category>
		<category><![CDATA[Planned Independent Requirement]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://www.renet-web.net/?p=606</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://www.renet-web.net/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-606">Password:<br />
<input name="post_password" id="pwbox-606" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.renet-web.net/2009/08/06/upload-of-planned-independent-requirements-made-easy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Linking your SAP ERP to Solution Manager for service messaging</title>
		<link>http://www.renet-web.net/2009/07/24/linking-your-sap-erp-to-solution-manager-for-service-messaging/</link>
		<comments>http://www.renet-web.net/2009/07/24/linking-your-sap-erp-to-solution-manager-for-service-messaging/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 22:38:44 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
				<category><![CDATA[SAP]]></category>
		<category><![CDATA[7.0]]></category>
		<category><![CDATA[Messaging]]></category>
		<category><![CDATA[service desk]]></category>
		<category><![CDATA[solman]]></category>
		<category><![CDATA[solution manager]]></category>

		<guid isPermaLink="false">http://www.renet-web.net/?p=593</guid>
		<description><![CDATA[<p><img src="http://www.renet-web.net/wp-content/uploads/2009/07/linkerptosolman.jpg" alt="" title="linkerptosolman" width="500" height="301" class="aligncenter size-full wp-image-790" /><br />
This is really a quick tip that I&#8217;m posting more for me, but which I thought I&#8217;d share with the rest of the community.</p>
<p>If you are using the Service Desk functionality of <a href="http://www.sap.com/platform/netweaver/components/solutionmanager/index.epx">Solution Manager</a>, you may know&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.renet-web.net/wp-content/uploads/2009/07/linkerptosolman.jpg" alt="" title="linkerptosolman" width="500" height="301" class="aligncenter size-full wp-image-790" /><br />
This is really a quick tip that I&#8217;m posting more for me, but which I thought I&#8217;d share with the rest of the community.</p>
<p>If you are using the Service Desk functionality of <a href="http://www.sap.com/platform/netweaver/components/solutionmanager/index.epx">Solution Manager</a>, you may know that it is possible to create support requests right from your satelite SAP system. <span id="more-593"></span>This is a really neat functionality because it allows you to report an incident right there and then when it happens &#8211; i.e there is no need for you to connect to a solution manager system, either via the SAP GUI or portal to report the incident. </p>
<p>To do that, you will find a &#8220;Create suport message&#8221; menu entry that allows you to do just that.</p>
<p><img src="http://www.renet-web.net/wp-content/uploads/2009/07/ScreenShot0031.jpg" alt="ScreenShot003" title="ScreenShot003" width="500" height="194" class="aligncenter size-full wp-image-594" /></p>
<p>The trouble is that if your system administrator has not done the customising that enables for your <a href="http://www.sap.com/">SAP</a> system to know the destination of the incident (the rfc destination of you solution manager system), then you will get an error message such as the one below.</p>
<p><img src="http://www.renet-web.net/wp-content/uploads/2009/07/ScreenShot0041.jpg" alt="ScreenShot004" title="ScreenShot004" width="500" height="164" class="aligncenter size-full wp-image-595" /><br />
<!--more--><br />
So to correct this you need to add an entry in the table BCOS_CUST. To add that entry go to transaction SM31 in maintenance mode.</p>
<p><img src="http://www.renet-web.net/wp-content/uploads/2009/07/ScreenShot001.jpg" alt="ScreenShot001" title="ScreenShot001" width="500" height="315" class="aligncenter size-full wp-image-596" /></p>
<p>You then need to add an entry identical to the one below (except that you must of course indicate the rfc destination of your Solution Manager system).</p>
<p><img src="http://www.renet-web.net/wp-content/uploads/2009/07/ScreenShot0022.jpg" alt="ScreenShot002" title="ScreenShot002" width="499" height="162" class="aligncenter size-full wp-image-597" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.renet-web.net/2009/07/24/linking-your-sap-erp-to-solution-manager-for-service-messaging/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Protected: Automated  emails in SAP Solution Manager made easy</title>
		<link>http://www.renet-web.net/2009/07/23/automated-emails-in-sap-solution-manager-made-easy/</link>
		<comments>http://www.renet-web.net/2009/07/23/automated-emails-in-sap-solution-manager-made-easy/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 07:15:21 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
				<category><![CDATA[SAP]]></category>
		<category><![CDATA[7.0]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[solman]]></category>
		<category><![CDATA[solution manager]]></category>
		<category><![CDATA[VAR]]></category>

		<guid isPermaLink="false">http://www.renet-web.net/?p=551</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://www.renet-web.net/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-551">Password:<br />
<input name="post_password" id="pwbox-551" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.renet-web.net/2009/07/23/automated-emails-in-sap-solution-manager-made-easy/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Protected: SLA&#8217;s made easy in SAP Solution Manager</title>
		<link>http://www.renet-web.net/2009/07/21/slas-made-easy-in-sap-solution-manager/</link>
		<comments>http://www.renet-web.net/2009/07/21/slas-made-easy-in-sap-solution-manager/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 05:47:20 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
				<category><![CDATA[SAP]]></category>
		<category><![CDATA[service desk]]></category>
		<category><![CDATA[SLA]]></category>
		<category><![CDATA[solman]]></category>
		<category><![CDATA[solution manager]]></category>
		<category><![CDATA[VAR]]></category>

		<guid isPermaLink="false">http://www.renet-web.net/?p=503</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://www.renet-web.net/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-503">Password:<br />
<input name="post_password" id="pwbox-503" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.renet-web.net/2009/07/21/slas-made-easy-in-sap-solution-manager/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Building RIA&#8217;s using SAP, Flex and Php</title>
		<link>http://www.renet-web.net/2009/07/20/building-rias-using-sap-flex-and-php/</link>
		<comments>http://www.renet-web.net/2009/07/20/building-rias-using-sap-flex-and-php/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 12:00:39 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[SAP]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[FLEX]]></category>
		<category><![CDATA[RIA]]></category>
		<category><![CDATA[saprfc]]></category>

		<guid isPermaLink="false">http://www.renet-web.net/?p=427</guid>
		<description><![CDATA[<a href="http://www.renet-web.net/wp-content/uploads/2009/07/RIASMALL.jpg"><img src="http://www.renet-web.net/wp-content/uploads/2009/07/RIASMALL.jpg" alt="" title="RIASMALL" width="286" height="68" class="aligncenter size-full wp-image-744" /></a>According to <a href="http://en.wikipedia.org/">Wikipedia</a>, "<a href="http://en.wikipedia.org/wiki/Rich_Internet_application">Rich Internet Applications</a> are web applications that have most of the characteristics of desktop applications, typically delivered by way of standards based web browser plug-ins or independently via sandboxes or virtual machines". I don't think that this definition does do it any justice - I think that RIA's are:
]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.renet-web.net/wp-content/uploads/2009/07/ScreenShot028.jpg" alt="ScreenShot028" title="ScreenShot028" width="500" height="170" class="aligncenter size-full wp-image-475" /></p>
<p>According to <a href="http://en.wikipedia.org/">Wikipedia</a>, &#8220;<a href="http://en.wikipedia.org/wiki/Rich_Internet_application">Rich Internet Applications</a> are web applications that have most of the characteristics of desktop applications, typically delivered by way of standards based web browser plug-ins or independently via sandboxes or virtual machines&#8221;. I don&#8217;t think that this definition does do it any justice &#8211; I think that RIA&#8217;s are:<span id="more-427"></span></p>
<ul>
<li>Applications that offer a visually rich and engaging user interface</li>
<li>Applications that offer content richness and useful and diverse functionalities</li>
</ul>
<p>In other words it has to deliver functionality and it has to do so in an engaging UI &#8211; the argument being that such applications will deliver a greater employee productivity and/or customer loyalty. I would certainly vouch for that &#8211; go see <a href="https://create.ondemand.com/explorer">a demo</a> of <a href="http://www.sap.com/">SAP</a> <a href="http://www.sap.info/en/solutions/business_user_business_objects/neue_BI-Loesungen_en.html">Business Explorer </a>to see what I mean (you can even<br />
upload your own data and play around with that).</p>
<p>As a continuation to my <a href="http://www.renet-web.net/2006/05/22/re-writing-sap-with-php-part-15/">experiments</a> in marrying technologies such as <a href="http://www.php.net/">Php</a>, <a href="http://pear.php.net/">Pear</a> &#038; Ajax to query a <a href="http://www.sap.com/">SAP</a> database and expose the data to a user in a visually appealing form, it seemed only fitting that I would give this RIA thing a shot too. You only need to google terms such as &#8220;<a href="http://www.google.com.au/search?q=SAP+FLEX">SAP FLEX</a>&#8221; to see that there is<br />
a wealth of information out there on that topic showcasing these two platforms with plenty of whoa factor. Being from a logistics background I thought it would be appropriate to use logistics functions in my examples.</p>
<p>So in this post I&#8217;ll be looking at the following scenarios:</p>
<ul>
<li>A sales application using SAP, Flex and Php (http service call method)</li>
<li>A production order application using SAP, Flex and Php (http service call method)</li>
<li>A sample sales application using SAP and Flex (web service call method)</li>
</ul>
<p>The tools of choice for my experiments today are:</p>
<ul>
<li><a href="http://www.adobe.com/">Adobe</a> <a href="http://www.adobe.com/products/flex/">Flex</a> (which is built on top of <a href="http://www.eclipse.org/">Eclipse</a> &#8211; the same tool used to build the SAP Developer Studio). Adobe is very generously offering you the chance to download a try-before-you-buy fully functional demo version for 60 days (if you have already have Eclipse or SAP developer Studio you may elect to download the plug-in instead &#8211; although I have not tried that). </li>
<li><a href="http://www.easyphp.org/">Easyphp</a> which is a nice WAMP (Windows Apache Mysql Php) package that I have been using for years &#8211; php in version 5.2.8</li>
<li>The <a href="http://saprfc.sourceforge.net/">SAPrfc</a> extension module for Php</li>
<li>Of course SAP. The SAP backend system I&#8217;ll be using is a SAP ECC 6.0 system.</li>
</ul>
<p><!--more--></p>
<p>In the first two scenarios, I&#8217;ll be using php as the go between Flex and SAP.<br />
<img src="http://www.renet-web.net/wp-content/uploads/2009/07/ScreenShot0221.jpg" alt="ScreenShot022" title="ScreenShot022" width="500" height="274" class="aligncenter size-full wp-image-471" /><br />
Essentially the Flex application will call an http service that is a php script to which we&#8217;ll be posting some variables. Php will then wrap those variables in an RF call to the SAP backend system. Assuming all goes well, SAP will send a response that needs to be formatted in a xml like structure so that that it can be properly interpreted by the Flex application &#8211; again php will take care of that.</p>
<pre class="brush: php;">
echo &quot;&lt;CUSTRECS&gt;\n&quot;;
		for($i=1; $i&lt;=$ADDRESSDATA ; $i++){
			$DATA = saprfc_table_read ($fce,&quot;ADDRESSDATA&quot;,$i);
			echo &quot;&lt;CUSTREC&gt;\n&lt;CUSTNUMB&gt;&quot; . $DATA[&quot;CUSTOMER&quot;] . &quot;&lt;/CUSTNUMB&gt;\n&quot;;
			echo &quot;&lt;CUSTADR&gt;&quot; . $DATA[&quot;STREET&quot;] . &quot;&lt;/CUSTADR&gt;\n&quot;;
			echo &quot;&lt;CUSTCOUNT&gt;&quot; . $DATA[&quot;COUNTRY&quot;] . &quot;&lt;/CUSTCOUNT&gt;\n&quot;;
			echo &quot;&lt;CUSTCITY&gt;&quot; . $DATA[&quot;CITY&quot;] . &quot;&lt;/CUSTCITY&gt;\n&quot;;
			echo &quot;&lt;CUSTNAME&gt;&quot; . $DATA[&quot;NAME&quot;] . &quot;&lt;/CUSTNAME&gt;\n&lt;/CUSTREC&gt;\n&quot;;
		}
echo &quot;&lt;/CUSTRECS&gt;&quot;;
</pre>
<p>will yield an xml response to the Flex application as below,</p>
<pre class="brush: xml;">
&lt;CUSTRECS&gt;
	&lt;CUSTREC&gt;
		&lt;CUSTNUMB&gt;0000100000&lt;/CUSTNUMB&gt;
		&lt;CUSTADR&gt;800 Gardiner Street&lt;/CUSTADR&gt;
		&lt;CUSTCOUNT&gt;AU&lt;/CUSTCOUNT&gt;
		&lt;CUSTCITY&gt;Darwin&lt;/CUSTCITY&gt;
		&lt;CUSTNAME&gt;Customer domestic 00&lt;/CUSTNAME&gt;
	&lt;/CUSTREC&gt;
&lt;/CUSTRECS&gt;
</pre>
<p>and in the Flex script below, on lines 5 and 6, you can see how I&#8217;ll be retrieving the customer number (CUSTNUMB) and customer name (CUSTNAME) in my Flex datagrid.</p>
<pre class="brush: xml;">
&lt;mx:DataGrid dataProvider=&quot;{srv3.lastResult.CUSTRECS.CUSTREC}&quot;
width=&quot;368&quot; height=&quot;119&quot; y=&quot;10&quot; x=&quot;10&quot; id=&quot;dg1&quot;
change=&quot;dgChangeHandler()&quot; dropShadowEnabled=&quot;true&quot;&gt;
	&lt;mx:columns&gt;
		&lt;mx:DataGridColumn dataField=&quot;CUSTNUMB&quot; headerText=&quot;Customer Number&quot;/&gt;
		&lt;mx:DataGridColumn dataField=&quot;CUSTNAME&quot; headerText=&quot;Customer Name&quot; textAlign=&quot;left&quot;/&gt;
	&lt;/mx:columns&gt;
&lt;/mx:DataGrid&gt;
</pre>
<p>So, without further adue, below are explanations and swf animations for each process.</p>
<h3>A simple sales order application</h3>
<p><img src="http://www.renet-web.net/wp-content/uploads/2009/07/ScreenShot023.jpg" alt="ScreenShot023" title="ScreenShot023" width="500" height="384" class="aligncenter size-full wp-image-472" /><br />
This application uses multiple http service calls and its key elements are:</p>
<ul>
<li>An http service calling BAPI_CUSTOMER_GETLIST is used to populate one datagrid</li>
<li>An http service calling BAPI_MATERIAL_GETLIST  is used to populate another datagrid. The product pictures are stored locally on the web server, and the picture filename corresponds to the material number in SAP (eg if the material is called Y126, we have a picture file called Y126.jpg)</li>
<li>The user will then pick the customer expected delivery date, the required quantity and indicate a selling price</li>
<li>The Order button will then post the data to another http service in order to create the sales order (by calling the FM CREATE_SD_ORDERDAT1) in SAP. If all goes well a response with the sales order number will be issued to the user.</li>
</ul>
<p>* Note that some values have been hard-coded in the php files (but they could just as well have come from posted variables). Also, the user will be required to type in his SAP credentials (the SAP server information has been hardcoded in the php file, but we are passing the SAP username and password to the script).</p>
<p>Here is a swf example of this application.<br />
<a href="http://www.renet-web.net/wp-content/uploads/2009/07/sales_demo.swf" rev="width:1131, height:743"  rel="milkbox[gall2]" title="Give it time to load - Wait a few seconds"><img src="http://www.renet-web.net/wp-content/uploads/2009/07/prodsales.jpg" width="500" height="236" /></a></p>
<h3>A simple production order application</h3>
<p><img src="http://www.renet-web.net/wp-content/uploads/2009/07/ScreenShot025.jpg" alt="ScreenShot025" title="ScreenShot025" width="500" height="269" class="aligncenter size-full wp-image-474" /><br />
This application uses multiple http service calls and its key elements are:</p>
<ul>
<li>There are two tabs in this application. One tab will show the data in a tabular form whilst the other tab is geared toward delivering the information graphically.</li>
<li>An initial http service calling BAPI_PRODORD_GET_LIST is used to populate a datagrid containing production order header details. The response provided by SAP is first interpreted and transformed into xml by Php.</li>
<li>The same http service above will not only deliver production order header data, but also aggregated data that will be used to drive some of the charts in the graphical dashboards. All this data is delivered in one xml formatted stream.</li>
<li>Whenever a line is selected in the production order header datagrid, it will trigger for another service call to be executed and this time call BAPI_PRODORD_GET_DETAIL in order to retrieve the production order component and operation details.</li>
</ul>
<p><img src="http://www.renet-web.net/wp-content/uploads/2009/07/ScreenShot024.jpg" alt="ScreenShot024" title="ScreenShot024" width="500" height="266" class="aligncenter size-full wp-image-473" /></p>
<p>Here is a swf example of this application.<br />
<a href="http://www.renet-web.net/wp-content/uploads/2009/07/prod_order_demo.swf" rev="width:1131, height:743"  rel="milkbox[gall3]" title="Give it time to load - Wait a few seconds"><img src="http://www.renet-web.net/wp-content/uploads/2009/07/prodsales.jpg" width="500" height="236" /></a></p>
<h3> A very simple production order header report</h3>
<p>In this last example, similar to the one above we will consume a web service calling BAPI_PRODORD_GET_LIST and populate the retrieved data in a Flex datagrid &#8211; nothing more here &#8211; if just to show another method to get the production order header information.</p>
<p>The corresponding Flex Project can be downloaded <a href="http://www.renet-web.net/mint/pepper/orderedlist/downloads/download.php?file=http://www.renet-web.net/wp-content/uploads/2009/07/SAP_BAPI_TST.zip">here</a>. Remember to change your server name and port before using it.</p>
<p>Here is a swf example of this application.<br />
<a href="http://www.renet-web.net/wp-content/uploads/2009/07/web_service.swf" rev="width:1131, height:743"  rel="milkbox[gall4]" title="Give it time to load - Wait a few seconds"><img src="http://www.renet-web.net/wp-content/uploads/2009/07/webserv.jpg" width="500" height="234" /></a></p>
<h3>Recommended readings</h3>
<p><a href="https://forums.sdn.sap.com:443/forum.jspa?forumID=272&#038;start=0"><br />
Rich Internet Application Development on SDN</a></br><br />
<a href="https://forums.sdn.sap.com:443/forum.jspa?forumID=124&#038;start=0">PHP Development on SDN</a></br><br />
<a href="https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/7130">Engaging User Interfaces with Adobe Flex</a><br />
<a href="https://wiki.sdn.sap.com/wiki/display/EmTech/Consuming+ABAP+Web+Services+using+Flex">Consuming ABAP Web Services using Flex</a> a hands-on tutorial given by <a href="http://matthiaszeller.com/blog/">Matthias Zeller</a>, <a href="http://blog.ewherrmann.com/">Ed Herrmann</a>, and <a href="http://blog.danmcweeney.com/">Dan McWeeney</a> </p>
<p>I hope you find these examples interesting and if you do find them useful and if there is anything you&#8217;d like to share, then please do leave a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.renet-web.net/2009/07/20/building-rias-using-sap-flex-and-php/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Protected: SAP Batch Determination made easy</title>
		<link>http://www.renet-web.net/2008/09/05/sap-batch-determination-made-easy/</link>
		<comments>http://www.renet-web.net/2008/09/05/sap-batch-determination-made-easy/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 05:47:29 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
				<category><![CDATA[SAP]]></category>

		<guid isPermaLink="false">http://www.renet-web.net/?p=278</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://www.renet-web.net/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-278">Password:<br />
<input name="post_password" id="pwbox-278" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.renet-web.net/2008/09/05/sap-batch-determination-made-easy/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Integration du processus Achat d&#8217;immobilisations et creation d&#8217;equipements</title>
		<link>http://www.renet-web.net/2007/06/13/integration-du-processus-achat-dimmobilisations-et-creation-dequipements/</link>
		<comments>http://www.renet-web.net/2007/06/13/integration-du-processus-achat-dimmobilisations-et-creation-dequipements/#comments</comments>
		<pubDate>Thu, 14 Jun 2007 01:41:01 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
				<category><![CDATA[SAP]]></category>

		<guid isPermaLink="false">http://www.renet-web.net/2007/06/13/integration-du-processus-achat-dimmobilisations-et-creation-dequipements/</guid>
		<description><![CDATA[<p>Je suis toujours surpris de voir que bien des clients ne savent pas qu’il est dans <a href="http://www.sap.com/">SAP</a>, possible d’optimiser le processus d’achats d’equipements qui doivent par la suite etre immobilises. En general ce processus releve de la responsabilite de&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Je suis toujours surpris de voir que bien des clients ne savent pas qu’il est dans <a href="http://www.sap.com/">SAP</a>, possible d’optimiser le processus d’achats d’equipements qui doivent par la suite etre immobilises. En general ce processus releve de la responsabilite de plusieurs services au sein d’un societe. Dans sa forme la plus complexe on peut imaginer le service Comptabilite qui va créer la fiche immobilisation, le service Achats qui va creer la commande d’achats, le magasin qui va realiser l’entree de marchandise et quelque part dans tout cela, le service Maintenance qui va s’occuper de la gestion et mise en service de l’equipement – et je ne parle meme pas de la communication necessaire entre tous ces interlocuteurs pour mener ce<span id="more-201"></span> processus a bien.Ce billet ne vise pas a eliminer toutes ces etapes car elles seront toujours obligatoires, mais plutot a suggerer une possibilite d’optimiser la facon de proceder – le but etant de reduire le temps necessaire, le nombre d’interlocuteurs et le nombre de transactions. Etant donne qu’il s’agit aussi de ceder une part de responsabilite a un collegue, des discussions et decisions doivent etre prises et acceptees par tous les interlocuteurs concernes.Il est en effet possible d’encapsuler la creation de la fiche immobilisation, de l’equipement et la commande d’achats en une seule transaction. Tout commence par la creation de la commande d’achats. Point important de cette etape est qu’il est neccessaire d’indiquer le type d’imputation adequat – en l’occurrence ‘immobilisation’.<br />
<img src="http://www.renet-web.net/wp-content/uploads/2007/06/screenshot1597.jpg" alt="commande HA poste" /><br />
Apres avoir indique le reste des donnees du poste a acheter, allez dans l’onglet des donnees d’imputation. Ici, plutot que d’indiquer une immobilisation existante, nous allons la créer dans la commande d’achats. Pour cela il suffit de cliquer sur le bouton de creation (‘Asset’ dans mon example).<br />
<img src="http://www.renet-web.net/wp-content/uploads/2007/06/screenshot1598.jpg" alt="imputation immo poste" /><br />
Cela ouvre la possibilite de renseigner les donnees propres a l’immobilisation (type d’immobilisation, centre de couts, etc…).<!--more--><br />
<img src="http://www.renet-web.net/wp-content/uploads/2007/06/screenshot1599.jpg" alt="donnes immo" /><br />
Il est aussi possible de naviguer jusque dans la fiche immobilisation en cours de creation.<br />
<img src="http://www.renet-web.net/wp-content/uploads/2007/06/screenshot1600.jpg" alt="navigation immo" /><br />
Lorsque vous avez renseignez toutes les donnees necessaires vous pouvez sauvegardez votre commande d’achats.<br />
<img src="http://www.renet-web.net/wp-content/uploads/2007/06/screenshot1602.jpg" alt="imputation immo poste" /><br />
Resultat, dans la meme transaction, nous avons creer une commande d’achats, une immobilisation ainsi que le fiche equipement correspondante.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.renet-web.net/2007/06/13/integration-du-processus-achat-dimmobilisations-et-creation-dequipements/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Re-writing SAP with PHP (part 1.5)</title>
		<link>http://www.renet-web.net/2006/05/22/re-writing-sap-with-php-part-15/</link>
		<comments>http://www.renet-web.net/2006/05/22/re-writing-sap-with-php-part-15/#comments</comments>
		<pubDate>Mon, 22 May 2006 11:29:33 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
				<category><![CDATA[SAP]]></category>

		<guid isPermaLink="false">http://www.renet-web.net/2006/05/22/re-writing-sap-with-php-part-15/</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[ If things always went to plan, I guess I would now be writing part 2 and not 1.5! The truth is, I&#8217;ve had so many ideas lately that I just had to test them out and so this is how 1.5 came to be. In this post I&#8217;m going to show you how I used PHP/SAP/PEAR/AJAX together to come up with I&#8217;m sure you&#8217;ll agree, a pretty cool result.</p>
<p>To set the scene this is what will be shown:</p>
<ul>
<li>We will first call a <a href="http://www.php.net/">PHP</a> script that uses BAPI <strong>BAPI_PRODORD_GET_LIST</strong> to retrieve a list of <a href="http://www.sap.com/">SAP</a> production orders.</li>
<li>As time goes by the amount of production orders that live in a system can be quite staggering and I didn&#8217;t want to bombard the user with thousands of production orders in one go. To solve that problem I&#8217;m using <a href="http://pear.php.net/">PEAR</a>, to be more specific I&#8217;m using the <a href="http://pear.php.net/package/Structures_DataGrid">Structures_DataGrid</a> package to setup the paged navigation and render the data in html format (I highly recommend this package as it takes care of everything for you and you can even style the output as you want it)</li>
<li>Once we have the data output (a list of production orders) we will then want to see a bit more detail for a chosen production order. This is where AJAX comes in. We will make an asynchronous call to another <a href="http://www.php.net/">PHP</a> script that calls the BAPI <strong>BAPI_PRODORD_GET_DETAIL</strong>.</li>
<li>The result of that AJAX call, is that the current page (or part of it) will be refreshed with new content. The content will be detailed production order information.</li>
</ul>
<p>If you can&#8217;t wait to read this post to the end, I&#8217;ve recorded a small flash animation that demonstrates exactly what I have outlined above. The animation can be viewed <a href="http://www.renet-web.net/wp-content/iimages/SAPRFCPART15/orderdetail.htm">here</a> (Give the file time to load as it makes approx 4.8Mb).<span id="more-154"></span></p>
<p>So we start out with a list of orders:</p>
<p><img src="/wp-content/iimages/SAPRFCPART15/listoforders.jpg" width="500" height="245" alt="listorders" title="listorders" /></p>
<p>Clicking on the detail icon will reveal detailed data about the production order:</p>
<p><img src="/wp-content/iimages/SAPRFCPART15/orderdetail.jpg" width="500" height="519" alt="detail" title="detail" /></p>
<p>Finally we&#8217;ve added an image which shows an overlay of:</p>
<ul>
<li>The list of orders</li>
<li>The order detail showing the operations and the components of the order</li>
<li>A screenshot of the operations (in SAP)</li>
<li>A screenshot of the components (in SAP)</li>
</ul>
<p><img src="/wp-content/iimages/SAPRFCPART15/collage.jpg" width="500" height="523" alt="collage" title="collage" /></p>
<p>What? No code? do I hear you say. Well as there are very rarely comments made on the code, I&#8217;m not going to bother including any in this post &#8211; it&#8217;s up to you to change that&#8230;.</p>
<p>As usual these tests have been made using an <a href="http://www.hp.com/">HP</a> (Compaq <a href="http://h30143.www3.hp.com/configure2.cfm?sid=18508&#038;jumpid=reg_R1002_USEN">nc6220</a>) laptop running on <a href="http://www.microsoft.com/windowsxp/pro/default.mspx">MS Windows XP Pro</a>, the <a href="http://httpd.apache.org/">Apache</a> server version 1.3.33 and the <a href="http://www.php.net/">PHP</a> scripting engine in version 4.3.10 and of course the <a href="http://saprfc.sourceforge.net/">SAPRfc</a> library (the Apache/PHP install was that installed via the <a href="http://www.easyphp.org/">EasyPhp</a> package). <a href="http://www.sap.com/">SAP</a> side I was using SAP ERP ECC (ERP Central Component) 5.0. I also used the <a href="http://script.aculo.us/">script.aculo.us</a> javascript libraries. You can download them <a href="http://script.aculo.us/downloads">here</a>. </p>
<p>

]]></content:encoded>
			<wfw:commentRss>http://www.renet-web.net/2006/05/22/re-writing-sap-with-php-part-15/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Re-writing SAP with PHP (part 1)</title>
		<link>http://www.renet-web.net/2006/05/13/re-writing-sap-with-php-part-1/</link>
		<comments>http://www.renet-web.net/2006/05/13/re-writing-sap-with-php-part-1/#comments</comments>
		<pubDate>Sat, 13 May 2006 07:33:46 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
				<category><![CDATA[SAP]]></category>

		<guid isPermaLink="false">http://www.renet-web.net/2006/05/13/re-writing-sap-with-php-part-1/</guid>
		<description><![CDATA[<p><img class="postpicright" align="right" src="/wp-content/iimages/SAPRFCPART1/headerpic.jpg" width="176" height="162" alt="header" title="header" />Don&#8217;t let the title fool you, I&#8217;m not quite there yet. I&#8217;ve already written a few posts that dealt with integrating <a href="http://www.sap.com/">SAP</a> and <a href="http://www.php.net/">PHP</a> (which you can find <a href="http://www.renet-web.net/2006/04/28/update-to-saprfc-material_getlist/">here</a> and <a href="http://www.renet-web.net/2006/01/09/saprfc-stockrequirements-list-in-da-browser/">here</a> to get you started), but&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><img class="postpicright" align="right" src="/wp-content/iimages/SAPRFCPART1/headerpic.jpg" width="176" height="162" alt="header" title="header" />Don&#8217;t let the title fool you, I&#8217;m not quite there yet. I&#8217;ve already written a few posts that dealt with integrating <a href="http://www.sap.com/">SAP</a> and <a href="http://www.php.net/">PHP</a> (which you can find <a href="http://www.renet-web.net/2006/04/28/update-to-saprfc-material_getlist/">here</a> and <a href="http://www.renet-web.net/2006/01/09/saprfc-stockrequirements-list-in-da-browser/">here</a> to get you started), but I thought it was time to take it to another level. So what I&#8217;ve done here is to try and build a portal of sorts and bundled together scripts that will allow one to perform various request to a <a href="http://www.sap.com/">SAP</a> system. All the scripts I&#8217;ve written so far deal with material masters in one way or another.</p>
<h4>Controlling the access</h4>
<p>Up till now,  I have in all my scripts hard coded all the necessary logon parameters (system, user, password, etc&#8230;). Now this is fine because if I had to change my password in say 2-3 scripts that would be manageable. But let&#8217;s for a second imagine that I embark on a script writing frenzy and I write 20-30 scripts and for some reason I have to change one of the logon parameters&#8230;.change 20-30 scripts &#8211; No thank you! So first up on the cards was to re-think how I pass those parameters to the various scripts so that I can correctly invoke all the necessary Remote Function Calls (RFC&#8217;s). Also if someone is going to use (God forbid) these scripts then they will probably want to have a user, use his credentials and not some generic user (and from a licensing point of view SAP will probably be happier too).<br clear="right" /></p>
<p>The answer to that question was easy: Ask a user to type in his SAP user and password, then check to see (SAP side) if that user exists. If yes, then he can access the portal and if not, then he can&#8217;t &#8211; simple. We also want for the user to type his credentials only once and pass them on from page to page. To this effect we&#8217;ll also start using PHP <a href="http://php.mirrors.ilisys.com.au/manual/en/function.session-start.php">session</a> variables so they are propagated throughout the <a href="http://php.mirrors.ilisys.com.au/manual/en/ref.session.php">session</a> during which the user is logged on.<span id="more-152"></span></p>
<p>The logon parameters are now passed through PHP session variables as shown below:</p>
<ul class="codelist">
<li class="odd">
<pre class="brush: plain;">JGxvZ2luID0gYXJyYXkgKA==</pre>
</li>
<li class="even">
<pre class="brush: plain;">IkFTSE9TVCI9PiRfU0VTU0lPTlsnYXNob3N0J10s</pre>
</li>
<li class="odd">
<pre class="brush: plain;">IlNZU05SIj0+JF9TRVNTSU9OWydzeXNuciddLA==</pre>
</li>
<li class="even">
<pre class="brush: plain;">IkNMSUVOVCI9PiRfU0VTU0lPTlsnY2xpZW50J10s</pre>
</li>
<li class="odd">
<pre class="brush: plain;">IlVTRVIiPT4kX1NFU1NJT05bJ3VzZXInXSw=</pre>
</li>
<li class="even">
<pre class="brush: plain;">IlBBU1NXRCIgPT4kX1NFU1NJT05bJ3Bhc3N3ZCddKTs=</pre>
</li>
</ul>
<p><img class="postpicright" align="right"  src="/wp-content/iimages/SAPRFCPART1/logon.jpg" width="250" height="292" alt="logon" title="logon" /></p>
<p>I&#8217;ve made a simple form (the server, system number and client fields have been pre-filled for the user) in which someone wishing to log on only has to input their SAP user and password. Also note that I&#8217;m trying to work at having a visually appealing content. The values typed in those fields will then be used to query SAP using the BAPI,
<pre class="brush: plain;">QkFQSV9VU0VSX0dFVF9ERVRBSUw=</pre>
<p>. The script will query the SAP username. If it exists it will return the user&#8217;s firstname and lastname which we&#8217;ll use to greet him. If not it will return an error.</p>
<p><br clear="right" /></p>
<p>We&#8217;ll use the import parameter
<pre class="brush: plain;">VVNFUk5BTUU=</pre>
<ul class="codelist">
<li class="odd">saprfc_import ($fce,&#8221;USERNAME&#8221;,$_SESSION["user"]);</li>
</ul>
<p>The information we want is in the export parameter
<pre class="brush: plain;">QUREUkVTUw==</pre>
<ul class="codelist">
<li class="odd">$result = saprfc_export ($fce, &#8220;ADDRESS&#8221;);</li>
</ul>
<p>The firstname and lastname returned will be assigned to session variables also</p>
<ul class="codelist">
<li class="odd">$_SESSION["lastname"] = $result["LASTNAME"];</li>
<li class="even">$_SESSION["firstname"] = $result["FIRSTNAME"];</li>
</ul>
<p><img class="postpicleft" align="left" src="/wp-content/iimages/SAPRFCPART1/logonok.jpg" width="250" height="315" alt="logonok" title="logonok" />Assuming the SAP user input was correct, we will then be presented with the &#8216;portal&#8217;, from which we can execute all the scripts available. Notice that thanks to
<pre class="brush: plain;">QkFQSV9VU0VSX0dFVF9ERVRBSUw=</pre>
<p> we can greet the user in more personalized fashion: By using his name.</p>
<p><br clear="left" /></p>
<p>The script I will be focussing on in this post is :</p>
<ul>
<li>Material reports (this report allows you to query material numbers. This script (an early version of it) has already been covered in a previous post, but I will talk about it again because I&#8217;ve brought new interesting enhancements to it)</li>
<li>Material Detail I will cover in part 2 (this report allows you to have more detailed information for a given material)</li>
</ul>
<p>The following two scripts have already been covered:</p>
<ul>
<li>List material groups (You can find more information in this <a href="http://www.renet-web.net/2005/07/30/php-sap-experimenting-with-saprfc/">post</a>)</li>
<li>Material stock requirements list (You can find more information in this <a href="http://www.renet-web.net/2006/01/09/saprfc-stockrequirements-list-in-da-browser/">post</a>)</li>
</ul>
<p>Last but not least the, the script Material Availability Check is still work in progress and will be part of part 3.</p>
<h4>Material reports</h4>
<p>As I said, this has already been partly covered in a previous post. However, what I&#8217;ve changed now is:</p>
<ul>
<li>Made the script a function. I can now query material lists whenever I want</li>
<li>Made it possible to pass material codes that are numerical and alphanumerical (in the previous version only numerical values were possible). The script will auto detect if the material code is numerical or not.</li>
<li>The plant code is no longer hard coded but fetched from within SAP in real time.</li>
<li>Made the code a little faster</li>
</ul>
<h4>Numerical and non numerical values</h4>
<p>In the previous version of this script it had been coded in such a way that you could only input numerical values. Passing numerical and non numerical material codes is now possible. This is achieved thanks to a nice PHP function is_numeric. Basically whatever the material number passed the script will check to see if it is numerical or not. If it is, it will append the material number by adding as many zeroes as necessary so as tho have the material number expressed on 18 characters. If it is not a numerical value it will pass the number to the script unaltered. So we have :</p>
<ul class="codelist">
<li class="odd">$matnumlength	= 18;</li>
<li class="even">if ( is_numeric($matnrlow) ){</li>
<li class="odd"> for ($i = 0 ; $i = ($matnumlength &#8211; strlen($matnrlow)) ; $i++) {</li>
<li class="even">$matnrlow = &#8220;0&#8243; . $matnrlow;</li>
<li class="odd">}</li>
</ul>
<p>Needless to say that you can also mix numerical and alphanumerical values.</p>
<p>You can query numerical values</p>
<p><img src="/wp-content/iimages/SAPRFCPART1/num.jpg" width="500" height="249" alt="num" title="num" /></p>
<p>Or mix types.</p>
<p><img src="/wp-content/iimages/SAPRFCPART1/mix.jpg" width="500" height="246" alt="mix" title="mix" /></p>
<h4>Making the code faster</h4>
<p>I have no scientific proof to go with that statement, it&#8217;s just my impression that execution is improved. What I&#8217;ve done is to add supplementary statements in the &#8216;table_append&#8217; section of the script. It now looks like this:</p>
<ul class="codelist">
<li class="odd">saprfc_table_append ($fce,&#8221;MATNRSELECTION&#8221;, array </li>
<li class="even">(&#8220;SIGN&#8221;=>&#8221;I&#8221;,&#8221;OPTION&#8221;=>&#8221;BT&#8221;,&#8221;MATNR_LOW&#8221;=>$matnrlow,&#8221;MATNR_HIGH&#8221;=>$matnrhigh));</li>
<li class="odd">saprfc_table_append ($fce,&#8221;MATERIALSHORTDESCSEL&#8221;, array</li>
<li class="even">(&#8220;SIGN&#8221;=>&#8221;E&#8221;,&#8221;OPTION&#8221;=>&#8221;CP&#8221;,&#8221;DESCR_LOW&#8221;=>&#8221;*&#8221;,&#8221;DESCR_HIGH&#8221;=>&#8221;"));</li>
<li class="odd">saprfc_table_append ($fce,&#8221;PLANTSELECTION&#8221;, array</li>
<li class="even">(&#8220;SIGN&#8221;=>&#8221;I&#8221;,&#8221;OPTION&#8221;=>&#8221;EQ&#8221;,&#8221;PLANT_LOW&#8221;=>$plant,&#8221;PLANT_HIGH&#8221;=>$plant)); </li>
</ul>
<p>Basically I&#8217;ve added the
<pre class="brush: plain;">TUFURVJJQUxTSE9SVERFU0NTRUw=</pre>
<p> table and I&#8217;ve added the
<pre class="brush: plain;">UExBTlRfSElHSA==</pre>
<p> parameter to the
<pre class="brush: plain;">UExBTlRTRUxFQ1RJT04=</pre>
<p> table.</p>
<h4>Retrieving the plant code dynamically</h4>
<p>The enhancement here is that the plant code is now retrieved dynamically from SAP. In my previous post I said that it could be retrieved from a MySQL database&#8230;but not everybody uses or wishes to use a database to store that information (especially considering that SAP has that information). Now I do not know of a function that allows to query specifically the plant code so I&#8217;ve had to resort to the function
<pre class="brush: plain;">UkZDX1JFQURfVEFCTEU=</pre>
<p> (and before I get flamed for this, yes I know I should not use it &#8211; read OSS note 382318).<br />
In SAP the plant code is stored in a table
<pre class="brush: plain;">VDAwMVc=</pre>
<p>. If I use the function
<pre class="brush: plain;">UkZDX1JFQURfVEFCTEU=</pre>
<p> in SAP and query the table
<pre class="brush: plain;">VDAwMVc=</pre>
<p> we have.</p>
<p>Query the table:<br />
<img src="/wp-content/iimages/SAPRFCPART1/queryt001w.jpg" width="400" height="192" alt="query" title="query" /><br />
<br />
And the result:<br />
<img src="/wp-content/iimages/SAPRFCPART1/resultqueryt001w.jpg" width="400" height="167" alt="result" title="result" /></p>
<p>What we are interested in retrieving is the plant code and the plant description. The plant code we want because that is what we need to pass to the various BAPI&#8217;s and FM&#8217;s we are using and the plant description we want so as to build a select list that the user can better understand (but that could be changed).</p>
<p>So we have the following to query table
<pre class="brush: plain;">VDAwMVc=</pre>
<p>:</p>
<ul class="codelist">
<li class="odd">saprfc_import ($fce,&#8221;QUERY_TABLE&#8221;,&#8221;T001W&#8221;);</li>
<li class="even">saprfc_import ($fce,&#8221;DELIMITER&#8221;,&#8221;/&#8221;);</li>
</ul>
<p>And we return the following to build a select list with the plant code and description:</p>
<ul class="codelist">
<li class="odd">$rfc_rc = saprfc_call_and_receive ($fce);</li>
<li class="even">if ($rfc_rc != SAPRFC_OK) { if ($rfc == SAPRFC_EXCEPTION ) echo (&#8220;Exception raised: &#8220;.saprfc_exception($fce)); else echo (saprfc_error($fce)); exit; }</li>
<li class="odd">$data_row = saprfc_table_rows ($fce,&#8221;DATA&#8221;);</li>
<li class="even">for($i=1; $i<=$data_row ; $i++){</li>
<li class="odd">$DATA = saprfc_table_read ($fce,&#8221;DATA&#8221;,$i);</li>
<li class="even">$plantinfo = SPLIT(&#8220;/&#8221;,$DATA['WA']);</li>
<li class="odd">$plantcode = $plantinfo[1]; // This is the plant code</li>
<li class="even">$plantname = $plantinfo[2]; // This is the plant description</li>
</ul>
<p>In our script we have a nice list of plants that are valid in SAP!<br />
<img src="/wp-content/iimages/SAPRFCPART1/plantlist.jpg" width="200" height="368" alt="plant" title="plant" />.</p>
<h4>Making a function file</h4>
<p>At this point, I should also mention that one of the things I&#8217;ve changed here is to build a functions file. Literally, a file in which I will store all the functions that I will call upon, on a recurring basis. For example, say I need to to retrieve the plant code in 10 of my scripts, why copy/paste the same code 10 times when you can code the function once and make a call to it 10 times &#8211; makes sense right! All I have to do then is to call them by referencing them like
<pre class="brush: plain;">ZnVuY3Rpb24gZG9fdGhlX2Zvbw==</pre>
<p>(). So easy, why did I not think of it sooner.</p>
<h4>The code &#038; feedback</h4>
<p>As usual, the code is released under Creative Commons License:<br />
<img height="31" src="/wp-content/iimages/somerights20.png" width="88" border="0" /><br />
This work is licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/2.5/" rel="license">Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License</a>.</p>
<p>I should maybe also mention that these tests have been made using an <a href="http://www.hp.com/">HP</a> (Compaq <a href="http://h30143.www3.hp.com/configure2.cfm?sid=18508&#038;jumpid=reg_R1002_USEN">nc6220</a>) laptop running on <a href="http://www.microsoft.com/windowsxp/pro/default.mspx">MS Windows XP Pro</a>, the <a href="http://httpd.apache.org/">Apache</a> server version 1.3.33 and the <a href="http://www.php.net/">PHP</a> scripting engine in version 4.3.10 and of course the <a href="http://saprfc.sourceforge.net/">SAPRfc</a> library (the Apache/PHP install was that installed via the <a href="http://www.easyphp.org/">EasyPhp</a> package). <a href="http://www.sap.com/">SAP</a> side I was using SAP ERP ECC (ERP Central Component) 5.0.</p>
<h4>Some code</h4>
<p>You can grab my
<pre class="brush: plain;">cmVhZF9wbGFudF9jb2RlKCk=</pre>
<p> function <a href="http://www.renet-web.net/mint/pepper/orderedlist/downloads/download.php?file=http://www.renet-web.net/wp-content/iimages/SAPRFCPART1/f234ffv98fjdofifvj3SDF/functions.txt">here</a>. If you can improve on this code (which should not be too difficult), give back to the community and post your findings. Comments and suggestions are also very welcome.</p>
<p><em><strong>If you want the complete codes to date with the images, then drop a comment at the bottom of this post (don&#8217;t use the contact page for that). You can safely leave your mail in the intended field as it will not be published .</strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.renet-web.net/2006/05/13/re-writing-sap-with-php-part-1/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
	</channel>
</rss>
