Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
SAP HANA Articles
Page 36 of 58
Determining the current client in SAP using code
You can find the current client in sy-mandt.ExampleHere is the code you can write for same.IF sy-mandt = ‘001’. *do A. ELSE. *Do B. ENDIF.
Read MoreGetting day of the year from DD/MM/YYYY using function in SAP system
You can do this by following line of code:DATA(l_day) = m_date - CONV d(m_date(4) && '0101' ) + 1.Where m date is the date that needs to be input as type d. Note the format of type d is YYYYMMDD.ExampleIf the above function is not present in your system, you can use the below code using simple date subtraction.DATA: l_date TYPE d, l_jan_01 TYPE d, l_day TYPE i. l_date = “your input date in YYYYMMDD format” l_jan_01 = l_date. l_jan_01+4 = '0101'. ( sets the date to first day of year) l_day = l_date - l_jan_01 + 1.
Read MoreJoin using CE functions in SAP HANA database
You can try using projection node as followsExampletable1 = CE_PROJECTION(:T1,["ACCT_ID","SALARY"]); table2 = CE_PROJECTION(:T2,["EMPL_ID" AS “ACCT_ID”,"ADD","ZIP","STATE"]); var_out = CE_JOIN(:table1,:table2,[“ACCT_ID”])Using Projection node, you can rename the column names. Note that EMPL_ID has been renamed to ACCT_ID
Read MoreTruncating multiple strings after 100 characters in ABAP
You can just define a character of 100 bytes and move your variable to that character. Please find the below code as example.Example
Read MoreGenerating range of numbers 1…n in SAP HANA
You can use For loop as below:FOR START_CID IN 1..1000 DO INSERT INTO "TEST_TABLE" VALUES(START_CID,''); END FOR;You can also use a Generator like this:INSERT INTO "TEST_TABLE" SELECT GENERATED_PERIOD_START as CID, '' as CNAME from SERIES_GENERATE_INTEGER(1,1,1001);
Read MoreI want to round a number to 2 decimal places in SAPUI5. Could anyone help?
RoundingMode function is used for rounding the number and it uses these parameters: number and how many decimal digits.ExampleYou can roundoff and your code will be like this:
Read MoreInserting Array list into HANA database
Try using below code:ExampleInteger[][] myarray ={ {1}, {1, 2}, {1, 2, 3, 4, 5} }; String test = "Insert Arrays"; stopWatch.start(test); myDBconn.setAutoCommit(false); Statement stmt = myDBconn.createStatement(); stmt = myDBconn.createStatement(); stmt.execute("TRUNCATE TABLE Schema.Table1"); // Running a loop over our array of arrays for (int i = 0 ; i < (myarray.length); i++) { int curr_length = myarray[i].length; String arrayFunction = "ARRAY ("; for (int j = 0; j < (curr_length); j++){ arrayFunction = arrayFunction.concat(myarr[i][j].toString()) ; // ...
Read MoreTaking backup of schema in SAP HANA
It is always recommended to back up your critical systems.ExampleFollowing SQL command can be used to export schema in HANA:EXPORT "SOURCE_SCHEMA_NAME".* AS BINARY INTO '/tmp/DESTINATION SCHEMA NAME' WITH REPLACE;This can also be directly zipped to Linux as below:tar -czf SOURCE_SCHEMA.tgz /tmp/DESTINATION_SCHEMA/
Read MoreGetting memory error while doing UNION in SAP HANA
The SQL UNION clause/operator is used to combine the results of two or more SELECT statements without returning any duplicate rows.To use this UNION clause, each SELECT statement must haveThe same number of columns selectedThe same number of column expressionsThe same data type andHave them in the same orderWhile performing UNION you need to note that what data it will bring. To perform UNION ALL you need to ensure that views should be fully materialized.To know more about SAP HANA Modeling, you can refer SAP Guide:SAP HANA Guide
Read MoreDifference between Open SQL, Native SQL in SAP HANA
As you know SAP was not providing any db for ECC and it had to be purchased separately. When you call your database in ABAP program, you need to write a SQL. As R/3 from SAP works with most relational databases, a common set of features had to be used, with some SAP specific extensions which are translated by the ABAP kernel to be understood by the actual DB. This language is known as Open SQL language.When you develop only for one database, it uses native instructions. IT is developed in Native SQL. Now when you use SAP HANA as ...
Read More