Check If Every List Element Matches Predicate Conditions in C#

AmitDiwan
Updated on 11-Dec-2019 07:06:51

371 Views

To check if every List element matches the predicate conditions, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    private static bool demo(int i) {       return ((i % 10) == 0);    }    public static void Main(String[] args) {       List list = new List();       list.Add(200);       list.Add(215);       list.Add(310);       list.Add(500);       list.Add(600);       Console.WriteLine("List elements...");       foreach (int i in list) {          Console.WriteLine(i);       } ... Read More

Trigger Same Function with jQuery for Multiple Events

Amit D
Updated on 11-Dec-2019 07:06:41

5K+ Views

To trigger the same function with multiple events, use the jQuery on() method with multiple events such as click, dblclick, mouse enter, mouse leave, hover, etc.ExampleYou can try to run the following code to learn how to work the same function with jQuery multiple events:Live Demo $(document).ready(function(){     $("p").on({             mouseenter: function(){             $(this).css("background-color", "gray");         },                   mouseleave: function(){             $(this).css("background-color", "red");         },                 dblclick: function(){             $(this).css("background-color", "yellow");         }             }); }); Click, double click and move the mouse pointer.

Create ListDictionary in C#

AmitDiwan
Updated on 11-Dec-2019 07:05:05

109 Views

To create a ListDictionary, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main(){       ListDictionary dict = new ListDictionary();       dict.Add("1", "SUV");       dict.Add("2", "Sedan");       dict.Add("3", "Utility Vehicle");       dict.Add("4", "Compact Car");       dict.Add("5", "SUV");       dict.Add("6", "Sedan");       dict.Add("7", "Utility Vehicle");       dict.Add("8", "Compact Car");       dict.Add("9", "Crossover");       dict.Add("10", "Electric Car");       Console.WriteLine("ListDictionary elements...");       foreach(DictionaryEntry d in dict){ ... Read More

Use SAP OLE Code to Paste Internal Table into Excel

Ali
Ali
Updated on 11-Dec-2019 07:03:46

753 Views

Note that you have to use “double quotation” for all the text you have to put into one cell and then connect cell with 0X09 and 0X0A for next column and next row respectively.Check the below code as it fills two cells with 2 lines:CONSTANTS:    nextC TYPE abap_char1 VALUE cl_abap_char_utilities=>horizontal_tab,    nextR TYPE abap_char1 VALUE cl_abap_char_utilities=>newline,    quot TYPE abap_char1 VALUE '"'. DATA:    buffer TYPE string. CONCATENATE quot 'R1C1L1' nextR 'R1C1L2' quot nextC quot 'R1C2L1' nextR 'R1C2L2' quot INTO buffer.Read More

Displaying Source Code of RFC in SAP System

Rahul Sharma
Updated on 11-Dec-2019 07:02:14

898 Views

You can check this information in table REPOSRC and column name is “DATA”.You can also make use of RPY_FUNCTIONMODULE_READ_NEW - this will return the source as well. This Function module uses changing Parameters.

Intersection of Two HashSets in C#

AmitDiwan
Updated on 11-Dec-2019 07:02:09

527 Views

To find the intersection of two HashSets, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       HashSet set1 = new HashSet();       set1.Add("AB");       set1.Add("CD");       set1.Add("EF");       set1.Add("AB");       set1.Add("IJ");       set1.Add("KL");       set1.Add("EF");       set1.Add("OP");       Console.WriteLine("Elements in HashSet1");       foreach(string val in set1){          Console.WriteLine(val);       }       HashSet set2 = new HashSet();       set2.Add("EF"); ... Read More

Intersection of SortedSet with a Collection in C#

AmitDiwan
Updated on 11-Dec-2019 06:58:58

155 Views

To get the intersection of SortedSet with a Collection, the code is as follow −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       SortedSet set1 = new SortedSet();       set1.Add(100);       set1.Add(200);       set1.Add(300);       SortedSet set2 = new SortedSet();       set2.Add(450);       set2.Add(200);       set2.Add(650);       set2.Add(300);       set2.Add(800);       Console.WriteLine("Does it contain the same elements? = "+set1.SetEquals(set2));       set1.IntersectWith(set2);       Console.WriteLine("Resultant SortedSet...");       foreach(int ... Read More

Insert into OrderedDictionary with Key and Value at Specified Index in C#

AmitDiwan
Updated on 11-Dec-2019 06:53:56

339 Views

To insert into OrderedDictionary with key and value at specified index, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main(){       OrderedDictionary dict = new OrderedDictionary();       dict.Add("A", "Books");       dict.Add("B", "Electronics");       dict.Add("C", "Smart Wearables");       dict.Add("D", "Pet Supplies");       Console.WriteLine("OrderedDictionary elements...");       foreach(DictionaryEntry d in dict){          Console.WriteLine(d.Key + " " + d.Value);       }       Console.WriteLine("Count of elements in OrderedDictionary = " + dict.Count); ... Read More

Expose Employee Master Data from SAP HR System using Web Service

Govinda Sai
Updated on 11-Dec-2019 06:51:17

1K+ Views

In a general scenario, when you have ICF configured you can expose SAP system business objects and jobs via BAPI. It is very easy to create and expose BAPI as a web service. As there are only few web services for SAP HR module in SAP system however you can transform a BAPI or ABAP function into a web service. If there is no such function you can create one easily.To find details about BAPI from Function module, use T-Code: SE37 and enter Functional module name for SAP HR module. Below is the list of existing HR function modules in ... Read More

Insert at the Specified Index in StringCollection in C#

AmitDiwan
Updated on 11-Dec-2019 06:48:14

172 Views

To insert at the specified index in StringCollection, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo {    public static void Main(){       StringCollection strCol = new StringCollection();       strCol.Add("Accessories");       strCol.Add("Books");       strCol.Add("Electronics");       Console.WriteLine("StringCollection elements...");       foreach (string res in strCol){          Console.WriteLine(res);       }       strCol.Insert(2, "Headphone");       Console.WriteLine("StringCollection elements...UPDATED");       foreach (string res in strCol){          Console.WriteLine(res);       }    } }OutputThis will ... Read More

Advertisements