Generic Method, How parameter type is determined

For method
<T> void fromArrayToCollection(T[] a, Collection<T> c) { ... } Why does
fromArrayToCollection(sa, co);passes and
fromArrayToCollection(oa, cs); fails.
oa - Object Array, Object[]
cs - Collection of String, Collection<String>
sa - String Array, String[]
co - Collection of Object, Collection<Object>
What are the rules governing the type of T inferred by compiler?

epiphanetic wrote:
I think you still haven't fully understood the issue.
I suggest, you also read the same generics tutorial by Gilad Bracha, section 6 from where I found this issue :). Ha! But I think it's misleading that that section uses arrays.
In his words "It will generally infer the most specific type argument that will make the call type-correct." Its also mentioned that collection parameter type has to be supertype of Array parameter type but no reason is given. I wonder why it fails to infer correct type in second case.Assume you passed in an array of Objects, and a Collection of Strings, and it was possible that T would then be Object. Using Bracha's example implementation:
static <T> void fromArrayToCollection(T[] a, Collection<T> c) {
   for (T o : a) {
      c.add(o); // correct
}Now imagine you had this code making use of it:
Object[] objects = {Integer.valueOf(1), "hi", new Object()};
Collection<String> strings = new LinkedList<String>();
fromArrayToCollection(objects, strings);
String string = strings.iterator().next(); //get first String, which is actually an IntegerTrying to get the first String would give a ClassCastException. So clearly that method cannot not be safely invoked.
The reason I think he's confusing things by using the array is because you might get it in your head that this would be OK:
static <T> void fromCollectionToCollection(Collection<T> one, Collection<T> two) {
   for ( T t : one ) {
      two.add(t);
Collection<Object> col1; Collection<String> col2;
doSomething(col1, col2);When clearly it's unsafe, as now your Collection of Strings might have a non-String in it! That's why I said this is more a nuance of generic arrays than of type inference proper.

Similar Messages

  • How movement type is determine in out bound delivery?

    Hello,
    (1) I want to know, how movement type is determine in out bound delivery (item detail --->Administration tab).
      If I want to make a setting of customer return, then where can I assign movement type 451 so that it will appear in OBD?
    (iii) Please provide me the path of setting of SD document category ex- J,7 etc (Which appears in T-code OVLP)
    Thanks,
    MMC

    Hello,
    M type (Tcode OMJJ) is determine into the Delv doc on the bases of Sch line Cat(Tcode VOV6)  maintain in your sales order's item level .
    The relevant Sch line Cat is determined into sales order on the bases (tcode VOV5 of
    I Cat + MRP type (if any) .
    And the I cat is determined into sales order based on (tcode VOV4)
    Sales Doc. Type + Item cat.group (determined from material Master) + Item usage (if any) + ItemCat-HgLvItm (if any).
    The std sch line cat for Return is 651.
    If you want to have 451 as M  type for your material then copy std sch line cat DN and maintain 'Z' Sch Line cat with your M Type.
    And determine the same to your I Cat for return in return sale order.
    Before executing your process cycle have a look/check on copying control config for Return Order to Delv in Tcode VTLA.
    Hope this can assist you.
    Thanks & Regards
    JP

  • How movement type is determined

    Let me know how movement type is determined in delivery when it is created from STO, iSTO?

    Dear,
    As per my view system take 601 mov. type for delivery.
    And for move. type use following link[http://help.sap.com/bestpractices/BBLibrary/html/P36_IntStockTransDel_EN_IN.htm]
    Regards,
    Mahesh Wagh

  • Generic method incorrectly infers types

    I've got an error when I've a parametric method and I want to use the result as a parameter of another method.
    For example:
    public class BuilderA {
            private static class Entity<T> {}
            protected <E> Entity<E> createSomeEntity() {
                    return null;
            private void add(Entity<String> entity) {}
            public void crearEntityList() {
                     *  1-
                     * The method add(BuilderA.Entity<BuilderA.User>) in the type BuilderA is not applicable for the arguments (BuilderA.Entity<Object>)
                    add(createSomeEntity());
                     *  2-
                     * OK
                    Entity<String> dummy;
                    add(dummy = createSomeEntity());
    }In this code, in the second case, the compiler infers right the generic E. But, in the first one it infers Object for E and produces a compiler error.
    Does anyone know if that issue is already reported as a bug?
    I don�t like to be forced to create a dummy variable.

    What is the use of your code? As far as I can see,
    createSomeEntity() will always have to return null,
    as it cannot access the class/type of E at any time.The code is an example. In the example, this method isn't implemented. The purpose is to show the compiler error!
    Even infering E on assignment does not help, as you
    cannot produce proper code for inside the method.That's not true. For example:
    protected <E> Entity<E> createSomeEntity() {
          return new Entity<E>();
    }Another example
            public abstract static class Entity<T> {
                 public abstract void process(T value);
            private static class EntityLogger<T> extends Entity<T> {
                 EntityLogger() {
                      super();
              @Override
              public void process(T value) {
                   System.out.println(value);
            protected <E> Entity<E> createEntityLogger() {
                    return new EntityLogger<E>();
            }Note, that EntityLogger is a private inner class a no one could create one instance of that class without calling the function createEntityLogger().
    This kind of things appears only in frameworks design

  • Generic method signatures

    I've searched but can't find that a question I have has been asked (or answered). I apologize in advance if it has. Here is my question.
    In Java Generics FAQ by Angelika Langer states in FAQ 802 ( [http://www.angelikalanger.com/GenericsFAQ/FAQSections/TechnicalDetails.html#FAQ802] ) "the type parameters of a generic method including the type parameter bounds are part of the method signature."
    In FAQ 810, many examples are presented of method declarations, including generic ones, and their corresponding method signatures. For example,
    <T> T method(T arg) has the following signature in the example:
    <$T1_extends_Object>method($T1_extends_Object>)
    It would seem to be intuitively clear that the type parameter and bounds would be part of the method signature but I can't seem to find such a stipulation/requirement of such in the Java Language Specification. Anybody know where it's stipulated in the JLS?
    Best Regards

    user13143654 wrote:
    Yeah, I know. The title of the subsection is "Determining Method Signature," but then it never seems to expressly do that other than in some ephemeral wafting byproduct of overload resolution.I wouldn't call it "ephemeral" and "wafting." It's pretty specific. If you're looking for the $T1_extends_Object notation, you won't find it. That's not part of the spec.
    I can't seem to find a specific spot in the subsection where I can say "OK, now I've got the method signature and now can proceed to ..." Well, it goes on to Phase 3, and then on to 15.12.2.5 Choosing the Most Specific Method. I'm not sure what you're looking for. It does describe in detail how we get from all the methods in the universe, to which type's methods we'll be considering to which signatures could match to which one is the best match. I don't know what else you're looking for.
    If you're looking for somebody to digest, translate, and simplify all that for you, good luck, but it ain't gonna be me. :-)
    If you have specific questions about smaller pieces of it I (or somebody else) might be able to help out. At the moment though, your question is rather vague.
    Edited by: jverd on May 3, 2011 1:48 PM

  • How do I gain type safety with a generic method taking a class object?

    How do I achieve type safety with the following code without getting a compile error?
    import java.util.ArrayList;
    import java.util.List;
    public class Main {
        public static void main(String[] args) throws Exception {
            ListenerHolder th = new ListenerHolder();
            List<TestObject<String>> list = createTestObjectList();
            /* *** compiler error here *** */
            th.addListener(TestObject.class, list);
        private final static List<TestObject<String>> createTestObjectList() {
            List<TestObject<String>> list = new ArrayList<TestObject<String>>();
            return list;
        private final static class ListenerHolder {
                /* *** my generic method *** */
                public <T> void addListener(Class<T> listenerType, List<T> listener) { }
        private final static class TestObject<T> { }
    }The compiler error is:
    C:\java\Main.java:11: <T>addListener(java.lang.Class<T>,java.util.List<T>) in Main.ListenerHolder cannot be applied to (java.lang.Class<Main.TestObject>,java.util.List<Main.TestObject<java.lang.String>>)
    Thanks in advance,
    Dan

    dandubois wrote:
    Thanks for the help, that is exactly what I wanted to know.
    It didn't occur to me that TestObject<T> would in some respects be considered as an 'extends' of TestObject as I know the compiler converts them all back to plain TestObjects.Maybe I should have written TestObject<?>, to make it more obvious. There's some supertype/subtype relation diagram in the Generics FAQ somewhere, if you need more detailed information.
    In the end, I think jtahlborn's solution might be more appropriate in the described scenario, so you should go for it.

  • How Oracle JDBC driver determine DATE data type parameter if it is not specified

    Hello,
    Oracle JDBC driver determine the DATE data type of parameter correctly without any typecasting.
    Example:
    ps = conn.prepareStatement("SELECT ? FROM DUAL");
    ps.setObject(1, Date.valueOf("2014-01-11"));
    How Oracle JDBC driver determine the DATE data type of parameter.
    Thought?
    Regards,
    Vinayak

    Oracle JDBC driver determine the DATE data type of parameter correctly without any typecasting.
    Example:
    ps = conn.prepareStatement("SELECT ? FROM DUAL");
    ps.setObject(1, Date.valueOf("2014-01-11"));
    How Oracle JDBC driver determine the DATE data type of parameter.
    Your question isn't clear. If the driver is doing it correctly what PROBLEM are you having? What exactly do you consider 'correct'? What results are you getting? What driver name and version are  you using? What Oracle DB version are you using?
    For the code you use above the 'Date' you specify is a java.sql.Date instance
    http://docs.oracle.com/javase/8/docs/api/java/sql/Date.html#valueOf-java.lang.String-
    public static Date valueOf(String s)
    Converts a string in JDBC date escape format to a Date value.
    Parameters:
    s - a String object representing a date in in the format "yyyy-[m]m-[d]d". The leading zero for mm and dd may also be omitted.
    Returns:
    a java.sql.Date object representing the given date
    The JDBC Dev Guide shows that is mapped to an oracle.sql.DATE
    http://docs.oracle.com/cd/E11882_01/java.112/e16548/datacc.htm#g1028145
    Oracle DATE datatypes have both date and time components. Depending on the JDBC driver version and DB version you are using an Oracle date could be mapped to a Java Date (which does NOT have a time component) or, for current versions, would be considered a timestamp..

  • How to create a generic method?

    Hi,
      I am using a std task TS01200205 to create instance for a BOR object. There are 2 key fields. I want to pass these 2 to the ObjectKey field.
    As for as I know, we have to concatenate these two Keyfields and assign it to 'Object Key' parameter.
      How can I concatenate the 2 strings in my Workflow? Is there any std way of doing it?
    Also what is a generic method? How to create it? Can I make use of generic method to achieve this?
    Thanks,
    Sivagami

    If you want to use it in different workflows the best solution is probably to define an interface and define and implement the method there (a nice thing about BOR interfaces is that you can provide an implementation and not just the definition).
    All you then need to do is let your object type(s) implement that interface, which only requires adding the interface since the implementation has been done already.
    However, I am not saying this is a good way of approaching things, I'm just telling you how you can implement what you suggest.

  • Inconsistent Accessibilty: parameter type 'CRUDApplication.Models.IEmployeeRepository' is less accessable than method 'CRUDApplication.Controllers.EmployeeController.EmployeeController'

    Am getting this error in my code
    Inconsistent accessibility: parameter type 'CRUDApplication.Models.IEmployeeRepository' is less accessible than method 'CRUDApplication.Controllers.EmployeeController.EmployeeController(CRUDApplication.Models.IEmployeeRepository)'   
    Here's my code
    // EmployeeController.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.Mvc;
    using CRUDApplication.Models;
    using System.Data;
    namespace CRUDApplication.Controllers
        public class EmployeeController : Controller
            // GET: /Employee/
             private IEmployeeRepository _repository;
            public EmployeeController()
                : this(new EmployeeRepository())
            public EmployeeController(IEmployeeRepository repository)
                _repository = repository;
            public ActionResult Index()
                var employee = _repository.GetEmployee();
                return View(employee);
            public ActionResult Details(int id)
                EmployeeModel model = _repository.GetEmployeeByID(id);
                return View(model);
            public ActionResult Create()
                return View(new EmployeeModel());
            [HttpPost]
            public ActionResult Create(EmployeeModel employee)
                try
                    if (ModelState.IsValid)
                        _repository.InsertEmployee(employee);
                        return RedirectToAction("Index");
                catch (DataException)
                    ModelState.AddModelError("", "Can't be Saved!");
                return View(employee);
            public ActionResult Edit(int id)
                EmployeeModel model = _repository.GetEmployeeByID(id);
                return View(model);
            [HttpPost]
            public ActionResult Edit(EmployeeModel employee)
                try
                    if (ModelState.IsValid)
                        _repository.UpdateEmployee(employee);
                        return RedirectToAction("Index");
                catch (DataException)
                    ModelState.AddModelError("", "Can't be Saved!");
                return View(employee);
            public ActionResult Delete(int id, bool? saveChangesError)
                if (saveChangesError.GetValueOrDefault())
                    ViewBag.ErrorMessage = "Can't be Deleted!";
                EmployeeModel employee = _repository.GetEmployeeByID(id);
                return View(employee);
            [HttpPost, ActionName("Delete")]
            public ActionResult DeleteConfirmed(int id)
                try
                    EmployeeModel user = _repository.GetEmployeeByID(id);
                    _repository.DeleteEmployee(id);
                catch (DataException)
                    return RedirectToAction("Delete",
                    new System.Web.Routing.RouteValueDictionary {
              { "id", id },
              { "saveChangesError", true } });
                return RedirectToAction("Index");
    // IEmployeeRepository.cs
    namespace CRUDApplication.Models
          interface IEmployeeRepository
            IEnumerable<EmployeeModel> GetEmployee();
            EmployeeModel GetEmployeeByID(int Emp_ID);
            void InsertEmployee(EmployeeModel emp_Model);
            void DeleteEmployee(int Emp_ID);
            void UpdateEmployee(EmployeeModel emp_Model);
    // EmployeeRepository.cs
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    namespace CRUDApplication.Models
        public class EmployeeRepository : IEmployeeRepository
            private EmployeeDataContext emp_DataContext;
            public EmployeeRepository()
                emp_DataContext = new EmployeeDataContext();
            public IEnumerable<EmployeeModel> GetEmployee()
                IList<EmployeeModel> employeeList = new List<EmployeeModel>();
                var myQuery = from q in emp_DataContext.EmployeeTabs
                              select q;
                var emp = myQuery.ToList();
                foreach (var empData in emp)
                    employeeList.Add(new EmployeeModel()
                        ID = empData.ID,
                        Emp_ID = empData.Emp_ID,
                        Name = empData.Name,
                        Dept = empData.Dept,
                        City = empData.City,
                        State = empData.State,
                        Country = empData.Country,
                        Mobile = empData.Mobile
                return employeeList;
            public void InsertEmployee(EmployeeModel emp_Model)
                var empData = new EmployeeTab()
                    Emp_ID = emp_Model.Emp_ID,
                    Name = emp_Model.Name,
                    Dept = emp_Model.Dept,
                    City = emp_Model.City,
                    State = emp_Model.State,
                    Country = emp_Model.Country,
                    Mobile = emp_Model.Mobile
                emp_DataContext.EmployeeTabs.InsertOnSubmit(empData);
                emp_DataContext.SubmitChanges();
            public void DeleteEmployee(int Emp_ID)
                EmployeeTab employee = emp_DataContext.EmployeeTabs.Where(u => u.ID == Emp_ID).SingleOrDefault();
                emp_DataContext.EmployeeTabs.DeleteOnSubmit(employee);
                emp_DataContext.SubmitChanges();
            public void UpdateEmployee(EmployeeModel emp_Model)
                EmployeeTab EmpData = emp_DataContext.EmployeeTabs.Where(u => u.ID == emp_Model.ID).SingleOrDefault();
                EmpData.Name = emp_Model.Name;
                EmpData.Dept = emp_Model.Dept;
                EmpData.City = emp_Model.City;
                EmpData.State = emp_Model.State;
                EmpData.Country = emp_Model.Country;
                EmpData.Mobile = emp_Model.Mobile;
                emp_DataContext.SubmitChanges();

    You have a ctor on EmployeeController that is public and therefore callable by anyone.  However it accepts an IEmployeeRepository which is not a public type. Therefore it will not compile. You can fix this one of several ways:
    Make IEmployeeRepository public
    IEmployeeRepository is most likely marked as internal so mark the EmployeeController ctor as internal as well.  Chances are this was done for unit testing so if you mark it internal then your unit test project won't find it anymore.  To work around
    that add
    InternalsVisibleTo attribute to your repository assembly as well.  The parameter will be the name of your unit test project.  This allows the unit test project to find the internal ctor.
    Michael Taylor
    http://blogs.msmvps.com/p3net

  • When/How to use - "search" parameter type in parameter like other types.

    We recently upgraded BI Publisher to 10.1.3.4. I saw new parameter type "search" in parameter section, when creating report. whats the use of it? How to use it ? like other parameter type Text, Menu,Hidden, Date.
    I couldn't find any help or release notes on this !
    Thanks
    Ayaps

    I started looking into this parameter type when our drop-down for customer numbers went from 13,000 (manageable) to 45,000 (completely unmanageable).
    I imagine this is supposed to mimic the effects of a "Long List" type LOV in Oracle Applications (as I had inquired about in [this thread|http://forums.oracle.com/forums/thread.jspa?threadID=895521&stqc=true|Large List of Values (LoV) hangs. Is there an equivalent for a long list?]), but performance-wise, "Search" does not seem to be any more efficient that using the "Menu" type LOV. Even with the help of having a partial string with a wildcard to match, the "Search" still takes too long to pull up to be of any use to us.

  • How to use INVOKE function with INT parameter types

    Can you tell me how to use invoke function with int parameter type ?

    Pass the int as an Integer.

  • Return del to vendor- How delivery type determination

    Hi All,
    When i am creating return delivery to vendor in MBRL transaction code with reference to Material document, the system is creating delivery with RLL document type, want to understand how the system is determining RLL document type for 122 movement type vendor return delivery.
    Do we have any assignment for delivery doc.type determination like how we have PO returns delivery.
    Thanks in advance!
    Regards
    Lakshmikanth

    Got the solution from SAP note 359247, we need to do the configuration as suggested in this Note.
    The steps are:
    1. You must add an entry to the domain fixed value for the domain DLVTP: Fixed value RL. Short text: Return delivery to vendor - this is already available in ECC 6
    2. Use transaction SM31 to maintain the view V_156Q_VC. Go to movement type 122 and change the delivery category from OD to
    RL for all entries with movement type 122.
    3. Use transaction SM31 to maintain the view V_156Q_VC. Go to movement type 161 and change the delivery category from OD to
    RL for all entries with movement type 161.
    If we complete setp2, the system will determine RLL delivery type which is correct.
    Regards,
    Lakshmikanth

  • How can I return in a native method a Java type?

    Hi,
    i want to return in the native methode ja Java type java.awt.Dimension!
    How can I do this?
    Java code:--------------------------------------------------------------------------------
    public native java.awt.Dimension getSize()
    generating the JNI header file
    JNI header code:--------------------------------------------------------------------------------
    JNIEXPORT jobject JNICALL Java_Video_getSize(JNIEnv *, jobject)
    my c function looks like this
    code:--------------------------------------------------------------------------------
    JNIEXPORT jobject JNICALL Java_Video_getSize(JNIEnv *env, jobject obj)
    return ???????
    how can I return in C an object like jawa.awt.Dimension?
    Thx
    Ronny

    Here is my 2 cents for a way we pass data between Java and C via the Java Native Interface. This excerpt is an example of passing an int value through a locally created Integer wrapper class, which must be adapted for local use. Note that because of the wrapper, return values are not needed.
    1. Create the Java class file.
    * This class encapsulates a Java <CODE>int</CODE> primitive.
    * This class was created to allow programmers to change
    * the value of an existing integer object without being
    * forced to create a new object (as is the case with the
    * Java Integer object).
    public class LocalInteger
         private int     value;
         * Creates a LocalInteger object and initializes
         * it to <I>0</I> (the default in Java).
         public LocalInteger ()
              super ();
         * Creates a LocalInteger object and initializes
         * it using the given <I>int</I> value.
         * @param i Integer value to use in initializing
         * the object.
         public LocalInteger (int i)
              super ();
              value = i;
         * Gets the value of the object.
         * @return The value of the object.
         public int getValue ()
              return (value);
    2. Create the jni header file.
    DLL_EXTERN void jni_GetValue_from_LocalInteger(int* LocalInteger, JNIEnv *env, jobject thisLocalInteger);
    3. Create the C file.
    /*start of jni header****************************************
    *NAME/TITLE:       jni_GetValue_from_LocalInteger
    *DESCRIPTION:      This routine copies the integer value
    * from the Java LocalInteger object to the
    * C 'int' variable.
    *CALLING SEQUENCE: jni_GetValue_from_LocalInteger (LocalInteger,
    * env,
    * thisLocalInteger)
    *PARAMETERS:
    * Type Name I/O Description
    * int * LocalInteger I/O C variable
    * JNIEnv * env I JNIEnv pointer
    * jobject thisLocalInteger I Java object
    *RETURN:           N/A
    **end of header*********************************************/
    /* ********************** BEGIN CODE ********************** */
    DLL_EXPORT
    void jni_GetValue_from_LocalInteger(int* LocalInteger, JNIEnv *env, jobject thisLocalInteger)
         LocalInteger = (int) (env)->GetIntField(env, thisLocalInteger, LocalInteger_Value);

  • Exch.Rate Type for Determining the Proposed Rate

    Dears,
    I defined, in the document type to be used for Goods Receipt, the field T003-KURST (Exch.Rate Type for Determining the Proposed Rate) equal to u2018Pu2019: exchange rate type used also for standard translation for cost planning.
    Then, I created a Purchase Order using a vendor in foreign currency, and in the header section within tab u2018Delivery/Invoiceu2019 in field "Exchange Rate" I filled in the exchange rate valid at the moment of the Purchase Order creation and I also put the flag in the indicator "Fixing of Exchange Rate".
    Afterwards, I posted  the Goods Receipt against the Purchase Order created at the previous step.
    My expectations were to find in FI accounting:
    - 1 line item for stock increase (transaction BSX) valuated using the exchange rate defined in the document type in field T003-KURST;
    - 1 line item for GR/IR increase (transaction WRX) valuated using the exchange rate defined in the Purchase Order and indicated as fixed;
    - 1 line item for difference (transaction PRD) between stock and GR/IR.
    but when I checked the accounting document, these my expectations were not met, because:
    - the line item for stock increase (transaction BSX) has not been valuated using the exchange rate defined in the document type in field T003-KURST, but a differet exchange rate that I didnu2019t find defined for this couple of currencies;
    - the line for GR/IR increase (transaction WRX) has been valuated as expected using the exchange rate defined in the Purchase Order and indicated as fixed;
    - the line item for difference (transaction PRD) between stock and GR/IR has been created.
    The help (F1) for field T003-KURST, show the following indication:
    Exch.Rate Type for Determining the Proposed Rate
        Rate type under which the proposed rate is defined for foreign currency documents.
    Use
        If no exchange rate is specified in the document header when entering documents in foreign currencies, the system will automatically select a rate from the currency translation rate table.  The system then converts all amounts in the document's line items using this exchange rate.
        The system uses the average rate as a default value as long as no other exchange rate type is entered here.
    Based on this message, my expectation is that all documentu2019s line items have to be converted at the exchange rate type defined in field T003-KURST. And in the case mentioned above, the line for stock (BSX) should be converted at exchange rate type defined in field T003-KURST.
    While, correctly, the line for GR/IR (WRX) has been converted at the exchanged rate fixed in the purchase order.
    Can you please let me know how can be fixed the problem for the line related to the stock allowing the conversion using the exchange rate type defined in field T003-KURST?
    Thanks and Regards,
    Jody

    Hello Jody,
    kindly consider the information contained under the attached note:
    191927 - Posting logic: GR for foreign currency PO.
    As stated in it:
    Postings to the material stock account (BSX):
    In order to be able to determine the value of the stock posting, the
    valuation methods which exist in the material master in local currency
    (standard price, total value of stock) must be converted into document
    currency. This translation is thus carried out on the posting date with
    the exchange rate type that is assigned to the FI document type used,
    that is, independent from the exchange rate defined in the purchase
    order!
    If no exchange rate type is assigned to an FI document type, the system
    uses exchange rate type M.
    Please, check in your system the settings stored in the customizing
    transaction OBF4 for the document type WE (Goods receipt). If the field
    'Exch.Rate Type for foreign currency documents' is empty, the exchange
    rate type M is used.
    The fixed conversion rate in the purchase order refers to the valuation
    approach in the purchase order and, therefore, to the costs for the
    purchased material. Therefore, the posting amount to the GR/IR clearing
    account (WRX) is converted according to the fixed conversion rate in the
    purchase order header.
    On the other side the fixed conversion rate in the purchase order is not
    designed for converting the posting values to the material stock account
    (BSX). This conversion reflects the situation of the valuation of the
    material stock and is therefore designed to be independent of the
    conversion rate defined in the purchase order. This is what note 191927
    outlines.
    In the note 191927 you will also locate relevant information about the
    postings to the KDM key:
    Exchange rate differences (KDM):
    As of Release 4.0A, exchange rate differences (KDM) can be posted to a
    separate account. The exchange rate differences result from the
    difference of the clearing value on the GR/IR clearing account (WRX) in
    document currency that is translated to the current exchange rate stored
    in the system in local currency from the clearing value in local
    currency that is determined with the conversion factor from the purchase
    order or the invoices.
    The offsetting entry for the exchange rate differences is settled with
    the price difference.
    (Price difference = GR/IR amount - stock value - exchange rate
    difference)
    KDM is only posted during the GR if the flag T169P-XPLCU is initial,
    therefore, KDM postings will not occur during incoming invoices.
    This is determined in the IMG path:
    Materials Management
    -> Logistics Invoice Verification
       -> Incoming Invoice
          -> Configure How Exchange Rate Differences Are Treated
    Here, you have the following options per Company Code:
    .- The exchange rate differences will be calculated from the difference
       between the exchange rate at the time of the goods receipt and the
       exchange rate at the time of the invoice receipt.
    .- The exchange rate differences will be calculated from the difference
       between the exchange rate at the time of the invoice receipt and an
       assumed exchange rate that is valid for a specific amount of time,
       such as a year or a season.
    .- No exchange rate differences will be calculated. Instead, differences
       from exchange rate variations will be considered as price differences
       and posted to a price difference account.
    The field T001A-CURDT for the company code will determine which date is
    relevant to calculate the exchange rate difference.
    This is set under the IMG path:
    Financial Accounting
    -> Financial Accounting Global Settings
       -> Company Code
          -> Multiple Currencies
             -> Define Additional Local Currencies
    So, finally, the value for KDM calculates as difference between
    GR/IR amount in local currency - GR/IR amount in foreign
    currency*exchange rate.
    I hope this information can be of help.
    cheers
    ray

  • How many types of transactions in ABAP

    How many types of transactions in ABAP

    Hi,
    Transactions
    The normal way of executing ABAP code in the SAP system is by entering a transaction code. Transactions can be accessed via system-defined or user-specific, role-based menus. They can also be started by entering their transaction code (a mnemonic name of up to 20 characters) in the special command field, which is present in every SAP screen. Transactions can also be invoked programmatically by means of the ABAP statements CALL TRANSACTION and LEAVE TO TRANSACTION. Transaction codes can also be linked to screen elements or menu entries. Selecting such an element will start the transaction. The term "transaction" must not be misunderstood here: in the context just described, a transaction simply means calling and executing an ABAP program. In application programming, "transaction" often refers to an indivisible operation on data, which is either committed as a whole or undone (rolled back) as a whole. This concept exists in SAP but is there called a LUW (Logical Unit of Work). In the course of one transaction (program execution), there can be different LUWs.
    Letu2019s have a look at the different kind of transactions:
    Dialog transaction
    These are the most common kind of transactions. The transaction code of a dialog transaction is linked to a Dynpro of an ABAP program. When the transaction is called, the respective program is loaded and the Dynpro is called. Therefore, a dialog transaction calls a Dynpro sequence rather than a program. Only during the execution of the Dynpro flow logic are the dialog modules of the ABAP program itself are called. The program flow can differ from execution to execution. You can even assign different dialog transaction codes to one program.
    Parameter transaction
    In the definition of a parameter transaction code, a dialog transaction is linked with parameters. When you call a parameter transaction, the input fields of the initial Dynpro screen of the dialog transaction are filled with parameters. The display of the initial screen can be inhibited by specifying all mandatory input fields as parameters of the transaction.
    Variant transaction
    In the definition of a variant transaction code, a dialog transaction is linked with a transaction variant. When a variant transaction is accessed, the dialog transaction is called and executed with the transaction variant. In transaction variants, you can assign default values to the input fields on several Dynpro screens in a transaction, change the attributes of screen elements, and hide entire screens. Transaction variants are maintained in transaction SHD0.
    Report transaction
    A report transaction is the transaction code wrapping for starting the reporting process. The transaction code of a report transaction must be linked with the selection screen of an executable program. When you execute a report transaction, the runtime environment internally executes the ABAP statement SUBMITu2014more to come on that.
    OO transaction
    A new kind of transaction as of release 6.10. The transaction code of an OO transaction is linked with a method of a local or global class. When the transaction is called, the corresponding program is loaded, for instance methods an object of the class is generated and the method is executed.
    Reward Points if found helpfull..
    Cheers,
    Chandra Sekhar.

Maybe you are looking for

  • Can i create a playlist of tv shows on my iPad?

    I have purchased an iPad holder that fits to my headrest so that my little girl can watch programmes whilst I am driving. I have downloaded a number of short programmes and would like to put them into a continuous playlist so that I do not have to st

  • MuVo2 playli

    Hi I have a MuVo 2 and use Mediasource software. When creating playlists (in the usual way following instructions), I end up with a separate folder in my actual player lists that duplicates the playlist title and contents - if I delete it off, the pl

  • Mavericks' finder "tag" vs. Lion's "label"

    Hey all. Can I make Mavericks finder tags look like Lion's finder labels? In Lion's finder, when you apply a "label" to a file (or whatever), in list view, it makes the entire row the color that you've chosen, which is really great for highlighting a

  • RDDEXECL - Syntax error in Context_X_Context_Attributes

    Hi - We are in the process of installing and patching SAP ECC 6.0 on a new sandbox.  The objective is to make this system as "prod like" without the data for patch testing, etc. Installation and patching to support stack 19 has gone without any issue

  • Errror message when downloading Lightroom

    I purchased Lighroom and when I went to download the software I was given an error message "Not Applicable" Has anyone else experienced this? Please advise.