Rahul Sharma

Rahul Sharma

35 Articles Published

Articles by Rahul Sharma

Page 2 of 4

How to declare variables in JavaScript?

Rahul Sharma
Rahul Sharma
Updated on 15-Mar-2026 1K+ Views

Like many other programming languages, JavaScript has variables. Variables can be thought of as named containers. You can place data into these containers and then refer to the data simply by naming the container. Before you use a variable in a JavaScript program, you must declare it. JavaScript provides three ways to declare variables: var, let, and const. Using var Keyword Variables are declared with the var keyword as follows: var money; var name; You can also declare multiple variables with the same var keyword: ...

Read More

What is the difference between anonymous and inline functions in JavaScript?

Rahul Sharma
Rahul Sharma
Updated on 15-Mar-2026 2K+ Views

In JavaScript, anonymous and inline functions are closely related concepts that are often confused. Let's explore their differences and uses. Anonymous Functions Anonymous functions are functions without a name identifier. They are created at runtime and cannot be called directly by name. Here's how they work: // Anonymous function assigned to a variable var myfunc = function() { alert('This is anonymous'); }; Anonymous functions are commonly used as arguments to other functions: setTimeout(function() { alert('Demo'); }, 3000); Inline Functions An inline ...

Read More

Why prefer to put JavaScript in the footer of an HTML page?

Rahul Sharma
Rahul Sharma
Updated on 15-Mar-2026 929 Views

JavaScript can be placed anywhere in an HTML page, whether inside the or tag. However, it's considered best practice to place JavaScript in the footer, just before the closing tag. Why Place JavaScript in the Footer? Non-blocking page rendering: Scripts don't block HTML content from loading DOM availability: All HTML elements are already parsed and available Faster perceived load time: Users see content immediately Better user experience: Page appears responsive during script loading Improved performance: Critical rendering path is ...

Read More

Debugging a failed Insert statement in SAP ABAP

Rahul Sharma
Rahul Sharma
Updated on 13-Mar-2026 555 Views

In SAP ABAP, debugging failed INSERT statements is crucial for maintaining data integrity. The system variable sy-subrc is your primary indicator for operation success, where sy-subrc = 0 means the INSERT statement executed successfully, while any non-zero value indicates an error. Using System Return Code (sy-subrc) After executing an INSERT statement, always check the sy-subrc value to determine if the operation was successful − INSERT INTO ztable VALUES wa_data. IF sy-subrc = 0. WRITE: 'Record inserted successfully'. ELSE. WRITE: 'Insert failed with return code:', sy-subrc. ENDIF. Debugging Techniques Setting ...

Read More

Internal Table itab declaration in SAP and difference between both the declarations

Rahul Sharma
Rahul Sharma
Updated on 13-Mar-2026 301 Views

When working with internal tables in SAP ABAP, there are two main declaration approaches that differ in memory allocation and performance characteristics. Declaration Methods The two common ways to declare internal tables are − Method 1: With Initial Size DATA: itab TYPE TABLE OF customer_tab INITIAL SIZE 5. Method 2: Without Initial Size DATA: itab TYPE TABLE OF customer_tab. Key Differences As per my understanding, the key difference between two statements is that in first you are reserving memory space for storing 5 lines of the customer_tab table. ...

Read More

I want to round a number to 2 decimal places in SAPUI5. Could anyone help?

Rahul Sharma
Rahul Sharma
Updated on 13-Mar-2026 2K+ Views

The RoundingMode function is used for rounding numbers in SAPUI5 and it uses these parameters: the number to be rounded and how many decimal digits to display. This is particularly useful when working with currency values or percentages that need to be displayed with consistent decimal places. Using Float Type with Format Options You can round a number to 2 decimal places by using the sap.ui.model.type.Float type with specific format options in your data binding − Format Options Explained The format options control how the number is displayed − ...

Read More

Using real Boolean type in SAP ABAP

Rahul Sharma
Rahul Sharma
Updated on 13-Mar-2026 507 Views

This approach is called a Predicative Method call. This will work if the initial value is false and false is the initial value for Boolean types in ABAP. Predicative method calls allow you to use method calls directly in logical expressions, making your code more concise and readable. In SAP ABAP, the real Boolean type abap_bool was introduced to provide true Boolean functionality. Unlike character-based flags ('X' and ' '), Boolean types have clear true and false values with false being the initial value. Using Boolean in Predicative Method Calls When using real Boolean types, you can ...

Read More

What is the difference between integer and floating point literals in Java?

Rahul Sharma
Rahul Sharma
Updated on 11-Mar-2026 1K+ Views

Integer literals represent fixed integer values like 900, 12, 400, -222 etc. (with in the integer range). Whereas, floating point literals represents fractional values i.e. numbers with decimal values like 25.53, 45.66, 58.66 etc. while writing these literals we should use the notation f or F as 25.53. Example public class StringExample { public static void main(String args[]){ int num1 = 100; float num2 = 30.0f; System.out.println("Value of integer:"+num1); System.out.println("Value of integer:"+num2); } } Output Value of integer:100 Value of integer:30.0

Read More

Can static variables be called using className.variableName in Java?

Rahul Sharma
Rahul Sharma
Updated on 11-Mar-2026 2K+ Views

Class variables also known as static variables are declared with the static keyword There would only be one copy of each class variable per class, regardless of how many objects are created from it. You can access a class variable without instantiation using the class name as className.variableName. Example public class Test{ static int num = 92; public static void main(String args[]) throws Exception { System.out.println(Test.num); } } Output 92

Read More

User rights required to make a call to SAP RFC Function Module RFC_SYSTEM_INFO from JAVA application

Rahul Sharma
Rahul Sharma
Updated on 25-Feb-2020 1K+ Views

When you use Java connector you need basic authorization to read metadata of Function Module. S_RFC is an authorization object for the RFC call.This object contains the following fieldsRFC_TYPE Type of the RFC object you want to protect. You can pass the value 'FUGR'- function group) or 'FUNC'- function module.RFC_NAME Name of RFC to be protected. This file contains a value of the function group or of function modules.CTVT ActivityThis field may take the value 16.In case you want a user to be able to call function modules in-group 'ABCD' remotely, following user authorization is required          ...

Read More
Showing 11–20 of 35 articles
Advertisements