Академический Документы
Профессиональный Документы
Культура Документы
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
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.
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_management
3.
4.
5.
6.
/sap/public/bc/icons
/sap/public/bc/icons_rtl
/sap/public/bc/pictograms
/sap/public/bc/webdynpro/
Navigate through the hierarchy until you reach the desired node. (as defined above)
Right click on the node and select the Activate Service Option.
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).
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.
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 developers key in SAP to be able to do these steps.
Go to transaction SE37.
Enter the name of your function module
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.
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 cant 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,
"short form
"time zone
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.
Import tab only receives the key from the dashboard to use in the select
statement.
Source Code
FUNCTION ZDASH_COMMENT_READ.
*"---------------------------------------------------------------------*"*"Local Interface:
*" IMPORTING
*"
VALUE(ZKEY_INPUT) TYPE CHAR64
*" EXPORTING
*"
VALUE(ZCOMMENTRY_OUT) TYPE STRING
*"---------------------------------------------------------------------SELECT ZCOMMENT FROM ZBO_DASH_COMMENT
INTO ZCOMMENTRY_OUT
WHERE ZKEY = ZKEY_INPUT.
ENDSELECT.
ENDFUNCTION.
Click continue
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 Im using no authentication.
Select complete
5. SOAMANGER
Step 1: SOAMANAGER
Enter transaction code SOAMANAGER in SAP
Enter your hostname of the server (look in your IE address bar if you dont 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.
Select the highlighted icon. (The third icon from the left)
The port number we are looking for is displayed in the screen that follows
Enter the service name defined when you deployed. Example ZDASH_COMMENT_WRITE_TEST3
Press Go to find it. (you can also enter a wild card (*))
Select the service as indicated by the red block in picture below.
Select Apply Selection
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 dont 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
Xcelsius
Step 1: Add Xcelsius Connection
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
After each of the fields have been bound to the specific cells, add input text blocks to dashboard
Here is a screenshot of how dashboard looks with a save button to trigger write function module
To check if the data is saving correctly go to transaction SE16 -> enter table name -> execute
REFERENCE LIST
Author(s): Marco Salazar S.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b043ef4e-e8d1-2c10-7d888077b209ce55?QuickLink=index&overridelayout=true
Author(s): Steve Park
Turn any SAP remote-enabled function module into a Web Service