Get the Fields of the Current Type in C#

AmitDiwan
Updated on 10-Dec-2019 09:45:21

293 Views

To get the fields of the current Type, the code is as follows −Example Live Demousing System; using System.Reflection; public class Demo {    public static void Main() {       Type type = typeof(System.String);       FieldInfo [] fields = type.GetFields(BindingFlags.Static | BindingFlags.NonPublic);       Console.WriteLine ("Following are the non-public fields=");       foreach (FieldInfo myField in fields) {          Console.WriteLine(myField.ToString());       }    } }OutputThis will produce the following output −Following are the non-public fields= Int32 TrimHead Int32 TrimTail Int32 TrimBoth Int32 charPtrAlignConst Int32 alignConstExampleLet us see another example − Live Demousing System; using System.Reflection; public class Demo {   ... Read More

Get Handle for the Type of a Specified Object in C#

AmitDiwan
Updated on 10-Dec-2019 09:41:48

235 Views

To get the handle for the Type of a specified object, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main() {       Type type1 = typeof(System.Type);       RuntimeTypeHandle typeHandle = Type.GetTypeHandle(type1);       Type type = Type.GetTypeFromHandle(typeHandle);       Console.WriteLine("Attributes = " + type.Attributes);       Console.WriteLine("Type Referenced = "+ type);    } }OutputThis will produce the following output −Attributes = AutoLayout, AnsiClass, Class, Serializable, BeforeFieldInit Type Referenced = System.RuntimeTypeExampleLet us see another example − Live Demousing System; public class Demo {    public static void ... Read More

Check if Dictionary Contains Specified Key in C#

AmitDiwan
Updated on 10-Dec-2019 09:39:46

168 Views

To check whether the Dictionary has the specified key or not, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main() {       Dictionary dict =       new Dictionary();       dict.Add("One", "John");       dict.Add("Two", "Tom");       dict.Add("Three", "Jacob");       dict.Add("Four", "Kevin");       dict.Add("Five", "Nathan");       Console.WriteLine("Count of elements = "+dict.Count);       Console.WriteLine("Key/value pairs...");       foreach(KeyValuePair res in dict) {          Console.WriteLine("Key = {0}, Value = {1}", res.Key, res.Value); ... Read More

Display Distinct Values in a Column Filtered on Another Column in SAP BO Report

Sreemaha
Updated on 10-Dec-2019 09:05:26

1K+ Views

There are multiple ways to do this. First is by creating a variable like this:Terms Count =Count([Terms Code]) in ([Sales #])You have to add this variable to your report. It will display 1 for all Sales # 1000 and 2 for all Sales # 1001. You can apply a filter on Count > 1.You can also do this using PREVIOUS() function as below:Previous([Payment Terms Code]; ([Sales #];[Line #]))

Error While Calling XBP Function Module via SAP .NET Connector

radhakrishna
Updated on 10-Dec-2019 09:03:22

127 Views

Note that you need to execute function call in a single session so you have to wrap your logic into JCoContext. Try using below method:try {    JCoContext.begin(destination);    try {       // your function calls here       // probably bapiTransactionCommit.execute(destination);    } catch(AbapException ex) {       // probably bapiTransactionRollback.execute(destination);    } } catch(JCoException ex) {    [...] } finally {    JCoContext.end(destination); }

Using SAP Tables from Chash Application RFC READ TABLE

vanithasree
Updated on 10-Dec-2019 09:01:35

734 Views

Many users use RFC_READ_Table as API for generic table access.Joins are not supported in RFC_READ_TABLE - Not correct as you can any time join your application. If you face any issues, you can ask user ABAP developer to create a Function Module.Select * query does not work for most cases as the data_buffer_exceed error is thrown- You shouldn’t run select * all the time as you don’t need all the data. You should only pull information that is required.

Unable to Access DBCONN After Upgrading to EHP7 in SAP System

seetha
Updated on 10-Dec-2019 08:56:39

154 Views

You can test the connection using T-code: SE38 using ADBC_TEST_CONNECTION. You could check details of exception as below:TRY. EXEC SQL. CONNECT TO 'ZUNIXDB_DBCON' ENDEXEC. EXEC SQL. OPEN dbcur FOR SELECT id FROM table ENDEXEC. CATCH cx_sy_native_sql_error INTO lr_cx_native_sql_error.

jQuery append, prepend, after, and before Methods Explained

David Meador
Updated on 10-Dec-2019 08:52:13

354 Views

jQuery.append()The append( content ) method appends content to the inside of every matched element. Here is the description of all the parameters used by this method −content − Content to insert after each target. This could be HTML or Text contentExampleYou can try to run the following code to learn how to work with jQuery.append() method:Live Demo           jQuery append() method                              $(document).ready(function() {             $("div").click(function () {                $(this).append('' ... Read More

Finding Items in SAP Tree Using Function

Johar Ali
Updated on 10-Dec-2019 08:46:35

181 Views

When you use string “1\1” in Java, it gives a valid path and returns the right key. You need the following code:SapTree tree = ...; // initialize somewhere String parentKey = tree.findNodeKeyByPath("1"); tree.expandNode(parentKey); String key = tree.findNodeKeyByPath("1\1");

Setup User Access Limitation on a Timely Basis in SAP HANA

vanithasree
Updated on 10-Dec-2019 08:44:46

108 Views

I must say, you got a pretty odd scenario of permission retraction but it is feasible.Create a stored procedure with entire onus of activating/deactivating the user or you can say authorize and de-authorize user.Create a batch user with privilege to execute the above-created procedures,Then you can set up a job to run the procedures with the help of hdbsql.

Advertisements