How to get an exception when casting a generic collection?

Hi,
I have a bit of code that looks more or less like this:import java.util.ArrayList;
import java.util.Collection;
public class CollectionTest {
     public static void main (String[] args) {
          try {
               get (Float.class);
          } catch (ClassCastException e) {
               System.err.println ("Oops");
               e.printStackTrace (System.err);
          try {
               Collection<Short> shorts = get (Short.class);
               for (Short s : shorts) {
                    System.out.println (s);
          } catch (ClassCastException e) {
               System.err.println ("Oops");
               e.printStackTrace (System.err);
          try {
               Collection<Number> numbers = get (Number.class);
               for (Number number : numbers) {
                    System.out.println (number);
          } catch (ClassCastException e) {
               System.out.println ("Oops again");
               e.printStackTrace (System.err);
     public static <T> Collection<T> get (Class<T> clazz) {
          Collection<T> ret = new ArrayList<T> ();
          if (clazz == String.class) {
               ret.add (clazz.cast ("Test"));
          } else if (clazz == Integer.class) {
               ret.add (clazz.cast (Integer.valueOf (1)));
          } else if (clazz == Double.class) {
               ret.add (clazz.cast (Double.valueOf (1.0)));
          } else if (clazz == Float.class) {
               ret.add (clazz.cast ("Bug")); // Bug here, blatent
          } else if (clazz == Short.class) {
               ret.add ((T) "Bug"); // Bug here, latent
          } else if (clazz == Number.class) {
               ret.addAll (get (Integer.class));
               ret.addAll (get (Double.class));
               ret.addAll (get (String.class)); // Another bug here, latent
          return ret;
}Obviously this doesn't compile as-is, I have to add 3 casts towards the end. Then when I add the casts and run the program I discover I have several bugs, some of which are fail-early and some of which lie hidden until the further away from the bug Since I have the type-token, I use it to check the simple cast, but is there any way I can get a failure more or less at the point where the dodgy Collection cast is made?

OK, sorry not to be clear. My example code is meant to crash on the erroneous casts - clearly a String cannot be cast to a Float, nor a Short. My point is that in one case the code crashes at the point where the cast is made and in another case the code crashes later on. What I want to achieve is this early failure in case of buggy code. Here is a shorter example:import java.util.ArrayList;
import java.util.Collection;
public class CollectionTest {     
     public static <T> Collection<T> get (Class<T> clazz) {
          Collection<T> ret = new ArrayList<T> ();
          if (clazz == String.class) {
               ret.add (clazz.cast ("Test"));
          } else if (clazz == Integer.class) {
               ret.add (clazz.cast (Integer.valueOf (1)));
          } else if (clazz == Double.class) {
               ret.add (clazz.cast (Double.valueOf (1.0)));
          } else if (clazz == Number.class) {
               ret.addAll ((Collection<? extends T>) get (Integer.class));
               ret.addAll ((Collection<? extends T>) get (Double.class));
                // This is a bug, but how can I get an exception at this point?
               ret.addAll ((Collection<? extends T>) get (String.class));
          return ret;
}If I mistakenly write this code it will compile (with the addition of the appropriate casts). However, my code is buggy and will fail when the user of the collection receives a String when he is expecting a Number. My question is, how can I get my code to fail where I make the erroneous cast? If you look at the code I originally posted I have two casts of the String "Bug", one of which is done by (T) and the other is clazz.cast. The first example fails late and the second fails early - it is this early failure that I would like to achieve, in the case of buggy code, in my example above.
Am I making sense yet?

Similar Messages

  • Xml: how to get node value when pasing node name as a parameter

    Hi,
    I've got some xml:
    var xmlData:XML =
    <1stNode>
        <buttonID>first child node value</buttonID>
        <imageID>second child node value</imageID>
        <labelID>third child node value</labelID>
    </1stNode>
    Then I want to read specific node value based on a value passed to a function. .
    var buttonID = new Button;
    var imageID = new Image;
    var labelID = new Label;
    getNodeValue(buttonID); //the value here is set dynamically
    private function getNodeValue (nodeName:String):void {
    trace (xmlData.nodeName)                      //doesn't work
    var str:String = "xmlData." + nodeName;
    var xml:XMLList = str as XMLList             //doesn't work
    I'm don't know how to get the value when node name is dynamically changed.

    use:
    getNodeValue(buttonID); //the value here is set dynamically
    private function getNodeValue (nodeName:String):void {
    trace (xmlData[nodeName])                    

  • How to get the path when i select a directory or a file in a JTree

    How to get the path when i select a directory or a file in a JTree

    import java.lang.*;
    import java.io.*;
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.awt.HeadlessException;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.Iterator;
    * @author Frederic FOURGEOT
    * @version 1.0
    public class JTreeFolder extends JPanel {
    protected DefaultMutableTreeNode racine;
    JTree tree;
    protected JScrollPane scrollpane;
    final static int MAX_LEVEL = 1; // niveau max de descente "direct" dans l'arborescence
    * Sous-classe FSNode
    * @author Frederic FOURGEOT
    * @version 1.0
    private class FSNode extends DefaultMutableTreeNode {
    File file; // contient le fichier li� au noeud
    * Constructeur non visible
    private FSNode() {
    super();
    * Constructeur par initialisation
    * @param userObject Object
    FSNode(Object userObject) {
    super(userObject);
    * Constructeur par initialisation
    * @param userObject Object
    * @param newFile File
    FSNode(Object userObject, File newFile) {
    super(userObject);
    file = newFile;
    * Definit le fichier lie au noeud
    * @param newFile File
    public void setFile(File newFile) {
    file = newFile;
    * Renvoi le fichier lie au noeud
    * @return File
    public File getFile() {
    return file;
    public JTree getJTree(){
         return tree ;
    * Constructeur
    * @throws HeadlessException
    public JTreeFolder() throws HeadlessException {
    File[] drive;
    tree = new JTree();
    // cr�ation du noeud sup�rieur
    racine = new DefaultMutableTreeNode("Poste de travail");
    // cr�ation d'un noeud pour chaque lecteur
    drive = File.listRoots();
    for (int i = 0 ; i < drive.length ; i++) {
    FSNode node = new FSNode(drive, drive[i]);
    addFolder(drive[i], node); // on descend dans l'arborescence du lecteur jusqu'� MAX_LEVEL
    racine.add(node);
    // Gestion d'evenement sur JTree (on �coute les evenements TreeExpansion)
    tree.addTreeExpansionListener(new TreeExpansionListener() {
    public void treeExpanded(TreeExpansionEvent e) {
    // lorsqu'un noeud est ouvert
    // on descend dans l'arborescence du noeud jusqu'� MAX_LEVEL
    TreePath path = e.getPath();
    FSNode node = (FSNode)path.getLastPathComponent();
    addFolder(node);
    ((DefaultTreeModel)tree.getModel()).reload(node); // on recharche uniquement le noeud
    public void treeCollapsed(TreeExpansionEvent e) {
    // lorsqu'un noeud est referm�
    //RIEN
    // alimentation du JTree
    DefaultTreeModel model = new DefaultTreeModel(racine);
    tree.setModel(model);
         setLayout(null);
    // ajout du JTree au formulaire
    tree.setBounds(0, 0, 240, 290);
    scrollpane = new JScrollPane(tree);
         add(scrollpane);
         scrollpane.setBounds(0, 0, 240, 290);
    * Recuperation des sous-elements d'un repertoire
    * @param driveOrDir
    * @param node
    public void addFolder(File driveOrDir, DefaultMutableTreeNode node) {
    setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
    addFolder(driveOrDir, node, 0);
    setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
    * Recuperation des sous-elements d'un repertoire
    * (avec niveau pour r�cursivit� et arr�t sur MAX_LEVEL)
    * @param driveOrDir File
    * @param node DefaultMutableTreeNode
    * @param level int
    private void addFolder(File driveOrDir, DefaultMutableTreeNode node, int level) {
    File[] fileList;
    fileList = driveOrDir.listFiles();
    if (fileList != null) {
    sortFiles(fileList); // on tri les elements
    // on ne cherche pas plus loin que le niveau maximal d�finit
    if (level > MAX_LEVEL - 1) {return;}
    // pour chaque �l�ment
    try {
    for (int i = 0; i < fileList.length; i++) {
    // en fonction du type d'�l�ment
    if (fileList[i].isDirectory()) {
    // si c'est un r�pertoire on cr�� un nouveau noeud
    FSNode dir = new FSNode(fileList[i].getName(), fileList[i]);
    node.add(dir);
    // on recherche les �l�ments (r�cursivit�)
    addFolder(fileList[i], dir, ++level);
    if (fileList[i].isFile()) {
    // si c'est un fichier on ajoute l'�l�ment au noeud
    node.add(new FSNode(fileList[i].getName(), fileList[i]));
    catch (NullPointerException e) {
    // rien
    * Recuperation des sous-elements d'un noeud
    * @param node
    public void addFolder(FSNode node) {
    setCursor(new Cursor(3)); // WAIT_CURSOR est DEPRECATED
    for (int i = 0 ; i < node.getChildCount() ; i++) {
    addFolder(((FSNode)node.getChildAt(i)).getFile(), (FSNode)node.getChildAt(i));
    setCursor(new Cursor(0)); // DEFAULT_CURSOR est DEPRECATED
    * Tri une liste de fichier
    * @param listFile
    public void sortFiles(File[] listFile) {
    triRapide(listFile, 0, listFile.length - 1);
    * QuickSort : Partition
    * @param listFile
    * @param deb
    * @param fin
    * @return
    private int partition(File[] listFile, int deb, int fin) {
    int compt = deb;
    File pivot = listFile[deb];
    int i = deb - 1;
    int j = fin + 1;
    while (true) {
    do {
    j--;
    } while (listFile[j].getName().compareToIgnoreCase(pivot.getName()) > 0);
    do {
    i++;
    } while (listFile[i].getName().compareToIgnoreCase(pivot.getName()) < 0);
    if (i < j) {
    echanger(listFile, i, j);
    } else {
    return j;
    * Tri rapide : quick sort
    * @param listFile
    * @param deb
    * @param fin
    private void triRapide(File[] listFile, int deb, int fin) {
    if (deb < fin) {
    int positionPivot = partition(listFile, deb, fin);
    triRapide(listFile, deb, positionPivot);
    triRapide(listFile, positionPivot + 1, fin);
    * QuickSort : echanger
    * @param listFile
    * @param posa
    * @param posb
    private void echanger(File[] listFile, int posa, int posb) {
    File tmpFile = listFile[posa];
    listFile[posa] = listFile[posb];
    listFile[posb] = tmpFile;

  • I cannot see my Iphone 4 in my device window in the finder anymore.  It use to appear so I could copy the camera pictures off of it and transfer them to other folders.  Does anyone have and idea how to get it back when you plug it in initially.  Thanks

    I cannot see my Iphone 4 in my device window in the finder anymore.  It use to appear so I could copy the camera pictures off of it and transfer them to other folders.  Does anyone have and idea how to get it back when you plug it in initially.  Thanks

    You will want to open iPhoto, go to the iPhoto menu and select Preferences. Under the General tab, next to Connecting camera opens: select iPhoto. Close the preferences and quit iPhoto. Reconnect your iPhone 4. iPhoto should open automatically and offer to import your pictures. Import them and then do what you want with them.
    Best of luck.

  • How to get a confirmation when your email is delivered or read  ?

    With Mail app ,How to get a confirmation when your email is delivered or read?

    When I send mail with Mail app , there is flying letter pops up. But now I could not see anymore. Do you know how can I active that animation ?
    Thanks for your help

  • How to get the tab when is it pressed?

    I have the following situation:
    I have an array of JTextField inside a scroollpane. The size of my array is nine or ten depends on some rules. But my window show just four JTextField. So I would like to know how to get the event when I press "tab", just to show the others JTextField while I'm pressing "tab". Because I need this event to scrooll down or scrooll up.
    I tried the keylistener, but when I press "tab" any method(keypressed, keyreleased, keytyped) is called.
    I also tried the focuslistener. If this event I could scrooll down or scrooll up, but I couldn't do both!!
    Can somebody help me??
    Thanks anyway!!
    Gin

    JTextField implements Scrollable interface, which provides information to the enclosing container such as JScrollPane.
    Hence when the tab event is fired, you can compute the Rectangle area that should be visible and then call the 'scrollRectToVisible()' method in JTextField. This will inform the JScrollPane to scroll to the rectangle that you mention.
    HTH

  • How to get an email when data got inserted

    Hi All,
    Could you please let me know how to get an email when data got inserted into table by using sql/plsql
    Thanks in adavance

    Could you please let me know how to get an email when data got inserted into table by using sql/plsql
    Well that seems pretty straightforward - write some pl/sql to send you an email when that pl/sql inserts data into a table.
    See this Oracle-base article for an example of sending mail.
    http://www.oracle-base.com/articles/misc/email-from-oracle-plsql.php
    Post what you have tried so far. What part of what you have tried doesn't seem to be working?

  • How to Get checkbox value when List value changed in classic report

    hi ,
    i worked with apex 4.2 and i create normal classic report with one checkbox column and one column change it to select list(named loved) now i want when user change list
    take value of checkbox item and show it in message .
    SQL for report
    SELECT
    '<INPUT TYPE="checkbox" NAME="f01" VALUE="'
    ||SEQ
    ||'">' SEQ,
    ID,
    DEPT_NO,
    EMP_NAME} i change the column attributes of Dept_NO to Display as Select list of department name (named lov).
    now i want when user change name of department the value of SEQ SHOW IN ALERT MESSAGE
    i create JavaScript on the page
    function test(pThis) {
    var f01_value = $('select[name="f01"]').value;
    alert('#SEQ : '+ f01_value);
    </script>
    I call this javascript function when list change but the value undefined..
    My Question :
    How can get this value Or any value of item in reports
    regards
    Ahmed

    Hi Ahmed,
    >
    i worked with apex 4.2 and i create normal classic report with one checkbox column and one column change it to select list(named loved) now i want when user change list
    take value of checkbox item and show it in message .
    SQL for report
    SELECT
    '<INPUT TYPE="checkbox" NAME="f01" VALUE="'
    ||SEQ
    ||'">' SEQ,
    ID,
    DEPT_NO,
    EMP_NAME} i change the column attributes of Dept_NO to Display as Select list of department name (named lov).
    >
    You should not create checkboxes like this. Either use the APEX_ITEM.CHECKBOX2 API or change the Column Type to Simple Checkbox.
    >
    now i want when user change name of department the value of SEQ SHOW IN ALERT MESSAGE
    i create JavaScript on the page
    function test(pThis) {
    var f01_value = $('select[name="f01"]').value;
    alert('#SEQ : '+ f01_value);
    </script>
    >
    name="f01" returns an array, what you need is single element value.
    Try
    <script type="text/javascript>
    function test(pThis) {
      var f01_value = $v(pThis);
       alert('#SEQ : '+ f01_value);
    </script>
    {code}
    {quote}
    I call this javascript function when list change but the value undefined..
    My Question :
    How can get this value Or any value of item in reports
    {quote}
    Depends in how you are invoking/triggering the change event. Are you using DA or have you written an "onchange" event on the element?
    Cheers,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to get swoosh sound when mail gets sent

    How to get the swoosh sound back when mail gets sent?

    I'm talking about my iMac desktop. I have OSX 10.9.5. I used to hear the swoosh sound when I sent an e-mail. Suddenly it's gone, and I can't find out how to get it back. I miss it!

  • How to get exact match when working with Oracle Text?

    Hi,
    I'm running Oracle9i Database R2.
    I would like to know how do I get exact match when working with Oracle Text.
    DROP TABLE T_TEST_1;
    CREATE TABLE T_TEST_1 (text VARCHAR2(30));
    INSERT INTO T_TEST_1 VALUES('Management');
    INSERT INTO T_TEST_1 VALUES('Busines Management Practice');
    INSERT INTO T_TEST_1 VALUES('Human Resource Management');
    COMMIT;
    DROP INDEX T_TEST_1;
    CREATE INDEX T_TEST_1_IDX ON T_TEST_1(text) INDEXTYPE IS CTXSYS.CONTEXT;
    SELECT * FROM T_TEST_1 WHERE CONTAINS(text, 'Management')>0;
    The above query will return 3 rows. How do I make Oracle Text to return me only the first row - which is exact match because sometimes my users need to look for exact match term.
    Please advise.
    Regards,
    Jap.

    But I would like to utilize the Oracle Text index. Don't know your db version, but if you slightly redefine your index you can achieve this (at least on my 11g instance) :
    SQL> create table t_test_1 (text varchar2(30))
      2  /
    Table created.
    SQL> insert into t_test_1 values ('Management')
      2  /
    1 row created.
    SQL> insert into t_test_1 values ('Busines Management Practice')
      2  /
    1 row created.
    SQL> insert into t_test_1 values ('Human Resource Management')
      2  /
    1 row created.
    SQL>
    SQL> create index t_test_1_idx on t_test_1(text) indextype is ctxsys.context filter by text
      2  /
    Index created.
    SQL> set autotrace on explain
    SQL>
    SQL> select text, score (1)
      2    from t_test_1
      3   where contains (text, 'Management and sdata(text="Management")', 1) > 0
      4  /
    TEXT                             SCORE(1)
    Management                              3
    Execution Plan
    Plan hash value: 4163886076
    | Id  | Operation                   | Name         | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |              |     1 |    29 |     4   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T_TEST_1     |     1 |    29 |     4   (0)| 00:00:01 |
    |*  2 |   DOMAIN INDEX              | T_TEST_1_IDX |       |       |     4   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("CTXSYS"."CONTAINS"("TEXT",'Management and
                  sdata(text="Management")',1)>0)
    Note
       - dynamic sampling used for this statementJust read that you indeed mentioned your db version in your first post.
    Not sure though if above method is already available in 9i ...
    Message was edited by:
    michaels

  • Can't get all how to get album artwork when all help options didn't work

    help - how do I get album artwork when all itunes help options didn't work

    Other is usually around 1 GB...
    A  ' Large Other ' usually indicates Corrupt Data...
    First Try a Restore from Backup... But... if the Large Other Persists, that is an Indicator of Corrupt Data in the Backup... Then a Restore as New is the way to go...
    Details Here  >  http://support.apple.com/kb/HT1414
    More Info about ‘Other’ in this Discussion
    https://discussions.apple.com/message/19958116

  • [SOLVED]How to get colorful output when pipe yaourt's STDIO to less?

    Hello, second post to NC.
    My question is how to get a piped(e.g. pipe yaourt's STDOUT to less) program's colorful output on screen without such option like '--color=always'.
    Before post this, I've configured less's default behaviour in "~/.zshrc" with following
    less() {
    env LESS=R less "$@"
    And When I run:
    $ dmesg --color=always | less
    Everything works fine(I get good, colorful output), but when I run this:
    $ yaourt -Qe --date | less
    Seems that I can only get grey output on terminal emulator (without 'less' I get colorful output).
    Does anyone has idea about getting yaourt's colorful output with 'less' ?
    Last edited by izmntuk (2014-06-08 00:15:15)

    Thanks for reply and after serveral mintues googling & getting some help from IRC:
    It seems that there're some utilities that do not provide such a option like 'color=always', what we need to do is trick these utilities into thinking their's STDIO is to a tty, not a pipe.
    1. stdoutisatty way (aur/stdoutisatty-git is needed) from [0]:
    $ stdoutisatty yaourt -Qe --date | less
    2. socat way (extra/socat is needed, sometimes doesn't work fine) from [1]:
    $ socat EXEC:"yaourt -Qe --date",pty STDIO | less
    3. script way (sometimes doesn't work fine) from [2]:
    $ script -fqc 'yaourt -Qe --date' | less
    4. unbuffer way (extra/expect is needed) from [3]:
    $ unbuffer yaourt -Qe --date | less
    5. zpty way (extra/zsh is needed) slightly modified from [4]:
    zmodload zsh/zpty
    autoload colors && colors
    pty() {
    local VERSION=0.2
    if [[ -t 0 && $# -ne 0 && ${1} != '--help' ]];then
    zpty pty-${UID} ${1+"$@"}
    ## when piping function pty to a pager, it may be a good idea to disable ^C *in this function*. assume that you're going to run this command: pty ls -alRi --color | less
    ## and now you enter a pager, and you press the End key by accident, and the pager seems stuck, and to get unstuck you pressed ^C, then the entire function interrupted. so to avoid the interrupt:
    if [[ ! -t 1 ]];then
    setopt local_traps
    trap '' INT
    zpty -r pty-${UID}
    else
    zpty -r pty-${UID}
    fi
    zpty -d pty-${UID}
    elif [[ $# -eq 1 && ${1} == '--version' ]];then
    print "pty v${VERSION}"
    else
    _-automatic-colored
    print "${bldblu}Usage: ${bldgrn}pty${rst} ${bldcyn}command${rst} [${bldcyn}argv${rst}...]
    wrapper function to run a program under pseudo-terminal
    ${bldcyn}--help${rst} print help message
    ${bldcyn}--version${rst} print version"
    fi
    ptypg() {
    if [[ -t 0 && $# -ne 0 && ${1} != '--help' ]];then
    pty $@ | pg
    else
    _-automatic-colored
    print "${bldblu}Usage: ${bldgrn}ptypg${rst} ${bldcyn}command${rst} [${bldcyn}argv${rst}...]
    wrapper function to run a program under pseudo-terminal and view its output in pg
    ${bldcyn}--help${rst} print help message"
    fi
    _-automatic-colored() {
    if [[ "${1}" == unset || ! -t 1 ]];then
    unset rst bld bldwht bldblk bldred bldgrn bldylw bldblu bldcyn blk red grn ylw blu cyn gry
    return 0
    elif [[ -t 1 ]];then
    rst="${reset_color}"
    bld="${fg_bold[default]}"
    bldwht="${fg_bold[white]}"
    bldblk="$fg_bold[black]"
    bldred="$fg_bold[red]"
    bldgrn="$fg_bold[green]"
    bldylw="$fg_bold[yellow]"
    bldblu="$fg_bold[blue]"
    bldcyn="$fg_bold[cyan]"
    gry="${fg[white]}"
    blk="$fg[black]"
    red="$fg[red]"
    grn="$fg[green]"
    ylw="$fg[yellow]"
    blu="$fg[blue]"
    cyn="$fg[cyan]"
    return 0
    fi
    $ pty yaourt -Qe --date | less
    $ ptypg yaourt -Qe --date
    And if there are any better implementation please leave a comment add it to wiki .
    Last edited by izmntuk (2014-08-19 14:18:45)

  • How to get JCORBA exception object message

    Hi I have this problem
    say:
    I have a JCORBA server and
    a method that throws an exception "A"
    I build the client program
    inside the client program I want to know
    if an exception "A" raised how to get the
    message inside "A"
    I have tried this
    ExceptionA extends Exception
    ExceptionA() super()
    ExceptionA(String msg) super(msg)
    In my client program i have
    catch(Exception A)
    System.out.println(A.getMessage());
    but this method does not seem to work
    because it will return java.lang.methodnotfoundexception
    it seems to complain that ExceptionA(String )
    not found
    thanks for your help
    null

    Hi,
    BAPIs that can create, change or delete instances of a business object type
    The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.
    Create( ) and CreateFromData( )
    The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.
    Change( )
    The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.
    Delete( ) and Undelete( )
    The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.
    The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.
    Cancel ( )
    Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.
    Add<subobject> ( ) and Remove<subobject> ( )
    The BAPI Add<subobject> adds a subobject to an existing object instance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.
    Reward if helpful.
    Regards,
    Harini.S

  • How to get the Details when we checked with check box?

    Hi....
    I want to display all the records of perticular checked vendor_id's. n for this checking I want to display series of checkbox along with vendor_id's. could U please give me the code for this.

    actually I'm not getting the logic how to get the vendor_id's which are checked in checkbox...... infact I'm not familier with checkbox properties also.....
    i can able to display series of checkboxs along with vendor_ids . but when I clicked perticualar checkboxes which vendor_id's I wanted. how can display only these checked vendor_id's records. ???? Can U help me????

  • How to get the filename when parsing a file with d3l

    All
    After some time have experience with interconnect, IStudio I need the following info. Is it possible to get the filename when parsing a flat file using a d3l? This is needed because we need to store the filename together with the data into the database.
    Any examples or directions to some documents are welcome.
    Regards
    Olivier De Groef

    has anyone some info on this

Maybe you are looking for