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
-
Economics & Finance
Articles by Amit Sharma
Page 2 of 3
JavaScript function in href vs. onClick
When creating clickable links that execute JavaScript, you can use either the href attribute with a JavaScript URL or the onclick event handler. Each approach has different behaviors and use cases. Using href with JavaScript The href attribute can execute JavaScript using the javascript: protocol. However, this approach has limitations with rapid clicks and can interfere with browser navigation. JavaScript href Example function calculateSum() { ...
Read MoreHow to write JavaScript in an External File?
JavaScript code can be written in external files with a .js extension and included in HTML documents using the tag's src attribute. This approach improves code organization and reusability. Why Use External JavaScript Files? External JavaScript files offer several advantages: Code Reusability: Same file can be used across multiple HTML pages Better Organization: Keeps HTML and JavaScript code separated Caching: Browsers cache external files, improving page load times Maintainability: Easier to update and debug code Creating an External JavaScript File First, create a JavaScript file with the .js extension. For example, script.js: ...
Read MoreIn dynamic fashion setting a custom class to a cell in a row
If you need to set CSS properties for a row, you can combine the predefined CSS class of the table along with your custom class. This allows you to apply specific styling to table cells dynamically. Syntax .table-class .custom-class { property: value; } Example: Custom Cell Styling The following example demonstrates how to apply custom styling to table cells using a combination of table class and custom class − .data-table { border-collapse: ...
Read MoreUsing CSS3 in SAP BSP application without using DOCTYPE tag
You can use CSS3 features in SAP BSP applications even without adding a DOCTYPE tag by leveraging JavaScript libraries and polyfills that provide CSS3-like functionality. Syntax /* CSS3 features may not work without DOCTYPE */ selector { border-radius: value; box-shadow: value; transition: value; } Method 1: Using jQuery UI jQuery UI provides CSS3-like effects and styling that work across browsers without requiring DOCTYPE − .custom-button { ...
Read MoreUsing datatype/element for destination in SAP ABAP
You can use RFCDEST to specify the destination for Remote Function Call connections in SAP ABAP. The RFCDEST statement specifies the destination value for a Remote Function Call connection and gateway information. This statement is essential for establishing connections to remote SAP systems. Supported Job Types This statement is optional for the following job types − SAP Batch Input Session SAP Business Warehouse InfoPackage SAP ...
Read MoreLinking ABAP Dynpro screen elements to program variables
You can make the connection between ABAP Dynpro screen elements and program variables by using the name of Global variables. A Global variable can be defined by using this code − DATA matnr TYPE MATNR. This creates a global variable matnr of type MATNR. You can also define DDIC structure or table references using the TABLES statement − TABLES: MARA. Once you have declared the table or structure, you can reference the fields of table/structure ...
Read MoreWhat are the default values of instance variables whether primitive or reference type in Java?
When we haven’t initialized the instance variables compiler initializes them with default values.For boolean type, the default value is false, for float and double types default values are 0.0 and for remaining primitive types default value is 0.Examplepublic class Sample { int varInt; float varFloat; boolean varBool; long varLong; byte varByte; short varShort; double varDouble; public static void main(String args[]){ Sample obj = new Sample(); System.out.println("Default int value ::"+obj.varInt); System.out.println("Default float value ::"+obj.varFloat); System.out.println("Default boolean value ::"+obj.varBool); ...
Read MoreHow to use constant in ABAP program which has trailing space?
This is because you are declaring constant as type c. The type c variable always trims the trailing space. I would suggest you define it as string as followsCONSTANTS: co_abc type string value ' b '.This will keep the trailing spaces.
Read MoreHow to convert a String to and fro from UTF8 byte array
Following example will showcase conversion of a Unicode String to UTF8 byte[] and UTF8 byte[] to Unicode byte[] using Reader and Writer classes.ExampleIOTester.javaimport java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.Reader; import java.io.Writer; import java.nio.charset.Charset; import java.text.ParseException; public class I18NTester { public static void main(String[] args) throws ParseException, IOException { String input = "This is a sample text" ; InputStream inputStream = new ByteArrayInputStream(input.getBytes()); //get the UTF-8 data Reader reader = new InputStreamReader(inputStream, Charset.forName("UTF-8")); ...
Read MoreAccessing table data from SAP system
Using Select statement you can read data with a dynamic table name. Try using below code &areDATA: lv_tablename TYPE string, ev_filelength TYPE i. lv_tablename = 'mara'. "e.g. a parameter DATA dref TYPE REF TO data. CREATE DATA dref TYPE TABLE OF (lv_tablename). FIELD-SYMBOLS: TYPE ANY TABLE. ASSIGN dref->* to . SELECT * FROM (lv_tablename) INTO TABLE .
Read More