Use of BADI's instead of in-line modifications

Hi!
In using SAP packages, we do some customizations to cope with the requirements right? I was asked to do some modifications, and they asked me to use BADIs instead of in-line modification. Can we put evrything under BADIs? The changes were quite big and additonal data needs to be retrieved and processed which is not part of the standard code. Also, we do not have BADI's under the BSP right? Can somebody give me an idea on this?
Thanks!

The key to using a BADI is that SAP would have had to place a BADI definition in the correct location within the Application you want to modify.  Certainly not every single application has a BADI definition within it.  You need to study the particual application you need to modify to see if a BADI definition is present.
If there is BADI, there is quite a bit of processing that can be done within the BADI.  Basicually you inherit from an SAP class for your BADI implementation.  You have the ability to add more methods to your class, so you can built quite a bit of logic there.
Off the top of my head, I don't know if any of SAP's delivered BSP applications have BADI definitions within them.  There is nothing technically stopping an application class, controller, or model class from having a BADI definition.
If you are on Netweaver 04S, you might also consider looking at the enhancement framework. This allows safe modifications to be made directly to certain enhancement points within standard SAP applications.

Similar Messages

  • Using MD42 purchase requisitions creating instead of schedule lines

    Hi PP Guru's
    Can any one help while using MD42/MD43 purchase requisitions generating instead of schedule lines.
    MRP Type :M0
    what are the required settings for this..?
    please help me to solve this issue.

    Hello
    This is a link to a note and you need to have access to SAP service marketplace.
    Please ask your system admin/basis and he will be able to provide you an user.
    The following information from the note should be relevant for you:
    If the flag "SC Vendor" is checked on the scheduling agreement, this source list entry will only be considered on a third-party order processing scenario with MRP areas.
    If you are not using MRP areas, this source list entry will not be considered and the vendor/schedule agreement will not be selected. This setting can be found on transaction ME32, on the menu path "ITEM" - "MORE FUNCTIONS" - "DELIVERY ADDRESS". See note 214298 for more details.
    BR
    Caetano

  • ECATT: Bad Message Handling in VL02N (Line Deletion)

    Hello All,
    I'm having a big headache with the following automation scenario on VL02N transaction:
    - open a DN number
    - use position button to trigger screen where u can select a line
    - enter a line (script parameter)
    - validate the line
    - use the delete button to delete selected line
    - confirm the deletion message
    - save and exit
    I recorded the whole good case in one step of SAPGUI.
    Problem is:
    A)without catching any message, if line does not exist (ex line is 20 and 20 is already deleted),
    the script raise no error BUT erases the first line in the screen (ie the lowest remaining one)
    B) the proper error msg ("Line does not exists") is only triggered when i enter the next interface of the screen but this interface do the deletion of the lowest line!!
    so either:
    - i don't put the deletion interface in the MSG block and the message is not raised
    - i put the deleting interface in the MSG block , the message is raised but too late.
    Do i handle the message badly?
    Is there a way to split the deletion interface to have separately the error detection and the deletion?
    See code below
    VL02N_111_STEP_1 = choice of line to position on
    VL02N_1000_STEP_2 = deletion of selected line
    MESSAGE ( VERIF_LINE_EXISTS ).
        SAPGUI ( VL02N_111_STEP_1 ).  <= this is the dialog where i select the line and get the error msg in record time
    ENDMESSAGE ( E_VERIF_LINE_EXISTS ).
    DO &TFILL.
        IF ( VERIF_LINE_EXISTS[&LPC]-MSGID = 'VL' ).
            IF ( VERIF_LINE_EXISTS[&LPC]-MSGNR = 341 ).
                LOG ( VERIF_LINE_EXISTS[&LPC]-MSGV1 ).
                LOG ( VERIF_LINE_EXISTS[&LPC]-MSGV2 ).
                SAPGUI ( VL02N_10_1).  <= exiting without deleting anything
                SAPGUI ( VL02N_1000_1 ).
                SAPGUI ( VL02N_4004_1 ).
            ENDIF.
        ELSE.
            LOG ( "LINE EXISTS" ).
            SAPGUI ( VL02N_1000_STEP_2 ). <= deleting the line
        ENDIF.
    ENDDO.
    ===below is saving and existing the transaction

    Hi Woody,
    Position button would retrive/result in the desired result only when the value is present, else it would select those elements/lines which are possibly the next or the previous.
    Like, suppose you are searching for 21 out of 20, 22, 23.. The search result would select 20 in some cases or 21 in some other cases. Its basically done on the alphabetical/numeric order in decending manner... 
    That might be one reason that you are not able to get a message saying wrong selection. To overcome such situation, I would have taken a list of database entries for the respective DN number and would have compared with the result.
    One thumb rule which I follow is, when ever I am going to use position button, I would also use a gettab to retrive values from the table, which has helped me almost 95% of the times.
    If that is a structure and/or there are multiple tables that are associated with the grid values, its always suggested to use SQL queries in INLINE ABAP.
    Also, you could substitute a single IF instead of nested IF in your statements..
        IF ( VERIF_LINE_EXISTS[&LPC]-MSGID = 'VL'  AND VERIF_LINE_EXISTS[&LPC]-MSGNR = 341 ).
                LOG ( VERIF_LINE_EXISTS[&LPC]-MSGV1 ).
                LOG ( VERIF_LINE_EXISTS[&LPC]-MSGV2 ).
                SAPGUI ( VL02N_10_1).  <= exiting without deleting anything
                SAPGUI ( VL02N_1000_1 ).
                SAPGUI ( VL02N_4004_1 ).
        ELSE.
            LOG ( "LINE EXISTS" ).
            SAPGUI ( VL02N_1000_STEP_2 ). <= deleting the line
        ENDIF.
    Also, see if the deletion is taken place basing on the row & col id of the line. If it is always deleting the line item 0,0 then you should make sure that you have to take the id of that line which is to be deleted.
    Hope this info helps.
    Best regards,
    Harsha
    PS: Reward points accordingly for all responding.

  • A suggestion : use "loop array list" instead of ArrayList / LinkedList

    ArrayList is good at:
    get / set by index : O(1)
    appending : O(log(n))
    remove last : O(1)
    and very bad at:
    add middle : O(n)
    remove from middle : O(n)
    LinkedList is good at:
    fast remove from middle, if your iteraror already goes there : O(1)
    convenient methods : addFirst, addLast, removeFirst, removeLast : O(1)
    and very bad at :
    get / set by index : O(n)
    here I want to make a suggestion : use "loop array list" instead of the ArrayList and LinkedList.
    a "loop array list" is based on array, just like ArrayList. But it has 2 member-variables : the start position, and the real size. the start position can be anywhere within array.length. an element of index "i" is stored in array[ start + i ], and when (start + i > array.length), loop to the beginning of the array; when (start + i < 0), loop to the end of the array.
    this "loop array list" has all the good sides:
    get / set by index : O(1)
    add first / last : O(log(n))
    remove first / last : O(log(n))
    add / remove from middle : O(n)
    (note : because we shrink the backup-array when the real size is too small, add / remove operation take O(log(n)) now.)
    the only problem is : add / remove from middle. let's take a look at it.
    1. the LinkedList does NOT really add/remove from middle in O(1), you has to locate the element, which is O(n).
    2. O(n) is acceptable, O(n^2) is not acceptable. try this : keep removing first element from an very big ArrayList ( size>10^6 ) until it's empty.
    the fact is, any list can perform batch-remove / batch-add operation in O(n) instead of O(n^2). it's easy : allocate a new list, iterate the original list, copy the element into the new list if condition is satisfied.
    so, instead of "remove from middle", what we need is a new methods : removeAllByCondition( Condition condition ), and now the batch-remove operation can be done in O(n)
    here is an implementation of mine. I've tested it on my computer( 512mem + 2G cpu, win2k + jdk1.5 ), it's amazing, just a little slower then ArrayList when add last, and a liitle slower then LinkedList when batch-remove. in all other cases, it's far more better then those 2 kinds of List.
    // source code : List2
    import java.util.AbstractList;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Collection;
    import java.util.Collections;
    import java.util.Comparator;
    import java.util.HashSet;
    import java.util.Iterator;
    import java.util.List;
    import java.util.NoSuchElementException;
    import java.util.Set;
    public final class List2<T> extends AbstractList<T> {
    private static int initialArrayLength = 4;
    private T[] array;
    private int start;
    private int size;
    private void init( T[] newArray, int start_a, int size_a ) {
    array = newArray;
    start = start_a;
    size = size_a;
    @SuppressWarnings("unchecked")
    private void init() {
    init( (T[]) new Object[ initialArrayLength ], 0, 0 );
    public List2() {
         init();
    @SuppressWarnings("unchecked")
    public List2( Collection<? extends T> collection ) {
         init(
              collection.toArray( (T[]) new Object[ collection.size() * 11 / 10 + 1 ] ),
              0,
              collection.size()
    private List2( T[] array_a, int start_a, int size_a ) {
         init( array_a, start_a, size_a );
    @SuppressWarnings("unchecked")
    public static <TT> List2<TT> createV( TT... elements ) {
         TT[] array = (TT[]) new Object[ elements.length * 11 / 10 + 1 ];
         System.arraycopy( elements, 0, array, 0, elements.length );
         return new List2<TT>( array, 0, elements.length );
    public static List2<Double> create( double... elements ) {
         Double[] array = new Double[ elements.length * 11 / 10 + 1 ];
         for( int i=0; i < elements.length; i++ )
              array[i] = elements;
         return new List2<Double>( array, 0, elements.length );
    public static List2<Integer> create( int... elements ) {
         Integer[] array2 = new Integer[ elements.length * 11 / 10 + 1 ];
         for( int i=0; i < elements.length; i++ )
              array2[i] = elements[i];
         return new List2<Integer>( array2, 0, elements.length );
    public static List2<Character> create( char... elements ) {
         Character[] array2 = new Character[ elements.length * 11 / 10 + 1 ];
         for( int i=0; i < elements.length; i++ )
              array2[i] = elements[i];
         return new List2<Character>( array2, 0, elements.length );
    public static List2<Character> create( String s ) {
         return create( s.toCharArray() );
    public List2<T> clone() {
         return new List2<T>( this );
    // basic
    public int size() {
         return size;
    private int index( int index ) {
         int i = start + index;
         if( i >= array.length )
              i -= array.length;
         return i;
    public T get( int d ) {
         if( d < 0 || d >= size )
              throw new IndexOutOfBoundsException();
         if( size == 0 )
              throw new NoSuchElementException();
         return array[ index( d ) ];
    public T set( int index, T element ) {
         if( index < 0 || index >= size )
              throw new IndexOutOfBoundsException();
         int i = index( index );
         T oldElement = array[i];
         array[i] = element;
         return oldElement;
    @SuppressWarnings("unchecked")
    private void copyAndSetToNewArray( int newArrayLength ) {
         T[] newArray = (T[]) new Object[ newArrayLength ];
         for( int i=0; i<size; i++ )
              newArray[i] = array[ index( i ) ];
         init( newArray, 0, size );
    public void addFirst( T element ) {
         if( size == array.length )
              copyAndSetToNewArray( size * 3 / 2 + 1 );
         int i = index( array.length - 1 );
         array[ i ] = element;
         start = i;
         size++;
    public void addLast( T element ) {
         if( size == array.length )
              copyAndSetToNewArray( size * 3 / 2 + 1 );
         array[ index( size ) ] = element;
         size++;
    public T removeFirst() {
         if( size == 0 )
              throw new NoSuchElementException();
         T oldElement = array[ start ];
         array[ start ] = null;
         start = index( 1 );
         size--;
         if( array.length > size * 2 + 1 )
              copyAndSetToNewArray( size * 11 / 10 + 1 );
         return oldElement;
    public T removeLast() {
         if( size == 0 )
              throw new NoSuchElementException();
         int i = index( size - 1 );
         T oldElement = array[i];
         array[i] = null;
         size--;
         if( array.length > size * 2 + 1 )
              copyAndSetToNewArray( size * 11 / 10 + 1 );
         return oldElement;
    @SuppressWarnings("unchecked")
    public int removeAll( ListCondition<T> condition ) {
         T[] newArray = (T[]) new Object[ array.length ];
         int iNew = 0;
         for( int i=0; i < size; i++ ) {
              T element = get( i );
              if( ! condition.isConditionSatisfied( this, i, element ) )
                   newArray[ iNew++ ] = element;
         int oldSize = size;
         init( newArray, 0, iNew );
         if( array.length > size * 2 + 1 )
              copyAndSetToNewArray( size * 11 / 10 + 1 );
         return size - oldSize;
    // aux
    public boolean equals(Object obj) {
         if( obj == this )
         return true;
         if( obj instanceof List2 ) {
              List2 that = (List2) obj;
              if( this.size != that.size )
                   return false;
              for( int i=0; i < size; i++ )
                   if( ! Tools.equals( this.array[ this.index(i) ], that.array[ that.index(i) ] ) )
                        return false;
              return true;
         if( obj instanceof List ) {
              List that = (List) obj;
              if( this.size != that.size() )
                   return false;
              Iterator thatIter = that.iterator();
              for( int i=0; i < size; i++ )
                   if( ! Tools.equals( this.array[ this.index(i) ], thatIter.next() ) )
                        return false;
              return true;
         return true;
    public int hashCode() {
         int hashCode = 1;
         for( int i=0; i < size; i++ ) {
              T element = array[ index( i ) ];
         hashCode = 31*hashCode + ( element==null ? 0 : element.hashCode() );
         return hashCode;
    public boolean isEmpty() {
         return size == 0;
    public T getFirst() {
         return get( 0 );
    public T getLast() {
         return get( size() - 1 );
    public T getRandom() {
         return get( (int) (Math.random() * size) );
    public int indexOf( Object element ) {
         for( int i=0; i < size; i++ )
              if( Tools.equals( array[ index( i ) ], element ) )
                   return i;
         return -1;
    public int lastIndexOf( Object element ) {
         for( int i=size-1; i >= 0; i-- )
              if( Tools.equals( array[ index( i ) ], element ) )
                   return i;
         return -1;
    public boolean contains( Object element ) {
         return indexOf( element ) != -1;
    public boolean add( T element ) {
         addLast( element );
         return true;
    @Deprecated
    public void add( int index, T element ) {
         throw new UnsupportedOperationException();
    public T remove() {
         return removeFirst();
    @Deprecated
    public boolean remove( Object element ) {
         throw new UnsupportedOperationException( "use removeAll( Condition ) instead" );
    @Deprecated
    public T remove( int index ) {
         throw new UnsupportedOperationException( "use removeAll( Condition ) instead" );
    public void clear() {
         init();
    public Object[] toArray() {
         Object[] result = new Object[ size ];
         for( int i=0; i < size; i++ )
         result[i] = array[ index( i ) ];
         return result;
    @SuppressWarnings("unchecked")
    public <TT> TT[] toArray( TT[] a ) {
    if( a.length < size )
    a = (TT[]) java.lang.reflect.Array.newInstance( a.getClass().getComponentType(), size );
    for( int i=0; i < size; i++ )
    a[i] = (TT) array[ index( i ) ];
    if( a.length > size )
         a[size] = null;
    return a;
    @SuppressWarnings("unchecked")
    public void sort() {
         Object[] a = toArray();
         Arrays.sort( a );
         for( int i=0; i < size; i++ )
              array[ i ] = (T) a[ i ];
         start = 0;
    @SuppressWarnings("unchecked")
    public void sortDesc() {
         Object[] a = toArray();
         Arrays.sort( a );
         for( int i=0, j=size-1; i < size; i++, j-- )
              array[ i ] = (T) a[ j ];
         start = 0;
    @SuppressWarnings("unchecked")
    public void sort( Comparator<T> comparator ) {
         T[] a = (T[]) toArray();
         Arrays.sort( a, comparator );
         for( int i=0; i < size; i++ )
              array[ i ] = a[ i ];
         start = 0;
    @SuppressWarnings("unchecked")
    public void sortDesc( Comparator<T> comparator ) {
         T[] a = (T[]) toArray();
         Arrays.sort( a, comparator );
         for( int i=0, j=size-1; i < size; i++, j-- )
              array[ i ] = a[ j ];
         start = 0;
    public String toString( String delimiter ) {
         return toString( "", delimiter, "", size() );
    public String toString( String prefix, String delimiter, String suffix, int max ) {
         StringBuffer stringBuffer = new StringBuffer( prefix );
         int dest = Math.min( max, size );
         for( int i=0; i < dest; i++ ) {
              stringBuffer.append( get(i) );
              if( i < dest - 1 )
                   stringBuffer.append( delimiter );
         if( size > max )
              stringBuffer.append( "...(" ).append( size() - max ).append( " more)" );
         stringBuffer.append( suffix );
         return stringBuffer.toString();
    // batch operation
    public boolean containsAll( Collection<?> that ) {
         Set<Object> thisSet = new HashSet<Object>( this );
         for( Object element : that )
              if( ! thisSet.contains( element ) )
                   return false;
         return true;
    @SuppressWarnings("unchecked")
    public List2<T> subList( int fromIndex, int toIndex ) {
         if( fromIndex < 0 || toIndex > size || toIndex < fromIndex )
              throw new IndexOutOfBoundsException();
         int newSize = toIndex - fromIndex;
         T[] newArray = (T[]) new Object[ newSize * 11 / 10 + 1 ];
         for( int i=fromIndex, iNew=0; i < toIndex; i++, iNew++ )
              newArray[ iNew ] = array[ index( i ) ];
         return new List2<T>( newArray, 0, newSize );
    public void addV( T... that ) {
         for( T element : that )
              addLast( element );
    public boolean addAll( Collection<? extends T> that ) {
         for( T element : that )
              addLast( element );
         return ! that.isEmpty();
    @Deprecated
    public boolean addAll( int index, Collection<? extends T> c ) {
         throw new UnsupportedOperationException();
    public void removeRest( T element ) {
         int position = lastIndexOf( element );
         if( position == -1 )
              return;
         while( ! Tools.equals( element, removeLast() ) );
    public void removeAllEquals( final T element ) {
         removeAll( new ListCondition<T>() { public boolean isConditionSatisfied(List2 list, int index, T currentElement) {
              return currentElement.equals( element );
    public void removeAllBetween( final T from, final T to ) {
         removeAll( new ListCondition<T>() {
              @SuppressWarnings("unchecked")
              public boolean isConditionSatisfied(List2 list, int index, T element) {
                   if( from != null && ((Comparable) from).compareTo( element ) > 0 )
                        return false;
                   if( to != null && ((Comparable) to).compareTo( element ) <= 0 )
                        return false;
                   return true;
    public boolean retainAll( Collection<?> that ) {
         final Set<Object> thatSet = new HashSet<Object>( that );
         int removeCount = removeAll( new ListCondition<T>() { public boolean isConditionSatisfied(List2 list, int index, T element) {
              return ! thatSet.contains( element );
         return removeCount > 0;
    public boolean removeAll( Collection<?> that ) {
         final Set<Object> thatSet = new HashSet<Object>( that );
         int removeCount = removeAll( new ListCondition<T>() { public boolean isConditionSatisfied(List2 list, int index, T element) {
              return thatSet.contains( element );
         return removeCount > 0;
    // unit test
    private static int maxTestCount = 1000 * 1000;
    public static void unitTest() throws Exception {
         // thest thoese methods for one time
         Tools.ensureEquals( new List2(), new ArrayList() );
         Tools.ensureNotEquals( List2.create( "abcde" ), new ArrayList() );
         Tools.ensureNotEquals( List2.create( "abcde" ), List2.create( "abcdef" ) );
         final List<Double> list1 = new ArrayList<Double>();
         final List2<Double> list2 = new List2<Double>();
         Runnable[] tasks = new Runnable[] {
              // test those methods that do NOT change the list
              new Runnable() { public void run() {
                   Tools.ensureEquals( new List2<Double>( list1 ), list1 );
                   Tools.ensureEquals( List2.createV( list1.toArray() ), list1 );
                   Tools.ensureEquals( List2.createV( list1.toArray( new Double[0] ) ), list1 );
                   double[] doubles = new double[ list1.size() ];
                   int i = 0;
                   for( double d : list1 )
                        doubles[i++] = d;
                   Tools.ensureEquals( List2.create( doubles ), list1 );
                   Tools.ensure( list1.isEmpty() == list2.isEmpty() );
                   Arrays.equals( list1.toArray(), list2.toArray() );
                   Tools.ensureEquals( list1, list2.clone() );
                   Double notExistElement = -2.0;
                   Tools.ensure( list1.indexOf( notExistElement ) == -1 );
                   Tools.ensure( list1.lastIndexOf( notExistElement ) == -1 );
                   Tools.ensure( list1.contains( notExistElement ) == false );
                   Tools.ensureEquals( list1.toString(), list2.toString() );
                   Tools.ensureEquals( list1.toString(), list2.toString() );
                   Tools.ensureEquals( list1.hashCode(), list2.hashCode() );
                   if( list1.isEmpty() )
                        return;
                   Tools.ensure( list1.get(0).equals( list2.getFirst() ) );
                   Tools.ensure( list1.get(list1.size()-1).equals( list2.getLast() ) );
                   Double existRandomElement = list2.getRandom();
                   Tools.ensure( list1.contains( existRandomElement ) );
                   Tools.ensure( list2.contains( existRandomElement ) );
                   Tools.ensure( list1.indexOf( existRandomElement ) == list2.indexOf( existRandomElement ) );
                   Tools.ensure( list1.indexOf( existRandomElement ) == list2.indexOf( existRandomElement ) );
                   int from = (int) (Math.random() * list1.size());
                   int to = (int) (Math.random() * (list1.size()+1));
                   if( from > to ) {
                        int t = from;
                        from = to;
                        to = t;
                   Tools.ensureEquals( list1.subList( from, to ), list2.subList( from, to ) );
              // test those methods that change the list
              new Runnable() { public void run() {
                   if( list1.isEmpty() )
                        return;
                   int i = (int) (Math.random() * list1.size());
                   double d = Math.random();
                   list1.set( i, d );
                   list2.set( i, d );
              new Runnable() { public void run() {
                   if( list1.isEmpty() )
                        return;
                   int i = (int) (Math.random() * list1.size());
                   Tools.ensure( list1.get( i ).equals( list2.get( i ) ) );
              new Runnable() { public void run() {
                   double d = Math.random();
                   list1.add( 0, d );
                   list2.addFirst( d );
              new Runnable() { public void run() {
                   double d = Math.random();
                   list1.add( d );
                   list2.addLast( d );
              new Runnable() { public void run() {
                   double d = Math.random();
                   list1.add( d );
                   list2.addLast( d );
              new Runnable() { public void run() {
                   if( list1.isEmpty() )
                        return;
                   Tools.ensure( list1.remove( 0 ).equals( list2.removeFirst() ) );
              new Runnable() { public void run() {
                   if( list1.isEmpty() )
                        return;
                   Tools.ensure( list1.remove( list1.size() - 1 ).equals( list2.removeLast() ) );
              new Runnable() { public void run() {
                   if( list1.isEmpty() )
                        return;
                   int i = 0;
                   for( Iterator<Double> iter=list1.iterator(); iter.hasNext(); i++ ) {
                        iter.next();
                        if( i % 3 == 0 )
                             iter.remove();
                   list2.removeAll( new ListCondition<Double>() { public boolean isConditionSatisfied(List2 list, int index, Double element) {
                        return index % 3 == 0;
              new Runnable() { public void run() {
                   double d = Math.random();
                   list1.add( d );
                   list2.add( d );
              new Runnable() { public void run() {
                   if( list1.isEmpty() )
                        return;
                   Tools.ensure( list1.remove(0).equals( list2.remove() ) );
              new Runnable() { public void run() {
                   if( list1.isEmpty() )
                        return;
                   int r = (int) (Math.random() * list1.size());
                   Double element = list1.get( r );
                   int index = list1.lastIndexOf( element );
                   for( int i=list1.size()-1; i>=index; i-- )
                        list1.remove( i );
                   list2.removeRest( element );
              new Runnable() { public void run() {
                   list2.removeRest( Math.random() - 2 );
              new Runnable() { public void run() {
                   list1.clear();
                   list2.clear();
              new Runnable() { public void run() {
                   Collections.sort( list1 );
                   list2.sort();
              new Runnable() { public void run() {
                   Collections.sort( list1 );
                   Collections.reverse( list1 );
                   list2.sortDesc();
              new Runnable() { public void run() {
                   Comparator<Double> comparator = new Comparator<Double>() { public int compare(Double o1, Double o2) {
                        return o1.toString().substring(2).compareTo( o2.toString().substring(2) );
                   Collections.sort( list1, comparator );
                   list2.sort( comparator );
              new Runnable() { public void run() {
                   Comparator<Double> comparator = new Comparator<Double>() { public int compare(Double o1, Double o2) {
                        return o1.toString().substring(2).compareTo( o2.toString().substring(2) );
                   Collections.sort( list1, comparator );
                   Collections.reverse( list1 );
                   list2.sortDesc( comparator );
              new Runnable() { public void run() {
                   Double notExistElement = -2.0;
                   list2.removeAllEquals( notExistElement );
                   Tools.ensureEquals( list1, list2 );
                   list2.removeAllBetween( 0.5, 0.6 );
                   for( Iterator<Double> iter=list1.iterator(); iter.hasNext(); ) {
                        double d = iter.next();
                        if( d >= 0.5 && d < 0.6 )
                             iter.remove();
                   Tools.ensureEquals( list1, list2 );
         System.out.print( "test List2 " );
         for( int i=0; i < maxTestCount; i++ ) {
              tasks[ (int) (Math.random() * tasks.length) ].run();
              Tools.ensureEquals( list1, list2 );
              if( i % (maxTestCount/10) == 0 )
                   System.out.print( "." );
         System.out.println( " ok" );
    // source code : ListCondition
    public interface ListCondition<T> {
    boolean isConditionSatisfied( List2 list, int index, T element );

    Hi,
    I have the following statement:
    private List list = new ArrayList();
    why not use private ArrayList list = new
    ArrayList()?
    I know ArrayList implements List, so list has a wide
    scope, right? What's the benefit?
    Thanks,
    JieBy using the interface you are not tied to a specific implementation.
    Later, you may determine that using a LinkedList is more efficient to your specific code and then all you need to do is change the statement to:
    private List list = new LinkedList();As long as you are not casting the list reference to ArrayList (or something along those lines) you would not need to change anything else.

  • BADI: PO creation : ME_PROCESS_PO_CUST : check line item matnr

    Hi all,
    I am using a BADI for PO creation definition is ME_PROCESS_PO_CUST and method PROCESS_ITEM
    if material number in the Line item is blank, create a material number(BDC or BAPI) and fill it in the line item.
    I am not very conversant in Objects...
    i seek help on the correctness of the method iam referring to for this purpose and also how to pass values to field matnr in the line item of the PO.
    i have used Get_Data for getting all the values and am using set_Data for changing the value of matnr if it is blank. but if i set the value of matnr it doesnt seem to change and am not able to figure out where i am wrong.
    Thanks in advance,
    Harish Ramakrishnan.

    Hi Harish!
    Then you are aware of the comment of SAP to process_item:
    "Under no circumstances make any changes to the database within this method. On no account use Commits."
    But also method post is commented like this: "On no account use Commits in this method."
    And you need a commit before you can use any created data in your PO.
    Nevertheless, you tried to change a value in process_item. I guess, you use method set_data of the interface, which is import parameter of this method. I had a look into the method set_item: there is just a update to an internal (hashed) table. So technically it should be changed. But if further checks will prohibit changes of special fields - who knows.
    I'm not surprised, that line checks can't change the matnr any longer, but at least online it's possible to change the material.
    Maybe you can debug, what happens when doing you changes. It might be already after a view steps, where the changes get lost.
    Regards,
    Christian
    P.S.: Do you also use method set_datax - or I'm in a totally wrong area?
    Message was edited by: Christian Wohlfahrt

  • CRM BADI CRM_COND_COM_BADI only called when line created or changed

    I am trying to ensure that the BADI CRM_COND_COM_BADI is called (to adjust pricing communication structure) for all line items every time a user hits update or enter during creation of a sales order via the web.  In my testing I am finding that the BADI CRM_COND_COM_BADI only gets called during the creation of a line item or a change of a line item.
    Does anyone know how I can have BADI CRM_COND_COM_BADI called for all line items every time update or order is clicked on the web during order entry?  Is there something I can set in config to make this happen?
    Thanks,
    Sarah.

    Remo,
    Even though this thread is very old and closed, but want to share my thoughts because we faced the same problem. We enhanced the BADI 'CRM_COND_COM_BADI' and was getting called multiple times.
    As per our business scenario, it should be called for Opportunity and for a specific transaction type. So a check was placed in the BADI for the Opportunity and transaction type. This was done using FM 'CRM_ORDERADM_H_READ_OW'. This helped us to skip the complete logic to be called by the BADI enhancement.
    If you found a better solution yet do share.
    Regards,
    Shyamak

  • *** ERROR = BAD REQUEST - Reason: DpRqCheck failed (line 5195): [dpxxdisp.

    Hello All,
    In our development system,  we are able to perform all the transactions normally(SAP level) and there is no performance issues..
    We have checked from OS level in work directory file dev_disp..
    We are getting below error.
    Can you please suggest us on this..............
    =========================================================
    ERROR => DpRqCheck: T72 in stat TM_SLOT_FREE [dpxxdisp.c   5805]
    ***LOG Q0G=> DpRqBadHandle, bad_req ( DIA) [dpxxdisp.c   4621]
    ERROR => BAD REQUEST - Reason: DpRqCheck failed (line 5195): [dpxxdisp.c   4623]
    -IN-- sender_id DISPATCHER        tid  72    wp_ca_blk   -1      wp_id -1
    -IN-- action    SEND_TO_WP        uid  8012   appc_ca_blk -1      type  DIA
    -IN-- new_stat  NO_CHANGE         mode 0     len         -1      rq_id 53650
    -IN-- req_info  MS_ERROR
    ERROR => DpRqCheck: T73 in stat TM_SLOT_FREE [dpxxdisp.c   5805]
    ***LOG Q0G=> DpRqBadHandle, bad_req ( DIA) [dpxxdisp.c   4621]
    ERROR => BAD REQUEST - Reason: DpRqCheck failed (line 5195): [dpxxdisp.c   4623]
    -IN-- sender_id DISPATCHER        tid  73    wp_ca_blk   -1      wp_id -1
    -IN-- action    SEND_TO_WP        uid  8013   appc_ca_blk -1      type  DIA
    -IN-- new_stat  NO_CHANGE         mode 0     len         -1      rq_id 53651
    -IN-- req_info  MS_ERROR
    ERROR => DpRqCheck: T74 in stat TM_SLOT_FREE [dpxxdisp.c   5805]
    ***LOG Q0G=> DpRqBadHandle, bad_req ( DIA) [dpxxdisp.c   4621]
    ERROR => BAD REQUEST - Reason: DpRqCheck failed (line 5195): [dpxxdisp.c   4623]
    -IN-- sender_id DISPATCHER        tid  74    wp_ca_blk   -1      wp_id -1
    -IN-- action    SEND_TO_WP        uid  8014   appc_ca_blk -1      type  DIA
    -IN-- new_stat  NO_CHANGE         mode 0     len         -1      rq_id 53652
    -IN-- req_info  MS_ERROR
    ERROR => DpRqCheck: T77 in stat TM_SLOT_FREE [dpxxdisp.c   5805]
    ***LOG Q0G=> DpRqBadHandle, bad_req ( DIA) [dpxxdisp.c   4621]
    ERROR => BAD REQUEST - Reason: DpRqCheck failed (line 5195): [dpxxdisp.c   4623]
    -IN-- sender_id DISPATCHER        tid  77    wp_ca_blk   -1      wp_id -1
    -IN-- action    SEND_TO_WP        uid  8019   appc_ca_blk -1      type  DIA
    -IN-- new_stat  NO_CHANGE         mode 0     len         -1      rq_id 53653
    -IN-- req_info  MS_ERROR
    Wed Apr  7 08:55:32 2010
    ***LOG Q0K=> DpMsAttach, mscon ( ussapdir00) [dpxxdisp.c   10127]
    Wed Apr  7 08:55:33 2010
    use SAPLOCALHOST=<ussapdir00> as internal hostname
    NiPAccept: accept failed (socket=7;errno=72)
    ***LOG Q0I=> NiPRead: recv (73: Connection reset by peer) [niuxi.c 928]
    SoftCancel request for T45 U8133 M0 received from REMOTE_TERMINAL
    Network error of client T46, NiBufReceive (-6: NIECONN_BROKEN), dp_tm_status=3
    Client address of T46 is 10.228.250.65(10.228.250.65)
    ***LOG Q04=> DpRTmPrep, NiBufReceive (8135 MKK27890 46 BREWL07D4359) [dpxxdisp.c   9830]
    RM-T46, U8135, 620     MKK27890, BREWL07D43598, 08:43:19, M0, W4,     , 2/0
    Network error of client T45, NiBufReceive (-6: NIECONN_BROKEN), dp_tm_status=3
    Client address of T45 is 10.228.250.65(10.228.250.65)
    ***LOG Q04=> DpRTmPrep, NiBufReceive (8133 RR606033 45 BREWL07D4359) [dpxxdisp.c   9830]
    RM-T45, U8133, 600     RR606033, BREWL07D43598, 08:38:22, M0, W0, SPRO, 2/3
    Release check o.K.
    MBUF state PREPARED
    MBUF component UP
    DpMBufHwIdSet: set Hardware-ID
    ***LOG Q1C=> DpMBufHwIdSet [dpxxmbuf.c   1025]
    MBUF state ACTIVE
    Wed Apr  7 08:55:39 2010
    ERROR => DpRqCheck: T45 in stat TM_SLOT_FREE [dpxxdisp.c   5805]
    ***LOG Q0G=> DpRqBadHandle, bad_req ( DIA) [dpxxdisp.c   4621]
    ERROR => BAD REQUEST - Reason: DpRqCheck failed (line 5195): [dpxxdisp.c   4623]
    -IN-- sender_id DISPATCHER        tid  45    wp_ca_blk   -1      wp_id -1
    -IN-- action    SEND_TO_WP        uid  8133   appc_ca_blk -1      type  DIA
    -IN-- new_stat  NO_CHANGE         mode 0     len         -1      rq_id 53678
    -IN-- req_info  LOGOFF CANCELMODE
    Wed Apr  7 08:55:44 2010
    ERROR => DpRqCheck: T46 in stat TM_SLOT_FREE [dpxxdisp.c   5805]
    ***LOG Q0G=> DpRqBadHandle, bad_req ( DIA) [dpxxdisp.c   4621]
    ERROR => BAD REQUEST - Reason: DpRqCheck failed (line 5195): [dpxxdisp.c   4623]
    -IN-- sender_id DISPATCHER        tid  46    wp_ca_blk   -1      wp_id -1
    -IN-- action    SEND_TO_WP        uid  8135   appc_ca_blk -1      type  DIA
    -IN-- new_stat  NO_CHANGE         mode 0     len         -1      rq_id 53676
    -IN-- req_info  LOGOFF CANCELMODE
    ======================================================================
    Thanks in advance..
    Best Regards,
    Kiran

    Hi Kiran,
    It's not a problem or error, it's just a message and hence can be ignored. However you can check out SAP note 1111154 once, it will fix the issue probably if it's happening due to HTTP problem. Else you can very well ignore it.
    Regards
    Sourabh Majumdar

  • How to use JOptionPane in jsp, instead of javascript message alert box?

    HI,
    How to use JOptionPane in jsp,
    instead of javascript "message alert box"?
    I hate javascript,
    I'd like to only use java in jsp. don't use javascript.
    javascript is client side,
    jsp is server side. i know that.
    how to... instead of javascript box?
    how to use ... message box in webpage?
    don't use applet,,,, don't use javascript,,,
    hm...zzzZzz
    I hate javascript..T.T
    <SCRIPT language=JavaScript>
    alert("hate javascript");
    </SCRIPT>
    ===>>>>
    In this way,,
    JOptionPane.showOptionDialog(null,"I love java")
    I'd like to only use jsp and java and html...in webpage.
    don't use javascript....
    Why? don't sun provide message box in jsp, instead of javascrip box?
    Why?
    Edited by: seong-ki on Nov 4, 2007 8:38 PM

    Drugs are bad, m'kay?

  • HAP_DOCUMENT BSP redirect using the BADI HRHAP00_BSP_TMPL

    Hi all,
    Below is my issue:
    Last year, We have modified the BSP HAP_DOCUMENT by copying it to Y_HAP_DOCUMENT. Now we had to make further changes to the BSP which had to be template specific.
    So we used the BADI HRHAP00_BSP_TMPL to redirect the document to a new BSP Y_HAP_DOCUMENT_V1.
    The iviews are pointing to the BSP Y_HAP_DOCUMENT, but when the BADI is hit its getting redirected to the V1 BSP.
    But the issue is that whenever the redirect BSP is used, the error messages are getting killed.
    Please let me know if anyone had a similar issue and if they were able to solve the issue.
    Thanks,
    Manasa
    I am using the

    Hi Luk!
    Sorry that i got back to you this late. Have you solved the issue?
    whenever we redirect using the badi for hap_document the control starts from layout_alternative.htm  view instead of the layout_sap_standard.htm. So if you copy paste the code from the sap standard view you will be able to redirect it.
    Hope this helps. Plesae reward hlpfull answers.
    Thanks,
    manasa

  • I was wondering, would be able to use my eligible upgrade on 1 phone line to buy a phone for another line?

    Hey, I was wondering if I would be able to use my eligible upgrade on one phone line to buy a phone for another line?.
    Also, I saw a commercial on TV about getting a plan with 10 gb of data for like 130 a month, that does include the cost of both phones instead of 130 + 40 + 40 for each smartphone on the line?...

    SumWiiTodd wrote:
    Also, I saw a commercial on TV about getting a plan with 10 gb of data for like 130 a month, that does include the cost of both phones instead of 130 + 40 + 40 for each smartphone on the line?...
    The $130 price is actually $110 and is for 2 situations, none of which involve subsidized contract upgrade.
    1) Edge payment plan. Cost of service is $110, but then the monthly phone payment added to that, usually around $25/phone
    2) phones out of contract, then it is $110 with no extra charges.
    The the costs break down is $80 for data, and $15/line

  • Statements which should not use in BADIs

    One Question ...
    Any specific statements are there which we should not use in BADIs ?
    Thanks

    Hi,
    BADI is an OO ABAP approach, therefore any statement which won't work in the OO context won't work here! Instead breaking your head on what is to be used? and what not? , run a "code inspector" and "EPC" on your implementation class.it will show list of illegal statements in your BADI implementation
    Regards
    Naren

  • [svn] 3904: Changing the FlexNativeMenu to use commandKey and controlKey instead of cmdKey and ctrlKey .

    Revision: 3904
    Author: [email protected]
    Date: 2008-10-27 10:48:49 -0700 (Mon, 27 Oct 2008)
    Log Message:
    Changing the FlexNativeMenu to use commandKey and controlKey instead of cmdKey and ctrlKey. This puts it more in line with AIR APIs.
    QE Notes: Joan ran the Mustella/manual tests for this and has a task to add tests for the two new properties
    Doc Notes: All examples need to be updated to use controlKey and commandKey instead of ctrlKey and cmdKey.
    Bugs: SDK-14996
    Reviewer: Gordon
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-14996
    Modified Paths:
    flex/sdk/branches/3.x/frameworks/projects/airframework/src/mx/controls/FlexNativeMenu.as

    Revision: 3904
    Author: [email protected]
    Date: 2008-10-27 10:48:49 -0700 (Mon, 27 Oct 2008)
    Log Message:
    Changing the FlexNativeMenu to use commandKey and controlKey instead of cmdKey and ctrlKey. This puts it more in line with AIR APIs.
    QE Notes: Joan ran the Mustella/manual tests for this and has a task to add tests for the two new properties
    Doc Notes: All examples need to be updated to use controlKey and commandKey instead of ctrlKey and cmdKey.
    Bugs: SDK-14996
    Reviewer: Gordon
    Ticket Links:
    http://bugs.adobe.com/jira/browse/SDK-14996
    Modified Paths:
    flex/sdk/branches/3.x/frameworks/projects/airframework/src/mx/controls/FlexNativeMenu.as

  • How do I use my new mac instead of old one with my iphone 4

    I recently just got a new Mac and wont be able to use my old Mac because I will be leaving for college in a couple weeks. My iPhone 4 is set up with my old Mac. How do i get it to sync with my new Mac now instead of my old one? Because of space on my iPhone, I manually manage all of the music on it. When I have my iPhone connected to my new mac, it shows up in iTunes but it wont let me manage my music.

    You can use Migration Assistant to migrate your old Home folder to your new computer. Or, if all you want is your iTunes Library, then copy the /Home/Music/iTunes/ folder to an external hard drive. Then move the external drive to the new computer and restore the folder to the /Home/Music/ folder on the new computer overwriting the one that's now there.
    If you have never started up the new computer, then you can use the Setup Assistant instead of Migration Assistant to transfer your old Home folder to the new computer.
    The two computers must be connected by Firewire cable or Thunderbolt cable depending upon what they both support. The old computer is booted into Target Disk Mode while the new computer is booted normally. In Setup or Migration Assistant you would be selecting the option to migrate from another Mac or disk drive.

  • Reg: fetch the data by using item_id which is retuned by In line View Query

    Hi all,
    create table xxc_transactions(type_id number,trx_line_id number ,item_id number,org_id number);
    insert into xxc_transactions values(null,null,null,null);
    create table xxc_items1(item_id number,org_id number,item_no varchar2(10));
    insert into xxc_items1 values(123,12,'book');
    create table xxc_headers(header_id number,order_id number);
    insert into xxc_headers values(null,null);
    create table xxc_lines(header_id number,item_id number,line_id number);
    insert into xxc_lines values(null,null,null);
    create table xxc_types_tl(transaction_id number,NAME varchar2(10));
    insert into xxc_types_tl values(106,'abc');
    create table xxc_quantity(item_id number);
    insert into xxc_quantity values (123);
    create table xxc_quantity_1(item_id number);
    insert into xxc_quantity_1 values (123);
    SELECT union_id.item_id,
           b.org_id,
           e.name,
           fun1(union_id.item_id) item_no
    FROM   xxc_transactions a,
           xxc_items1 b,
           xxc_headers c,
           xxc_lines d,
           xxc_types_tl e,
           (SELECT item_id
            FROM   xxc_quantity
            WHERE  item_id = 123
            UNION
            SELECT item_id
            FROM   xxc_quantity_1
            WHERE  item_id = 123
            UNION
            SELECT item_id
            FROM   xxc_transactions
            WHERE  item_id = 123) union_id
    WHERE  a.type_id = 6
           AND a.item_id  = b.item_id
           AND union_id.item_id = b.item_id
           AND a.org_id = b.org_id
           AND c.header_id = d.header_id
           AND d.line_id = a.trx_line_id
           AND d.item_id = b.item_id
           AND c.order_id = e.transaction_id
           AND b.org_id = 12
    GROUP  BY union_id.item_id,
              b.org_id,
              e.name
    ORDER  BY union_id.item_id;
    create or replace function fun1(v_item in number)
    return varchar2
    is
    v_item_no
    Begin
       select item_no from xxc_items1
       where item_id=v_item;
       return v_item_no ;
        Exception
         When Others Then
          v_item_no := null;
          return v_item_no;
    END fun1;
    I  need  fetch the data by using item_id which is retuned by In line View Query(UNION)
    item_id  org_id  name    item_no
    123        12        abc       book
    Version: 11.1.0.7.0  and 11.2.0.1.0
    Message was edited by: Rajesh123 Added test cases script
    Message was edited by: Rajesh123 changed Question as fetch the data by using item_id which is retuned by In line View Query(UNION)

    Hi Master , sorry for the late reply and can you please help on this?
    create table xxc_transactions(type_id number,trx_line_id number ,item_id number,org_id number);
    insert into xxc_transactions values(null,null,null,null);
    create table xxc_items(item_id number,org_id number,item_no varchar2(10));
    insert into xxc_items values(123,12,'book');
    create table xxc_headers(header_id number,order_id number);
    insert into xxc_headers values(null,null);
    create table xxc_lines(header_id number,item_id number,line_id number);
    insert into xxc_lines values(null,null,null);
    create table xxc_types_tl(transaction_id number,NAME varchar2(10));
    insert into xxc_types_tl values(106,'abc');
    create table xxc_uinon_table(item_id number);
    insert into xxc_types_tl values(123);
    SELECT   union_id.item_id,
             b.org_id ,
             e.name ,
             fun1(union_id.item_id) item_no   --> to get item_no
             FORM xxc_transactions a,
             xxc_items             b,
             xxc_headers           c,
             xxc_lines             d,
             xxc_types_tl          e,
             ( SELECT item_id
                 FROM   xxc_uinon_table ) union_id
    WHERE    a.type_id= 6
    AND      a.item_id = b.item_id
    AND      union_id.item_id = b.item_id
    AND      a.org_id = b.org_id
    AND      c.header_id = d.header_id
    AND      d.line_id= a.trx_line_id
    AND      d.item_id= b.item_id
    AND      c.order_id= e.transaction_id ---106
    AND      b.org_id = 12
    GROUP BY union_id.item_id,
             b.org_id ,
             e.name
    ORDER BY union_id.item_id;
    Note: xxc_uinon_table is a combination of UNION's
    select 1 from dual
    union
    select 1 from dual
    union
    select no rows returned  from dual;
    I will get 1 from the above Query
    Thank you in advanced

  • I bought an iTunes gift card, reedemed it, and when i try to buy a game it doesn't let me use my credits, but instead I have to buy it using my Visa card?

    I bought an iTunes gift card, reedemed it, and when i try to buy a game it doesn't let me use my credits, but instead I have to buy it using my Visa card?

    What exactly do you see when trying to buy a game, what messages do you get on-screen ?
    If it's an account that you've just created then unless the instructions on this page are followed when creating an account : Create an iTunes Store, App Store, or iBooks Store account without a credit card or other payment method
    then credit card details will need to be entered before the account can be used to download any item from the store. You should be able to remove the card after entering its details.
    If you are getting a prompt to review the account then you could see if this post by mountaingoatgirl lets you do so without needing to enter credit card details : https://discussions.apple.com/message/24303054#24303054

Maybe you are looking for

  • Airport time capsule losing network connection

    Running a time capsule with airport utility v. 6.3.2 and it is losing wi-fi and ethernet connection daily. I have had the unit for three years or so, and while it used to happen once or twice a year, its happening daily now. Unplugging/replugging get

  • Need help getting palm to turn on.

    Posted in the wrong section of the forum. I am a Volunteer here, not employed by HP. You too can become an HP Expert! Details HERE! If my post has helped you, click the Kudos Thumbs up! If it solved your issue, Click the "Accept as Solution" button s

  • XML Binding to UI components

    Can I bind UI component properties to XML data that is read from an HTTPService? For example, I'd like to bind the text property of a TextInput to the Node tag of myXML. (not actual source) [Bindable] private var myXML:XML = the event.result from a e

  • How to view AT&T/Yahoo email on Excite 10?

    I am new to this only used a laptop and desktop before. I have zero problem viewing my email with those PCs, but cannot with the Toshiba Excite 10. I can start the tablet, connect to wifi and start up the browser fine. I can go to the URL for at&t/Ya

  • Understanding IKE Phase I and II

    Hi,  I have been through the concept a lot of time but what confuses me is encryption algorithm and DH key, how they go hand in hand in the IKE phase and II.  I understand phase I authenticates the vpn peers and negotiates the ISAKMP policy which inc