Close Sidebar close
Sapignite
  • SAP
  • Coding Challenges
  • Download
  • SAP Ignite Products

Subscribe & Follow

All product names on this web site are trademarks of the companies that own them. Sapignite.com is not affiliated with SAP AG in any way. SAP AG is the registered trademark holder of SAP, SAP R/3, mySAP, ABAP, xApps, NetWeaver, and other proprietary terms. The technical information on this site is verified to the greatest extent possible, however, any information found on this site is used at the site visitor's own risk. Sapignite.com reserves the right to correct any errors or omissions in any portion of this site at any time without obligation.

  • SAP
  • Coding Challenges
  • Download
  • SAP Ignite Products
Sapignite
Sapignite
    featured SAP Webdynpro for ABAP

    Pie Charts in Adobe Flex using Webdynpro for ABAP

    July 6, 2017

    In this article will try to explain you how easily one can create an Adobe Flash application embedded in Webdynpro for ABAP.

    But why Adobe Flash??? Is webdynpro for ABAP is not good enough to develop beautiful UI?

    Well Flash is good to develop highly interactive UI so if you are looking to develop Rich UI just go for it.Webdynpro is still recommended to develop and form based applications. Starting with our tutorial Our Mission is: A pie chart which shows the number of claims submitted in different line of business as shown billow.

    Step1 : Install Flash builder ( I used 4.6 ). Download it from http://www.adobe.com/support/downloads/detail.jsp?ftpID=5517

    Step2 : Download the Library from your SAP system from MIME repository .( Tcode : Se80 )

    Step3: Start Your Flash Builder and create your Flex Project.


    Step 4:

    Open your SAP system and develop a webdynpro for ABAP Component which gonna be your main application.

    Write a code to initialize this node :

    method WDDOINIT .

    DATA lo_nd_claimarea TYPE REF TO if_wd_context_node.

      DATA lt_claimarea TYPE wd_this->Elements_claimarea.
    DATA ls_claimarea like LINE OF lt_claimarea.

    *   navigate from <CONTEXT> to <CLAIMAREA> via lead selection
    lo_nd_claimarea = wd_context->get_child_node( name = wd_this->wdctx_claimarea ).
    *

    ls_claimarea–AREA = ‘Personal’.
    ls_claimarea–number = ‘200’.
    APPEND ls_claimarea to lt_claimarea.

    ls_claimarea–AREA = ‘Package’.
    ls_claimarea–number = ‘100’.
    APPEND ls_claimarea to lt_claimarea.

    ls_claimarea–AREA = ‘Commercial’.
    ls_claimarea–number = ’50’.
    APPEND ls_claimarea to lt_claimarea.

    ls_claimarea–AREA = ‘Health Care’.
    ls_claimarea–number = ‘150’.
    APPEND ls_claimarea to lt_claimarea.

    lo_nd_claimarea->bind_table( new_items = lt_claimarea set_initial_elements = abap_true ).

    endmethod.

    Explanation: Here we have 4 different type of lines of business and we have initialized the node with number of claims Each Area contains.

    Step 5:

    Let’s Move to Flash Builder now .Go to src folder and start editing your mxml file. (This is the file where we going to write a code to develop Pie chart ).

    <?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”

                     >

        <mx:Metadata>

            [Event(type=“com.flexblog.examples.events.CustomEvent”, name=“dataLoaded”)]

        </mx:Metadata>

        <mx:Script>

            <![CDATA[

                import com.flexblog.examples.events.CustomEvent;

                import mx.collections.ArrayCollection;

                import mx.graphics.IFill;

                import mx.graphics.SolidColor;

                import mx.rpc.soap.SOAPFault;

                import sap.FlashIsland;

                [Bindable]

                public
    var claimArea:ArrayCollection;

                [Bindable]

                public
    var number:String;

                [Bindable]

                public
    var area:String;

                public
    function initApp():void

                {

                    FlashIsland.register(this);

                }

            ]]>

        </mx:Script>

            <mx:Panel title=”Pie Chart“>

                <mx:PieChart id=”PieChart”

                             dataProvider=”{claimArea}”

                             showDataTips=”true“

                             >

                    <mx:series>

                        <mx:PieSeries

                            field=”{number}”

                            nameField=”{area}”

                            labelPosition=”callout“

                            />

                    </mx:series>

                </mx:PieChart>

                <mx:Legend dataProvider=”{claimArea}“/>

            </mx:Panel>    

        </mx:Application>

    So as The Great Goku Says (if you don’t know this guy your childhood was not awesome J ) Save this file to your computer ( Here its ClaimPieChart.swf ) which we import as MIME object in our WD4A component.

    Step 6:

    Get back to your webdynpro for ABAP component and in the main view:

    Swap the RootUIelementContainer with the FlashIsland and Add two properties one for number and one for area. (make sure you bind it with the view context as well).

    Step 7: Create a webdynpro for ABAP Application and call your friends to show them your first flash application (If it works J )

    pie chart sap webdynprosap abap chartssap abap flash pie chartsap adobesap flash pie chart tutorialwebdynpro for abap
    raju borda
    Raju is working with Technical areas like SAP ABAP, PI , Web design, JAVA , PBT, robotics as architect also functional areas like SCM , QM, MM , insurance . When he is not Doing above geeky things you might find him travelling , Cooking , dancing or drinking with friends :-) .
    • SAP Tips and tricks

    • Android application to call SAP web service

    You Might Also Like

    SAP’s revolutionary journey and history of User interface / GUI

    July 10, 2017

    Best practices While working with SAP Database

    July 18, 2017

    SAP Freeway : My journey towards SAP teched demojam trophy

    July 8, 2017

    No Comments

    Leave a Reply Cancel Reply

Sign up for some exciting content

Recent Posts

  • How to prepare for SAP IBP Certification
  • What is SAP Leonardo ?
  • RoadMap UI Tutorial webdynpro for ABAP
  • Offline Adobe forms in WebDynPro for ABAP
  • MVC Architecture for Webdynpro for ABAP

Categories

  • ABAP
  • Android
  • Coding Challenges
  • Enhancement
  • featured
  • Interviews
  • Learning Hub
  • PI ( Process integration )
  • SAP
  • SAP HANA
  • Uncategorized
  • Webdynpro for ABAP
  • Webdynpro For ABAP