Ali has Published 41 Articles

How to check whether element is in the array in Java?

Ali

Ali

Updated on 24-Feb-2020 10:55:45

60 Views

Following example uses Contains method to search a String in the Array.Exampleimport java.util.ArrayList; public class Main {    public static void main(String[] args) {    ArrayList objArray = new ArrayList();    ArrayList objArray2 = new ArrayList();    objArray2.add(0, "common1"); objArray2.add(1, "common2");   objArray2.add(2, "notcommon"); objArray2.add(3, "notcommon1");    objArray.add(0, "common1"); objArray.add(1, ... Read More

How do I reverse an int array in Java

Ali

Ali

Updated on 24-Feb-2020 10:35:31

124 Views

Following program reverses an int array.Examplepublic class Tester {    public static void main(String[] args) {       int[] numbers = {1,2,3,4,5};       //swap the numbers till the midpoint comes       for (int start = 0, end = numbers.length - 1;       start

Where should jQuery code go in header or footer?

Ali

Ali

Updated on 20-Feb-2020 07:01:23

2K+ Views

It’s always a good practice to add jQuery code in footer i.e. just before the closing tag. If you have not done that, then use the defer attribute.Use defer attribute so the web browser knows to download your scripts after the HTML downloaded −The defer attribute is used to ... Read More

How do I put a jQuery code in an external .js file?

Ali

Ali

Updated on 20-Feb-2020 05:23:20

6K+ Views

Create an external JavaScript file and add the jQuery code in it.ExampleLet’s say the name of the external file is demo.js. To add it in the HTML page, include it like the following −                           ... Read More

Equivalent for Row_Number() in SAP ABAP

Ali

Ali

Updated on 14-Feb-2020 11:18:18

499 Views

When you want to modify the contents and store them into table and also to add a column for the value, use something likeDATA: my_string TYPE StringLOOP AT itab INTO wa_itab. my_string = sy-tabix. CONCATENATE some_text my_string more_text into wa_itab-my_field. MODIFY itab FROM wa_itab. CLEAR my_string. ENDLOOP.Read More

Converting OData using SAPUI5 libraries to JSON format

Ali

Ali

Updated on 14-Feb-2020 10:18:07

379 Views

This can be done in multiple ways. One of common approach would be by passing user name/password in URL.$.ajax({    url : "http://user:password@url/SERVICE?$format=json",    type: "GET", //or POST?    dataType: "jsonp",    success: function(){alert("ok")},    error: function(){alert("error")} })

How page load time affects with JavaScript?

Ali

Ali

Updated on 03-Jan-2020 07:15:01

352 Views

Page load time gets affected with JavaScript files and code. If you are not optimizing JavaScript files then the page load time will increase, which shouldn’t happen. Minify the JavaScript code to decrease the page load time.Also, cache JavaScript file for better results. For better performance, use inline and external ... Read More

Generating range of numbers 1…n in SAP HANA

Ali

Ali

Updated on 18-Dec-2019 06:24:21

285 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);

Inserting Array list into HANA database

Ali

Ali

Updated on 17-Dec-2019 06:44:43

256 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 ... Read More

Using SAP OLE code to take an internal table and paste it into an excel file

Ali

Ali

Updated on 11-Dec-2019 07:03:46

458 Views

Note that you have to use “double quotation” for all the text you have to put into one cell and then connect cell with 0X09 and 0X0A for next column and next row respectively.Check the below code as it fills two cells with 2 lines:CONSTANTS:    nextC TYPE abap_char1 VALUE ... Read More

Advertisements