Transcription

Converting and Exporting Data inXML FormatApplies to:SAP BW 3.5, SAP BI 7.0 etc. For more information, visit the EDW homepage.SummaryThis paper briefs about Information broadcasting that allows you to make objects with business intelligencecontent available to a wide spectrum of users. It also offers functions to optimize performance and forexception reporting.Author:Ramam VelivalaCompany: Deloitte ConsultingCreated on: 10th June 2011Author BioRamam Velivala is a Lead consultant with SAP BW/BI, BPC and EPM practice at Deloitte. He iscurrently leading the SAP-BW track integration with EPM tools. He has extensively worked on PCMmodeling to extract data to SAP-BW and BPC systems. He has more than 12 years of SAPexperience in providing analytic solution in various SAP functional modules like Finance, Controlling,Procurement etc.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com1

Converting and Exporting Data in XML FormatTable of ContentsInformation Broadcasting . 3Features: . 4Using ABAP through APD (Analysis Process Design) . 6Use of PI . 8Development of ABAP Proxy in BI: . 81. BI outbound interface:. 82. Interface in PI: . 8Related Content . 9Disclaimer and Liability Notice . 10SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com2

Converting and Exporting Data in XML FormatInformation BroadcastingInformation broadcasting allows you to make objects with business intelligence content available to a widespectrum of users. It also offers functions to optimize performance and for exception reporting.It is mainly used to automate queries, web templates, and reports in different output formats like PDF, Excel,XML, XHTML, and HTML or as an online link such to different destinations such as: End-user emails or group of user mails (E-mail Bursting)SAP Enterprise PortalSAP Enterprise Portal Knowledge Management foldersFrom the above diagram we can say that:Information Broadcasting allows the distribution of BW informationViaDifferent channels. i.,e., E-Mail and Enterprise PortalDifferent formats.i.e., XML, HTML, MHTML, BEx Analyzer Workbooks and ZIP FilesDifferent sources i.e., BI Web Applications - Dashboards, cockpits, BEx Analyzer Workbooks and QueriesDifferent modes i.e., Online & pre-calculatedWhy Is Broadcasting Important? Reduces the time users spend looking for informationImproves the likelihood that users will use your BI dataExpands the reach of BI data to non-SAP users as well!Makes BW data available for users on the goSAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com3

Converting and Exporting Data in XML Format Lets you link your BW and Portal systems together!Lets users collaborate, integrate BW content with other enterprise and Web content, etc.!Features: Distribution with BEx BroadcasterWith the BEx Broadcaster, we can pre-calculate queries, query views, Web templates, reports andworkbooks and broadcast them by e-mail or to the portal. In addition to the pre-calculated documentsin various formats (XML, HTML, MHTML, ZIP and so on) that contain historical data and we can alsogenerate online links. Access in the SAP NetWeaver PortalIn the portal, the ideal way of accessing Business Intelligence information is through a central entrypage (for example BEx Portfolio). This shows the content of the Knowledge Management folderwhere you published the content. The Broadcasting layout profile displays the content that isespecially tailored to the needs of users who work with Business Intelligence content in the portal. BEx BroadcasterUsing the BEx Broadcaster we can pre-calculate and distribute Web templates, queries, query views,reports and workbooks. We can broadcast BI objects either as pre-calculated documents or onlinelinks (this is not possible for workbooks). Your distribution options include broadcasting by e-mail orbroadcasting to the portal. Furthermore, you can print these BI objects in the required format. BEx Broadcaster and Broadcasting WizardIn the BEx Broadcaster, we can create new broadcast settings with both the broadcaster itself andwith a wizard. The broadcasting wizard is an assistant that supports in creating a new setting byproviding step-by-step instructions. Since the settings options are limited with the wizard incomparison to the broadcaster, we have the option of jumping from the wizard to the broadcaster tomake further settings as necessary. Precalculation and Distribution of Queries, Query Views, Web Templates and ReportsWe can precalculate queries, query views, Web templates, and reports in various formats or createonline links for these BI objects. We can broadcast the information by e-mail, to the portal, or to aprinter.For precalculation and distribution, we can choose1) Queries2) Query Views3) Web Templates4) Reports Output Formatsa. XML (MS Excel)The system generates an XML file that contains the results and displays them in a data table. This output format supports object types Query and Query View only. The XML file cannot be edited in the BEx Analyzer.b. MHTMLThe system generates an MHTML file. All components of the HTML page (HTML, style sheet,pictures, and so on) are in one file. We can use this output format when you want to generate oneindividual document and broadcast it by e-mail or to the portal. Recipients cannot navigate in thegenerated file. This output format does not support object type Report.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com4

Converting and Exporting Data in XML Formatc. HTMLThe components of the HTML page are generated by the system in individual files. We can use thisoutput format to generate multiple documents with various filter settings from the same BI object.Recipients can navigate between different filter views for the BI object (Query, Query View, Report,or Web Template). This output format does not support object type Report.d. Online Link to Current DataThe system generates a URL to the current navigational state of the BI object (Query, Query View,Web Template, or Report). The recipients can call the BI object and navigate further within it.e. PDFThe system generates a static PDF file.f. Print Format (PS or PCL)The document is generated in the suitable format for the output device: PostScript (PS) or PrinterControl Language (PCL).The BEx Broadcaster allows you to select from the output formats available for the distribution typeyou selected.The Print Format (PS or PCL) output format is printer-specific and is therefore only available withdistribution type Broadcast to Printer. The Portable Document Format (PDF) output format is alsoavailable for this distribution type.Output formats are based on the distribution type you select. Below screen shot shows the outputformats for BEx Broadcaster., out of which XML is one. Distribution Options:Using the BEx Broadcaster we can distribute the reporting objects either in pre-calculated form or asan online link. Your distribution options include Sending by e-mail Exporting into the Enterprise Portal Sending by E-MailSending by e-mail is an option for distributing BW objects. We can send the reports in BW to theEmail address specified of the recipients.We can send the file in the different formats mentioned above.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com5

Converting and Exporting Data in XML FormatExporting into the Enterprise PortalExport into the Enterprise Portal is one option for distributing BW data file. You can put the this data file in acollaboration room or in a KM folder.From the Enterprise Portal we can download the file in the different formats mentioned above.From KM folder we need to write Java program to put this file in required folder for accessing by othersystem.Using ABAP through APD (Analysis Process Design)In this approach, we use Bex Query result as input and extract this query data into direct DSO. After that, thisDSO active table data used as source and convert this table data into XML file using ABAP program andsave this file in application server of BW system.See the below picture to extract query data into XML file.ABAP Program For Conversion:DATA :DATA :a(100)END OFt009 LIKE TABLE OF t009 WITH HEADER LINE.BEGIN OF itab OCCURS 0,TYPE c,itab.DATA: xml out TYPE string ,path type rlgrap-filename value 'D:\usr\sap\put\file p.xml'.DATA : BEGIN OF upl OCCURS 0,f(255) TYPE c,END OF upl.DATA: xmlupl TYPE string .*------------------ Fetch DataSELECT * FROM t009 INTO TABLE t009.*------------------- Convert data to XML FormatCALL TRANSFORMATION ('ID')SOURCE tab t009[]SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com6

Converting and Exporting Data in XML FormatRESULT XML xml out.CALL FUNCTION 'SCMS STRING TO FTEXT'EXPORTINGTEXT xml out* IMPORTING* LENGTH TABLESFTEXT TAB itab.* Exporting to Presentation serverCALL FUNCTION 'GUI DOWNLOAD'EXPORTINGfiletype 'BIN'filename 'c:\a.xml'TABLESdata tab itab.* Exporting to Application serveropen dataset path for output in binary mode.loop at itAB .transfer ITAB to path.endloop.close dataset path.In the above program code, the data from table is exported to Application and Presentation server.Output file from Presentation server:a.xmlScreen shot showing output from File a.xml:Conclusion: From the above two options APD is the optimal solution to build XML file in terms of configuration and costas through broadcaster we need Enterprise Portal configuration and programming effort in JAVA.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com7

Converting and Exporting Data in XML FormatUse of PIPI provides a technical infrastructure for XML-based message exchange to enable the integration of SAPand non-SAP systems. Generating TVA reports in XML format can be achieved with the use of PI.PI would be used for: Converting BI information into XML reportValidating data against XML schema using validation techniquesAdditionally, PI would also allow making periodic changes to XML schema, if any are required. As shown in the below diagram, SAP BI will send the data to SAP PI; PI will convert it to XMLDevelopment of ABAP Proxy in BI:The scenario development begins in PI with the definition of interface objects for inbound and outboundcommunication with the BI system. These generic definitions will be used to generate ABAP proxies in BI.The objects will establish the link between the two systems.Once the technical infrastructure has been established for the interface between BI and PI, the proxies arebound to the process chain infrastructure by creating a custom process type. In other words, ABAP code isimplemented which reads datasets from the database tableIn order to deliver the dataset to PI, the methods of the generated proxy are called, utilizing the configurationthat defines the interface between the systems. The source code that performs the read and delivery iswrapped inside a custom process type, thus inheriting the general properties of the process chainsframework (such as active monitoring of its status and writing a log).The following interfaces need to be set up:1. BI outbound interface: Create and implement ABAP-proxies for BI-PI communicationPreparations for custom process type – class definition and implementationCreate Open Hub/InfoSpokeCreate custom process type and process chain2. Interface in PI: Define interface objects for BI-PI communication.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com8

Converting and Exporting Data in XML FormatRelated ContentFor more information, visit the EDW homepage.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com9

Converting and Exporting Data in XML FormatDisclaimer and Liability NoticeThis document may discuss sample coding or other information that does not include SAP official interfaces and therefore is notsupported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document,and anyone using these methods does so at his/her own risk.SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article orcode sample, including any liability resulting from incompatibility between the content within this document and the materials andservices offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of thisdocument.SAP COMMUNITY NETWORK 2011 SAP AGSDN - sdn.sap.com BPX - bpx.sap.com BA - boc.sap.com UAC - uac.sap.com10