Return Objects by Value/Reference?

Could someone please tell me which of this methods would be faster:
import java.util.ArrayList;
import java.util.List;
public class Test {
    public static final int MAX_ITER = 2000000;
    public static void main(String[] args) {
         long begin, end = 0;
         //Return Object by Value
         begin = System.currentTimeMillis();
         List list1 = returnByValue();
         end = System.currentTimeMillis();
         System.out.println(end - begin);
         //Return Object by reference
         begin = System.currentTimeMillis();
         List list2 = new ArrayList();
         returnByRef(list2);
         end = System.currentTimeMillis();
         System.out.println(end - begin);
    public static List returnByValue() {
         List list = new ArrayList();
         for(int i=0; i<MAX_ITER; i++)
              list.add(new Integer(i));
         return list;
    public static void returnByRef(List list) {
         for(int i=0; i<MAX_ITER; i++)
              list.add(new Integer(i));
}From what I understand, returnByValue would be slower as it involves creating a local List, and then returning it by way of copying itself? But surprisingly, both methods take almost identical times to run. Also, please run each method individually one at a time per run, otherwise for some reason, the second method always takes longer if ran simultaneously. Thanks.

Okay, I thought about that, too, because I thought
that your post did sound a bit sarcastic. Your post was most useful. I think s/he's refering to me.
I don't care about my post count. Maybe next time
I'll help people who are more appreciative of my
information, instead of helping you.Actually, I think s/he's most appreciative of your excellent contribution. I believe I'm the problem.
I think that telling people to believe the evidence in front of them is a good service to provide. You ran a test that told you the two were virtually identical. I gave you another viewpoint that said side effect free functions should be preferred, especially in situations like this one. No post count boosting there. That's good information. You just need to be sharp enough to realize it.
%

Similar Messages

  • Compile error: Returning a local object to a reference variable

    Hi all...
    I just need to know that when I return from a function with a local object to a reference, I am getting a compile error (Error name is "badarglval2"). Actually I'm sure that the error is closely related to Sun Solaris Compiler. According to C++ specs, when I return a local object to a reference, the local object has to survive until the refence variable is destroyed. However it doesn't work as expected with Solaris compiler and I am not allowed referencing a local variable.. Is there anyone who can explain why it works like this?
    Thanks in advance...
    - Volkan
    Edited by: 938646 on 05.Haz.2012 00:46

    Could you illustrate what you mean with a short (but complete) example?
    Just in case: did you try adding a "const"?

  • How to import multi-value reference with Granfeldt PowerShell MA?

    Hi,
    I am trying to import multi-value reference into FIM (Group object).
    I can import all attributes from source SQL, except Multivalue reference (into members attribute on Group object).
    I have defined schema like this:
    $obj = New-Object -Type PSCustomObject
    $obj | Add-Member -Type NoteProperty -Name "Anchor-axs_profid|String" -Value ""
    $obj | Add-Member -Type NoteProperty -Name "objectClass|String" -Value "role"
    $obj | Add-Member -Type NoteProperty -Name "name|String" -Value ""
    $obj | Add-Member -Type NoteProperty -Name "member|Reference[]" -Value ""
    $obj
    On source attribute I have members defined in one attribute, divided by ",". 
    Import script:
    $Obj = @{}
    $Obj.Add("objectClass", "role")
    $Obj.Add("[DN]", "Role_"+$Object.$("axs_profid"))
    $Obj.Add("axs_profid", $Object.$("axs_profid").ToString())
    $Obj.Add("name", $Object.$("name").ToString())
    if($Object.$("member").ToString() -ne "")
    [string[]]$members = $Object.$("member").ToString().Split(',')
    $Obj.Add("member", $members)
    $Obj
    When Full import is triggered, I get following error for roles with multiple users:
    FIM Sync = staging-error
    Event log = 
    The server encountered an unexpected error in the synchronization engine:
     "BAIL: MMS(9588): d:\bt\32669\private\source\miis\shared\utils\libutils.cpp(7045): 0x8023040e (The distinguished name is invalid)
    BAIL: MMS(9588): d:\bt\32669\private\source\miis\server\sqlstore\utils.cpp(229): 0x8023040e (The distinguished name is invalid)
    BAIL: MMS(9588): d:\bt\32669\private\source\miis\server\sqlstore\nscsimp.cpp(5348): 0x8023040e (The distinguished name is invalid)
    BAIL: MMS(9588): d:\bt\32669\private\source\miis\server\sqlstore\nscsimp.cpp(5753): 0x8023040e (The distinguished name is invalid)
    BAIL: MMS(9588): d:\bt\32669\private\source\miis\server\sqlstore\nscsimp.cpp(686): 0x8023040e (The distinguished name is invalid)
    BAIL: MMS(9588): d:\bt\32669\private\source\miis\server\sqlstore\csobj.cpp(12876): 0x8023040e (The distinguished name is invalid)
    BAIL: MMS(9588): d:\bt\32669\private\source\miis\server\sqlstore\csobj.cpp(13976): 0x8023040e (The distinguished name is invalid)
    BAIL: MMS(9588): d:\bt\32669\private\source\miis\server\sqlstore\csobj.h(1252): 0x8023040e (The distinguished name is invalid)
    ERR_: MMS(9588): d:\bt\32669\private\source\miis\server\sync\syncstage.cpp(2018): ERR_: MMS(9588): d:\bt\32669\private\source\miis\server\sync\syncstage.cpp(612): ERR_: MMS(9588): d:\bt\32669\private\source\miis\server\sync\syncstage.cpp(647): Staging failed
    0x8023040e: [21]ERR_: MMS(9588): d:\bt\32669\private\source\miis\server\sync\syncmonitor.cpp(2528): SE: Rollback SQL transaction for: 0x8023040e
    Forefront Identity Manager 4.1.3559.0"
    If I change the script to return only first member:
    $Obj.Add("member", $members[0])
    import is successfull and I can see referenced member in Group.
    I have also tried to specify DN for both users and roles with the same outcome.
    $Obj.Add("[DN]", "Role_"+$Object.$("axs_profid"))
    I am using the latest version of  PSMA: 5.5
    Thanks for your help guys!

    I managed to solve this issue.
    The problem was in string array (I always appended "," at the end of each value). MA then expected another value after the last comma.
    The wrong approach:
    [string[]]$members = $Object.$("member").ToString().Split(',')
    The right approach:
    [string[]]$members = $Object.$("member").ToString().TrimEnd(',').Split(',')

  • How are objects and values passed in rmi?

    how are objects and values passed in rmi?

    In java there are two mwthods of passing aruguments and returning results.
    1) by value
    2) by reference.
    While invoking local methods, java passes primitive types by value and objects by reference.
    However while invoking remote methods both these data types are passed by value. Except for the objects being exported. Reason being two different JVM's are involved and thus memory addresses references of one are meaningles for the other. However "pass by value" for values of type object are implemented as deep copy.

  • Request.getParameter("checkbox") Returns only one value

    Hello Friends,
    I have a very urgent problem on live site. I moved my project from jrun2.3.3 to Jrun 3.1 and I was using multiple select and checkboxes.
    With Jrun3.1 if you select multiple select or multiple checkboxes it returns only one value instead of all the values.
    Any help is hightly appreciated.

    If multiple checkboxes have the same name, when selected and submitted, it will pass all values. But you will need to access those using getParameterValues("checkboxname") not getParameter("checkboxname"). The same goes for select elements.
    Perhaps it was a bug in JRun 2.3.3 that allowed you to reference all parameter values using just the getParameter("xxx") method.

  • How to have custom control in DataGridView display object's value?

    I have a sample project located
    here
    The project has a main form `Form1` where the user can enter customers in a datagridview. The `CustomerType` column is a custom control and when the user clicks the button, a search form `Form2` pops up.
    The search form is populated with a list of type `CustomerType`. The user can select a record by double-clicking on the row, and this object should be set in the custom control. The `DataGridView` should then display the `Description` property but in the background
    each cell should hold the value (ie. the `CustomerType` instance).
    The relevant code is located in the following classes:
    The column class:
    public class DataGridViewCustomerTypeColumn : DataGridViewColumn
    public DataGridViewCustomerTypeColumn()
    : base(new CustomerTypeCell())
    public override DataGridViewCell CellTemplate
    get { return base.CellTemplate; }
    set
    if (value != null && !value.GetType().IsAssignableFrom(typeof(CustomerTypeCell)))
    throw new InvalidCastException("Should be CustomerTypeCell.");
    base.CellTemplate = value;
    The cell class:
    public class CustomerTypeCell : DataGridViewTextBoxCell
    public CustomerTypeCell()
    : base()
    public override void InitializeEditingControl(int rowIndex, object initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)
    base.InitializeEditingControl(rowIndex, initialFormattedValue, dataGridViewCellStyle);
    CustomerTypeSearch ctl = DataGridView.EditingControl as CustomerTypeSearch;
    if (this.Value == null)
    ctl.Value = (CustomerType)this.DefaultNewRowValue;
    else
    ctl.Value = (CustomerType)this.Value;
    public override Type EditType
    get { return typeof(CustomerTypeSearch); }
    public override Type ValueType
    get { return typeof(CustomerType); }
    public override object DefaultNewRowValue
    get { return null; }
    And the custom control:
    public partial class CustomerTypeSearch : UserControl, IDataGridViewEditingControl
    private DataGridView dataGridView;
    private int rowIndex;
    private bool valueChanged = false;
    private CustomerType value;
    public CustomerTypeSearch()
    InitializeComponent();
    public CustomerType Value
    get { return this.value; }
    set
    this.value = value;
    if (value != null)
    textBoxSearch.Text = value.Description;
    else
    textBoxSearch.Clear();
    private void buttonSearch_Click(object sender, EventArgs e)
    Form2 f = new Form2();
    DialogResult dr = f.ShowDialog(this);
    if (dr == DialogResult.OK)
    Value = f.SelectedValue;
    #region IDataGridViewEditingControl implementation
    public object EditingControlFormattedValue
    get
    if (this.value != null)
    return this.value.Description;
    else
    return null;
    set
    if (this.value != null)
    this.value.Description = (string)value;
    public object GetEditingControlFormattedValue(DataGridViewDataErrorContexts context)
    return EditingControlFormattedValue;
    public void ApplyCellStyleToEditingControl(DataGridViewCellStyle dataGridViewCellStyle)
    this.BorderStyle = BorderStyle.None;
    this.Font = dataGridViewCellStyle.Font;
    public int EditingControlRowIndex
    get { return rowIndex; }
    set { rowIndex = value; }
    public bool EditingControlWantsInputKey(Keys key, bool dataGridViewWantsInputKey)
    return false;
    public void PrepareEditingControlForEdit(bool selectAll)
    //No preparation needs to be done
    public bool RepositionEditingControlOnValueChange
    get { return false; }
    public DataGridView EditingControlDataGridView
    get { return dataGridView; }
    set { dataGridView = value; }
    public bool EditingControlValueChanged
    get { return valueChanged; }
    set { valueChanged = value; }
    public Cursor EditingPanelCursor
    get { return base.Cursor; }
    #endregion
    private void CustomerTypeSearch_Resize(object sender, EventArgs e)
    buttonSearch.Left = this.Width - buttonSearch.Width;
    textBoxSearch.Width = buttonSearch.Left;
    However, the `DataGridView` is not displaying the text and it also is not keeping the `CustomerType` value for each cell.
    What am I missing?
    Marketplace: [url=http://tinyurl.com/75gc58b]Itza[/url] - Review: [url=http://tinyurl.com/ctdz422]Itza Update[/url]

    Hello,
    1. To display the text, we need to override the ToString method for CustomerType
    public class CustomerType
    public int Id { get; set; }
    public string Description { get; set; }
    public CustomerType(int id, string description)
    this.Id = id;
    this.Description = description;
    public override string ToString()
    return this.Description.ToString();
    2. To get the cell's value changed, we could pass the cell instance to that editing control and get its value changed with the following way.
    public partial class CustomerTypeSearch : UserControl, IDataGridViewEditingControl
    private DataGridView dataGridView;
    private int rowIndex;
    private bool valueChanged = false;
    private CustomerTypeCell currentCell = null;
    public CustomerTypeCell OwnerCell
    get { return currentCell; }
    set
    currentCell = null;
    currentCell = value;
    public CustomerTypeSearch()
    InitializeComponent();
    private void buttonSearch_Click(object sender, EventArgs e)
    Form2 f = new Form2();
    DialogResult dr = f.ShowDialog(this);
    if (dr == DialogResult.OK)
    currentCell.Value = f.SelectedValue;
    this.textBoxSearch.Text = f.SelectedValue.Description;
    #region IDataGridViewEditingControl implementation
    public object EditingControlFormattedValue
    get
    if (this.currentCell.Value != null)
    return (this.currentCell.Value as CustomerType).Description;
    else
    return null;
    set
    if (this.currentCell != null)
    (this.currentCell.Value as CustomerType).Description = (string)value;
    public object GetEditingControlFormattedValue(DataGridViewDataErrorContexts context)
    return EditingControlFormattedValue;
    public void ApplyCellStyleToEditingControl(DataGridViewCellStyle dataGridViewCellStyle)
    this.BorderStyle = BorderStyle.None;
    this.Font = dataGridViewCellStyle.Font;
    public int EditingControlRowIndex
    get { return rowIndex; }
    set { rowIndex = value; }
    public bool EditingControlWantsInputKey(Keys key, bool dataGridViewWantsInputKey)
    return false;
    public void PrepareEditingControlForEdit(bool selectAll)
    //No preparation needs to be done
    public bool RepositionEditingControlOnValueChange
    get { return false; }
    public DataGridView EditingControlDataGridView
    get { return dataGridView; }
    set { dataGridView = value; }
    public bool EditingControlValueChanged
    get { return valueChanged; }
    set { valueChanged = value; }
    public Cursor EditingPanelCursor
    get { return base.Cursor; }
    #endregion
    private void CustomerTypeSearch_Resize(object sender, EventArgs e)
    buttonSearch.Left = this.Width - buttonSearch.Width;
    textBoxSearch.Width = buttonSearch.Left;
    Cell:
    public class CustomerTypeCell : DataGridViewTextBoxCell
    public CustomerTypeCell()
    : base()
    public override void InitializeEditingControl(int rowIndex, object initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)
    base.InitializeEditingControl(rowIndex, initialFormattedValue, dataGridViewCellStyle);
    CustomerTypeSearch ctl = DataGridView.EditingControl as CustomerTypeSearch;
    ctl.OwnerCell = this;
    public override Type EditType
    get { return typeof(CustomerTypeSearch); }
    public override Type ValueType
    get { return typeof(CustomerType); }
    public override object DefaultNewRowValue
    get { return null; }
    Result:
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Powershell - Help with returning dynamic variable values

    Add-Type -AssemblyName System.Windows.Forms
    $frm1 = New-Object System.Windows.Forms.form
    $frm1.Name = "Hey"
    $flw1 = New-Object System.Windows.Forms.FlowLayoutPanel
    $flw1.flowdirection = 'TopDown'
    $frm1.controls.add($flw1)
    $m = "apple","orange","banana"
    for($i=0;$i -le $m.Length-1;$i++){
    $lb = New-Object System.Windows.Forms.linkLabel
    $lb.text = $m[$i]
    $m[$i] = $null
    $flw1.Controls.Add($lb)
    $lb.add_Click({Write-Host $lb.text})
    $frm1.showdialog()
    Could someone please help me with a method to return the value of the label that was clicked? Or a means to identify which linklabel was clicked. Thank you.

    Hi, jrv-
    Awfully sorry to trouble you. Could you please assist with the solution to this script or a better way to approach this scenario? I need to return the current value of label ($lb) from the form ($frm1), when $btnfrm2 on form ($frm2) is clicked.
    Thank you.
    Add-Type -AssemblyName System.Windows.Forms
    $frm1 = New-Object System.Windows.Forms.form
    $frm1.Name = "Hey"
    $flw1 = New-Object System.Windows.Forms.FlowLayoutPanel
    $flw1.flowdirection = 'TopDown'
    $frm1.controls.add($flw1)
    $m = "apple","orange","banana"
    function frmDisplay{
    $frm2 = New-Object System.Windows.Forms.Form
    $btnfrm2 = New-Object System.Windows.Forms.Button
    #$btnfrm2.Add_Click()
    $btnfrm2.text = 'Click'
    $frm2.Controls.Add($btnfrm2)
    $frm2.Add_Shown({$frm2.Activate()})
    [void] $frm2.ShowDialog()
    for($i=0;$i -le $m.Length-1;$i++){
    $lb = New-Object System.Windows.Forms.linkLabel
    $lb.text = $m[$i]
    $m[$i] = $null
    $flw1.Controls.Add($lb)
    $lb.add_Click({Write-Host $this.text; (frmDisplay)})
    $frm1.showdialog()

  • Remove_column( ) of cl_wd_table not returning back the column reference

    Am using the remove_column( ) of cl_wd_table to remove a particular table column & also get the reference of a the same for inserting at a different position. But the system doesn't return back any value. I tried doing a get_column( ) before doing the remove_column( ) but even that wasn't able to get the reference to that column. I debugged & observed that the system was internally reading an internal table ME->ch_COLUMNS to get the list of columns but this table was empty and so the READ was failing.
    method GET_COLUMN.
      CLEAR the_COLUMN.
      IF index > 0.
       READ TABLE ME->ch_COLUMNS INDEX index INTO the_COLUMN.
      ELSE.
       READ TABLE ME->CH_COLUMNS WITH KEY TABLE_LINE->ID = ID INTO
       THE_COLUMN.
      ENDIF.
    endmethod.
    I had bound the TABLE to a context node based on dictionary structure SCARR & 3 fields CARRNAME, CARRCODE & URL.  Please advise as to why the column references aren't available.
    Uday

    Hi Suman,
    Thanks for the reply.
    In WDDOMODIFYVIEW I have put the below coding:
    method WDDOMODIFYVIEW .
      check first_time = abap_true.
      wd_this->gr_table ?= view->get_element( id = 'TABLE' ).
    endmethod.
    I need to change the table column position when the user clicks on a pushbutton. The attribute context_element is an importing parameter of type if_wd_context_element and have declared gr_table in view attributes as of type CL_WD_TABLE.  The coding is as below:
    method ONACTIONMOVE_DOWN .
      data: old_index type i,
            new_index type i,
            lr_column type ref to cl_wd_table_column.
      old_index = context_element->get_index( ).
      check old_index < 3.
      lr_column = wd_this->gr_table->get_column( index = old_index ).
      wd_this->gr_table->remove_column( index = old_index ).
      new_index = old_index + 1.
      wd_this->gr_table->add_column( the_column  = lr_column
                                     index       = new_index ).
    endmethod.
    By the way I have noticed something else while debugging inside the standard code for get_column( ). The ME->CH_COLUMNS is empty but there is another attribute ME->CH_GROUPED_COLUMNS which has the type ref info for the 3 columns which am displaying in the TABLE. I haven't set anything specific properties for the table either. Any inputs from your side would be very useful.
    Edited by: Uday on Aug 29, 2008 11:09 AM

  • Are there any advantages to using a Data Value Reference for LabVIEW Classes?

    Hi
    I recently came across an example where the developer had used a data value reference for the class cluster in LabVIEW.
    What are the advantages of doing this?
    Doesn't the use of LV objects already avoid the creation of multiple copies of data thereby reducting memory usage?
    Thanks
    AD

    LabVIEW's OOP is implemented as a By Value.  This means, as Tst stated, branches in wires could mean copies in the object.  The DVR is a way to make it By Reference.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How Do I Convert a String that Names an Object to a Reference to the Object

    You get many program-specific object names in the XML that is returned by describeType.  Suppose I find an object that interests me.  What is the best way to convert the String that names the object (e.g. the id of the object) to a reference variable that points to the object? 

    Sure.  I am working on a complex application that involves several ViewStacks, several Accordions, some checkboxes, some radio buttons, some text boxes.  These components are scattered about, but all are children of a base class that is successfully enumerated by
    var classInfo:XML = describeType(vwstk);
    Suppose I write a loop as follows:
     for each (var a:XML in classInfo..accessor){
    Inside that loop I have a series of tests like
    if (a.@type == "mx.controls::CheckBox"{
    Then, I iterate thru all of the children of the base class as in:
    for  
    (var u:Object in vwstk)
    {        if  
    Inside the if I persist the checked/not checked status of the checkbox.
    The tricky part is going from the string a.@name to the Object reference u.  I doubt my proposed method will work.  Do you have a better idea?

  • Percentage pie chart whose query return just one value

    Hi,
    I have a requirement which is to display a pie chart that shows the relative percentage of based on a particular row's values.
    Here the SQL query return just one value to generate the chart, however Apex is creating its own seemingly random value to draw the rest of the chart and dividing the region.
    Is there any way for Apex to take the single value that the query returns as a percentage and generate the chart by calculating the other value to be as (100 - queried value) and split the region in the chart accordingly.
    Of course one method is to store both the value that the query returns as well as 100 - that value in a table and then write the query in the chart that references both these values.. but I'd like to know if there is a way to go about it without storing this extra bit of information in a table
    Thanks!

    you create a hidden page item and populate with total value and percentile calculated value and use it in dial chart as querry.

  • Generated WS client is unable to unmarshal returned object array

    Hello,
    I have created web service using Sun jaxws implementation. Several methods of this ws return object array (CustomObj []). When I generate the client (using jaxws-maven-plugin - wsimport) and call these methods I always get
    empty array. I get no errors or warnings. When I generate axis client all works as expected. I think that this issue is related to jaxb but i have tried to switch between several versions ant this didn't help. CustomObj is very simple object with two attributes name and value...
    Thanks for hints...

    Hi Shepy,
    I think mapping an array of objects as response in WSDL messages is somewhat of an issue.
    Instead try moving this array of object into another XSD if i assume you are using XSDs and then make sure that response XSD holds and array of your objects.
    Regards,
    Anand

  • Objects-by-value

    Hi all,
    I am using WLS 5.1/Visibroker 4.0 for C++ and I have the following
    questions:
    The RMI-IIOP example in WLS 5.1 worked, but it is not shown how objects
    are passed over the wire. Is there example code which does more than say
    "Hello World"?
    How I can access an ejb from C++ by RMI-IIOP?
    And how can I pass Objects-by-value?
    What are the parameters I have the rmic-compiler to call with?
    Any help will be greatly appreciated!
    Ralf

    Eduardo Ceballos wrote:
    It's not easy to do, due to the specification, and as a result we are working on improvements.
    For the moment....
    There are no additional examples. New examples will accompany the 5.1.1 release, due shortly. If anything useful becomes available before the end of the month, I will post it to this list.
    Objects are marshaled per the spec, but there is the trouble: the spec requires that the transitive closure of the types for any given object be described in the idl for the value type. So, a simple object, 'public class Foo extends java.lang.Object {}', is straight forward in that you must
    implement the one value type in C++, but an ejb home is another matter: the home drags in 100+ value types, which you must implement for the C++ compiler of your choice.
    To access an ejb from C++ I recommend the following:
    -- create a home such that it defines a finder that returns an instance of the bean's remote interface.
    -- define the bean's remote interface such that useful methods use only primitive types, strings and remote interfaces.
    -- generate the idl from ejbc/rmic... call either code generator with the -idl command parameter
    -- remove all the value types (or carefully select the value types you will need) from the idl files corresponding to the home and remote interfaces.
    -- generate the C++ code from the idl
    The step where you trim away the value types is so that you can make the effort to link the C++ code manageable.
    Hope this helps.
    [email protected] wrote:
    Hi all,
    I am using WLS 5.1/Visibroker 4.0 for C++ and I have the following
    questions:
    The RMI-IIOP example in WLS 5.1 worked, but it is not shown how objects
    are passed over the wire. Is there example code which does more than say
    "Hello World"?
    How I can access an ejb from C++ by RMI-IIOP?
    And how can I pass Objects-by-value?
    What are the parameters I have the rmic-compiler to call with?
    Any help will be greatly appreciated!
    Ralf
    Eduardo -
    Could you clarify -
    When you state:
    ...define the bean's remote interface such that useful methods use only primitive types, strings and remote interfaces.
    what do you mean by the last two words: "remote interfaces"? Do you mean "objects that implement the java.rmi.Remote interface"?
    Mike Rabe - Nortel Networks Tel: (w) 613-763-3874 ESN: 393-3874
    INM Arch Prototyping - 1A06 (h) 613-823-4385 [email protected]
    The relationship of an OO program's run time structure to its code structure
    can be comparable to that of the dynamism of living ecosystems vs. the static
    taxonomy of plant and animals... (ref.) Erich Gamma et al. - Design Patterns

  • How to Restrict Return Sales Order with reference to a cancelled invoice

    SAP Standard is allowing to create Return Sales Order with reference to a cancelled invoice which practically should not be allowed.
    Has any body worked on this problem and what could be the possible solutions so that return sales orders can not be created against a cancelled invoice.
    Kindly share your possible solutions.

    Hi Standard Process will not allow to create a Sales Order With Cancelled invoice,
    Kindly go through at Copy Controls
    T.CODE:VTAF
    in that some body might have maintained between S1 invoice to RE Sales Document.
    Remove the settings then u will be not able to create Sales Order w.r.t to Cancelled Document.
    Rewards if Usefull
    B.Shyam Sunder
    SAP SD Consultant

  • Error: Expression must not return a multiline value

    Hi all,
    I am doing a file to file scenario. My input file has more than one record. I have to validate for each of these records and send back the erroneous records in a file to the source folder.
    I am using BPM for this. In my BPM, i have some multiline container elements. When i try to activate my BPM, i am getting an error saying: <b>Expression must not return a multiline value.</b>
    Can anybody tell me why this error is coming? Also i want to know what type of mapping i have to do to split my source file.
    Regards,
    Divija.

    "Can anybody tell me why this error is coming? Also i want to know what type of mapping i have to do to split my source file."
    Go through the following blogs which give step-bystep approach for split mapping using BPM:-
    1. /people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure
    2. /people/narendra.jain/blog/2005/12/30/various-multi-mappings-and-optimizing-their-implementation-in-integration-processes-bpm-in-xi
    Also, you might want to look at this, where a BPM is not required..i think you can avoid a BPM altogether if you have very little validation..
    /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible
    Regards,
    Sushumna

Maybe you are looking for