karthikeya Boyini

karthikeya Boyini

1,421 Articles Published

Articles by karthikeya Boyini

Page 90 of 143

Java program to find the area of a circle

karthikeya Boyini
karthikeya Boyini
Updated on 13-Mar-2020 23K+ Views

Area of a circle is the product of the square of its radius, and the value of PI, Therefore, to calculate the area of a rectangleGet the radius of the circle.Calculate the square of the radius.Calculate the product of the value of PI and the value of the square of the radius.Print the result.Exampleimport java.util.Scanner; public class AreaOfCircle {    public static void main(String args[]){       int radius;       double area;       Scanner sc = new Scanner(System.in);       System.out.println("Enter the radius of the circle ::");       radius = sc.nextInt();   ...

Read More

Adding rows in an internal table with header line in SAP ABAP

karthikeya Boyini
karthikeya Boyini
Updated on 13-Mar-2020 2K+ Views

Note that you shouldn’t use headers with internal tables. As you are using it, and header of in_table2 is empty. Use the loop to print it as below −LOOP AT in_table2.   "here in_table2 means table (an internal table)   WRITE / in_table2. "here in_table2 means the header of the table (a structure) ENDLOOP.When you have headers with internal tables, you shouldn’t use it in the same way. You should use field symbols for looping and append like this −FIELD-SYMBOLS: LIKE LINE OF in_table2[]. LOOP AT in_table2[] ASSIGNING .   WRITE / . ENDLOOP.

Read More

What does the method toString(int[] a) do?

karthikeya Boyini
karthikeya Boyini
Updated on 13-Mar-2020 125 Views

The toString(int[]) method of the class java.util.Arrays return a string representation of the contents of the specified int array. The string representation consists of a list of the array's elements, enclosed in square brackets ("[]"). Adjacent elements are separated by the characters ", " (a comma followed by a space).Exampleimport java.util.Arrays; public class ArrayDemo {    public static void main(String[] args) {       int[] i1 = new int[] { 33, 12, 98 };       System.out.println("The array is:");       for (int number : i1) {          System.out.println("Number = " + number);   ...

Read More

Transforming XML file into fixed length flat file in SAP

karthikeya Boyini
karthikeya Boyini
Updated on 12-Mar-2020 762 Views

This is an EDIfact invoice. Try using the script, and it can help −                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   ERROR: The maximum length of "TABNAM" is 10 characters.                                                                                                                                                                                                                                                                               ERROR: The maximum length of "MANDT" is 3 characters.                                                                                                                                                                                                                                                                                                                                                                                                              ERROR: The maximum length of "ACTION" is 3 characters.                                                                                                                                                                                                          ERROR: The maximum length of "KZABS" is 1 character.                                                                                                                                     There are various sites which provide a built-in script to convert your EDIfact to XSLT.  Check this site and it may also help −https://www.codeproject.com/Articles/11278/EDIFACT-to-XML-to-Anything-You-Want

Read More

Passing to method geticon in SAPUI5

karthikeya Boyini
karthikeya Boyini
Updated on 12-Mar-2020 263 Views

SAP UI supports custom formatter functions. formatter="function" is used to specify a function to format cell data prior to display.formatter="function"Try using formatter function as below −icon : {    parts : ["answer"],    formatter : function(answerValue){       return self.getIcon(answerValue);    } }Refer below link to know more about custom formatter functions −https://sapui5.hana.ondemand.com/#/topic/07e4b920f5734fd78fdaa236f26236d8

Read More

MySQL query to select records from a table on the basis of a particular month number?

karthikeya Boyini
karthikeya Boyini
Updated on 06-Mar-2020 570 Views

You can select specific month with the help of MONTH() function. The syntax is as follows −SELECT yourColumnName FROM yourTableName WHERE MONTH(yourColumnName) = yourValue;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table UserLoginTimeInformation    -> (    -> UserId int NOT NULL AUTO_INCREMENT PRIMARY KEY,    -> UserLoginDatetime datetime    -> ); Query OK, 0 rows affected (0.55 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into UserLoginTimeInformation(UserLoginDatetime) values(date_add(now(), interval 3 month)); Query OK, 1 row affected (0.14 sec) ...

Read More

How to add/subtract large numbers using Python?

karthikeya Boyini
karthikeya Boyini
Updated on 05-Mar-2020 2K+ Views

You can add/subtract large numbers in python directly without worrying about speed. Python supports a "bignum" integer type which can work with arbitrarily large numbers. In Python 2.5+, this type is called long and is separate from the int type, but the interpreter will automatically use whichever is more appropriate.As long as you have version 2.5 or better, just perform standard math operations and any number which exceeds the boundaries of 32-bit math will be automatically (and transparently) converted to a bignum.examplea = 182841384165841685416854134135 b = 135481653441354138548413384135 print(a - b)OutputThis will give the output −47359730724487546868440750000

Read More

How to Convert Decimal to Binary, Octal, and Hexadecimal using Python?

karthikeya Boyini
karthikeya Boyini
Updated on 05-Mar-2020 1K+ Views

Python provides straightforward functions to convert Decimal to Binary, Octal, and Hexadecimal. These functions are −Binary: bin() Octal: oct() Hexadecimal: hex()ExampleYou can use these functions as follows to get the corresponding representation −decimal = 27 print(bin(decimal),"in binary.") print(oct(decimal),"in octal.") print(hex(decimal),"in hexadecimal.")OutputThis will give the output −0b11011 in binary. 0o33 in octal. 0x1b in hexadecimal.

Read More

How can I loop over entries in JSON using Python?

karthikeya Boyini
karthikeya Boyini
Updated on 05-Mar-2020 1K+ Views

You can parse JSON files using the json module in Python. This module parses the json and puts it in a dict. You can then get the values from this like a normal dict. For example, if you have a json with the following content −{    "id": "file",    "value": "File",    "popup": {       "menuitem": [       {"value": "New", "onclick": "CreateNewDoc()"},       {"value": "Open", "onclick": "OpenDoc()"},       {"value": "Close", "onclick": "CloseDoc()"}       ]    } }ExampleYou can load it in your python program and loop over its keys ...

Read More

How to compare two variables in an if statement using Python?

karthikeya Boyini
karthikeya Boyini
Updated on 05-Mar-2020 6K+ Views

You can compare 2 variables in an if statement using the == operator. examplea = 10 b = 15 if a == b:    print("Equal") else:    print("Not equal")OutputThis will give the output −Not EqualYou can also use the is the operator. examplea = "Hello" b = a if a is b:    print("Equal") else:    print("Not equal")OutputThis will give the output −EqualNote that is will return True if two variables point to the same object, == if the objects referred to by the variables are equal.

Read More
Showing 891–900 of 1,421 articles
« Prev 1 88 89 90 91 92 143 Next »
Advertisements