Thursday, February 3, 2011

Part 1: SAP BSP + BO-Xcelsius (Excel XML Maps Connection)

Part 1: SAP BSP + BO-Xcelsius (Excel XML Maps Connection)

By Gokul Natarajan, Kaar Technologies

Create a BSP application using SE80 transaction (ZDEMO_EXCELMAPS)

Create a View (PWFL)-DATA.XML which will have the XML data. This data will be acting as the main source for the Xcelsius file which is going to be created in the further steps. Use the below code in the layout of the XML view.

<%@page language="abap"%>
<% DATA: ITAB TYPE TABLE OF SFLIGHT,
XML_STRING
TYPE STRING .

SELECT * FROM SFLIGHT INTO TABLE ITAB UP TO 5 ROWS.

TRY.
CALL TRANSFORMATION ('ID')
SOURCE PARA = ITAB
RESULT XML XML_STRING.

CATCH CX_ST_ERROR.
ENDTRY.

REPLACE ALL OCCURRENCES OF 'utf-16' IN XML_STRING WITH 'utf-8' .

CALL METHOD RESPONSE->IF_HTTP_ENTITY~SET_CDATA
EXPORTING
DATA = XML_STRING.
%>

The above code is used to generate the XML data. The internal table returned from the select statement will be presented to the standard “CALL TRANSFORMATION (ID) “to generate the XML. The XML format may be either in UTF-8 or UTF-16 or anything. Based on the setting and server configurations the versions have to be set. The XML file has to be tested and the generated XML will be saved locally in order to design the Chart.

Now an Excel file is imported with the XML data saved locally. The data returned from the FM will be presented in the excel file and the file will be saved locally.

Now the BO-Xcelsius will be opened and imported with excel file which is saved in the previous step. The data will be feed into the excel sheet of the Xcelsius and the report is designed by using several components available.

Now the connectivity has to be made by opening the Manage Data Connections - > Add - > Excel XML Maps. Name the connection and mention the XML data URL. The view represented in BSP application for the XML file has the URL and will be represented.

The designed Xcelsius file will be saved in XLF format locally which will be then exported as SWF file. The SWF file will be imported as MIME object into the BSP application.

Another HTML view will be created inside the same BSP application in order to display the MIME object. Apply the below code in the layout of FLIGHTS.HTML view.

<%@page language="abap"%>
<%@extension name="htmlb" prefix="htmlb"%>

content design="design2003">
title = "XCelsius-SAP (Excel XMl Maps Connection)">
form>
<
object>
src="Excel_XML_MAPS.swf" quality="high"

bgcolor="#869ca7" width="50%" height="50%"

name="test_page" align="middle" play="true" loop="false" quality="high"

allowScriptAccess="sameDomain"

type="application/x-shockwave-flash"

pluginspage="http://www.adobe.com/go/getflashplayer">

object>

form>

content>

Now test the FLIGHTS.HTML page. The HTML page first calls the Xcelsius – SWF file. The SWF file gets data from the XML page created as a view in the BSP application. You can easily have a view by debugging the application on keeping the break point in the appropriate places. For example when a refresh button is placed in the Xcelsius file and whenever it is clicked, the data gets refreshed and acts based on the current data.

I think the blog on Excel XML maps connection gave a basic idea of integrating SAP with the BO. Not only R/3 data can be presented as a report or dashboard, but also the BW data can also be presented by representing the BW Query or BW objects into the customized FM’s and can be operated as the same as that of operating the R/3 data through the XML file. Below shows the sample application which is consuming data from BW query.






No comments:

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)

Userexits/BADIs

Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials

Blog Archive

goodsites