Error while Posting a Sales Order in SAP from .NET Application

SAP ABAP Expert
Updated on 04-Dec-2019 09:29:37

183 Views

Note that sold to party and ship to party are mandate fields. You need to add the created structures and tables to the function as shown in below code:RfcRepository repo = destination.Repository; IRfcFunction salesDoc = repo.CreateFunction("BAPI_SALESORDER_CREATEFROMDAT1"); IRfcStructure salesHeader = salesDoc.GetStructure("ORDER_HEADER_IN"); salesHeader.SetValue("DOC_TYPE", "ZDLR"); salesDoc.SetStructure(salesHeader); salesDoc.Invoke(destination);For more details you can check BAPI_SALESORDER_CREATEFROMDAT1 or below link:BAPI_SALESORDER_CREATEFROMDAT1

Check If a SortedList Contains a Specific Value in C#

AmitDiwan
Updated on 04-Dec-2019 08:20:54

171 Views

To check if a SortedList object contains a specific value, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(){       SortedList list = new SortedList();       list.Add("1", "One");       list.Add("2", "Two");       list.Add("3", "Three");       list.Add("4", "Four");       list.Add("5", "Five");       list.Add("6", "Six");       list.Add("7", "Seven");       list.Add("8", "Eight");       Console.WriteLine("Key and Value of SortedList....");       foreach(DictionaryEntry k in list )       Console.WriteLine("Key: {0}, Value: {1}", ... Read More

Get Enumerator to Iterate Through List in C#

AmitDiwan
Updated on 04-Dec-2019 08:18:21

567 Views

To get an enumerator that iterates through the List, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(String[] args){       List list1 = new List();       list1.Add("One");       list1.Add("Two");       list1.Add("Three");       list1.Add("Four");       list1.Add("Five");       Console.WriteLine("Elements in List1...");       foreach (string res in list1){          Console.WriteLine(res);       }       List list2 = new List();       list2.Add("India");       list2.Add("US");       list2.Add("UK"); ... Read More

Get the First Node of the Linked List in C#

AmitDiwan
Updated on 04-Dec-2019 08:13:04

397 Views

To get the first node of the LinkedList, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       LinkedList list = new LinkedList();       list.AddLast("A");       list.AddLast("B");       list.AddLast("C");       list.AddLast("D");       list.AddLast("E");       list.AddLast("F");       list.AddLast("G");       list.AddLast("H");       list.AddLast("I");       list.AddLast("J");       Console.WriteLine("Count of nodes = " + list.Count);       Console.WriteLine("First Node = "+list.First.Value);       list.Clear();       Console.WriteLine("Count ... Read More

Convert Data Back to Table Using SAP FM RFC_READ_TABLE

Anil SAP Gupta
Updated on 04-Dec-2019 08:09:48

617 Views

This is very simple and you can write a code as below. This code works when you only have characters fields in table:DATA: lt_options TYPE TABLE OF rfc_db_opt,         lt_fields  TYPE TABLE OF rfc_db_fld,         lt_entries TYPE TABLE OF dpr_pha_type. CALL FUNCTION 'RFC_READ_TABLE'   DESTINATION 'Y58CLNT800'   EXPORTING     query_table = 'DPR_PHA_TYPE'   TABLES     options     = lt_options     fields      = lt_fields     data        = lt_entries.

Get ICollection of Values from OrderedDictionary in C#

AmitDiwan
Updated on 04-Dec-2019 08:08:06

555 Views

To get an ICollection containing the values in OrderedDictionary, 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("1", "One");       dict.Add("2", "Two");       dict.Add("3", "Three");       dict.Add("4", "Four");       dict.Add("5", "Five");       dict.Add("6", "Six");       dict.Add("7", "Seven");       dict.Add("8", "Eight");       ICollection col = dict.Values;       String[] strVal = new String[dict.Count];       col.CopyTo(strVal, 0);     ... Read More

Check If a Hashtable is Equal to Another Hashtable in C#

AmitDiwan
Updated on 04-Dec-2019 08:03:47

230 Views

To check if a Hashtable is equal to another Hashtable, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(){       Hashtable hash1 = new Hashtable();       hash1.Add("1", "Kevin");       hash1.Add("2", "Steve");       hash1.Add("3", "Tim");       hash1.Add("4", "Gary");       hash1.Add("5", "Kevin");       hash1.Add("6", "Steve");       hash1.Add("7", "Tom");       hash1.Add("8", "Stephen");       Console.WriteLine("HashSet1...");       ICollection key = hash1.Keys;       foreach (string k in key) {       ... Read More

Check If a HashSet is a Subset of a Specified Collection in C#

AmitDiwan
Updated on 04-Dec-2019 08:00:02

134 Views

To check if a HashSet is a subset 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("EF");       set1.Add("OP");       Console.WriteLine("Elements in HashSet1");       foreach(string val in set1){          Console.WriteLine(val);       }       HashSet set2 = new HashSet();       set2.Add("KL");       set2.Add("MN");       set2.Add("OP");       set2.Add("QR");       Console.WriteLine("Elements in HashSet2");   ... Read More

Check if Two BitArray Objects are Equal in Chash

AmitDiwan
Updated on 04-Dec-2019 07:55:59

372 Views

To check if two BitArray objects are equal, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(){       BitArray arr1 = new BitArray(2);       BitArray arr2 = new BitArray(2);       arr1[0] = false;       arr1[1] = true;       Console.WriteLine("Elements in BitArray1...");       foreach (bool res in arr1){          Console.WriteLine(res);       }       arr2[0] = false;       arr2[1] = true;       Console.WriteLine("Elements in BitArray2...");       foreach ... Read More

Get Collection of Keys in StringDictionary in C#

AmitDiwan
Updated on 04-Dec-2019 07:53:04

149 Views

To get a collection of keys in the StringDictionary, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main(){       StringDictionary strDict1 = new StringDictionary();       strDict1.Add("U", "Electronics");       strDict1.Add("V", "Toys");       strDict1.Add("W", "Books");       strDict1.Add("X", "Accessories");       Console.WriteLine("StringDictionary1 elements...");       foreach(DictionaryEntry d in strDict1){          Console.WriteLine(d.Key + " " + d.Value);       }       Console.WriteLine("Does StringDictionary1 has key G? "+strDict1.ContainsKey("G"));       StringDictionary strDict2 = new ... Read More

Advertisements