SAP HANA Articles

Page 36 of 58

Naming conflict error while consuming SAP Web Service in .net

Nancy Den
Nancy Den
Updated on 18-Dec-2019 238 Views

You can fix this issue by adding Global before all calls giving the error. This has happened cos of system namespace in BAPI and Windows.ExampleAnother possible solution of this is by adding an alias for System.XML and change System.XML with SysXml as below:using SysXml = System.Xml; /// [System.Xml.Serialization.XmlElementAttribute(Form=SysXml.Schema.XmlSchemaForm.Unqualified)] public string Type {    get {       return this.typeField;       set {          this.typeField = value;       }    } }

Read More

Determining the current client in SAP using code

Jennifer Nicholas
Jennifer Nicholas
Updated on 18-Dec-2019 1K+ Views

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 More

Getting day of the year from DD/MM/YYYY using function in SAP system

Nancy Den
Nancy Den
Updated on 18-Dec-2019 709 Views

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 More

Join using CE functions in SAP HANA database

Nishtha Thakur
Nishtha Thakur
Updated on 18-Dec-2019 393 Views

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 More

Truncating multiple strings after 100 characters in ABAP

Daniol Thomas
Daniol Thomas
Updated on 18-Dec-2019 584 Views

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 More

Generating range of numbers 1…n in SAP HANA

Ali
Ali
Updated on 18-Dec-2019 636 Views

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 More

I want to round a number to 2 decimal places in SAPUI5. Could anyone help?

Rahul Sharma
Rahul Sharma
Updated on 17-Dec-2019 2K+ Views

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 More

Inserting Array list into HANA database

Ali
Ali
Updated on 17-Dec-2019 581 Views

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 More

Taking backup of schema in SAP HANA

Govinda Sai
Govinda Sai
Updated on 16-Dec-2019 481 Views

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 More

Getting memory error while doing UNION in SAP HANA

John SAP
John SAP
Updated on 13-Dec-2019 370 Views

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 More
Showing 351–360 of 573 articles
« Prev 1 34 35 36 37 38 58 Next »
Advertisements