Amit Sharma

Amit Sharma

27 Articles Published

Articles by Amit Sharma

Page 2 of 3

JavaScript function in href vs. onClick

Amit Sharma
Amit Sharma
Updated on 15-Mar-2026 13K+ Views

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 More

How to write JavaScript in an External File?

Amit Sharma
Amit Sharma
Updated on 15-Mar-2026 8K+ Views

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 More

In dynamic fashion setting a custom class to a cell in a row

Amit Sharma
Amit Sharma
Updated on 15-Mar-2026 167 Views

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 More

Using CSS3 in SAP BSP application without using DOCTYPE tag

Amit Sharma
Amit Sharma
Updated on 15-Mar-2026 289 Views

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 More

Using datatype/element for destination in SAP ABAP

Amit Sharma
Amit Sharma
Updated on 13-Mar-2026 294 Views

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 More

Linking ABAP Dynpro screen elements to program variables

Amit Sharma
Amit Sharma
Updated on 13-Mar-2026 648 Views

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 More

What are the default values of instance variables whether primitive or reference type in Java?

Amit Sharma
Amit Sharma
Updated on 11-Mar-2026 3K+ Views

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 More

How to use constant in ABAP program which has trailing space?

Amit Sharma
Amit Sharma
Updated on 25-Feb-2020 621 Views

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 More

How to convert a String to and fro from UTF8 byte array

Amit Sharma
Amit Sharma
Updated on 24-Feb-2020 3K+ Views

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 More

Accessing table data from SAP system

SAP
Amit Sharma
Amit Sharma
Updated on 14-Feb-2020 684 Views

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
Showing 11–20 of 27 articles
Advertisements