Quantcast
Channel: SCN : Document List - SMP Developer Center
Viewing all 539 articles
Browse latest View live

Integration Gateway in SMP 3.0 Webinar Slides


Collaboration Workspace "CW" Mobility sample projects are available @ SCN WiKi

$
0
0

Dear All,

 

Not sure if you are aware that Collaboration Workspace (cw.sdn.sap.com) has been shutdown and unfortunately sample projects available over there can't be accessed now. I was having few mobility related sample projects with me. I have uploaded it at SAP Mobility - Wiki page.

 

In case if you need to check,

 

SUP sample Projects - SAP Mobility - SCN Wiki

SAP AppBuilder Developer Center

$
0
0

Discussions (Forum) | Blog Posts | Documents (Articles / e-Learning)

Ask a Question (check category "AppBuilder")

AppBuilderScreen2.PNG

 


Updates (05/Aug/2014):

There's currently an issue with the UI5 framework that AppBuilder use with the latest Google Chrome (as early as 36.0.1985.125 m). It causes your App to fail to load in the Chrome. In short, a change in Google Chrome break a workaround used by UI5 to handle navigation in the app. We are currently investigating it. Workarounds to overcome this issue:

1. Use Safari for Windows/Mac, or

2. Enter the preview URL to the browser directly and remove the sap-ui-fakeOS=ios parameter.


Updates (14/May/2014):

The latest Google Chrome updates , as early as version 34.0.1847.131m, seemed to have caused an issue with SMP Onboarding in AppBuilder. If you are having issue retrieving data from SMP server with the latest Chrome, please download the latest AppBuilder (from 1.0.1252 onwards), it contains the fix for the issue.

 

Introduction

The SAP AppBuilder is a browser-based application development tool for developers to easily build HTML5/JavaScript mobile applications. It provides:

  • WYSIWYG form designer:
    • Drag & drop UI controls to the application’s screen while developers design it
    • Customize application UI controls easily with properties panel.
    • Display application with live data from connected data-sources as it is designed
  • Easy data binding in a graphic way with data-sources from OData, RESTFul services to help developers speed up their development
  • Super Control for further boost of developer’s productivity, such as:
    • SuperList: metadata based List control that retrieves, processes and presents data from the OData/RESTFul services with no code or little code
    • Chart: metadata based Chart control that retrieves data from the OData/RESTFul services and renders into compelling charts with no code or little code
  • Automatic generation of event handlers skeleton code for user defined events
  • Switch between designing view and coding application logic easily with just a single click and enhanced code editor with syntax highlighting
  • Preview and Run and the application on the desktop browser with just a single click
  • Customize application with custom CSS files

 

Get AppBuilder Now!

Download AppBuilder from here (scroll down to the AppBuilder section).

 

Resources

Product Documentation

Check out our product documentation on the SAP Help portal.

 

Tutorials

Check out our tutorial to kickoff your development quickly with AppBuilder:

  1. Quick start guide on how to Create a Simple App
  2. Create a data oriented app using SuperList
  3. Create an analytic app using Chart
  4. Create a tab-based app using TabApp

 

Tutorial Videos

Also check out AppBuilder tutorial video here: http://www.sapmobileacademy.com/appbuilder-tutorial/


Useful Links & Blogs

  1. If you would like to know more about SuperList there is an excellent comprehensive 2 parts blog by Paul Horan about SuperList. View it here: Part 1, Part 2
  2. There is also a blog by Patrick Wenger about deploying application to a real device using AppBuilder here
  3. Useful blog by Martin Grasshoff about connecting AppBuilder to SMP Cloud Version here.


AppBuilder Dev Community

Check out our new dev community! We created a category called 'AppBuilder' so get blogging and tick 'AppBuilder' before saving and we will answer your questions.

  • All our listed content (blog, questions, documents) under 'AppBuilder' here
  • You have a question regarding our solution? Ask your question here


Collaboration Workspace "CW" Mobility sample projects are available @ SCN WiKi

$
0
0

Dear All,

 

Not sure if you are aware that Collaboration Workspace (cw.sdn.sap.com) has been shutdown and unfortunately sample projects available over there can't be accessed now. I was having few mobility related sample projects with me. I have uploaded it at SAP Mobility - Wiki page.

 

In case if you need to check,

 

SUP sample Projects - SAP Mobility - SCN Wiki

SAP AppBuilder Developer Center

$
0
0

Discussions (Forum) | Blog Posts | Documents (Articles / e-Learning)

Ask a Question (check category "AppBuilder")

AppBuilderScreen2.PNG

 


Updates (05/Aug/2014):

There's currently an issue with the UI5 framework that AppBuilder use with the latest Google Chrome (as early as 36.0.1985.125 m). It causes your App to fail to load in the Chrome. In short, a change in Google Chrome break a workaround used by UI5 to handle navigation in the app. We are currently investigating it. Workarounds to overcome this issue:

1. Use Safari for Windows/Mac, or

2. Enter the preview URL to the browser directly and remove the sap-ui-fakeOS=ios parameter.


Updates (14/May/2014):

The latest Google Chrome updates , as early as version 34.0.1847.131m, seemed to have caused an issue with SMP Onboarding in AppBuilder. If you are having issue retrieving data from SMP server with the latest Chrome, please download the latest AppBuilder (from 1.0.1252 onwards), it contains the fix for the issue.

 

Introduction

The SAP AppBuilder is a browser-based application development tool for developers to easily build HTML5/JavaScript mobile applications. It provides:

  • WYSIWYG form designer:
    • Drag & drop UI controls to the application’s screen while developers design it
    • Customize application UI controls easily with properties panel.
    • Display application with live data from connected data-sources as it is designed
  • Easy data binding in a graphic way with data-sources from OData, RESTFul services to help developers speed up their development
  • Super Control for further boost of developer’s productivity, such as:
    • SuperList: metadata based List control that retrieves, processes and presents data from the OData/RESTFul services with no code or little code
    • Chart: metadata based Chart control that retrieves data from the OData/RESTFul services and renders into compelling charts with no code or little code
  • Automatic generation of event handlers skeleton code for user defined events
  • Switch between designing view and coding application logic easily with just a single click and enhanced code editor with syntax highlighting
  • Preview and Run and the application on the desktop browser with just a single click
  • Customize application with custom CSS files

 

Get AppBuilder Now!

Download AppBuilder from here (scroll down to the AppBuilder section).

 

Resources

Product Documentation

Check out our product documentation on the SAP Help portal.

 

Tutorials

Check out our tutorial to kickoff your development quickly with AppBuilder:

  1. Quick start guide on how to Create a Simple App
  2. Create a data oriented app using SuperList
  3. Create an analytic app using Chart
  4. Create a tab-based app using TabApp

 

Tutorial Videos

Also check out AppBuilder tutorial video here: http://www.sapmobileacademy.com/appbuilder-tutorial/


Useful Links & Blogs

  1. If you would like to know more about SuperList there is an excellent comprehensive 2 parts blog by Paul Horan about SuperList. View it here: Part 1, Part 2
  2. There is also a blog by Patrick Wenger about deploying application to a real device using AppBuilder here
  3. Useful blog by Martin Grasshoff about connecting AppBuilder to SMP Cloud Version here.


AppBuilder Dev Community

Check out our new dev community! We created a category called 'AppBuilder' so get blogging and tick 'AppBuilder' before saving and we will answer your questions.

  • All our listed content (blog, questions, documents) under 'AppBuilder' here
  • You have a question regarding our solution? Ask your question here


Collaboration Workspace "CW" Mobility sample projects are available @ SCN WiKi

$
0
0

Dear All,

 

Not sure if you are aware that Collaboration Workspace (cw.sdn.sap.com) has been shutdown and unfortunately sample projects available over there can't be accessed now. I was having few mobility related sample projects with me. I have uploaded it at SAP Mobility - Wiki page.

 

In case if you need to check,

 

SUP sample Projects - SAP Mobility - SCN Wiki

SAP AppBuilder Developer Center

$
0
0

Discussions (Forum) | Blog Posts | Documents (Articles / e-Learning)

Ask a Question (check category "AppBuilder")

AppBuilderScreen2.PNG

 


Updates (05/Aug/2014):

There's currently an issue with the UI5 framework that AppBuilder use with the latest Google Chrome (as early as 36.0.1985.125 m). It causes your App to fail to load in the Chrome. In short, a change in Google Chrome break a workaround used by UI5 to handle navigation in the app. We are currently investigating it. Workarounds to overcome this issue:

1. Use Safari for Windows/Mac, or

2. Enter the preview URL to the browser directly and remove the sap-ui-fakeOS=ios parameter.


Updates (14/May/2014):

The latest Google Chrome updates , as early as version 34.0.1847.131m, seemed to have caused an issue with SMP Onboarding in AppBuilder. If you are having issue retrieving data from SMP server with the latest Chrome, please download the latest AppBuilder (from 1.0.1252 onwards), it contains the fix for the issue.

 

Introduction

The SAP AppBuilder is a browser-based application development tool for developers to easily build HTML5/JavaScript mobile applications. It provides:

  • WYSIWYG form designer:
    • Drag & drop UI controls to the application’s screen while developers design it
    • Customize application UI controls easily with properties panel.
    • Display application with live data from connected data-sources as it is designed
  • Easy data binding in a graphic way with data-sources from OData, RESTFul services to help developers speed up their development
  • Super Control for further boost of developer’s productivity, such as:
    • SuperList: metadata based List control that retrieves, processes and presents data from the OData/RESTFul services with no code or little code
    • Chart: metadata based Chart control that retrieves data from the OData/RESTFul services and renders into compelling charts with no code or little code
  • Automatic generation of event handlers skeleton code for user defined events
  • Switch between designing view and coding application logic easily with just a single click and enhanced code editor with syntax highlighting
  • Preview and Run and the application on the desktop browser with just a single click
  • Customize application with custom CSS files

 

Get AppBuilder Now!

Download AppBuilder from here (scroll down to the AppBuilder section).

 

Resources

Product Documentation

Check out our product documentation on the SAP Help portal.

 

Tutorials

Check out our tutorial to kickoff your development quickly with AppBuilder:

  1. Quick start guide on how to Create a Simple App
  2. Create a data oriented app using SuperList
  3. Create an analytic app using Chart
  4. Create a tab-based app using TabApp

 

Tutorial Videos

Also check out AppBuilder tutorial video here: http://www.sapmobileacademy.com/appbuilder-tutorial/


Useful Links & Blogs

  1. If you would like to know more about SuperList there is an excellent comprehensive 2 parts blog by Paul Horan about SuperList. View it here: Part 1, Part 2
  2. There is also a blog by Patrick Wenger about deploying application to a real device using AppBuilder here
  3. Useful blog by Martin Grasshoff about connecting AppBuilder to SMP Cloud Version here.


AppBuilder Dev Community

Check out our new dev community! We created a category called 'AppBuilder' so get blogging and tick 'AppBuilder' before saving and we will answer your questions.

  • All our listed content (blog, questions, documents) under 'AppBuilder' here
  • You have a question regarding our solution? Ask your question here


How to access SUP Cluster DB?

$
0
0

Hi All,

 

OBJECTIVE:

 

There are different type of database availble at SUP (Sybase Unwired Platform) side like SUP cache, SUP monitoring DB, Cluster DB. This Document explains steps how we can access cluster based information from database.

 

REQUIREMENT:

 

  • SUP 2.x

 

   Procedure:

 

You would have checked

  How to access SUP CDB (Cache Database) ?

How to access SUP Monitoring DB?

 

For accessing ClusterDB, a tool is available. This tool is same for SUP cache, Montoring DB, Cluster DB.

 

Finding Out the path for Cluster DB Tool:

 

  • go to the location: C:\Sybase\UnwiredPlatform\Servers\SQLAnywhere12\Bin32
  • look for dbisql.exe

 

1.PNG+

 

 

  • For ODBC Data Source name, click on Browse, search for clusterdb_mysupcluster_32bit

 

    • Pass User ID: dba
    • Password: sql
    • Click on Connect

1.PNG

 

 

This database contains list of tables which has different information.

 

e.g.  1. there is a table called SLD_SUPSERVER_INFO

 

when you execute this table by select * from SLD_SUPSERVER_INFO

 

it will give you server information like what is server name, what is the installation path for the same sup server etc.

 

1.PNG

2. another table , RELAY_SERVER

it will give you relay server information (asssuming relay server has been installed for that SUP server) like relay server host name, port no, URL etc.

 

1.PNG

 

 

3. You can also check which SUP node is a primary one by running a join query like:

 

SELECT x.CLUSTERID,x.name, y.name , x.LEASEEXPIRES

FROM CLUSTER_RESOURCE x, Cluster_member y where x.OWNER = y.MEMBERID

 

 

It is not possible to share all tables' screenshots.so here i am listing down all the tables name available in this cluster database.

 

you can access these tables from the tool by running a simple object query.

select * from table name

 

  1. async_queue_prop
  2. BACKEND_FARM
  3. BACKEND_SERVER
  4. cache_addr_mapping
  5. cache_config
  6. CLUSTER
  7. CLUSTER_INSTALLATION
  8. CLUSTER_MEMBER
  9. CLUSTER_PROP
  10. CLUSTER_RESOURCE
  11. djc_pc
  12. endpoint_prop
  13. ENTITY_TYPE
  14. FARM_AND_PORT_TYPE
  15. MEMBER_PROP
  16. RELAY_SERVER
  17. RELAY_SERVER_HTTP_CREDENTIAL
  18. RSOE
  19. RSOE_PROXY
  20. RSOE_PROXY_USER
  21. SLD
  22. SLD_SUPSERVER_INFO
  23. SUP_APNS_CONFIG
  24. SUP_BES_CONFIG
  25. SUP_BIS_CONFIG        
  26. SUP_GCM_CONFIG
  27. SUP_PUSH_CONFIG
  28. SUP_SERVER_PORT
  29. SUP_PUSH_CONFIG
  30. SYNC_DATA

 

Note: For more details check this Wiki Page.

 

I hope this document will help you.

Your comments/Suggestions are most welcome.

 

Regards,

Jitendra Kansal


AppBuilder Tutorial - Hello World App

$
0
0

Introduction

This tutorial will introduce you to AppBuilder and guide you on creating a simple application using AppBuilder.

 

 

Prerequisites

AppBuilder must be installed on your workstation. Visit here to get AppBuilder and here for the documentation.

 

 

Starting AppBuilder

To start AppBuilder the user need double click run.bat (or execute run.sh in Terminal app in Mac), which will start the AppBuilder server instance and loads the AppBuilder in Google Chrome/Safari browser.

If everything goes fine, the IDE will be started using the following URL http://127.0.0.1:9009/ide/ares/index.html

The browser will go to the above URL in the address bar automatically, the Project Management page will show up like figure 1.

 

Figure1.png 

Figure 1


Using AppBuilder to create new project

Creating hello world application

  • Tap New > button in Project Management screen.
  • In the New Project dialog, enter Project Name as “SAPB_HelloWorld_Tutorial”.

  Figure2.png

Figure 2

 

  • Select Device Type to “Phone” from the drop down list box.
  • Select Template to“Generic Application” from the drop down list box.
  • Press “CONFIRM” to create the project.

 

Adding Controls to the Project

 

  • The workspace of IDE now opens with phone device frame Form Builder.  Following figure 3 shows IDE with Form Builder.

Figure3.png

Figure 3


  • To add a label control to the Form, drag and drop the label control from toolbox to the designer surface in the Form.
  • Enter control name as “helloLabel” in properties of the control.
  • Press text and enter display text as “HelloWorld”. press Enter.
  • Press style and add font size to “font-size:20px;”. Press “CONFIRM”.

Figure4.png

Figure 4

 

  • After adding label the designer form looks like figure 5:

 

Figure5.png

Figure 5

 

 

 

  • Add input control into designer and enter control name as “helloInput” and then enter placeholder text as “Enternewtextforthelabel”. Press Enter.

 

Figure6.png

Figure 6

 

 

  • Add Button control into designer and enter control name as “helloBtn” and then enter text as “ApplyChanges”. Press Enter.

 

Figure7.png

Figure 7

 

 

  • Select Events tab of button control from the right panel.

Figure8.png

Figure 8

 

 

  • Enter the event handler name for press event as “onHelloBtnPressed”. Press Enter.
  • Select application view “SOURCE” tab from the panel.

Figure9.png

Figure 9

 

 

  • You can see the event handler “onHelloBtnPressed” which was enter for “helloBtn” button control.
  • Type the following script to “onHelloBtnPressed” event, this script will change the “HellWorld” label to “NewHellowWorld” when press the “ApplyChanges” button.

 

 

//Get the controls              var helloLabel = this.byId("helloLabel");              var helloInput = this.byId("helloInput");              //Get the value of helloInput              var newLabel = helloInput.getValue();              //Check the newLabel value is not empty and set the label              if(newLabel.length > 0) {                     helloLabel.setText(newLabel);              }

 

  • After entering the script, the screen will looks like figure 10:

Figure10.png

Figure 10

 

  • Press “Save” from main menu “FILE”.

 

 

 

Running AppBuilder Project

SAPB_HelloWorld_Tutorial project can run Chrome/Safari Browser by clicking the “Run” menu from main menu “EXECUTE”. The new browser will be launched to show the hello world application.

Figure11.png

Figure 11

 

 

Enter text “New Hello World” in the input column and press “Apply Changes” button. Now you can see the “Hello World” text changed to “New Hello World”.

Figure12.png

Figure 12

Android Push Notification using SMP 3.0.3 and Relay Server in Kepsel Method

$
0
0

Hi All,

 

My Domain is ABAP, After certain days of research on android and Phonegap, Finally we developed an application with enabling push notification.

 

Our business requirement is, we have a vehicle approval process, If sales consultant is giving discount more than certain amount, manager has to approve for the discount.  For this we are done with ABAP code and created services in Gateway.

 

Note: You should have minimum knowledge on Android development in Eclipse.

Now the following are the steps to enable push notification.

 

1. Create a Google API Project and get Sender Id, API Key as shown in below link

Getting Started | Android Developers

 

2.Create an application in SMP for gateway service URL and in PUSH tab in Android section enter Sender Id, API Key

which you got in step 1.

as shown in https://websmp101.sap-ag.de/~sapidb/011000358700000038522014E.pdf

 

We done with application in SMP.

 

Now we need to create an application, with following

a. Register with SMP

b. Enable Push Notification

c. GCM Listener

d. And out application.

 

1. create Android Application project in eclipse.

 

In AndroidManifest.xml add following

(Change the package name as your application project name)

 

<!-- GCM connects to Internet Services. -->

    <uses-permission android:name="android.permission.INTERNET" />

    <!-- GCM requires a Google account. -->

    <uses-permission android:name="android.permission.GET_ACCOUNTS" />

    <!-- Keeps the processor from sleeping when a message is received. -->

    <uses-permission android:name="android.permission.WAKE_LOCK" />

    <!-- Creates a custom permission so only this app can receive its messages. -->

    <permission

        android:name="com.packagename.permission.C2D_MESSAGE"

        android:protectionLevel="signature" />

    <uses-permission android:name="com.packagename.permission.C2D_MESSAGE" />

    <!-- This app has permission to register and receive data message. -->

    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />

    <!-- Network State Permissions to detect Internet status -->

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <!-- Permission to vibrate -->

    <uses-permission android:name="android.permission.VIBRATE" />

    <application

        android:allowBackup="true"

        android:icon="@drawable/ic_launcher"

        android:label="@string/app_name"

        android:theme="@style/AppTheme" >

         <!-- receiver is for gcm -->

        <receiver

            android:name="com.google.android.gcm.GCMBroadcastReceiver"

            android:permission="com.google.android.c2dm.permission.SEND" >

            <intent-filter>

                <action android:name="com.google.android.c2dm.intent.RECEIVE" />

                <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

                <category android:name="com.packagename" /> 

            </intent-filter>

        </receiver>

        <!-- intent service for gcm -->

        <service android:name="GCMIntentService" />    

    </application>

 

 

2. Add following libraries to your project, these libraries you can find in MobileSDK3\KapselSDK\plugins\ folders

AfariaSLL-7.00.6169.0

ClientHubSLL-3.0.1

Common-3.0.0

commons-codec-1.3

Connectivity-3.0.0

cordova-2.9.0

CoreServices-3.0.0

DataVaultLib-2.3.3.13

gcm

gson-2.2.4

maflogger-1.2.1

maflogoncore-1.2.1

maflogonui-1.2.1

mafsettingscreen-1.2.1

mafuicomponents-1.2.1

Parser-3.0.0

perflib-1.1.5

Request-3.0.0

sap-e2etrace-2.3.3.13

sqlcipher-android-2.1.1

 

3. In MainActivity.java add below line to load our HTML .

super.loadUrl("file:///android_asset/www/index.html");

For more details about Phonegap development go through below link.

PhoneGap API Documentation

 

Now our aim is to call java code from JavaScript

4. create push.js file and following code, after include this file in your HTML, javascript section

var PushNotif= function(){};

cordova.addConstructor(function() {

    cordova.addPlugin("pushnotif", new PushNotif());

});

PushNotif.prototype.send = function (message){

cordova.exec(function(){  },

    function(){   },

    'PushNotif',

    'sendPush',

    [message]);

}

function sendFeedback(){

   window.PushNotif.prototype.send("My message body");}

 

5.Add the plugin in res/xml/config.xml  <plugin name="PushNotif" value="com.packagename.PushNotif"/>

 

6. To call java code from JavaScript, use

window.PushNotif.prototype.send(body);

if you want to send any data to java, you can fill in body variable.

 

7. Create a java file in your package folder (src) with name PushNotif.java

"Here we are writing about, register the android device with SMP and enabling push notification.

Please find the attached sample file "PushNotif.java " for code.

 

8. Please add the GCMIntentService.java to your project and add GCMIntentService.txt code.

Note, here you need to change the GCM_SENDER_ID .

and add ConnectivityConstants.java to your project

 

Now we are done with our application creation. Now install the apk file in android device.

If everything is successful, you should see a new registration in SMP registrations.

 

By using PostMan Plugin POST Method, you should able to send the data(enjoy) to your android device.

http://xxxxxx:8080/Notification/y_VehicleApproval?data=enjoy

 

Now our aim is How to call POST method call using ABAP

1. create a HTTP Connections to External Server in SM59 , Give the URL of SMP and SMP credentials

2. find the place where we need to send notification to device( means on which status, Like If discount is more than 10k)

3. write below code to send notification

 

CALL METHOD cl_http_client=>create_by_destination

     EXPORTING

       destination              = '  'HTTP Connections to External Server

     IMPORTING

       client                   = client

     EXCEPTIONS

       destination_not_found    = 1

       internal_error           = 2

       argument_not_found       = 3

       destination_no_authority = 4

       plugin_not_active        = 5

       OTHERS                   = 6.

* set http method GET

   CALL METHOD client->request->set_method(

     if_http_request=>co_request_method_post ).

* set protocol version

 

   client->request->set_version(

   if_http_request=>co_protocol_version_1_0 ).

 

* set request uri (/<path>[?<querystring>])

   concatenate '/Notification/' connid into l_url.  // in connid give the registration id, which got registered in SMP

   cl_http_utility=>set_request_uri( request = client->request

 

   uri  = l_url ).

   CALL METHOD client->request->set_header_field

     EXPORTING

       name  = 'X-SMP-GCM-DATA'

       value = data.

 

*  * Send

   DATA:timeout TYPE i.

   timeout = 100000000.

   CALL METHOD client->send

     EXPORTING

       timeout                    = timeout

     EXCEPTIONS

       http_communication_failure = 1

       http_invalid_state         = 2

       http_processing_failed     = 3

       OTHERS                     = 4.

   IF sy-subrc <> 0.

     DATA:errortext TYPE string,

           subrc TYPE i.

     CALL METHOD client->get_last_error

       IMPORTING

         code    = subrc

         message = errortext.

     WRITE: / 'communication_error( send )',

     / 'code: ', subrc, 'message: ', errortext.

     EXIT.

   ENDIF.

 

 

 

 

* receive

   CALL METHOD client->receive

     EXCEPTIONS

       http_communication_failure = 1

       http_invalid_state         = 2

       http_processing_failed     = 3

       OTHERS                     = 4.

   IF sy-subrc <> 0.

     CALL METHOD client->get_last_error

       IMPORTING

         code    = subrc

         message = errortext.

     WRITE: 'communication_error( receive )',

     'code: ', subrc, 'message: ', errortext to message.

     EXIT.

   ELSE.

     WRITE:'Notification Sent' to message.

   ENDIF.

 

 

* * close

   CALL METHOD client->close

     EXCEPTIONS

       http_invalid_state = 1

       OTHERS             = 2.

Efficient SUP log collection

$
0
0

Productive SUP environments produce a multitude of interesting logs in a multitude of places. The important process of collecting these logs regularly can become quite tedious, so I wrote a short and hopefully universally adaptable batch script that simplifies and streamlines this task.

 

This script will check which logs exist on the machine it is running and use a packer (default is 7-zip) to pack all existing logs into a single file that is automatically named with a timestamp and the hostname for optimal distinction. The script has been successfully tested on both single-node and clustered installations of SUP 2.1.2 in its current form and it is easily adaptable to whatever environment you may have.

 

In order to use it, you may need to customize the following three variables OUTPUT_DIR, SYBASE_DIR, PACKER:

 

SET PACKER="C:\Program Files\7-Zip\"7z a -ssw
SET SYBASE_DIR=D:\Sybase
SET OUTPUT_DIR=%USERPROFILE%\Desktop

 

PACKER is the path to the packer's executable. Here, the default is the standard installation path of 7-zip. You can configure other packers to work with the script, but 7-zip is the best free tool for the job. I also include an adaptation to WinRAR for convenience.

 

SYBASE_DIR is the top-level folder of your SUP installation. Since most people run SUP and the OS on separate partitions, this defaults to D:\Sybase.

 

OUTPUT_DIR is where the packed logs will end up. The default is the desktop of the active user, to ensure that you have the necessary write permissions.

 

Please note that this script comes without warranty of any kind. You should check it thoroughly for yourself and will run it at your own risk. Since the script is collecting some windows eventlogs, you may have to run it as an administrator. If you don't have an administrator account on the machine, the script will still collect all logs that your user can access.

runasadmin.png

 

Listing of logcollect.bat

@ECHO OFF

SETLOCAL

REM 8<----- Change this part to customize

REM Uncomment to use 7-zip
SET PACKER="C:\Program Files\7-Zip\"7z a -ssw
REM Uncomment to use rar
REM SET PACKER="C:\Program Files\WINRAR\"rar a -dh
SET SYBASE_DIR=D:\Sybase
REM Seperate database dir can be entered here if necessary
REM Standard is UnwiredPlatform\Data\CDB
SET DATABASE_DIR=UnwiredPlatform\Data\CDB
SET OUTPUT_DIR=%USERPROFILE%\Desktop

REM ----->8

IF EXIST %SYBASE_DIR% (
  CD /D %SYBASE_DIR%
)

SET LOG_DIRS=

REM Main SUP logs
SET ITEM=UnwiredPlatform\Servers\UnwiredServer\logs
IF EXIST %ITEM% (
  SET LOG_DIRS=%LOG_DIRS% %ITEM%
)
REM Main SCC logs
SET ITEM=SCC-3_2\log
IF EXIST %ITEM% (  SET LOG_DIRS=%LOG_DIRS% %ITEM%
)

REM Windows Eventlogs
SET ITEM=%SYSTEMROOT%\system32\winevt\logs
IF EXIST %ITEM% (
  SET LOG_DIRS=%LOG_DIRS% %ITEM%\System.evtx %ITEM%\Application.evtx
)

REM SUP repository information
SET ITEM=UnwiredPlatform\Servers\UnwiredServer\Repository\Instance
IF EXIST %ITEM% (
  SET LOG_DIRS=%LOG_DIRS% %ITEM%
)
REM SCC database errorlogs
SET ITEM=SCC-3_2\services\Repository\scc_repository.slg
IF EXIST %ITEM% (  SET LOG_DIRS=%LOG_DIRS% %ITEM%
)

REM Advantage database errorlogs
SET ITEM=C:\ADS_ERR.ADI
IF EXIST %ITEM% (
  SET LOG_DIRS=%LOG_DIRS% C:\ADS_ERR.*
)
REM SQL Anywhere database errorlogs (on data tier)
SET ITEM=%DATABASE_DIR%\errorlog.txt
IF EXIST %ITEM% (  SET LOG_DIRS=%LOG_DIRS% %DATABASE_DIR%\*errorlog.txt
)

REM Get time in locale-independent WMI format
SET X=
FOR /F "skip=1 delims=" %%x IN ('wmic os get localdatetime') DO (
  IF NOT DEFINED X (    SET X=%%x  )
)
REM Split WMI format
SET YEAR=%X:~0,4%
SET MONTH=%X:~4,2%
SET DAY=%X:~6,2%
SET HOUR=%X:~8,2%
SET MINUTE=%X:~10,2%
SET SECOND=%X:~12,2%

SET ARCHIVE_FILENAME=%OUTPUT_DIR%\
SET ARCHIVE_FILENAME=%ARCHIVE_FILENAME%%YEAR%-%MONTH%-%DAY%_
SET ARCHIVE_FILENAME=%ARCHIVE_FILENAME%%HOUR%-%MINUTE%-%SECOND%_
SET ARCHIVE_FILENAME=%ARCHIVE_FILENAME%%COMPUTERNAME%_
SET ARCHIVE_FILENAME=%ARCHIVE_FILENAME%suplogs

SET CMD=%PACKER% "%ARCHIVE_FILENAME%" %LOG_DIRS% 
ECHO Running %CMD%
%CMD%
IF %ERRORLEVEL% NEQ 0 (
  ECHO Errorlevel is %ERRORLEVEL%, please check what went wrong  PAUSE
)
ENDLOCAL

Integration with CA SiteMinderSAP Mobile Platform 2.3

Regenerating SMP 3.0 Agentry Certificate

$
0
0

During installation of the SMP 3.0 server, it will automatically generate a self-signed certificate that will be used for Agentry server authentication (among other things).  This certificate will be based on the fully qualified domain name (FQDN) at the time of the installation.  Should this change for any reason or need to reference an external name versus an internal name you will need to regenerate the certificate.

 

This document outlines the steps needed to regenerate the certificate using the Java keytool utility.  Please note that you will need to know the Keystore password you specified during installation of the SMP 3.0 server to perform these steps.  These commands assume the C:\SAP\MobilePlatform3\sapjvm_7\bin directory (default location) is in your path and that you are executing the commands from the C:\SAP\MobilePlatform3\Server\configuration directory.

 

  1. Remove the existing certificate
    • keytool -keystore smp_keystore.jks -delete -alias smp_crt -storepass {keystore password}
  2. Create the new self-signed certificate (edit the dname information to match your organization details}
    • keytool -keystore smp_keystore.jks -genkeypair -keyalg RSA -sigalg SHA1withRSA -validity 3650 -alias smp_crt -dname "C=US, ST=IL, L=Chicago, O=SAP, OU=Global Mobility Services, CN={New FQDN}, emailAddress={your email address}" -ext BC:ca:true -keypass {keystore password} -storepass {keystore password}
  3. Export the new certificate for use with your Agentry clients
    • keytool -keystore smp_keystore.jks -export -alias smp_crt -file smp_crt.cer -rfc -storepass {keystore password} -keypass {keystore password}
  4. After executing these commands restart your SMP 3.0 server to pickup the new certificate

 

In my case, I frequently need to regenerate my certificates due to changing networks and IP addresses so I have created the attached batch file to simplify the process.  I simply execute the batch file and it prompts me for the password and new FQDN and performs all the other steps opening Windows explorer to the configuration directory at the end so I can easily install, copy or email the new certificate out.

 

Note, if you download the attached file, please be sure to rename the file from .txt to .bat before using and also edit the batch file to set the SMP3ROOT location, CERTINFO (country, state, locattion, organization, org unit) and CERTEMAIL for your specific needs.

 

Enjoy!

SAP Mobile Platform 3.0 Overview

$
0
0

SAP Mobile Platform 3.0 combines three best of breed mobile platforms into one. Sybase Unwired Platform, Sybase Mobiliser and Syclo Agentry have been combined to create the SAP Mobile Platform 3.0. Also included is Integration Gateway, a middle ware component for exposing SAP and non-SAP system services as OData endpoints.

View this Presentation

SMP 3.0: Setup local Agentry development environment with source=INI in JavaBE.ini

$
0
0

Problem:

You want to setup a local Agentry development environment on your PC to modify an existing Agentry application you have installed in your system landscape. You install an SMP 3.0 and publish an Agentry Application to your SMP (check SMP 3.0: Custom development of SAP Work Manager 6.1 on Agentry Server).

 

Now you need to setup the mobile application parameters for the interaction between Agentry and your SAP backend. You will want your production instance (central SMP 3.0 server) to use source=SAP, meaning you maintain the parameter values on the backend. However if you want to make changes to the parameters, which only influence your local installation there are 2 ways of doing this:

 

1. Copy the (productive) mobile application in the Configuration Portal on the Backend, and setup your environment to use this.

2. Use source=INI in your JaveBE.ini file, and maintain all parameters in the JavaBE.ini file.

 

If you are working in sprints and needs to do this over and over, solution 1 may not be a good solution for you, and you will wish you could just do changes locally on your SMP server.

The problem with solution 2 is that there's is no standard way of getting the mobile application parameters from the productive mobile application to the JavaBE.ini file.

 

Solution:

I have created a small ABAP program (please excuse the state it is in, consider it to be a draft). It is attached to this post and can easily be copy-pasted in your local system.

Run it and it will generate a text file with all the key/value pairs of the parameters for your (production) mobile application.

 

Then change the value (in your local server) of source to INI (from SAP) in the JavaBE.ini file.

Append the content of the generated text file at the end of the JavaBE.ini file.

If you want to make local modifications do this also in JavaBE.ini.

 

Publish to SMP.

Restart SMP.

 

Now you can test you local changes to the parameter value.

 

When your test is done, you can save the new value in the SAP backend, and afterwards you can easily realign your local environment with your central one.

 

Hope this may help somebody.

 

 

Søren Hansen


SAP AppBuilder Developer Center

$
0
0

Discussions (Forum) | Blog Posts | Documents (Articles / e-Learning)

Ask a Question (check category "AppBuilder")

AppBuilderScreen2.PNG

 


Updates (05/Aug/2014):

There's currently an issue with the UI5 framework that AppBuilder use with the latest Google Chrome (as early as 36.0.1985.125 m). It causes your App to fail to load in the Chrome. In short, a change in Google Chrome break a workaround used by UI5 to handle navigation in the app. We are currently investigating it. Workarounds to overcome this issue:

1. Use Safari for Windows/Mac, or

2. Enter the preview URL to the browser directly and remove the sap-ui-fakeOS=ios parameter.


Updates (14/May/2014):

The latest Google Chrome updates , as early as version 34.0.1847.131m, seemed to have caused an issue with SMP Onboarding in AppBuilder. If you are having issue retrieving data from SMP server with the latest Chrome, please download the latest AppBuilder (from 1.0.1252 onwards), it contains the fix for the issue.

 

Introduction

The SAP AppBuilder is a browser-based application development tool for developers to easily build HTML5/JavaScript mobile applications. It provides:

  • WYSIWYG form designer:
    • Drag & drop UI controls to the application’s screen while developers design it
    • Customize application UI controls easily with properties panel.
    • Display application with live data from connected data-sources as it is designed
  • Easy data binding in a graphic way with data-sources from OData, RESTFul services to help developers speed up their development
  • Super Control for further boost of developer’s productivity, such as:
    • SuperList: metadata based List control that retrieves, processes and presents data from the OData/RESTFul services with no code or little code
    • Chart: metadata based Chart control that retrieves data from the OData/RESTFul services and renders into compelling charts with no code or little code
  • Automatic generation of event handlers skeleton code for user defined events
  • Switch between designing view and coding application logic easily with just a single click and enhanced code editor with syntax highlighting
  • Preview and Run and the application on the desktop browser with just a single click
  • Customize application with custom CSS files

 

Get AppBuilder Now!

Download AppBuilder from here (scroll down to the AppBuilder section).

 

Resources

Product Documentation

Check out our product documentation on the SAP Help portal.

 

Tutorials

Check out our tutorial to kickoff your development quickly with AppBuilder:

  1. Quick start guide on how to Create a Simple App
  2. Create a data oriented app using SuperList
  3. Create an analytic app using Chart
  4. Create a tab-based app using TabApp

 

Tutorial Videos

Also check out AppBuilder tutorial video here: http://www.sapmobileacademy.com/appbuilder-tutorial/


Useful Links & Blogs

  1. If you would like to know more about SuperList there is an excellent comprehensive 2 parts blog by Paul Horan about SuperList. View it here: Part 1, Part 2
  2. There is also a blog by Patrick Wenger about deploying application to a real device using AppBuilder here
  3. Useful blog by Martin Grasshoff about connecting AppBuilder to SMP Cloud Version here.


AppBuilder Dev Community

Check out our new dev community! We created a category called 'AppBuilder' so get blogging and tick 'AppBuilder' before saving and we will answer your questions.

  • All our listed content (blog, questions, documents) under 'AppBuilder' here
  • You have a question regarding our solution? Ask your question here


How to access SUP Cluster DB?

$
0
0

Hi All,

 

OBJECTIVE:

 

There are different type of database availble at SUP (Sybase Unwired Platform) side like SUP cache, SUP monitoring DB, Cluster DB. This Document explains steps how we can access cluster based information from database.

 

REQUIREMENT:

 

  • SUP 2.x

 

   Procedure:

 

You would have checked

  How to access SUP CDB (Cache Database) ?

How to access SUP Monitoring DB?

 

For accessing ClusterDB, a tool is available. This tool is same for SUP cache, Montoring DB, Cluster DB.

 

Finding Out the path for Cluster DB Tool:

 

  • go to the location: C:\Sybase\UnwiredPlatform\Servers\SQLAnywhere12\Bin32
  • look for dbisql.exe

 

1.PNG+

 

 

  • For ODBC Data Source name, click on Browse, search for clusterdb_mysupcluster_32bit

 

    • Pass User ID: dba
    • Password: sql
    • Click on Connect

1.PNG

 

 

This database contains list of tables which has different information.

 

e.g.  1. there is a table called SLD_SUPSERVER_INFO

 

when you execute this table by select * from SLD_SUPSERVER_INFO

 

it will give you server information like what is server name, what is the installation path for the same sup server etc.

 

1.PNG

2. another table , RELAY_SERVER

it will give you relay server information (asssuming relay server has been installed for that SUP server) like relay server host name, port no, URL etc.

 

1.PNG

 

 

3. You can also check which SUP node is a primary one by running a join query like:

 

SELECT x.CLUSTERID,x.name, y.name , x.LEASEEXPIRES

FROM CLUSTER_RESOURCE x, Cluster_member y where x.OWNER = y.MEMBERID

 

 

It is not possible to share all tables' screenshots.so here i am listing down all the tables name available in this cluster database.

 

you can access these tables from the tool by running a simple object query.

select * from table name

 

  1. async_queue_prop
  2. BACKEND_FARM
  3. BACKEND_SERVER
  4. cache_addr_mapping
  5. cache_config
  6. CLUSTER
  7. CLUSTER_INSTALLATION
  8. CLUSTER_MEMBER
  9. CLUSTER_PROP
  10. CLUSTER_RESOURCE
  11. djc_pc
  12. endpoint_prop
  13. ENTITY_TYPE
  14. FARM_AND_PORT_TYPE
  15. MEMBER_PROP
  16. RELAY_SERVER
  17. RELAY_SERVER_HTTP_CREDENTIAL
  18. RSOE
  19. RSOE_PROXY
  20. RSOE_PROXY_USER
  21. SLD
  22. SLD_SUPSERVER_INFO
  23. SUP_APNS_CONFIG
  24. SUP_BES_CONFIG
  25. SUP_BIS_CONFIG        
  26. SUP_GCM_CONFIG
  27. SUP_PUSH_CONFIG
  28. SUP_SERVER_PORT
  29. SUP_PUSH_CONFIG
  30. SYNC_DATA

 

Note: For more details check this Wiki Page.

 

I hope this document will help you.

Your comments/Suggestions are most welcome.

 

Regards,

Jitendra Kansal

AppBuilder Tutorial - Hello World App

$
0
0

Introduction

This tutorial will introduce you to AppBuilder and guide you on creating a simple application using AppBuilder.

 

 

Prerequisites

AppBuilder must be installed on your workstation. Visit here to get AppBuilder and here for the documentation.

 

 

Starting AppBuilder

To start AppBuilder the user need double click run.bat (or execute run.sh in Terminal app in Mac), which will start the AppBuilder server instance and loads the AppBuilder in Google Chrome/Safari browser.

If everything goes fine, the IDE will be started using the following URL http://127.0.0.1:9009/ide/ares/index.html

The browser will go to the above URL in the address bar automatically, the Project Management page will show up like figure 1.

 

Figure1.png 

Figure 1


Using AppBuilder to create new project

Creating hello world application

  • Tap New > button in Project Management screen.
  • In the New Project dialog, enter Project Name as “SAPB_HelloWorld_Tutorial”.

  Figure2.png

Figure 2

 

  • Select Device Type to “Phone” from the drop down list box.
  • Select Template to“Generic Application” from the drop down list box.
  • Press “CONFIRM” to create the project.

 

Adding Controls to the Project

 

  • The workspace of IDE now opens with phone device frame Form Builder.  Following figure 3 shows IDE with Form Builder.

Figure3.png

Figure 3


  • To add a label control to the Form, drag and drop the label control from toolbox to the designer surface in the Form.
  • Enter control name as “helloLabel” in properties of the control.
  • Press text and enter display text as “HelloWorld”. press Enter.
  • Press style and add font size to “font-size:20px;”. Press “CONFIRM”.

Figure4.png

Figure 4

 

  • After adding label the designer form looks like figure 5:

 

Figure5.png

Figure 5

 

 

 

  • Add input control into designer and enter control name as “helloInput” and then enter placeholder text as “Enternewtextforthelabel”. Press Enter.

 

Figure6.png

Figure 6

 

 

  • Add Button control into designer and enter control name as “helloBtn” and then enter text as “ApplyChanges”. Press Enter.

 

Figure7.png

Figure 7

 

 

  • Select Events tab of button control from the right panel.

Figure8.png

Figure 8

 

 

  • Enter the event handler name for press event as “onHelloBtnPressed”. Press Enter.
  • Select application view “SOURCE” tab from the panel.

Figure9.png

Figure 9

 

 

  • You can see the event handler “onHelloBtnPressed” which was enter for “helloBtn” button control.
  • Type the following script to “onHelloBtnPressed” event, this script will change the “HellWorld” label to “NewHellowWorld” when press the “ApplyChanges” button.

 

 

//Get the controls              var helloLabel = this.byId("helloLabel");              var helloInput = this.byId("helloInput");              //Get the value of helloInput              var newLabel = helloInput.getValue();              //Check the newLabel value is not empty and set the label              if(newLabel.length > 0) {                     helloLabel.setText(newLabel);              }

 

  • After entering the script, the screen will looks like figure 10:

Figure10.png

Figure 10

 

  • Press “Save” from main menu “FILE”.

 

 

 

Running AppBuilder Project

SAPB_HelloWorld_Tutorial project can run Chrome/Safari Browser by clicking the “Run” menu from main menu “EXECUTE”. The new browser will be launched to show the hello world application.

Figure11.png

Figure 11

 

 

Enter text “New Hello World” in the input column and press “Apply Changes” button. Now you can see the “Hello World” text changed to “New Hello World”.

Figure12.png

Figure 12

Efficient SUP log collection

$
0
0

Productive SUP environments produce a multitude of interesting logs in a multitude of places. The important process of collecting these logs regularly can become quite tedious, so I wrote a short and hopefully universally adaptable batch script that simplifies and streamlines this task.

 

This script will check which logs exist on the machine it is running and use a packer (default is 7-zip) to pack all existing logs into a single file that is automatically named with a timestamp and the hostname for optimal distinction. The script has been successfully tested on both single-node and clustered installations of SUP 2.1.2 in its current form and it is easily adaptable to whatever environment you may have.

 

In order to use it, you may need to customize the following three variables OUTPUT_DIR, SYBASE_DIR, PACKER:

 

SET PACKER="C:\Program Files\7-Zip\"7z a -ssw
SET SYBASE_DIR=D:\Sybase
SET OUTPUT_DIR=%USERPROFILE%\Desktop

 

PACKER is the path to the packer's executable. Here, the default is the standard installation path of 7-zip. You can configure other packers to work with the script, but 7-zip is the best free tool for the job. I also include an adaptation to WinRAR for convenience.

 

SYBASE_DIR is the top-level folder of your SUP installation. Since most people run SUP and the OS on separate partitions, this defaults to D:\Sybase.

 

OUTPUT_DIR is where the packed logs will end up. The default is the desktop of the active user, to ensure that you have the necessary write permissions.

 

Please note that this script comes without warranty of any kind. You should check it thoroughly for yourself and will run it at your own risk. Since the script is collecting some windows eventlogs, you may have to run it as an administrator. If you don't have an administrator account on the machine, the script will still collect all logs that your user can access.

runasadmin.png

 

Listing of logcollect.bat

@ECHO OFF

SETLOCAL

REM 8<----- Change this part to customize

REM Uncomment to use 7-zip
SET PACKER="C:\Program Files\7-Zip\"7z a -ssw
REM Uncomment to use rar
REM SET PACKER="C:\Program Files\WINRAR\"rar a -dh
SET SYBASE_DIR=D:\Sybase
REM Seperate database dir can be entered here if necessary
REM Standard is UnwiredPlatform\Data\CDB
SET DATABASE_DIR=UnwiredPlatform\Data\CDB
SET OUTPUT_DIR=%USERPROFILE%\Desktop

REM ----->8

IF EXIST %SYBASE_DIR% (
  CD /D %SYBASE_DIR%
)

SET LOG_DIRS=

REM Main SUP logs
SET ITEM=UnwiredPlatform\Servers\UnwiredServer\logs
IF EXIST %ITEM% (
  SET LOG_DIRS=%LOG_DIRS% %ITEM%
)
REM Main SCC logs
SET ITEM=SCC-3_2\log
IF EXIST %ITEM% (  SET LOG_DIRS=%LOG_DIRS% %ITEM%
)

REM Windows Eventlogs
SET ITEM=%SYSTEMROOT%\system32\winevt\logs
IF EXIST %ITEM% (
  SET LOG_DIRS=%LOG_DIRS% %ITEM%\System.evtx %ITEM%\Application.evtx
)

REM SUP repository information
SET ITEM=UnwiredPlatform\Servers\UnwiredServer\Repository\Instance
IF EXIST %ITEM% (
  SET LOG_DIRS=%LOG_DIRS% %ITEM%
)
REM SCC database errorlogs
SET ITEM=SCC-3_2\services\Repository\scc_repository.slg
IF EXIST %ITEM% (  SET LOG_DIRS=%LOG_DIRS% %ITEM%
)

REM Advantage database errorlogs
SET ITEM=C:\ADS_ERR.ADI
IF EXIST %ITEM% (
  SET LOG_DIRS=%LOG_DIRS% C:\ADS_ERR.*
)
REM SQL Anywhere database errorlogs (on data tier)
SET ITEM=%DATABASE_DIR%\errorlog.txt
IF EXIST %ITEM% (  SET LOG_DIRS=%LOG_DIRS% %DATABASE_DIR%\*errorlog.txt
)

REM Get time in locale-independent WMI format
SET X=
FOR /F "skip=1 delims=" %%x IN ('wmic os get localdatetime') DO (
  IF NOT DEFINED X (    SET X=%%x  )
)
REM Split WMI format
SET YEAR=%X:~0,4%
SET MONTH=%X:~4,2%
SET DAY=%X:~6,2%
SET HOUR=%X:~8,2%
SET MINUTE=%X:~10,2%
SET SECOND=%X:~12,2%

SET ARCHIVE_FILENAME=%OUTPUT_DIR%\
SET ARCHIVE_FILENAME=%ARCHIVE_FILENAME%%YEAR%-%MONTH%-%DAY%_
SET ARCHIVE_FILENAME=%ARCHIVE_FILENAME%%HOUR%-%MINUTE%-%SECOND%_
SET ARCHIVE_FILENAME=%ARCHIVE_FILENAME%%COMPUTERNAME%_
SET ARCHIVE_FILENAME=%ARCHIVE_FILENAME%suplogs

SET CMD=%PACKER% "%ARCHIVE_FILENAME%" %LOG_DIRS% 
ECHO Running %CMD%
%CMD%
IF %ERRORLEVEL% NEQ 0 (
  ECHO Errorlevel is %ERRORLEVEL%, please check what went wrong  PAUSE
)
ENDLOCAL

Writing Custom Logic using Java Script in SMP Integration Gateway

$
0
0

This document explains on  how to expose web services as a OData services using the Integration gateway component of SMP 3.0 SP04.This also explains on how we can write a custom logic using the Java script .

View this Document

Viewing all 539 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>