Johar Ali has Published 58 Articles

Passing multiple parameters in SAP BO Webi report

Johar Ali

Johar Ali

Updated on 26-Feb-2020 06:11:12

An open document URL is constructed as follow −http://:/OpenDocument/opendoc/?&&...&With use of SAP Business Objects API, you can query each prompt- single value or multiple value. When you build URL, you may have to include parameter types.You can join parameters with the ampersand (&) and you shouldn’t use space with & ... Read More

What are primitive data types in Java?

Johar Ali

Johar Ali

Updated on 25-Feb-2020 12:36:48

Java supports eight predefined primitive datatypes they are −byteByte data type is an 8-bit signed two's complement integerMinimum value is -128 (-2^7)Maximum value is 127 (inclusive)(2^7 -1)Default value is 0Byte data type is used to save space in large arrays, mainly in place of integers, since a byte is four ... Read More

How to delete the actives while running a loop in the internal table?

Johar Ali

Johar Ali

Updated on 25-Feb-2020 11:08:33

DELETE command will have a result. You should make sure that once you delete the row, there should not be any reference or use of row subsequently in the loop. The best is to use CONTINUE as soon as you perform the deletion. I will suggest avoiding “DELETE lt_itab INDEX sy-tabix” ... Read More

How to use ‘while loop’ in Java?

Johar Ali

Johar Ali

Updated on 25-Feb-2020 09:53:13

A while loop statement in Java programming language repeatedly executes a target statement as long as a given condition is true.SyntaxThe syntax of a while loop is −while(Boolean_expression) {    // Statements }Here, statement(s) may be a single statement or a block of statements. The condition may be any expression, and ... Read More

What is the ‘nested if’ statement in Java and how to use it?

Johar Ali

Johar Ali

Updated on 25-Feb-2020 09:44:15

It is always legal to nest if-else statements which means you can use one if or else if statement inside another if or else if statement.Syntaxif(Boolean_expression 1) {    // Executes when the Boolean expression 1 is true    if(Boolean_expression 2) {       // Executes when the Boolean ... Read More

What is a switch case statement in Java and how to use it?

Johar Ali

Johar Ali

Updated on 25-Feb-2020 09:34:41

A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each case.Syntaxswitch(expression) {    case value :       // Statements       break;    case value : ... Read More

How to create an array of Object in Java

Johar Ali

Johar Ali

Updated on 24-Feb-2020 11:09:51

Array of Object class can be created which can accept any type of object. During operation on such array, instanceof operator can be used.Examplepublic class Tester {    public static void main(String[] args) {       Object[] dataArray = new Object[3];       dataArray[0] = new Integer(0);   ... Read More

How to declare a static String array in Java

Johar Ali

Johar Ali

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

Following program shows how to declare a static string array.Examplepublic class Tester {    private static String[] array;    static {       array = new String[2];       array[0] = "Hello";       array[1] = "World";    }    public static void main(String[] args) {   ... Read More

How to initialize an array in Java

Johar Ali

Johar Ali

Updated on 24-Feb-2020 10:37:19

Following example shows how to create and initialize an array.Examplepublic class Tester {    public static void main(String[] args) {       int[] dataArray = {1, 2, 3, 4};       for(int i: dataArray){          System.out.println(i);       }    } }

what is the simplest way to print a java array

Johar Ali

Johar Ali

Updated on 24-Feb-2020 10:34:41

To make things simple, convert the array to list and then print it.Exampleimport java.util.Arrays; import java.util.List; public class Tester {    public static void main(String[] args) {       Integer[] numbers = {1,2,3,4,5};       List list = Arrays.asList(numbers);       System.out.println(list);    } }Output[1,2,3,4,5]

Advertisements