NSCollectionView / index of NSImageView
Hello everybody,
I am going to try to describe simply my problem.
Context :
I manage a list of images (NSImage in correlation with a NSArrayController).
These images are drawn in a NSCollectionView (-> NSBox - > NSImageView).
OK.
The images are added in the NSCollectionView either by "Drag and Drop", or by adding items ( NSImage) in my list of images.
Theses images are not "selectables" (and it is a will of my part).
The problem :
When I put down by "Drag and Drop" an image ("on" a NSImageView of my NSCollectionView), I do not manage to get back the index of this NSImageView in the NSCollectionView !
The problem would be different if the items of the NSCollectionViex were "selectables" but it is not the case.
Is it possible or not to get back in this context the index of the NSImageView concerned during "Drag and Drop"?
Thank you in advance for your help.
Yes something like this.
This is how I solved it
private static final String WORD_DELIM = " \t\n\r\f,.;:";
private int getIndexOfWord(String str, String text) {
StringTokenizer tokenizer = new StringTokenizer(str, WORD_DELIM, true);
String token;
StringBuffer previousContents = new StringBuffer();
while(tokenizer.hasMoreTokens()) {
token = tokenizer.nextToken();
if(startsWithWord(text, token)) {
break;
previousContents.append(token);
if(previousContents.length() == 0) {
return -1;
} else {
return previousContents.length();
private boolean startsWithWord(String word, String token) {
//The token must start with "word"
if(!token.startsWith(word)) {
return false;
//Now rplace all delimiters by blanks
int delimCount = WORD_DELIM.length();
char c;
for(int i = delimCount - 1; i >= 0; i--) {
c = WORD_DELIM.charAt(i);
token = token.replace(c, ' ');
//Finally get rid of the blanks.
token = token.trim();
if(token.equals(word)) {
return true;
return false;
Similar Messages
-
Envelope index deleted - Rebuild fails....
Hi,
I have a a complete crash, and successfully restored thanks to Time Machine.
As you know, TM does not backup the envelope index file, so i have to go through the import process.
However, the process constantly hangs, right from the start, without even making any progress or importing a single email. It sits there at 0 out of 56352 emails.
it does however swap a nice chunk of space (a few gigs) but that's about it. I tried letting it alone for a full night with no success.
Here is a sample done throught activity monitor:
Sampling process 1779 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling Mail (pid 1779) every 1 millisecond
Call graph:
1327 Thread_2503
1327 0xfa206
1327 NSApplicationMain
1327 -[NSApplication run]
1327 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
1327 _DPSNextEvent
1327 BlockUntilNextEventMatchingListInMode
1327 ReceiveNextEventCommon
1327 RunCurrentEventLoopInMode
1327 CFRunLoopRunInMode
1327 CFRunLoopRunSpecific
1327 __NSFireDelayedPerform
1327 0x447e
1327 0xeda5e
1327 0xf123e
1327 -[NSApplication runModalForWindow:]
1327 -[NSApplication _realDoModalLoop:peek:]
1327 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:]
1327 _DPSNextEvent
1327 BlockUntilNextEventMatchingListInMode
1327 ReceiveNextEventCommon
1327 RunCurrentEventLoopInMode
1327 CFRunLoopRunInMode
1327 CFRunLoopRunSpecific
1286 mach_msg
1286 machmsgtrap
1286 machmsgtrap
39 __NSFireTimer
13 0x185c68
13 -[NSView displayIfNeeded]
13 -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
13 -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectFor View:topView:]
13 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectFor View:topView:]
12 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
8 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
8 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
7 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
6 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
5 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
3 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
3 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
2 -[NSView _drawRect:clip:]
2 -[NSControl drawRect:]
2 -[NSTextFieldCell drawWithFrame:inView:]
2 -[NSTextFieldCell drawInteriorWithFrame:inView:]
2 _NSDrawTextCell
2 _NSStringDrawingCore
1 -[NSStringDrawingTextStorage drawTextContainer:withRect:graphicsContext:baselineMode:scrollable:padding:]
1 -[NSLayoutManager glyphRangeForTextContainer:]
1 -[NSLayoutManager textContainerForGlyphAtIndex:effectiveRange:]
1 _NSFastFillAllLayoutHolesUpToEndOfContainerForGlyphIndex
1 -[NSLayoutManager(NSPrivate) _fillLayoutHoleAtIndex:desiredNumberOfLines:]
1 -[NSLayoutManager(NSPrivate) _fillLayoutHoleForCharacterRange:desiredNumberOfLines:isSoft:]
1 -[NSATSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:]
1 -[NSTypesetter layoutCharactersInRange:forLayoutManager:maximumNumberOfLineFragments:]
1 -[NSTypesetter _layoutGlyphsInLayoutManager:startingAtGlyphIndex:maxNumberOfLineFragments:maxC haracterIndex:nextGlyphIndex:nextCharacterIndex:]
1 -[NSTypesetter _getRemainingNominalParagraphRange:andParagraphSeparatorRange:charactarIndex:la youtManager:string:]
1 -[NSTypesetter _getRemainingNominalParagraphRange:andParagraphSeparatorRange:charactarIndex:la youtManager:string:]
1 -[NSStringDrawingTextStorage textContainerForAttributedString:containerSize:lineFragmentPadding:]
1 -[NSConcreteMutableAttributedString replaceCharactersInRange:withAttributedString:]
1 -[NSTextStorage edited:range:changeInLength:]
1 -[NSStringDrawingTextStorage processEditing]
1 0x23743
1 -[NSMutableAttributedString(NSMutableAttributedStringKitAdditions) fixAttributesInRange:]
1 -[NSMutableAttributedString(NSMutableAttributedStringKitAdditions) fixFontAttributeInRange:]
1 +[NSFontManager sharedFontManager]
1 +[NSFontManager sharedFontManager]
1 -[NSView lockFocus]
1 -[NSView lockFocusIfCanDraw]
1 -[NSWindow _copyAcquiredViewHierarchyLock]
1 -[NSViewHierarchyLock lockForReadingWithExceptionHandler:]
1 pthreadmutexlock
1 pthreadmutexlock
1 -[NSView _drawRect:clip:]
1 -[NSView _regionForOpaqueDescendants:forMove:]
1 objcmsgSendstret
1 objcmsgSendstret
1 objc_msgSend
1 objc_msgSend
1 -[NSView lockFocus]
1 -[NSView lockFocusIfCanDraw]
1 -[NSView _focusFromView:withContext:]
1 _runningOnAppKitThread
1 CFRunLoopGetCurrent
1 _CFRunLoop0
1 _CFRunLoop0
1 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
1 -[NSView _drawRect:clip:]
1 0xf158c
1 -[NSControl drawRect:]
1 -[NSControl currentEditor]
1 -[NSWindow fieldEditor:forObject:]
1 -[NSImageView respondsToSelector:]
1 -[NSObject respondsToSelector:]
1 -[NSObject respondsToSelector:]
3 -[NSView _drawRect:clip:]
3 -[NSThemeFrame drawRect:]
3 -[NSFrameView drawRect:]
3 -[NSFrameView drawThemeContentFill:inView:]
3 -[NSThemeFrame drawWindowBackgroundRect:]
3 -[NSFrameView drawWindowBackgroundRect:]
3 NSDrawWindowBackground
3 NSRectFillUsingOperation
3 CGContextFillRect
3 CGContextFillRects
3 ripc_DrawRects
2 ripc_Render
2 ripl_BltShape
2 ripd_Lock
2 CGSDeviceLock
2 _CGSLockWindow
2 _CGSSynchronizeWindowBackingStore
2 mach_msg
2 machmsgtrap
2 machmsgtrap
1 ripr_Rectangles
1 aa_rectat
1 aa_rectat
1 -[NSView _drawOverlayRectSet:]
1 objc_msgSend
1 objc_msgSend
1 NSIntersectionRect
1 NSIntersectionRect
10 -[NSView displayIfNeeded]
10 -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
9 -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectFor View:topView:]
9 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectFor View:topView:]
9 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
7 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
7 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
7 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
4 -[NSView _drawRect:clip:]
4 -[NSBox drawRect:]
4 DrawThemeBox
4 CUIRenderer::Draw(CGRect, CGContext*, __CFDictionary const*, __CFDictionary const**)
4 CUIRenderer::Draw9Piece(long, CUIContext const*, unsigned long)
4 CGContextDrawImages
4 ripc_DrawImages
4 ripc_RenderImage
4 ripl_BltImage
4 ripd_Mark
4 argb32_image
4 argb32imagemark
4 argb32sampleARGB32
4 argb32sampleARGB32
3 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
3 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
3 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
3 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
3 -[NSView _drawRect:clip:]
3 -[NSProgressIndicator drawRect:]
3 -[NSProgressIndicator _drawThemeBackground]
3 Draw3PartImage
3 _NSTileImageWithOperation
2 CGContextDrawLayerInRect
2 ripc_DrawLayer
2 ripc_RenderImage
2 ripl_BltImage
2 ripl_Mark
2 argb32_image
2 argb32imagemark
2 argb32imagemark
1 CGContextBeginTransparencyLayer
1 CGContextBeginTransparencyLayerWithRect
1 CGGStackSaveForLayer
1 CGGStateCreateCopyForLayer
1 calloc
1 malloczonecalloc
1 szone_calloc
1 tinymalloc_from_freelist
1 tinymalloc_from_freelist
1 -[NSView _drawOverlayRectSet:]
1 -[NSView lockFocusIfCanDraw]
1 -[NSWindow _copyAcquiredViewHierarchyLock]
1 OSAtomicAdd32Barrier
1 _atomicadd32
1 _atomicadd32
1 -[NSView _drawRect:clip:]
1 -[NSThemeFrame drawRect:]
1 -[NSFrameView drawRect:]
1 -[NSFrameView drawThemeContentFill:inView:]
1 -[NSThemeFrame drawWindowBackgroundRect:]
1 -[NSFrameView drawWindowBackgroundRect:]
1 NSDrawWindowBackground
1 NSRectFillUsingOperation
1 CGContextFillRect
1 CGContextFillRects
1 ripc_DrawRects
1 ripc_Render
1 ripl_BltShape
1 ripd_Lock
1 CGSDeviceLock
1 _CGSLockWindow
1 _CGSSynchronizeWindowBackingStore
1 mach_msg
1 machmsgtrap
1 machmsgtrap
1 -[NSWindow _copyNeedsDisplayRegionInRect:validateSubtractedRegion:]
1 -[NSRegion mutableCopy]
1 +[NSObject alloc]
1 +[NSObject allocWithZone:]
1 internal_classcreateInstance
1 internal_classcreateInstanceFromZone
1 calloc
1 malloczonecalloc
1 szone_calloc
1 szone_calloc
8 0x185c7c
8 -[NSView displayIfNeeded]
8 -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
7 -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectFor View:topView:]
7 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectFor View:topView:]
7 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
5 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
5 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
5 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
2 -[NSView _drawRect:clip:]
2 -[NSBox drawRect:]
2 DrawThemeBox
1 CUIRenderer::Draw(CGRect, CGContext*, __CFDictionary const*, __CFDictionary const**)
1 CUIRenderer::Draw9Piece(long, CUIContext const*, unsigned long)
1 CGContextDrawImages
1 ripc_DrawImages
1 ripc_RenderImage
1 ripl_BltImage
1 ripd_Mark
1 argb32_image
1 argb32imagemark
1 argb32sampleARGB32
1 argb32sampleARGB32
1 DrawThemeBox
2 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
2 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
2 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
1 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
1 -[NSView _drawRect:clip:]
1 -[NSControl drawRect:]
1 -[NSTextFieldCell drawWithFrame:inView:]
1 -[NSTextFieldCell drawInteriorWithFrame:inView:]
1 _NSDrawTextCell
1 _NSStringDrawingCore
1 +[NSStringDrawingTextStorage _fastDrawString:attributes:length:inRect:graphicsContext:baselineRendering:uses FontLeading:usesScreenFont:typesetterBehavior:paragraphStyle:lineBreakMode:bound ingRect:padding:scrollable:]
1 CGContextShowGlyphsWithAdvances
1 draw_glyphs
1 ripc_DrawGlyphs
1 ripl_BltGlyph
1 argb32_mark
1 CGSColorDeepMaskCopyARGB8888
1 CGSColorDeepMaskCopyARGB8888
1 -[NSView unlockFocus]
1 objc_msgSend
1 objc_msgSend
1 -[NSView lockFocus]
1 -[NSView lockFocusIfCanDraw]
1 PSgsave
1 CGContextSaveGState
1 CGGStackSave
1 CGGStateCreateCopy
1 calloc
1 malloczonecalloc
1 szone_calloc
1 szone_calloc
2 -[NSView _drawRect:clip:]
2 -[NSThemeFrame drawRect:]
2 -[NSFrameView drawRect:]
2 -[NSFrameView drawThemeContentFill:inView:]
1 -[NSThemeFrame _regionForOpaqueDescendants:forMove:]
1 -[NSView _regionForOpaqueDescendants:forMove:]
1 -[NSView _regionForOpaqueDescendants:forMove:]
1 -[NSView _regionForOpaqueDescendants:forMove:]
1 -[NSView _regionForOpaqueDescendants:forMove:]
1 -[NSView _regionForOpaqueDescendants:forMove:]
1 objc_msgSend
1 objc_msgSend
1 -[NSThemeFrame drawWindowBackgroundRect:]
1 -[NSFrameView drawWindowBackgroundRect:]
1 NSDrawWindowBackground
1 NSRectFillUsingOperation
1 CGContextFillRect
1 CGContextFillRects
1 ripc_DrawRects
1 ripc_Render
1 ripl_BltShape
1 ripd_Lock
1 CGSDeviceLock
1 _CGSLockWindow
1 _CGSSynchronizeWindowBackingStore
1 mach_msg
1 machmsgtrap
1 machmsgtrap
1 -[NSWindow flushWindow]
1 CGContextFlush
1 ripc_Operation
1 CGSDeviceSynchronize
1 _CGSFlushRegionInline
1 mach_msg
1 machmsgtrap
1 machmsgtrap
7 0x185c54
7 -[NSView displayIfNeeded]
7 -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
7 -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectFor View:topView:]
7 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectFor View:topView:]
7 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
6 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
6 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
4 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
2 -[NSView _drawRect:clip:]
2 -[NSBox drawRect:]
2 DrawThemeBox
2 CUIRenderer::Draw(CGRect, CGContext*, __CFDictionary const*, __CFDictionary const**)
1 CUIRenderer::DecodeToCUIInfo(CGRect, CGContext*, __CFDictionary const*, CUIInfo*)
1 CUIConstantToMapID(__CFString const*)
1 CFDictionaryGetValue
1 CFDictionaryGetValue
1 CUIRenderer::Draw9Piece(long, CUIContext const*, unsigned long)
1 CGContextDrawImages
1 ripc_DrawImages
1 ripc_RenderImage
1 ripl_BltImage
1 ripd_Mark
1 argb32_image
1 argb32imagemark
1 argb32imagemark
1 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
1 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
1 -[NSView _drawRect:clip:]
1 -[NSView _regionForOpaqueDescendants:forMove:]
1 -[NSView _regionForOpaqueDescendants:forMove:]
1 -[NSView convertRect:toView:]
1 -[NSView _convertRect:toAncestor:]
1 -[NSView _convertRect:toAncestor:]
1 -[NSView _convertRect:toAncestor:]
1 -[NSView _convertRect:toAncestor:]
1 -[NSView _convertRect:toAncestor:]
1 -[NSView _convertRect:toAncestor:]
1 objcmsgSendstret
1 objcmsgSendstret
1 -[NSView lockFocus]
1 -[NSView lockFocusIfCanDraw]
1 PSgsave
1 -[NSCFArray addObject:]
1 CFArrayGetCount
1 CFArrayGetCount
2 -[NSView _drawRect:clip:]
2 0xf158c
2 -[NSControl drawRect:]
2 -[NSImageCell drawWithFrame:inView:]
2 -[NSImageCell drawInteriorWithFrame:inView:]
2 -[NSImage _drawMappingAlignmentRectToRect:withState:backgroundStyle:operation:fraction:fl ip:]
1 -[NSImage drawInRect:fromRect:operation:fraction:]
1 -[NSBitmapImageRep _drawFromRect:toRect:operation:alpha:compositing:flipped:ignoreContext:]
1 CGContextDrawImage
1 ripc_DrawImage
1 ripc_RenderImage
1 ripl_BltImage
1 ripd_Mark
1 argb32_image
1 sseCGSBlendXXXX8888Transpose
1 sseCGSBlendXXXX8888Transpose
1 objc_msgSend
1 objc_msgSend
1 -[NSView unlockFocus]
1 -[NSFocusStack fixInvalidatedFocusForFocusView]
1 -[NSFocusStack fixInvalidatedFocusForFocusView]
1 NSPopAutoreleasePool
1 -[NSObject release]
1 __CFDoExternRefOperation
1 __CFDoExternRefOperation
1 __CFRunLoopDoObservers
1 _handleWindowNeedsDisplay
1 CFRunLoopGetCurrent
1 _CFRunLoop0
1 CFDictionaryGetValue
1 __CFDictionaryFindBuckets1a
1 __CFDictionaryFindBuckets1a
1 __CFRunLoopModeFindSourceForMachPort
1 CFSetApplyFunction
1 __CFRunLoopFindSource
1 __CFRunLoopFindSource
1327 Thread_2603
1327 thread_start
1327 pthreadstart
1327 CAPThread::Entry(CAPThread*)
1327 HALRunLoop::OwnThread(void*)
1327 CFRunLoopRunInMode
1327 CFRunLoopRunSpecific
1327 mach_msg
1327 machmsgtrap
1327 machmsgtrap
1327 Thread_2703
1327 thread_start
1327 pthreadstart
1327 _NSThread__main_
1327 -[NSThread main]
1327 +[NSURLConnection(NSURLConnectionReallyInternal) _resourceLoadLoop:]
1327 CFRunLoopRunInMode
1327 CFRunLoopRunSpecific
1327 mach_msg
1327 machmsgtrap
1327 machmsgtrap
1327 Thread_2803
1327 thread_start
1327 pthreadstart
1327 _NSThread__main_
1327 -[NSThread main]
1327 -[NSUIHeartBeat _heartBeatThread:]
1327 -[NSConditionLock lockWhenCondition:]
1327 -[NSConditionLock lockWhenCondition:beforeDate:]
1327 -[NSCondition waitUntilDate:]
1327 pthreadcond_timedwait_relativenp
1327 pthread_condwait
1327 semaphoretimedwait_signaltrap
1327 semaphoretimedwait_signaltrap
1327 Thread_2903
1327 thread_start
1327 pthreadstart
1327 select$DARWIN_EXTSN
1327 select$DARWIN_EXTSN
1327 Thread_2a03
1327 thread_start
1327 pthreadstart
1327 CFURLCacheWorkerThread(void*)
1327 CFRunLoopRunInMode
1327 CFRunLoopRunSpecific
1327 mach_msg
1327 machmsgtrap
1327 machmsgtrap
Total number in stack (recursive counted multiple, when >=5):
30 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
13 -[NSView _drawRect:clip:]
8 -[NSView _regionForOpaqueDescendants:forMove:]
8 mach_msg
8 machmsgtrap
6 -[NSView _convertRect:toAncestor:]
5 -[NSView lockFocusIfCanDraw]
5 CFRunLoopRunInMode
5 CFRunLoopRunSpecific
5 pthreadstart
5 argb32_image
5 objc_msgSend
5 ripc_RenderImage
5 ripl_BltImage
5 thread_start
Sort by top of stack, same collapsed (when >= 5):
machmsgtrap 5272
select$DARWIN_EXTSN 1327
semaphoretimedwait_signaltrap 1327
argb32sampleARGB32 5
objc_msgSend 5
Sample analysis of process 1779 written to file /dev/stdout
I have repeated the process by removing any bundles, IMAP and .Mac accounts in the mail folder, with no success.
Any ideas what to do?
Best,I don't know what's wrong with your Mail but you can try the following. Move the file homedirectory/Library/Preferences/com.apple.mail.plist and the folder homedirectory/Library/Mail to the desktop.
Start Mail. It will take you through account setup so you'll have to set up your accounts again. Once that's finished go to File menu->import mailboxes and import your mailboxes from the Mail folder sitting on your desktop. -
Which to use - Sy-index or sy-tabix ??
This is what i found out about SY-INDEX and SY-TABIX but which one to use when i want to delete a line of data from an internal table ? I tried both sy-index and sy-tabix and both works fine and returning the expected output for me but which one is better of to use ?
SY-TABIX :- For Internal Table, Current Line Index
SY-INDEX :- For Loops, Current Loop Pass
The below code is where i uses the Delete ..
LOOP AT dmg.
CONCATENATE
dmg-dmg00
dmg-dmg01
dmg-dmg02
dmg-dmg03
dmg-dmg04
dmg-dmg07
dmg-dmg08
dmg-dmg09 INTO tli_down1 SEPARATED BY '*'.
APPEND tli_down1. CLEAR tli_down1.
DELETE dmg INDEX sy-index.
EXIT.
ENDLOOP.Right. Just like what they said upstairs, sy-babix is the best choice.
One more thing is, if you want to concatenate fields of table dmg and append to tli_down1 on by one. You should not use EXIT after delete dmg.
In that case ,only one line can be appended into tli_down1 table.
> The below code is where i uses the Delete ..
>
> LOOP AT dmg.
> CONCATENATE
> dmg-dmg00
> dmg-dmg01
> dmg-dmg02
> dmg-dmg03
> dmg-dmg04
> dmg-dmg07
> dmg-dmg08
> dmg-dmg09 INTO tli_down1 SEPARATED BY '*'.
> APPEND tli_down1. CLEAR tli_down1.
> DELETE dmg INDEX sy-index.
> EXIT.
> ENDLOOP. -
Index's on cubes or Aggregates on infoobjects
Hello,
Please tell me if it is possible to put index's on cubes; are they automatically added or is this something I put on them?
I do not understand index's are they like aggregates?
Need to find info that explains this.
Thanks for the hlep.
NewbieIndexes are quite different from aggregates.
An Aggregate is a slice of a cube which helps the data retrival on a faster note when a query is executed on a cube. Basically it is kind of a snapshot of KPI's and Business Indicators (Chars) which will be displayed as the initial query run result.
Index is a process which is inturn will reduce the query response time. While an object gets activated, the system automatically create primary indexes. Optionaly, you can create additional index called secondary indexes.Before loading data, it is advisable to delete the indexes and insert them back after the loading.
Indexes act like pointers for quickly geting the Data.When u delete it will delete indexes and when u create it will create the indexes.
When loading we delete Bcs during loading it has to look for existing Indexes and try to update so it will effect the Data load performence so we delete and create it will take less time when compared to updating the existing ones.
There is one more issue we have to take care if u r having more than 50 million records this is not a good practice insteah we can delete and create during week end when they r no users. -
LIKE, LIKEC and Index usage
I've table that contains about 20 million rows, and I've created index for varchar2(100) column. It works well if I do
SELECT * FROM MY_TABLE WHERE MY_COL LIKE 'FOO%';
But if I change query to use LIKEC (to make unicode escaped strings work):
SELECT * FROM MY_TABLE WHERE MY_COL LIKEC 'FOO%';
I always get full table scan in explain plan.
I tried to use NVARCHAR, or index created by TO_NCHAR but I always end up hitting full table scan.
Should I create index some special way or do something else before I get index working?Just a gut feeling : is the database using character semantics or byte semantics?
My gut feeling, after looking up the documentation, is it should be character semantics.
BTW: Not posting version info decreases the chance you get an adequate reply.
Sybrand Bakker
Senior Oracle DBA -
Index with "or" clause (BUG still exists?)
The change log for 2.3.10 mentions "Fixed a bug that caused incorrect query plans to be generated for predicates that used the "or" operator in conjunction with indexes [#15328]."
But looks like the Bug still exists.
I am listing the steps to-repro. Let me know if i have missed something (or if the bug needs to be fixed)
DATA
dbxml> openContainer test.dbxml
dbxml> getDocuments
2 documents found
dbxml> print
<node><value>a</value></node>
<node><value>b</value></node>
INDEX (just one string equality index on node "value")
dbxml> listIndexes
Index: unique-node-metadata-equality-string for node {http://www.sleepycat.com/2002/dbxml}:name
Index: node-element-equality-string for node {}:value
2 indexes found.
QUERY
setVerbose 2 2
preload test.dbxml
query 'let $temp := fn:compare("test", "test") = 0
let $results := for $i in collection("test.dbxml")
where ($temp or $i/node[value = ("a")])
return $i
return <out>{$temp}{$results}</out>'
When $temp is true i expected the result set to contain both the records, but that was not the case with the index. It works well when there is no index!
Result WITH INDEX
dbxml> print
<out>true<node><value>a</value></node></out>
Result WITHOUT INDEX
dbxml> print
<out>true<node><value>a</value></node><node><value>b</value></node></out>Hi Vijay,
This is a completely different bug, relating to predicate expressions that do not examine nodes. Please try the following patch, to see if it fixes this bug for you:
--- dbxml-2.3.10-original/dbxml/src/dbxml/optimizer/QueryPlanGenerator.cpp 2007-04-18 10:05:24.000000000 +0100
+++ dbxml-2.3.10/dbxml/src/dbxml/optimizer/QueryPlanGenerator.cpp 2007-08-08 11:32:10.000000000 +0100
@@ -1566,11 +1572,12 @@
else if(name == Or::name) {
UnionQP *unionOp = new (&memMgr_) UnionQP(&memMgr_);
+ result.operation = unionOp;
for(VectorOfASTNodes::iterator i = args.begin(); i != args.end(); ++i) {
PathResult ret = generate(*i, ids);
unionOp->addArg(ret.operation);
+ if(ret.operation == 0) result.operation = 0;
- result.operation = unionOp;
// These operators use the presence of the node arguments, not their valueJohn -
Hi,
Can some body explain the CLEAR difference between Sy-index and Sy-tabix. And one or two small examples. I am little bit confused.
Thanx.Hi,
SY-INDEX
In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.
SY-TABIX
Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.
APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
SEARCH <itab> FOR sets SY-TABIX to the index of the table line in which the search string is found.
regards,
madhu -
What is" LINE-COL2 = SY-INDEX ** 2."
can u explain what is '' ** "
FIELD-SYMBOLS <FS> LIKE LINE OF ITAB.
DO 4 TIMES.
LINE-COL1 = SY-INDEX.
LINE-COL2 = SY-INDEX ** 2. "what this will do
APPEND LINE TO ITAB.
ENDDO.Hi sunil,
1 ** means "To the power of"
2. eg. 5 ** 2 = 25
(5 To the power of 2 = 25)
regards,
amit m. -
Hi all,
I am trying to get loop count by using sy-index.
But I am not able get exact expected out put.
I am gettig all zeros instead of loop number.
I am sending my code here.
DATA: lv_diff(10) TYPE c,
lv_erdat1 LIKE sy-datum,
lv_erdat2 LIKE sy-datum,
i(15) TYPE c VALUE '1'.
SORT t_ordno BY aufnr.
LOOP AT t_ordno INTO st_ordno.
READ TABLE t_ordno INTO st_ordno INDEX i.
lv_erdat1 = st_ordno-erdat.
i = i + 1.
READ TABLE t_ordno INTO st_ordno INDEX i.
lv_erdat2 = st_ordno-erdat.
i = i + 1.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = lv_erdat2
i_datum_von = lv_erdat1
IMPORTING
e_tage = lv_diff.
WRITE:/ lv_diff,
50 <u><b>sy-index.</b></u>
CLEAR: lv_erdat1,lv_erdat2,lv_diff.use this code
DATA: lv_diff(10) TYPE c ,
lv_erdat1 LIKE sy-datum ,
lv_erdat2 LIKE sy-datum ,
i(15) TYPE c VALUE '1' ,
l_tabix type syst-tabix .
SORT t_ordno BY aufnr.
LOOP AT t_ordno INTO st_ordno.
l_tabix = sy-tabix .
READ TABLE t_ordno INTO st_ordno INDEX i.
lv_erdat1 = st_ordno-erdat.
i = i + 1.
READ TABLE t_ordno INTO st_ordno INDEX i.
lv_erdat2 = st_ordno-erdat.
i = i + 1.
CALL FUNCTION 'DAYS_BETWEEN_TWO_DATES'
EXPORTING
i_datum_bis = lv_erdat2
i_datum_von = lv_erdat1
IMPORTING
e_tage = lv_diff.
WRITE:/ lv_diff,
50 l_tabix.
CLEAR: lv_erdat1,lv_erdat2,lv_diff. -
ANY SY-INDEX REFLECT CHANGES WHEN CONTROL BREAK STATEMENT PROCESS
Dear Guru's,
I have a requirement where i have to move the values to variable when control break (AT END OF) process. So i want to move the values according to the end of Vendor so for that i want to know is there any sy-index available which reflects changes when Control break (AT end of) process.
LIKE Sy-subrc = 0 when select statement fetches record or sy-tabix is like counter for loop.
Hope to get reply soon.
Regards,
Himanshu RangappaHi,
There is no system Fields for it.
But your requirement can be done with 'AT NEW' and 'AT END' statement.
Refer this sample example,
loop at otab.
at new module.
move otab-module to otab2-module.
ENDAT.
at END OF effort.
sum. "Do your calculations here
move otab-count to otab2-count.
append otab2.
endat.
endloop. -
What is the diffrence betweensy-tabix and sy-index
hi
can any one suggest me
what is the diffrence betweensy-tabix and sy-index
Thanks & Regards
kalyan.Hi Kalyan,
This question has been answered many times on SCN. Please make a search before posting a thread.
Read the Rules of Engagement.
Happy Posting.
Regards,
Chandra Sekhar -
ABAP-- diff between sy-sy-tabix and sy-index
Hi Guru's,
Pleae can anybody expalins me what is the difference between sy-tabix and sy-index(Loop Index) ?
Because in one case i am Modifyimg the internal table inside the do loop by giving sy-index ((Index of Internal Tables)(MODIFY scarr_tab INDEX sy-index FROM scarr_wa TRANSPORTING currcode. ) in the syntax and in other case inside loop statement i am modifyng same record by giving sy-tabix MODIFY scarr_tab INDEX sy-tabix FROM scarr_wa TRANSPORTING currcode.) in the syntax.
in both cases its working fine but i am not getting which one i have to use where to modify the internal table?
regards
SATYAHi Henry,
SY-INDEX is the value of the current iteration. It is applicable for the following programming constructs in ABAP -
DO...ENDDO.
WHILE...ENDWHILE.
SY-TABIX (TABle IndeX) is applicable to internal tables. If you scroll down in the link which Eddie has given, you will find a more detailed explanation for sy-tabix and which statements affect its value.
Regards,
Anand Mandalika. -
What is difference between sy-tabix and sy-index.
SAP Seniors,
Can you please let me know what is difference between sy-index and sy-tabix.
I read the SAP help, it is confusing for me. it looks like both are same from help. please help me.
Thank you
Anitha.HI,
Here is a brief description of difference between SY_TABIX and SY_INDEX and using them with several conditions.
SY-TABIX
Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.
APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
SEARCH <itab> FOR sets SY-TABIX to the index of the table line in which the search string is found.
SY-INDEX
In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.
Hope this helps.
Thank you,
Pavan. -
What is diff b/w sy-index and sy-tabix
Hi all,
Can u plz give me the diff b/w sy-index and sy-tabix exactly and how it works.
Thanks & Regards
VenkatHi Venkat,
<b>1.SY-INDEX</b>
<b>-></b>Current loop pass
<b>-></b>In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.
<b>2.SY-TABIX</b>
<b>-></b>Current line index
Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables.
The field is either not set or is set to 0 for hashed tables.
<b>APPEND</b> sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
<b>
COLLECT</b> sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
<b>LOOP AT</b> sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
<b>READ TABLE</b> sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
<b>
SEARCH</b> <itab> FOR sets SY-TABIX to the index of the table line in which the search string is found.
I think that it clears ur doubt.
<b>Thanks,
Venkat.O</b> -
Difference between sy-tabix and sy-index?
tell me about sy-tabix and sy-index?what is the difference between sy-tabix and sy-index?
Moderator Message: Please search before posting. Read the [Forum Rules Of Engagement |https://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement] for further details.
Edited by: Suhas Saha on Jun 18, 2011 5:33 PMHI,
Here is a brief description of difference between SY_TABIX and SY_INDEX and using them with several conditions.
SY-TABIX
Current line of an internal table. SY-TABIX is set by the statements below, but only for index tables. The field is either not set or is set to 0 for hashed tables.
APPEND sets SY-TABIX to the index of the last line of the table, that is, it contains the overall number of entries in the table.
COLLECT sets SY-TABIX to the index of the existing or inserted line in the table. If the table has the type HASHED TABLE, SY-TABIX is set to 0.
LOOP AT sets SY-TABIX to the index of the current line at the beginning of each loop lass. At the end of the loop, SY-TABIX is reset to the value that it had before entering the loop. It is set to 0 if the table has the type HASHED TABLE.
READ TABLE sets SY-TABIX to the index of the table line read. If you use a binary search, and the system does not find a line, SY-TABIX contains the total number of lines, or one more than the total number of lines. SY-INDEX is undefined if a linear search fails to return an entry.
SEARCH <itab> FOR sets SY-TABIX to the index of the table line in which the search string is found.
SY-INDEX
In a DO or WHILE loop, SY-INDEX contains the number of loop passes including the current pass.
Hope this helps.
Thank you,
Pavan.
Maybe you are looking for
-
Having trouble configuring xorg 1.6
Hi all, I've started installing Arch today on my Laptop, using both the official install guide & beginners guide. However after installing the xf86-video-ati, and attempting to configure my xorg.conf file I have run into problems. No errors are displ
-
Changing the iCloud account on an iMac
Hi, I loaded the wrong iCloud account onto our iMac and can't figure out how to change it to the correct one? System preference only shows me account details but no way of removing the account itself. Any help appreciated. Thanks
-
The e-mail program works fine but stops rotating after while. In order to get it to change direction again I must do a shut down of the iPAD2 and restart...then it's fine. Any ideas how to fix this?
-
I have just started to have problems with my ipod 20g (4th gen) it all started with the ipod taking ages to start playing, it also wouldn't skip to the next track. The folder logo appeared and told me to go to the apple web site, I did what the site
-
Effect Controls Blank For Any Selected Clip
Hello Adobe Community, After much searching, I have been unable to find a solution to my problem and so turn to you, the community. Essentially, I am using Adobe Premiere Pro CC and would like to apply a rotation effect to a particular clip (Accid