Rfc Abap Adobe

download Rfc Abap Adobe

of 17

Transcript of Rfc Abap Adobe

  • 8/6/2019 Rfc Abap Adobe

    1/17

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

    Consumpt ion of SAP RFC in Adob eFlex 3 Appl ic at ion Using WebServ ice In t rospect ion Method

    Applies to:

    SAP Web Application Server (WAS) 6.40, 7.0 and CE (7.1).

    For more information, visit the Web Services homepage.

    Summary

    The main objective of this tutorial is to create a Web Service whose end point is a Remote Function Moduleand consuming that web service in Adobe Flex 3 Application using Web Service Introspection Method. Youcan now easily develop your favorite Flex based client application that consumes SAP RFCs as WebServices. Web Service Introspection Method will generate client proxy classes from WSDL signatures.

    Author: Vivek Khedekar

    Company: Larsen & Toubro Infotech Ltd.

    Created on: 5 August 2009

    Author Bio

    Vivek Khedekar works at Larsen & Toubro Infotech Ltd., as a SAP Technical Consultant. Hehas primarily worked on SAP technologies like ABAP, ALE-IDoc, WebDynpro Java, AdobeInteractive Forms and also tried hands on integrating Adobe Flex, AIR with SAP via RFCs andWeb Services.

    https://www.sdn.sap.com/irj/sdn/webserviceshttps://www.sdn.sap.com/irj/sdn/webservices
  • 8/6/2019 Rfc Abap Adobe

    2/17

    Consumption of SAP RFC in Adobe Flex 3 Application Using Web Service Introspection Method

    Table of Contents

    Creating Simple RFC..........................................................................................................................................3Generating Web Service Using WS Wizard .......................................................................................................5Create a Flex Project ..........................................................................................................................................9Web Service Introspection................................................................................................................................11Script to Call the Web Service Proxy................................................................................................................14Running the Application....................................................................................................................................15Related Content................................................................................................................................................16Disclaimer and Liability Notice..........................................................................................................................17

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/6/2019 Rfc Abap Adobe

    3/17

    Consumption of SAP RFC in Adobe Flex 3 Application Using Web Service Introspection Method

    Creating Simple RFC

    Go to SE37 to create simple function module which will return a simple calculation. We will pass a value tothe webservice and that web service will call the function module in SAP and return that value to Flexapplication.

    In the Import Tab we are importing a Data with Type Integer.

    In Export Tab FM is returning the calculated value.

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/6/2019 Rfc Abap Adobe

    4/17

    Consumption of SAP RFC in Adobe Flex 3 Application Using Web Service Introspection Method

    In the Source tab we are adding following code

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/6/2019 Rfc Abap Adobe

    5/17

    Consumption of SAP RFC in Adobe Flex 3 Application Using Web Service Introspection Method

    Generating Web Service Using WS Wizard

    Now we have to create a web service for this function module.

    Press continue.

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/6/2019 Rfc Abap Adobe

    6/17

    Consumption of SAP RFC in Adobe Flex 3 Application Using Web Service Introspection Method

    Provide the name and description of the FM. This may not be same as FM name

    Press continue.

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/6/2019 Rfc Abap Adobe

    7/17

    Consumption of SAP RFC in Adobe Flex 3 Application Using Web Service Introspection Method

    Select Basic Authorization and must check the Release for Runtime.

    Click Complete

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/6/2019 Rfc Abap Adobe

    8/17

    Consumption of SAP RFC in Adobe Flex 3 Application Using Web Service Introspection Method

    Now you can access the wsdl as:

    http://:/sap/bc/srt/rfc/sap/?sap-client=&wsdl=1.1

    For our example it is:

    http://:/sap/bc/srt/rfc/sap/ZTEST_INTRO?sap-client=800&wsdl=1.1

    Note: You can skip the generation of web service using wizard and use wsdl as:

    http:// :/sap/bc/soap/wsdl11?services=ZTEST_INTRO

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/6/2019 Rfc Abap Adobe

    9/17

    Consumption of SAP RFC in Adobe Flex 3 Application Using Web Service Introspection Method

    Create a Flex Project

    In your Adobe Flex Builder, create a new Flex Project.

    Name your project ZTEST_FLEX.

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/6/2019 Rfc Abap Adobe

    10/17

    Consumption of SAP RFC in Adobe Flex 3 Application Using Web Service Introspection Method

    Confirm with Finish. The Flex project is created.

    In ZTEST_FLEX.mxml add design as below:

    Here is the code generated

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/6/2019 Rfc Abap Adobe

    11/17

    Consumption of SAP RFC in Adobe Flex 3 Application Using Web Service Introspection Method

    Web Service Introspection

    In the flex builder Menu go to Data->Import Web Service

    Enter the WSDL and press next

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/6/2019 Rfc Abap Adobe

    12/17

    Consumption of SAP RFC in Adobe Flex 3 Application Using Web Service Introspection Method

    Enter SAP user id and Password

    Press Finish

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/6/2019 Rfc Abap Adobe

    13/17

    Consumption of SAP RFC in Adobe Flex 3 Application Using Web Service Introspection Method

    You will see below files are generated

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/6/2019 Rfc Abap Adobe

    14/17

    Consumption of SAP RFC in Adobe Flex 3 Application Using Web Service Introspection Method

    Script to Call the Web Service Proxy

    Add below Action script to call the Web Service Proxy.

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/6/2019 Rfc Abap Adobe

    15/17

    Consumption of SAP RFC in Adobe Flex 3 Application Using Web Service Introspection Method

    Running the Application

    Build the Flex Application and Press Run.

    Enter the value and press Button.

    After entering valid Login credentials application will gives the output.

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

  • 8/6/2019 Rfc Abap Adobe

    16/17

    Consumption of SAP RFC in Adobe Flex 3 Application Using Web Service Introspection Method

    Related Content

    Welcome to the Flex and SAP Web Services Quickstart

    Consuming ABAP Web Services using Flex

    Adobe Flex

    For more information, visit the Web Services homepage.

    SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com

    2009 SAP AG

    https://wiki.sdn.sap.com/wiki/display/EmTech/Quickstart+Using+Flex+and+SAP+Web+Serviceshttps://wiki.sdn.sap.com/wiki/display/EmTech/Consuming+ABAP+Web+Services+using+Flexhttps://wiki.sdn.sap.com/wiki/display/EmTech/Consuming+ABAP+Web+Services+using+Flexhttps://wiki.sdn.sap.com/wiki/display/EmTech/Adobe+Flexhttps://www.sdn.sap.com/irj/sdn/webserviceshttps://www.sdn.sap.com/irj/sdn/webserviceshttps://wiki.sdn.sap.com/wiki/display/EmTech/Adobe+Flexhttps://wiki.sdn.sap.com/wiki/display/EmTech/Consuming+ABAP+Web+Services+using+Flexhttps://wiki.sdn.sap.com/wiki/display/EmTech/Quickstart+Using+Flex+and+SAP+Web+Services
  • 8/6/2019 Rfc Abap Adobe

    17/17

    Consumption of SAP RFC in Adobe Flex 3 Application Using Web Service Introspection Method

    Disclaimer and Liability Notice

    This 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.