how to get live commentary xcelsius, using sap function modules and web services

25
LIVE INPUT FROM XCELSIUS DASHBOARD VIA SAP R/3 TABLE, FUNCTION MOD ULE AND WEB SERVICES Table of Contents Overview ....................................................................................................................................................... 2 1. Activating Services .................................................................................................................................... 3 Step 1: Enabling Services in SICF...............................................................................................................3 Step 2: Traversing Hierarchy Nodes..........................................................................................................4 2. Create ZTable ............................................................................................................................................ 5 Step 1: Create custom table SE11.............................................................................................................5 3. Create RFC enabled Function Module ...................................................................................................... 6 Step 1: Create Function Group ................................................................................................................. 6 Step 2: Create Function Module ............................................................................................................... 6 Step 3: Redo for Reading Module.............................................................................................................9 4. Expose Function Module as Web Service ............................................................................................... 11 Step 1: Create Web Service SE80............................................................................................................11 Step 2: Configuration Screens.................................................................................................................12 Step 3: Repeat for Reading Module........................................................................................................15 5. SOAMANGER...........................................................................................................................................15 Step 1: SOAMANAGER ............................................................................................................................ 15 Step 2: Configuring SOA Management ................................................................................................... 15 Step 3: Web Service Administration ....................................................................................................... 18 Step 4: Configure Specific Web Service .................................................................................................. 18 Step 5: Create Service To Bind To ........................................................................................................... 19 Step 6: Add Authentication Information ................................................................................................ 20 Step 7: Retrieve WSDL URL ..................................................................................................................... 21 Xcelsius........................................................................................................................................................22 Step 1: Add Xcelsius Connection............................................................................................................. 22 REFERENCE LIST .......................................................................................................................................... 25

Upload: suresh-mandalapu

Post on 01-Jun-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 1/25

LIVE INPUT FROM XCELSIUS DASHBOARD VIA SAP R/3 TABLE, FUNCTION MODULE

AND WEB SERVICES

Table of ContentsOverview ....................................................................................................................................................... 2

1. Activating Services .................................................................................................................................... 3

Step 1: Enabling Services in SICF...............................................................................................................3

Step 2: Traversing Hierarchy Nodes..........................................................................................................4

2. Create ZTable ............................................................................................................................................5

Step 1: Create custom table SE11.............................................................................................................5

3. Create RFC enabled Function Module ...................................................................................................... 6

Step 1: Create Function Group ................................................................................................................. 6

Step 2: Create Function Module ............................................................................................................... 6

Step 3: Redo for Reading Module.............................................................................................................9

4. Expose Function Module as Web Service ............................................................................................... 11

Step 1: Create Web Service SE80............................................................................................................11

Step 2: Configuration Screens.................................................................................................................12

Step 3: Repeat for Reading Module........................................................................................................15

5. SOAMANGER...........................................................................................................................................15

Step 1: SOAMANAGER ............................................................................................................................15

Step 2: Configuring SOA Management ................................................................................................... 15

Step 3: Web Service Administration ....................................................................................................... 18

Step 4: Configure Specific Web Service .................................................................................................. 18

Step 5: Create Service To Bind To ...........................................................................................................19Step 6: Add Authentication Information ................................................................................................ 20

Step 7: Retrieve WSDL URL ..................................................................................................................... 21

Xcelsius........................................................................................................................................................22

Step 1: Add Xcelsius Connection............................................................................................................. 22

REFERENCE LIST .......................................................................................................................................... 25

Page 2: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 2/25

Overview

This is a document created from a few sources I found on the internet and some personal experiences while trying

to get this solution working. I would like to give credit to Steve Parks for his tutorials on the subject as they were a

great help.

This project was done to be able to give live commentary from a dashboard. This was completed by writing two

functions modules (one for reading and one for writing), exposing these function modules as web services and

calling them from Xcelsius.

So down to the nuts and bolts of it.

Page 3: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 3/25

1. Activating Services

Step 1: Enabling Services in SICF

Go to transaction SICF Click execute

Activate the following services in transaction code SICF

1. /default_host/sap/bc/srt/2. /sap/bc/webdynpro/sap/appl_soap_management3. /sap/public/bc/icons4. /sap/public/bc/icons_rtl5. /sap/public/bc/pictograms

6.   /sap/public/bc/webdynpro/

Page 4: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 4/25

Step 2: Traversing Hierarchy Nodes

Navigate through the hierarchy until you reach the desired node. (as defined above)

Right click on the node and select the Activate Service Option.

Do this for all the nodes specified above.

Page 5: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 5/25

2. Create ZTable

Step 1: Create custom table SE11

Go to transaction SE11 Input table name and press the Create button

An example of the commentary table used is given below. The main thing you must remember when

creating this table is to have a unique key (that we generate in Xcelsius and pass to the table).

Page 6: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 6/25

NOTE: When using data type LCHR you must include an INT2/INT4 field before as done below with

ZLEN, else you will not be able to use the field in the function module source code.

3. Create RFC enabled Function Module

Step 1: Create Function Group

Go to transaction SE80

Create a function group to contain the solution

In this case I called mine ZDASH_COMMENT.

NOTE: You will need a developer’s key in SAP to be able to do these steps.

Step 2: Create Function Module

Go to transaction SE37.

Enter the name of your function module

Page 7: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 7/25

Press create

On the Attributes tab, make sure that the Remote Enabled button is ticket. This enables the

function module to be used from an external source

Define the fields you want to import from Xcelsius under the import tab.

Page 8: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 8/25

Because this is a writing function module I am not defining anything in the export tab.

Under the Source Code tab write the code as per your functional requirements. The code below

 just accepts the import parameters and writes them to a table.

The reason for the use of a structure is because you can’t reference the table directly in a table

definition.

FUNCTION ZDASH_COMMENT_WRITE.

*"----------------------------------------------------------------------*"*"Local Interface:*" IMPORTING*" VALUE(ZKEY_INPUT) TYPE CHAR0064*" VALUE(ZCOMMENT_INPUT) TYPE CHAR4000*" VALUE(ZPROJECT) TYPE CHAR6*" VALUE(ZDASHBOARD) TYPE CHAR8*" VALUE(ZLEGAL_ENTITY) TYPE CHAR7*" VALUE(ZBU) TYPE CHAR6*" VALUE(ZPRODUCT) TYPE CHAR13*" VALUE(ZVERSION) TYPE CHAR5*" VALUE(ZMEASURE) TYPE CHAR11*" VALUE(ZYEAR) TYPE NUMC04*" VALUE(ZPERIOD) TYPE NUMC3*" VALUE(ZUSERCHANGED) TYPE CHAR32

*"----------------------------------------------------------------------

TYPES: BEGIN OF ZDASHBOARD_COMMENT_type,ZKEY type CHAR64,ZPROJECT type CHAR6,ZDASHBOARD type CHAR8,ZLEGAL_ENTITY type CHAR7,ZBU type CHAR6,ZPRODUCT type CHAR13,ZVERSION type CHAR5,ZMEASURE type CHAR11,

Page 9: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 9/25

ZYEAR type NUMC04,ZPERIOD type NUMC3,ZTIMESTAMP type TIMESTAMP,ZUSERCHANGED type CHAR32,ZLEN type int2,

ZCOMMENT(4000) type c,

END OF ZDASHBOARD_COMMENT_type.

DATA : lt_ZGCRR_COMMENTRY type table of ZDASHBOARD_COMMENT_type,wa_ZGCRR_COMMENTRY type ZDASHBOARD_COMMENT_type,s_tst TYPE timestamp,tzone TYPE timezone.

GET TIME STAMP FIELD s_tst. "short formtzone = 'UTC+2'. "time zone

*WRITE: s_tst TIME ZONE tzone.

wa_ZGCRR_COMMENTRY-ZKEY = ZKEY_INPUT.wa_ZGCRR_COMMENTRY-ZLEN = strlen( ZCOMMENT_INPUT ).wa_ZGCRR_COMMENTRY-ZPROJECT = ZPROJECT.wa_ZGCRR_COMMENTRY-ZDASHBOARD = ZDASHBOARD.wa_ZGCRR_COMMENTRY-ZLEGAL_ENTITY = ZLEGAL_ENTITY.wa_ZGCRR_COMMENTRY-ZBU = ZBU.wa_ZGCRR_COMMENTRY-ZPRODUCT = ZPRODUCT.wa_ZGCRR_COMMENTRY-ZVERSION = ZVERSION.wa_ZGCRR_COMMENTRY-ZMEASURE = ZMEASURE.wa_ZGCRR_COMMENTRY-ZYEAR = ZYEAR.wa_ZGCRR_COMMENTRY-ZPERIOD = ZPERIOD.wa_ZGCRR_COMMENTRY-ZTIMESTAMP = s_tst.wa_ZGCRR_COMMENTRY-ZUSERCHANGED = ZUSERCHANGED.

wa_ZGCRR_COMMENTRY-ZCOMMENT = ZCOMMENT_INPUT.modify ZBO_DASH_COMMENT from wa_ZGCRR_COMMENTRY.

ENDFUNCTION.

Step 3: Redo for Reading ModuleFollow the same steps as in step 2 for your reading function module. Screenshots below

Page 10: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 10/25

Import tab only receives the key from the dashboard to use in the select

statement.

Export tab contains the field I want to display in the dashboard.

Source Code

FUNCTION ZDASH_COMMENT_READ.

Page 11: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 11/25

*"----------------------------------------------------------------------*"*"Local Interface:*" IMPORTING*" VALUE(ZKEY_INPUT) TYPE CHAR64*" EXPORTING

*" VALUE(ZCOMMENTRY_OUT) TYPE STRING*"----------------------------------------------------------------------

SELECT ZCOMMENT FROM ZBO_DASH_COMMENTINTO ZCOMMENTRY_OUTWHERE ZKEY = ZKEY_INPUT.

ENDSELECT.

ENDFUNCTION.

Remember to save and activate the function modules after creation.

4. Expose Function Module as Web Service

Step 1: Create Web Service SE80

Go back to transaction SE80.

Expand the function module node in the hierarchy

Right click on the function module -> Create -> Web Service

Page 12: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 12/25

Step 2: Configuration Screens

Enter service definition name

Kurzbeschreibung : Enter short description for the service definition

Enpoint Type : Function Module

Click continue

Page 13: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 13/25

On the next screen you need to select the authorization level you will be using for the web service. The

selection you make here will put the lowest level that the administrator can set it to when deploying it

on SOAMANAGER. In my example I’m using no authentication.

Enter your companies deployment package

Either select local object if you are testing or create a transport request

Page 14: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 14/25

Select complete

When the next screen appears, select activate

Page 15: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 15/25

Page 16: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 16/25

Navigate to the Access Information J2EE Server tab

Enter your hostname of the server (look in your IE address bar if you don’t know this)

Port number: This information was setup by your basis team. You can look at which port they

used for the java stack by going to transaction SMICM.

Page 17: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 17/25

Select the highlighted icon. (The third icon from the left)

The port number we are looking for is displayed in the screen that follows

Page 18: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 18/25

Page 19: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 19/25

Page 20: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 20/25

Step 6: Add Authentication Information

Select the authentication mode you want to use. The lowest setting you will be able to select

here is the level that you chose when deploying the web service in transaction SE80

If you don’t want the user to be asked for the ABAP service user every time they use the

connection, fill in that username and password as requested below

Press Save after all the information has been edited

Page 21: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 21/25

Step 7: Retrieve WSDL URL

Select Open WSDL document for selected bindings

A page like the following should appear

Copy the address (URL) at the top of the screen. The server name has been edited out

Page 22: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 22/25

Page 23: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 23/25

Paste the WSDL URL you copied in step 7

Click the Import button

After you press import you should see the function module, Import and Export Values, in the

respective blocks

Bind the fields to the blocks as you would with normal Xcelsius connections

Page 24: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 24/25

Page 25: How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

8/9/2019 How to Get Live Commentary Xcelsius, Using SAP Function Modules and Web Services

http://slidepdf.com/reader/full/how-to-get-live-commentary-xcelsius-using-sap-function-modules-and-web-services 25/25

REFERENCE LIST

Author(s): Marco Salazar S.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b043ef4e-e8d1-2c10-7d88-

8077b209ce55?QuickLink=index&overridelayout=true

Author(s): Steve Park

Turn any SAP remote-enabled function module into a Web Service