SAP DI API – Data Type Mapping

Application

DI API

Type Structure Type SubType
Alphanumeric Regular db_Alpha st_None
Alphanumeric Address db_Alpha st_Address
Alphanumeric Phone db_Alpha st_Phone
Alphanumeric Text db_Memo st_None
Numeric None db_Numeric st_None
Date/Hour Date db_Date st_None
Date/Hour Hour db_Date st_Time
Units And Totals Rate db_Float st_Rate
Units And Totals Sum db_Float st_Sum
Units And Totals Price db_Float st_Price
Units And Totals Quantity db_Float st_Quantity
Units And Totals Percent db_Float st_Percentage
Units And Totals Measure db_Float st_Measurement
General Link db_Memo st_Link
General Image db_Alpha st_Image

Install Jira

CÀI ĐẶT

Source: https://www.it4sharing.com/cai-dat-jira-7-2-5-tren-ubuntu-server-16-04-standalone/

//Download Jira

$ wget https://downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-7.2.5-x64.bin

//gán quyền tự chạy cho file vừa download về (grant execution permission)

$ chmod a+x atlassian-jira-software-7.2.5-x64.bin

//cài đặt postgresql (Install Postgresql)

$ sudo apt-get update

$ sudo apt-get install postgresql postgresql-contrib

//Tạo User (Create User)

$ sudo -u postgres createuser -D -A -P jirauser

//Tạo Database (Create database)

$ sudo -u postgres createdb -O jirauser jiradb

//Chạy file cài đặt (execute setup file)

$ ./atlassian-jira-software-7.2.5-x64.bin

//Install log

=================================

kietnt@kietnt-jira:~$ ./atlassian-jira-software-7.2.5-x64.bin

Unpacking JRE …

Starting Installer …

Nov 23, 2016 2:09:47 PM java.util.prefs.FileSystemPreferences$2 run

INFO: Created system preferences directory in java.home.

You do not have administrator rights to this machine and as such, some installation options will not be available. Are you sure you want to continue?

Yes [y, Enter], No [n]

y

This will install JIRA Software 7.2.5 on your computer.

OK [o, Enter], Cancel [c]

o

Choose the appropriate installation or upgrade option.

Please choose one of the following:

Express Install (use default settings) [1], Custom Install (recommended for advanced users) [2, Enter], Upgrade an existing JIRA installation [3]

2

Where should JIRA Software be installed?

[/home/kietnt/atlassian/jira]Default location for JIRA Software data

[/home/kietnt/atlassian/application-data/jira]Configure which ports JIRA Software will use.

JIRA requires two TCP ports that are not being used by any other

applications on this machine. The HTTP port is where you will access JIRA

through your browser. The Control port is used to startup and shutdown JIRA.

Use default ports (HTTP: 8080, Control: 8005) – Recommended [1, Enter], Set custom value for HTTP and Control ports [2]

2

HTTP Port Number

[8080]8100

Control Port Number

[8005]8009

Details on where JIRA Software will be installed and the settings that will be used.

Installation Directory: /home/kietnt/atlassian/jira

Home Directory: /home/kietnt/atlassian/application-data/jira

HTTP Port: 8100

RMI Port: 8009

Install as service: No

Install [i, Enter], Exit [e]

i

Extracting files …

 

Please wait a few moments while JIRA Software is configured.

Installation of JIRA Software 7.2.5 is complete

Start JIRA Software 7.2.5 now?

Yes [y, Enter], No [n]

y

Please wait a few moments while JIRA Software starts up.

Launching JIRA Software …

Installation of JIRA Software 7.2.5 is complete

Your installation of JIRA Software 7.2.5 is now ready and can be accessed

via your browser.

JIRA Software 7.2.5 can be accessed at http://localhost:8100

Finishing installation …

 

wget https://product-downloads.atlassian.com/software/jira/downloads/atlassian-jira-software-7.12.1-x64.bin

chmod a+x atlassian-jira-software-7.12.1-x64.bin
sudo apt-get update

sudo apt-get install postgresql postgresql-contrib
sudo -u postgres createuser -D -A -P jirauser

(Pass@123)

sudo -u postgres createdb -O jirauser jiradb

./atlassian-jira-software-7.12.1-x64.bin

HTTP Port: 7070
RMI Port: 7005

The file “MDF” is compressed but does not reside in a read-only database or filegroup. The file must be decompressed

Error giving hint about some kind of compression. So if we look at the folder which is specified E:\BlogContent\DatabaseFiles it was in blue color.

image

Blue color actually indicates that folder is compressed. Right Click on folder, go to “Properties” and click on “Advanced…”

image

The checkbox “Compress contents to save disk space” is checked which means compression is enabled. Once we uncheck the box, we should be able to create database.

How to install Android KitKat in VMware Workstation

Recently I stumbled on an article which briefly explains the installation of Android KitKat 4.4 in VMware Workstation. I knew that previous version of Android worked fine (including network) in VMware Workstation – see this post, but some tweaks were necessary. I wanted to test the latest version of Android, to see how it looks like and if it’s true that VMware Workstation can be used for the job. And it seems that the tweak for the network card, when the change in the VMX file was necessary is no longer needed. I’ll walk you through the steps to install Android KitKat in VMware Workstation.

How to install Android Kitkat in VMware Workstation

How to install Android KitKat in VMware Workstation? The steps:

1. Download the iso file from this page – the file is called android-x86-4.4-RC1.iso

2. Then create a new VM via the Wizard and connect the ISO (Workstation detects the new VM as FreeBSD).

kitkat1

3. Adjust the hardware of the VM and adjust the Memory. I put mine to 2Gb of RAM as most of today’s phones uses 2 gigs of RAM. Click next and use the arrows to go down to select the 4th option – Install Android Kitkat.

How to install Android Kitkat in VMware Workstation

4. Select Create or modify partitions

How to install Android Kitkat in VMware Workstation

5. Then create a newprimary partition and write down the changes.

How to install Android Kitkat in VMware Workstation How to install Android Kitkat in VMware Workstation How to install Android KitKat in VMware Workstation

6. Then select this partition to install Android KitKat.

How to install Android Kitkat in VMware Workstation

7. Chose EXT3 as filesystem …..

How to install Android Kitkat in VMware Workstation

8. Almost done, just validate the formatting of the media.

How to install Android Kitkat in VMware Workstation

10. Validate the Read/Write possibility, otherwise you won’t be able to make any changes to this VM.

How to install Android Kitkat in VMware Workstation

I’m not sure it’s here but during one moment it also asks you if you want to install GRUB as a boot loader. Says YES as without validating you won’t be able to boot up the system.

How to install Android Kitkat in VMware Workstation

11. Let the installation rolling….

How to install Android Kitkat in VMware Workstation

13. Then you’ll see a screen which shows you if you to run Android or reboot. You can go either way, but don’t forget to disconnect the ISO file before the next reboot otherwise you’ll start over and you’ll be presented with the LiveCD option again!

How to install Android Kitkat in VMware Workstation

 

 

SOURCE:

https://www.vladan.fr/how-to-install-android-kitkat-in-vmware-workstation/

Bridging the gap between .NET and HANA

With the advent of HANA SPS 08 circa Q2 2014, SAP finally released the HANA data provider for Microsoft ADO.NET. Admittedly, this is not trousers stirring news this but I am pleased to know that there is now an effective way to allow the .NET framework to efficiently communicate with SAP HANA. In the past, you could still do that but it was through the use of the ODBC driver – there is nothing wrong with it if all you wanted to do was to connect to SAP HANA and perform some simple SQL statements but we all know SAP HANA if more than just an in memory database.

This article will to tease out some of the key concepts and features introduced by SPS 08 on the client interfaces for ADO.NET.  Data access and manipulation will be the theme here today using C# and SAP’s new .NET API – Sap.Data.Hana. If you are wondering what ADO.NET is, it is Microsoft data access technology for the .NET framework using programming languages such as C# or VB.NET.

I beg the question that you ask why is it important for SAP to release this new API when ODBC is sufficient? Given that the standard ODBC connection to SAP HANA is still a valid method to bridge the connection to the database or any database for that matter, we need to understand the core use of an ODBC driver itself. Microsoft’s primary goal when they released the initial ODBC driver was to provide a vendor neutral way of accessing stored data in any
machine. As you might have already guessed, the whole host of ODBC driver that Microsoft currently supports spans vast and wide from databases such as Oracle, Informix, Teradata and all the way to SAP HANA, just to name a few. The result of building an ODBC driver to be as generic as possible can come at a cost. Cost in terms of lost of performance, unleveraged hidden features, missing core functionalities and best practices surrounding a given database.

Although there are no official information from SAP detailing why a developer should use the new API, one can only infer that SAP has put in a lot of hard work to ensure that your .NET code communicates efficiently with their HANA database. Take for example if your team were to deliver a .NET solution specifically on Microsoft SQL Server, they will certainly use the System.Data.SQLClient.SQLConnection object, on Oracle they would most likely end up using the ODP.NET driver and with SAP HANA, it would be this new API. Although the .NET framework is able to connect to SAP HANA through the ODBC driver, SAP reckons that your application will take full advantage of all the underlying advances build specially for the .NET framework to play nicely with SAP HANA. There will be instances when you find yourself with no vendor delivered driver and in this case the ODBC driver is your only option to exchange information with the database on the .NET framework e.g. when developing application on Hadoop Hive.

Getting Started

To start using the new ADO.NET API delivered in SPS 08, you will need to have the latest SAP HANA Client Developer Edition version 1.00.80 installed on your machine or alternatively check the default installation path under C:\Program Files\sap\hdbclient\ado.net. If you have that installed, you should see two folders call v3.5 and v4.5 and clicking through v4.5, you should have the Sap.Data.Hana.v4.5.dll.

/wp-content/uploads/2014/10/sap_data_hana_564270.png

View, Insert, Update and Delete

Building an enterprise .NET application on SAP HANA will undoubtedly require you to perform one of these four actions and in this section of the article, the aim is to demonstrate the basic database call to interact and manipulate the data that resides in SAP HANA.

Under the .NET solution explorer, expend the Reference dropdown and ensure that Sap.Data.Hana.v4.5 has been included to your .NET solution and if not you can add a new reference under the Extensions path. Once you have that, standard C #codes ensue for namespace: using Sap.Data.Hana;

/wp-content/uploads/2014/10/ref1_564271.png /wp-content/uploads/2014/10/ref2_564276.png

Establishing the database connection

The bare minimum parameter required to establish a connection is to have the connection string include the server address, user name and password. Other parameters such as connection lifetime, database, pooling, etc. are optional but worthwhile exploring if you want to maintain a healthy level of database activity.

/wp-content/uploads/2014/10/conn_564277.png

Selecting records

Once a database connection has been established it is a straight forward approach to acquire the data that you require from any table or schema. In this example, I have issued a simple SELECT statement with the intention of publishing the data to a .NET DataGridViewer. The class demonstrated here is the HanaDataReader class use to return a read only result set and output into a Windows form.

//Establish an active connection to the SAP HANA database

HanaConnection conn = newHanaConnection(“Server=your.hana.server;UserID=username;Password=password”);

//Open the database connection

conn.Open();

String strSQL = “select * from customers order by ID desc”;

//Execute the SQL statement

HanaCommand cmd = new HanaCommand(strSQL, conn);

//Read and store the result set

HanaDataReader reader = cmd.ExecuteReader();

//Bind the result set to a DataGridViewer/

dgViewTweet.DataSource = reader;

//Close the reader connection

reader.Close();

//Close the database connection

conn.Close();

/wp-content/uploads/2014/10/table1_564281.png

Updating new records

Inserting records into the database is as easy as querying for it but not without additional effort to format and prepare the data. The example provided here stores the information from 5 text fields using standard SQL inserts statements executed by C#.

Upon loading the application, it connects to SAP HANA, loads 150 rows of customer records from the database and the intention here is to create a new piece of information and write it back to the table.

/wp-content/uploads/2014/10/table2_564283.png

When the Save New button is clicked, the .NET framework runs through this piece of simple code to perform two sets of activities. Firstly, it will perform a SQL insert statement to store all the values captured from the text box by running the ExecuteNonQuery() method and secondly it reread the information by running the ExecuteReader() method as this will repopulate the DataGridViewer  with the new record.

The only information that the ExecuteNonQuery() method returns is the number of rows affected by the specific action and this method is useful for running SQL statements such as INSERT, UPDATE or DELETE.

HanaConnection conn = newHanaConnection(“Server=your.hana.server;UserID=username;Password=password”);

string sCust, sLifespend, sNewspend, sIncome, sLoyalty;

conn.Open();

HanaCommand insertCmd = new HanaCommand(“INSERT INTO Customers(CUSTOMER, LIFESPEND, NEWSPEND, INCOME, LOYALTY) “ + “VALUES(?, ?, ?, ?, ? )”, conn);

sCust = txtCustomer.Text;

sLifespend = txtLifespend.Text;

sNewspend = txtNewspend.Text;

sIncome = txtIncome.Text;

sLoyalty = txtLoyalty.Text;

HanaParameter parm = new HanaParameter();

//Customer

parm = new HanaParameter();

parm.HanaDbType = HanaDbType.NVarChar;

insertCmd.Parameters.Add(parm);

//Life Spend

parm = new HanaParameter();

parm.HanaDbType = HanaDbType.Double;

insertCmd.Parameters.Add(parm);

//New Spend

parm = new HanaParameter();

parm.HanaDbType = HanaDbType.Double;

insertCmd.Parameters.Add(parm);

//Income

parm = new HanaParameter();

parm.HanaDbType = HanaDbType.Double;

insertCmd.Parameters.Add(parm);

//Loyalty

parm = new HanaParameter();

parm.HanaDbType = HanaDbType.Double;

insertCmd.Parameters.Add(parm);

//Customers

insertCmd.Parameters[1].Value = sCust;

//Life Spend

insertCmd.Parameters[2].Value = sLifespend;

//New Spend

insertCmd.Parameters[3].Value = sNewspend;

//Income

insertCmd.Parameters[4].Value = sIncome;

//Loyalty

insertCmd.Parameters[5].Value = sLoyalty;

//Execute the insert statement

insertCmd.ExecuteNonQuery();

//Requery for the latest record from SAP HANA

String strSQL = “select * from customers order by ID desc”;

//Execute the SQL statement

HanaCommand cmd = new HanaCommand(strSQL, conn);

//Read and store the result set

HanaDataReader reader = cmd.ExecuteReader();

//Bind the result set to a DataGridViewer/

dgViewTweet.DataSource = reader;

//Close the reader connection

reader.Close();

//Close the database connection

conn.Close();

/wp-content/uploads/2014/10/table3_564284.png

Using Stored Procedure

My guess is Stored Procedure has always been off limits for SAP applications that sits on the NetWeaver stack because of the vast database vendors out there and the effort to cater for the different method of creating and calling a procedure can add up to an unnecessary amount of overhead. What SAP has given us in equivalent is the lovely function module builder that we have all known to work with and love throughout the years. Like any high performing, respectable RDBMS out there in the market, SAP HANA has included the Stored Procedure function and using it with .NET is just as simple as the
rest.

In this next example, the goal here is to change the record for Customer ID 150. The customer name Samuel Johnson has been misspelled and it needs to be corrected. Upon clicking on the Update Changes button, the .NET framework will call a Stored Procedure in SAP HANA, passing in the Customer ID and update the record using a standard SQL update command that is embedded within a Stored Procedure. A Stored Procedure can contain logic as simple as accepting fields and processing it to as complex as performing specific validation and returning an error if the conditions are not met.

CREATE PROCEDURE prcUpdateCustomers(IN ID INTIN CUSTOMER NVARCHAR(60)) AS

BEGIN

UPDATE customers SET customer = :CUSTOMERWHERE ID = :ID;

END;

The change to execute Stored Procedure is to set the Hana command type to StoredProcedure and passing in the actual name of the Stored Procedure.

HanaCommand cmd = new HanaCommand(“”, conn);

//Pass in the Stored Procedure Name

cmd.CommandText = “prcUpdateCustomers”;

cmd.CommandType = CommandType.StoredProcedure;

/wp-content/uploads/2014/10/table4_564285.png

//Read the changed column data

string col0 = dgViewTweet[0, dgViewTweet.CurrentCell.RowIndex].Value.ToString();

string col1 = dgViewTweet[1, dgViewTweet.CurrentCell.RowIndex].Value.ToString();

string col2 = dgViewTweet[2, dgViewTweet.CurrentCell.RowIndex].Value.ToString();

string col3 = dgViewTweet[3, dgViewTweet.CurrentCell.RowIndex].Value.ToString();

//Establish an active connection to the SAP HANA database

HanaConnection conn = newHanaConnection(“Server=your.hana.server;UserID=username;Password=password”);

//Open the database connection

conn.Open();

//Create an instance of a HanaCommand

HanaCommand cmd = new HanaCommand(“”, conn);

//Pass in the Stored Procedure Name

cmd.CommandText = “schia_pal.prcUpdateCustomers”;

cmd.CommandType = CommandType.StoredProcedure;

//Prepare input parameters

HanaParameter param = new HanaParameter();

param = cmd.CreateParameter();

param.HanaDbType = HanaDbType.Integer;

param.Direction = ParameterDirection.Input;

param.Value = col0;

cmd.Parameters.Add(param);

param = new HanaParameter();

param = cmd.CreateParameter();

param.HanaDbType = HanaDbType.NVarChar;

param.Direction = ParameterDirection.Input;

param.Value = col1;

cmd.Parameters.Add(param);

//Execute he update statement

cmd.ExecuteNonQuery();

cmd.Dispose();

conn.Close();

/wp-content/uploads/2014/10/table5_564293.png

In brief and not trying to include needless details on the vast .NET sample codes which SAP has documented for the wider community, this article is just an example of some of the basic database communication that you can work with using Sap.Data.Hana. With the new SPS 08 client interface, customers who are heavily reliant on the .NET framework to address business problems can now have full SAP support when working with SAP HANA and the ability to fully utilise all features within the product.

 

Source: https://blogs.sap.com/2014/10/16/bridging-the-gap-between-net-and-hana-using-c/

 

How to Execute Custom Code via SP_TransactionNotification

if you read theThe SP_TransactionNotification Stored Procedure Stored Procedure  you understood the advantage of procedure: “you can do some validation in SAP Business One and prevent the user from doing an action if the validation condition fails.”

Probably Everybody can have the question:
Is It possible to execute custom code via SP_TransactionNotification procedure?

Basically the answer is Yes.

Read more

Support