flashislands lession 1

39
7/30/2019 FlashIslands Lession 1 http://slidepdf.com/reader/full/flashislands-lession-1 1/39  SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 1 Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1 Applies to: SAP NetWeaver 7.0 Enhancement Package 1 and higher  – Web Dynpro ABAP Summary This is the first in a series of tutorials on the topic of Adobe Flash Islands for Web Dynpro ABAP. We will see how to create a simple Flex Component in Adobe Flex Builder. Then we will look at how you adjust this component to make it available as an Island. Finally we will see how to integrate this Island Component into Web Dynpro ABAP. Author(s): Thomas Jung Company: SAP Labs, LLC. – SAP NetWeaver Product Management Created on: October 31, 2008 Author Bio Thomas Jung is an SAP NetWeaver Product Manager focusing on Custom Development - particularly in the areas of ABAP, MDM APIs, UI Strategy, and NetWeaver Voice. Before joining SAP Labs in 2006, Thomas was an applications developer for a SAP customer company. He was involved in SAP implementations at this customer as an ABAP Developer for nearly 10 years. He is also the co-author of the SAP Press Books,  Advanced BSP Programming and Next Generation ABAP Development.

Upload: xdgr

Post on 14-Apr-2018

232 views

Category:

Documents


0 download

TRANSCRIPT

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 1/39

 

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 1

Adobe Flash Islands for WebDynpro ABAP  – Tutorial #1

Applies to:

SAP NetWeaver 7.0 Enhancement Package 1 and higher  – Web Dynpro ABAP

Summary

This is the first in a series of tutorials on the topic of Adobe Flash Islands for Web Dynpro ABAP. We will seehow to create a simple Flex Component in Adobe Flex Builder. Then we will look at how you adjust thiscomponent to make it available as an Island. Finally we will see how to integrate this Island Component intoWeb Dynpro ABAP. 

Author(s): Thomas Jung

Company: SAP Labs, LLC. – SAP NetWeaver Product Management

Created on: October 31, 2008

Author Bio

Thomas Jung is an SAP NetWeaver Product Manager focusing on Custom Development - particularly in theareas of ABAP, MDM APIs, UI Strategy, and NetWeaver Voice. Before joining SAP Labs in 2006, Thomaswas an applications developer for a SAP customer company. He was involved in SAP implementations at

this customer as an ABAP Developer for nearly 10 years. He is also the co-author of the SAP Press Books, Advanced BSP Programming and Next Generation ABAP Development.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 2/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 2

Table of Contents

Table of Contents ....................... .......................... ......................... ......................... ........................... ............ 2  Adobe Flash Islands for Web Dynpro ABAP Estimated Time: 30 minutes ........................ ......................... ..... 3 Exercise - Solution ........................................................................................................................................ 4 

Start by creating a new Flex Project in Flex Builder. ........................ ......................... ......................... ......... 4 

Coding the Flex Component ................................ ........................... ......................... ......................... ....... 12 Building the Flex Component ........................ ......................... ......................... ......................... ................ 16 Create the New Web Dynpro Component .......................................... ......................... ........................... .. 18 Building the V_MAIN view layout. ..................... ......................... ......................... ......................... ............ 21 Creating the Flash Islands View ........................ ......................... ......................... ......................... ............ 26 Completing and Running the Web Dynpro Application ........................ ......................... ......................... ... 34 

Related Content .......................... ......................... ......................... ......................... ........................... .......... 38 Copyright .................................................................................................................................................... 39 

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 3/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 3

Adobe Flash Islands for Web Dynpro ABAPEstimated Time: 30 minutes

For this we will learn how easy it can be to integrate Adobe Flash or Flex content into our Web Dynpro ABAPapplication. We have a simple charting control that has been built with Adobe Flex Builder and designed torun within the Web Dynpro Islands framework.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 4/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 4

Exercise - Solution

Web Dynpro Islands

For this we will learn how easy it can be to integrate Adobe Flash or Flex content into our Web Dynpro ABAPapplication. We have a simple charting control that has been built with Adobe Flex Builder and designed torun within the Web Dynpro Islands framework.

Start by creating a new Flex Project in Flex Builder.

1. Open Adobe Flex Builder (standalone, Eclipse based, or as shown in these screen shots – runningwithin SAP NetWeaver Developer Studio).

2. Choose New->Flex Project.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 5/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 5

3. Name your project IslandsIntro1. You can choose the location to store the project, just be sure toremember the location as we will need to access it later in the tutorial to upload the finished FlexComponent to the ABAP Server. Be sure to leave the application type to Web application (runs inFlash Player).

4. Click Next . On the next screen, leave the default output folder of bin-debug. Click Next again.

5. At this point we need to add the SAP Supplied FlashIslands Component into our project. It is thisSAP supplied library that does most of the work to perform the data transformations and provides thefunctions for eventing.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 6/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 6

a. The necessary library is stored on the ABAP Server in the MIME Repository. Go to SE80and choose the MIME Repository View. Then navigate through the folders: PUBLIC->BC->UR->nw7->FlashIslands

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 7/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 7

b. There are multiple files in this folder. The *Impl.swf files are linked at runtime to the compiledFlex components. These contain the majority of the Islands functionality. By linking atruntime we reduce the size of the Flex Component (saving bandwidth) but it also makes iteasier for SAP to patch the library by delivering a new version in the MIME repository viasupport packages. You then get fixes and new functionality without having to recompile your Flex Components.The library that we are interested in for adding to our Flex Component Project is theWDIslandsLibrary*.swc. The files without a numeric suffix are the Flex 2.0 versions. Theones with the 30 suffix are for Flex 3.0. There are also debug versions of each library.

(Please note that Ramp-up customers with 7.0 SP2 or lower will not see the 3.0 version of the libraries and will have to use the 2.0 versions).

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 8/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 8

c. For our purposes we will use the 3.0 version of the non-debug library (although if you don’t have the 3.0 version in your system it is fine to use the 2.0 version. You will simply need analternative step later in the tutorial). Right mouse click on the WDIslandsLibrary30.swc andchoose Upload/Download->Download. Save the file in a convenient location as well willneed to access it in the next step.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 9/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 9

6. Returning to the Flex Builder we are still in the Create a Flex Project wizard. Choose the Library Path tab and click on the Add SWC button.

7. Choose the WDIslandsLibrary30.swc that we downloaded from the ABAP MIME repository in theprevious steps and then click the Finish button.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 10/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 10

8. You will then have the empty shell of a Flex Component available in the Flex Builder:

9. NOTE: OPTIONAL STEP  – If you have to use the Flex 2.0 version of the WDIslandLibrary.swc filethen you need to also perform this optional step to also force your Flex Component to compile asversion 2.0. This step is not needed if you use the Flex 3.0 version of the library(WDIslandLibrary30.swc).

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 11/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 11

a. Right mouse click on your project folder in the Flex Navigator and choose Properties.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 12/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 12

b. In the Properties dialog set the left hand navigation to Flex Compiler . Then for the Flex SDK Version choose Use a specific SDK. From the drop down choose Flex 2.x (actual value

dependent upon the version and patch level of the SDK that you have installed on your system).

Coding the Flex Component

1. You can now switch to the Source tab for the IslandsIntro1.mxml editor. We will walk through eachsection of the coding to explain what it is doing; but at the end of this chapter of the tutorial we havethe complete code listing for easy cut-and-paste. Although this isn’t intended to be a general tutorialon Flex development (check the Adobe website for such tutorials) a little explanation is in order.Flex development is a mixture of MXML tags and ActionScript. MXML tags allow you define thelayout of the UI elements on the screen. You can also make the arrangement via the WYSIWYGeditor on the Design tab and the MXML will be generated for you.

 ActionScript is the scripting language of Flex Components. This is where you place event handlers,dynamic manipulation of the UI and other such coding blocks.For our Flash Island component we will use a mixture of MXML and ActionScript.

2. We start by altering some of the properties of the mx:Application tag. We will change the layout tovertical and set a backgroundColor and backgroundGradientAlphas value that matches up to thebackground settings in Web Dynpro. We also set the width and height to 100%. This allows theFlash Island component to fill the entire container set aside for it on the screen by Web Dynpro. Wewill control the actual size of the component later when we create the definition of the Island withinWeb Dynpro ABAP.Finally we come to the most important change the mx:Application tag for the usage of the Islands

framework. We need to set an ActionScript function to be fired upon initialization (the initialize property) of the component. It is the coding within this function that will register this component withthe Flash Islands framework.

3. Next we have the scripting block for the component. In this scripting block we 3 different sections.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 13/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 13

a. First we have the import statements. These declare the libraries we want to use in our application. Notice the import of sap.FlashIslands. This gives us access to the functionsthat are exposed by the WDIslandsLibrary30.swc that we added to our project earlier.

b. Next we have the variables section. Data binding between the Island and the surroundingWeb Dynpro application is really quite easy. Any public variables or public GET/SETmethods are immediately exposed to the Island Framework. The SAP providedFlashIslands library will do all the translation between the data types for us. From the FlexDevelopers’ standpoint we only need to make these variables public. So for our Chart wewant to get the data from Web Dynpro.In Web Dynpro ABAP this data is an internal table bound to a 0:n context node. Thecorresponding object ot such a data object in Flex is an Array Collection. However ArrayCollections do not work exactly like ABAP internal tables in that their “columns” are notstatically typed at design time. Therefore it will adapt to whatever columns are passedthrough from Web Dynpro. However we won’t want to tie our Flex code to the columnnames that are used in ABAP. Therefore we can declare “alias” fields to point to the actual

column names. These are the next three public variables – MonthLbl, otd, and rty. Later when we do the name mapping in Web Dynpro you will see how we specific what WebDynpro context attribute name will get filled into these alias variables. This makes it possibleto rename objects in Web Dynpro without breaking the connected Flex CodingFinally the otdFill and rtyFill variables really don’t have anything to do with the Islandsinterface. They are local variables to define the colors we want to use on our Bar Chart.

c. Fine final script section is the initApp function. Remember this is the function that will becalled when the component is initialized. In this function we only need to call the register function of the SAP supplied FlashIsland library. This registers the entire component with theFlash Islands framework.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 14/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 14

4. In the final code block we the remain MXML tags to define the animations for our chart, the bar chartitself with its inner Axis and Series definitions as well as a Legend.

5. Complete Source: 

<?xml version="1.0" encoding="utf-8"?><mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical"

width="100%" height="100%" initialize="initApp()"backgroundColor="#eaf1f6"backgroundGradientAlphas="1.0,1.0"> <mx:Script> 

<![CDATA[import mx.rpc.soap.SOAPFault;import sap.FlashIsland;import mx.collections.ArrayCollection;import mx.graphics.IFill;

import mx.graphics.SolidColor;

[Bindable] public var dataSource:ArrayCollection;[Bindable] public var MonthLbl:String;[Bindable] public var otd:String;[Bindable] public var rty:String;

 public var otdFill:IFill = new SolidColor(0xbcd0df, 1.0); public var rtyFill:IFill = new SolidColor(0xFFD965, 1.0);

 public function initApp():void  {

FlashIsland.register(this);}

]]></mx:Script> 

<mx:SeriesSlide id="slideIn" duration="1000" direction="right" /> <mx:SeriesZoom id="zoomIn" duration="1000" relativeTo="chart"

horizontalFocus="left" /> 

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 15/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 15

<mx:BarChart id="barChart" type="clustered" width="100%" fontSize="16"fontWeight="bold" fontStyle="italic" showDataTips="true" > <mx:verticalAxis> 

<mx:CategoryAxis categoryField="{MonthLbl}"dataProvider="{dataSource}" /> 

</mx:verticalAxis> 

<mx:series> <mx:BarSeries xField="{otd}" displayName="OTD"

dataProvider="{dataSource}"fill="{otdFill}" showDataEffect="{slideIn}" /> 

<mx:BarSeries xField="{rty}" displayName="RTY"dataProvider="{dataSource}"

fill="{rtyFill}" showDataEffect="{zoomIn}" /> </mx:series> 

</mx:BarChart> <mx:Legend dataProvider="{dataSource}" direction="horizontal" /> 

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 16/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 16

</mx:Application> 

Building the Flex Component

1. The Flex Coding is now complete. You can view the preview of what the final component will looklike in the Design view

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 17/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 17

2. Now if you want to use a debug build of the component that has actually been being built ever timewe saved the application. However we are pretty sure that this application is going to work the firsttime without needing any debugging so we will produce a final build For this choose Project->ExportRelease Build.

3. This will create a new folder within your project workspace called bin-release with the compiledruntime version of your component named IslandsIntro1.swf. Remember this location as we will needto upload this file into our Web Dynpro application later in the tutorial.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 18/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 18

Create the New Web Dynpro Component

1. We will start this process by creating a normal Web Dynpro Component. Name the ComponentZISL_INTRO1. Also create the initial Window (W_MAIN) and initial View (V_MAIN).

2. We now need to model that data that will be displayed both in the Web Dynpro table UI element andthe Flash Island Bar Chart. For this we will go to the context of the Component Controller.a. Right mouse click on the Context and choose to create a new Node

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 19/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 19

b. Create a Node named REPORT_DATA with a cardinality of 0:n.

c. Now we need add the attributes to our REPORT_DATA context node. There are three

attributes that we will add – the Month Description, the On Time Delivery value, and the RollThroughput Yield value.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 20/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 20

i. Month Description: type STRING

ii. On Time Delivery: type I (integer)

iii. Roll Throughput Yield: type I (integer)

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 21/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 21

3. We now need some code to populate the REPORT_DATA context node. Since this is just a verysimple example application we will actually hard code these values. We will use the WDDOINIT 

method of the component controller to do this population.METHOD wddoinit .

DATA lo_nd_report_data TYPE REF TO if_wd_context_node.DATA lt_report_data TYPE wd_this->elements_report_data.lo_nd_report_data = wd_context->get_child_node(

name = wd_this->wdctx_report_data ).

FIELD-SYMBOLS <wa_data> LIKE LINE OF lt_report_data.APPEND INITIAL LINE TO lt_report_data ASSIGNING <wa_data>.<wa_data>-month = '07/2008'.<wa_data>-otd = 90.<wa_data>-rty = 85.

APPEND INITIAL LINE TO lt_report_data ASSIGNING <wa_data>.<wa_data>-month = '08/2008'.<wa_data>-otd = 73.<wa_data>-rty = 78.

APPEND INITIAL LINE TO lt_report_data ASSIGNING <wa_data>.<wa_data>-month = '09/2008'.<wa_data>-otd = 94.<wa_data>-rty = 56.

* lo_nd_report_data->bind_table(

new_items = lt_report_data set_initial_elements = abap_true ).

ENDMETHOD.

Building the V_MAIN view layout.

1. We can now go to the V_MAIN view and map the Context Node from the Component Controller tothe View Controller Context via Drag and Drop.

2. Now return to the Layout tab of the V_MAIN view. We want to create a Table UI element.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 22/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 22

a. Right Mouse Click on the ROOTUIELEMENTCONTAINER and choose Insert Element .

b. In the Create element dialog, choose a UI element named table of type Table.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 23/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 23

c. Add a caption called Quality Data to the table

d. Right Mouse Click on the Table UI element and choose Create Binding to start the Binding

Wizard.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 24/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 24

e. Choose REPORT_DATA as the context node to bind the table to

f. Map the MONTH attribute to a TextView and the OTD and RTY attributes to InputField.This way users of the application can change the OTD and RTY values and view the updateto the Bar Chart immediately.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 25/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 25

g. In order to Trigger the update of the Flash Island Bar Chart, place an onEnter Action on theOTD and RTY InputField. There doesn ’t actually have to be any coding in the Event Handler for this Action. Just the act of triggering the event will update the shared context betweenWeb Dynpro and the Flex Component.

3. The FlashIsland UI element cannot be placed directly within the UI element Hierarchy. It mustalways be a root node UI element of a View. Therefore within our V_MAIN we can only reserve aplace holder for the Flash Islands View using a VIEWCONTAINERUIELEMENT.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 26/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 26

a. Right Mouse Click on the ROOTUIELEMENTCONTAINER and choose Insert Element .

b. In the Create element dialog create a new UI element named ISLANDS_CONTAINER of type VIEW_CONTAINER_UIELEMENT .

Creating the Flash Islands View

1. Create a new View named V_ISLANDa. Right mouse click on the Views node of the Component and choose Create.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 27/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 27

b. Name the new View – V_ISLAND.

2. Map the Component Controller Context Node REPORT_DATA to the View Context.

3. Add the ISLAND UI elements to the View and Map to the Flex Component namesa. The FlashIslands UI element must be the ROOT UI Element. Therefore, Web Dynpro has a

new feature that lets you swap the UI Element of the ROOTUIELEMENTCONTAINER. RightMouse click on the ROOTUIELEMENTCONTAINER in the UI element Hierarchy and chooseSwap Root Element .

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 28/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 28

b. Choose FlashIsland from the list of possible UI elements.

c. We now need to upload the compiled Flex Component file to the ABAP application server.

Right Mouse Click on the Component and choose Create->Mime Object->Import .

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 29/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 29

d. Choose the completed Flex Component file from the Flex Builder project workspace.

e. Save the Mime Object with the default Document Settings

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 30/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 30

f. The Flex Component is now displayed within the MIMEs folder of the Web DynproComponent and transported with the Web Dynpro development object.

g. Click on the ROOTUIELEMENTCONTAINER and you will see via its Properties that it now isa FlashIsland. The main property is the swfFile – which tells Web Dynpro which AdobeFlash/Flex component should be loaded in this space. Supply the following properties:

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 31/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 31

h. Now we need to map our Context Node REPORT_DATA to the Flex ComponentDataSource named dataSource. To do this add a child element of theROOTUIELEMENTCONTAINER of type DataSources.

i. Then context bind the dataSource property and the supply the Flex Component name in thename property.

 j. Just like we mapped the name of the Context Node to the Flex dataSource, we must alsomap the names of the Context Attributes to Flex property names. Right mouse click on theGACDataSource in the UI element hierarchy and choose Insert Property .

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 32/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 32

k. The first property is for MONTH = MonthLbl.

l. The second property is for OTD = otd

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 33/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 33

m. The final property is for RTY = rty

n. You might be wondering how we knew the Flex property and dataSet names. Well if youdidn’t have access to the Flex source code, you would have to ask the original developer.

Here see the source code within the Adobe Flex Builder (running within the NetWeaver Developers’ Studio). 

4. Embed the Islands View within the Window/View Container a. Drag and Drop the V_ISLAND View to the ISLANDSCONTAINER within V_RPT1.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 34/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 34

b. The final association should look like this.

Completing and Running the Web Dynpro Application

1. Right Mouse Click on the Web Dynpro Component and choose Create->Web Dynpro Application.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 35/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 35

2. Creating the application will generate a URL from which we can test our application.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 36/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 36

3. Hit F8 or press the Text/Execute button to launch the application in your default Web Browser. Youshould see the data in the Table and in the Flex Component Bar Chart

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 37/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com

© 2008 SAP AG 37

4. Try changing some of the data in the Table and see the changes reflected in the chart.

5. If you need to do any trouble shooting trying using the Right Mouse Clicks within the FlashIslandarea and choose either Copy Log to Clipboard or Copy Source to Clipboard. This will allow you toview the FlashIsland processing log or the xBCML data feed that passes between Web Dynpro

 ABAP and the FlashIslands Component.

7/30/2019 FlashIslands Lession 1

http://slidepdf.com/reader/full/flashislands-lession-1 39/39

Adobe Flash Islands for Web Dynpro ABAP  – Tutorial #1

Copyright

© 2008 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG.The information contained herein may be changed without prior notice.

Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.

Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.

IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries,zSeries, System i, System i5, System p, System p5, System x, System z, System z9, z/OS, AFP, Intelligent Miner, WebSphere,

Netfinity, Tivoli, Informix, i5/OS, POWER, POWER5, POWER5+, OpenPower and PowerPC are trademarks or registered trademarks of IBM Corporation.

 Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe SystemsIncorporated in the United States and/or other countries.

Oracle is a registered trademark of Oracle Corporation.

UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.

Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc.

HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, MassachusettsInstitute of Technology.

Java is a registered trademark of Sun Microsystems, Inc.

JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented byNetscape.

MaxDB is a trademark of MySQL AB, Sweden.

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All

other product and service names mentioned are the trademarks of their respective companies. Data contained in this document servesinformational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAPGroup") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or 

omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in theexpress warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituti ng an

additional warranty.

These materials are provided “as is” without a warranty of any kind, either express or implied, including but not limited to, the implied

warranties of merchantability, fitness for a particular purpose, or non-infringement.SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that mayresult from the use of these materials.

SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within thesematerials. SAP has no control over the information that you may access through the use of hot links contained in these materia ls and

does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages.

 Any software coding and/or code lines/strings (“Code”) included in this documentation are only examples and are not intended to beused in a productive system environment. The Code is only intended better explain and visualize the syntax and phrasing rules of 

certain coding. SAP does not warrant the correctness and completeness of the Code given herein, and SAP shall not be liable for errorsor damages caused by the usage of the Code, except if such damages were caused by SAP intentionally or grossly negligent.