Get Enumerator to Iterate Through HybridDictionary in C#

AmitDiwan
Updated on 05-Dec-2019 07:57:29

126 Views

To get an enumerator that iterates through the HybridDictionary, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main(){       HybridDictionary dict1 = new HybridDictionary();       dict1.Add("A", "Books");       dict1.Add("B", "Electronics");       dict1.Add("C", "Smart Wearables");       dict1.Add("D", "Pet Supplies");       dict1.Add("E", "Clothing");       dict1.Add("F", "Footwear");       Console.WriteLine("HybridDictionary1 elements...");       foreach(DictionaryEntry d in dict1){          Console.WriteLine(d.Key + " " + d.Value);       }       HybridDictionary ... Read More

Error While Passing Image Value to OData Request in SAP

Altamas Khan
Updated on 05-Dec-2019 07:54:55

346 Views

If you ImgData includes an image in Data URI format base64 then add the below line to Imgvalue to convert it to ImgData:var imgData = JSON.stringify(ImgValue);I suggest you to use AJAX to post image through OData as shown in below code:OData.request ({      requestUri:"http://test.test1.net:8081/sap/opu/odata/sap/ SALES_VRS/DailySalesSet",      method: "GET",      headers:      {       -Requested-With": "XMLHttpRequest",       "Content-Type": "application/atom+xml",       "DataServiceVersion": "2.0",                 "X-CSRF-Token":"Fetch"                                    }     ... Read More

Remove All Objects from the Queue in C#

AmitDiwan
Updated on 05-Dec-2019 07:54:16

137 Views

To remove all objects from the Queue, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       Queue queue = new Queue();       queue.Enqueue("Gary");       queue.Enqueue("Jack");       queue.Enqueue("Ryan");       queue.Enqueue("Kevin");       queue.Enqueue("Mark");       queue.Enqueue("Jack");       queue.Enqueue("Ryan");       queue.Enqueue("Kevin");       Console.Write("Count of elements = ");       Console.WriteLine(queue.Count);       queue.Clear();       Console.Write("Count of elements (updated) = ");       Console.WriteLine(queue.Count);    } }OutputThis will produce ... Read More

Properties of SAP ABAP Development Objects

Nikitha N
Updated on 05-Dec-2019 07:51:37

259 Views

Similar to reflection in JAVA we have RTTS in SAP. RTTS stands for runtime type services. It provides you with ways to retrieve the definitions of variables and lets you create a new variable during program execution. RTTS comprises of two sub-componentsRTTI – Run Time Type IdentificationRTTC – Run Time Type CreationAs the name suggests, RTTI is responsible for retrieving the definitions of variables and types Whereas RTTC is responsible for the creation of new variables with provided definition at run-time.

Remove All Entries from ListDictionary in C#

AmitDiwan
Updated on 05-Dec-2019 07:51:18

119 Views

To remove all entries from the 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 dict1 = new ListDictionary();       dict1.Add("A", "Books");       dict1.Add("B", "Electronics");       dict1.Add("C", "Smart Wearables");       dict1.Add("D", "Pet Supplies");       dict1.Add("E", "Clothing");       dict1.Add("F", "Footwear");       Console.WriteLine("ListDictionary1 elements...");       foreach(DictionaryEntry d in dict1){          Console.WriteLine(d.Key + " " + d.Value);       }       ListDictionary dict2 = ... Read More

Convert File into Byte Array in SAP ABAP

Ramu Prasad
Updated on 05-Dec-2019 07:49:09

961 Views

Here is a code snippet to do the same.data: f_line type xstring.               // to get line by line content data: f_file type table of xstring.      // to get the final content data: f_filename type string value 'samplefile.txt'.   // store the filename of file data: f_len type i. open dataset f_filename for input in binary mode.   // read the binary read dataset f_filename into f_line length f_len.  // get the number of lines in the file while f_len > 0.               // ... Read More

Check if a HashSet is a Proper Superset in C#

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

137 Views

To check if a HashSet is a proper superset of the specified collection, 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(30);       set1.Add(60);       set1.Add(70);       set1.Add(80);       set1.Add(100);       set1.Add(125);       set1.Add(150);       set1.Add(200);       Console.WriteLine("Elements in HashSet1");       foreach(int val in set1){          Console.WriteLine(val);       }       HashSet set2 = ... Read More

Get Details When a Table is Modified in SAP HANA DB

Rama Giri
Updated on 05-Dec-2019 07:45:45

2K+ Views

You can query SYS.M_TABLE_STATISTICS providing name of table and LAST MODIFY DATE. Here is the sample SQL query.SELECT "ABC", "LAST_MODIFY_TIME"   FROMSYS.M_TABLE_STATISTICS ORDER BY “LAST_MODIFY_TIME" DESCIn above command, you need to replace “ABC” by your table name.

Perform Total of a Column in a Temporary Column in SAP

Arjun Thakur
Updated on 05-Dec-2019 07:44:31

156 Views

You need to perform select again on your query. Here is the sampleSELECT DATE, FUND_ID, PPT_ID, SOURCE_ID, AMOUNT, SUM (AMOUNT) as TOTAL FROM (    SELECT    AD.CHV_DATE.DATE,    AD.CHV_FUND.FUND_ID,    AD.CHV_PARTICT.PPT_ID,    AD.CHV_PARTICT.SOURCE_ID,    SUM (AD.CHV_PARTICT.AMOUNT), FROM    AD.CHV_DATE,    AD.CHV_FUND,    AD.CHV_PARTICT,    AD.CHV_SOURCE WHERE    DC.CHV_SOURCE.FUND_ID=AD.CHV_FUND.FUND_ID AND (DC.CHV_SOURCE.DATE=AD.CHV_DATE.DATE) AND (DC.CHV_PARTICT.PPT_ID=AD.CHV_SOURCE.PPT_ID) AND (    AD.CHV_DATE.DATE IN ('2017-08-02')      AND    AD.CHV_PARTICT.PPT_ID IN ('PPT0449') ) GROUP BY    AD.CHV_DATE.DATE,    AD.CHV_FUND.FUND_ID,    AD.CHV_PARTICT.PPT_ID,    AD.CHV_SOURCE.SOURCE_ID) GROUP by DATE, FUND_ID, PPT_ID, SOURCE_ID, AMOUNTRead More

Remove All Elements in a Collection from a HashSet in C#

AmitDiwan
Updated on 05-Dec-2019 07:44:31

154 Views

To remove all elements in a collection from a HashSet, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(String[] args){       HashSet set1 = new HashSet();       set1.Add("Ryan");       set1.Add("Tom");       set1.Add("Andy");       set1.Add("Tim");       Console.WriteLine("Elements in HashSet1...");       foreach (string res in set1){          Console.WriteLine(res);       }       HashSet set2 = new HashSet();       set2.Add("John");       set2.Add("Jacob");       set2.Add("Ryan");       ... Read More

Advertisements