Please help me to implement my logic.

Hi Experts,
I am providing the complete code and my exact requirement.
CREATE OR REPLACE PACKAGE INTERNAL_SCORING_RAM
IS
PROCEDURE TrendScoring_ram(pBUID       IN STAGING_ORDER_DATA.BUID%TYPE,
                         OrderNum    IN STAGING_ORDER_DATA.ORDER_NUM%TYPE,
                         ReturnValue OUT VARCHAR2);
PROCEDURE InsertTrend_ram(pBUID        IN ORDER_TREND_SCORE.BUID%TYPE,
                        OrderNum     IN ORDER_TREND_SCORE.ORDER_NUM%TYPE,
                        Variable     IN ORDER_TREND_SCORE.TREND_VARIABLE%TYPE,
                        DeductPoints IN ORDER_TREND_SCORE.DEDUCTION_POINTS%TYPE,
                        FraudPct     IN ORDER_TREND_SCORE.FRAUD_PERCENTAGE%TYPE,
                        FraudWkdPct  IN ORDER_TREND_SCORE.FRAUD_WORKED_PERCENTAGE%TYPE);
END;
CREATE OR REPLACE PACKAGE BODY INTERNAL_SCORING_RAM
IS
PROCEDURE trendscoring_ram
(pBUID  IN STAGING_ORDER_DATA.BUID%TYPE,
  OrderNum  IN STAGING_ORDER_DATA.ORDER_NUM%TYPE,
  ReturnValue OUT VARCHAR2)
IS
    tCleanProdDesc  ORDERS.PRODUCT_DESC%TYPE;
    tLocalChannel   STAGING_ORDER_DATA.LOCAL_CHANNEL%TYPE;
    tSKUNum         STAGING_ORDER_DATA.SKU_NUM%TYPE;
    tDeductionPoints  TREND.DEDUCTION_POINTS%TYPE := 0;
    tFrdPct           TREND.FRAUD_TOTAL_PERCENTAGE%TYPE := 0;
    tFrdWkdPct        TREND.FRAUD_WORKED_PERCENTAGE%TYPE := 0;
    tCount          NUMBER := 0;
    tAVS            VARCHAR2(50);
    tScore          SCORE.VENDOR_COMBINED_SCORE%TYPE;
    tProdDesc       ORDERS.PRODUCT_DESC%TYPE;
   tPayCode        ORDERS.PAY_CODE%TYPE;
BEGIN
  ReturnValue := 'get order header';
SELECT stgOrder.LOCAL_CHANNEL
      INTO tLocalChannel
      FROM STAGING_ORDER_DATA stgOrder
     WHERE stgOrder.BUID = pBUID
     AND stgOrder.ORDER_NUM = OrderNum
     AND stgOrder.ADDRESS_TYPE = 'B';
      SELECT ord.PRODUCT_DESC,
            NVL (ord.SKU_NUM, ''),
            NVL (cc.AVS_CC_CODE, ''),
            NVL (s.VENDOR_COMBINED_SCORE, -1)
  INTO    tProdDesc,tSKUNum, tAVS, tScore
  FROM   MASTER_CURRENCY exchg,
               ORDERS ord
            LEFT OUTER JOIN
               (  SELECT   BUID,
                           ORDER_NUM,
                           MIN (AVS_CC_CODE) AS AVS_CC_CODE,
                           MIN (CID_CODE) AS CID_CODE
                    FROM   CREDIT_CARD
                   WHERE   BUID = pBUID AND ORDER_NUM = OrderNum
                GROUP BY   BUID, ORDER_NUM) cc
            ON ord.BUID = cc.BUID AND ord.ORDER_NUM = cc.ORDER_NUM
         LEFT OUTER JOIN SCORE s
         ON ord.BUID = s.BUID
         AND ord.ORDER_NUM = s.ORDER_NUM
WHERE   ord.CURRENCY_CODE = exchg.CURRENCY_CODE
         AND ord.BUID = pBUID
         AND ord.ORDER_NUM = OrderNum;
------SKU Num---------------------------------------------------------
     ReturnValue := 'sku Num';
   BEGIN
     SELECT DEDUCTION_POINTS,
             FRAUD_TOTAL_PERCENTAGE,
             FRAUD_WORKED_PERCENTAGE
        INTO tDeductionPoints, tFrdPct, tFrdWkdPct
        FROM TREND
       WHERE VARIABLE_NAME = 'sku num' AND
             UPPER(VARIABLE_VALUE) = tSKUNum AND BUID = pBUID AND
             LOCAL_CHANNEL = tLocalChannel
         AND DEDUCTION_POINTS IS NOT NULL;
    ReturnValue := 'product degredation';
         InsertTrend_ram(pBUID,OrderNum,'sku num: ' || tSKUNum,tDeductionPoints,tFrdPct,tFrdWkdPct);
EXCEPTION
WHEN no_data_found THEN
tCleanProdDesc := fn_cleanproddesc(UPPER(tProdDesc));
    ReturnValue := 'product degredation';
--product degredation---------------------------------------------------------
    BEGIN
    SELECT DEDUCTION_POINTS,
              FRAUD_TOTAL_PERCENTAGE,
              FRAUD_WORKED_PERCENTAGE
         INTO tDeductionPoints, tFrdPct, tFrdWkdPct
         FROM TREND
        WHERE VARIABLE_NAME = 'product' AND
             UPPER(VARIABLE_VALUE) = tCleanProdDesc
         AND BUID = pBUID
         AND LOCAL_CHANNEL = tLocalChannel
     AND DEDUCTION_POINTS IS NOT NULL;
       InsertTrend_ram(pBUID,OrderNum,'product: ' || tCleanProdDesc,tDeductionPoints,tFrdPct,tFrdWkdPct);
     EXCEPTION
     WHEN no_data_found THEN
      NULL;
     END;
END;
-----pay code--------------------------------------------------------------------
ReturnValue := 'pay code';
    BEGIN
      SELECT DEDUCTION_POINTS,
             FRAUD_TOTAL_PERCENTAGE,
             FRAUD_WORKED_PERCENTAGE
        INTO tDeductionPoints, tFrdPct, tFrdWkdPct
        FROM TREND
       WHERE VARIABLE_NAME = 'payment code' AND VARIABLE_VALUE = tPayCode AND
             BUID = pBUID AND LOCAL_CHANNEL = tLocalChannel
              AND DEDUCTION_POINTS IS NOT NULL;
      InsertTrend_ram(pBUID,OrderNum,'pay code: ' || tPayCode,tDeductionPoints,tFrdPct,tFrdWkdPct);
EXCEPTION
WHEN no_data_found THEN
NULL;
END;
--ship code--------------------------------------------------------------------
--InsertTrend_ram(pBUID,OrderNum,'ship code: ' || tShipCode,tDeductionPoints,tFrdPct,tFrdWkdPct);
--source system flag----------------------------------------------------------
--InsertTrend_ram(pBUID,OrderNum, 'source system flag: ' || tSrcSys,tDeductionPoints,tFrdPct,tFrdWkdPct);
--st address diff flag--------------------------------------------------------
--InsertTrend_ram(pBUID,OrderNum, 'st address diff flag: ' || tSTDiff,tFrdPct,tFrdWkdPct);
---inserttrend_ram procedure calling 70 times
END  trendscoring_ram;
PROCEDURE InsertTrend_ram (
   pBUID          IN ORDER_TREND_SCORE.BUID%TYPE,
   OrderNum       IN ORDER_TREND_SCORE.ORDER_NUM%TYPE,
   Variable       IN ORDER_TREND_SCORE.TREND_VARIABLE%TYPE,
   DeductPoints   IN ORDER_TREND_SCORE.DEDUCTION_POINTS%TYPE,
   FraudPct       IN ORDER_TREND_SCORE.FRAUD_PERCENTAGE%TYPE,
   FraudWkdPct    IN ORDER_TREND_SCORE.FRAUD_WORKED_PERCENTAGE%TYPE
IS
BEGIN
DELETE FROM  ORDER_TREND_SCORE WHERE  BUID = pBUID AND ORDER_NUM = OrderNum AND TREND_VARIABLE = Variable;
   INSERT INTO ORDER_TREND_SCORE (BUID,
                                  ORDER_NUM,
                                  TREND_VARIABLE,
                                  DEDUCTION_POINTS,
                                  FRAUD_PERCENTAGE,
                                  FRAUD_WORKED_PERCENTAGE)
     VALUES   (pBUID,
               OrderNum,
               Variable,
               DeductPoints,
               FraudPct,
               FraudWkdPct);
END InsertTrend_ram;
END;
/In my code the procedure "trendscoring_ram" is calling "inserttrend_ram" procedure 70 times
for different variable values.
Instead of calling the "inserttrend_ram" procedure 70 times.
I want to hold the values in a associative array , defining it in package and call that procedure only once.
As below.
Inserttrend_ram(pBUID, OrderNum, Associativearray, Associativearray, Associativearray,Associativearray);
For that I have tried the following but it's not working.
IN the package I have declared the associative array like this.
TYPE type_ots IS TABLE OF ORDER_TREND_SCORE%ROWTYPE INDEX BY PLS_INTEGER;
I have modified the inserttrend_ram as below.
PROCEDURE InsertTrend_ram(
                            P_TYPE_OTS_REC IN type_ots
        IS
        BEGIN
            FORALL i in P_TYPE_OTS_REC.FIRST.. P_TYPE_OTS_REC.LAST
              DELETE
                FROM ORDER_TREND_SCORE
                WHERE BUID = P_TYPE_OTS_REC(i).BUID
                  AND ORDER_NUM = P_TYPE_OTS_REC(i).ORDER_NUM
                  AND TREND_VARIABLE = P_TYPE_OTS_REC(i).TREND_VARIABLE;
            FORALL i in P_TYPE_OTS_REC.FIRST.. P_TYPE_OTS_REC.LAST
              INSERT INTO ORDER_TREND_SCORE(
                                            BUID,
                                            ORDER_NUM,
                                            TREND_VARIABLE,
                                            DEDUCTION_POINTS,
                                            FRAUD_PERCENTAGE,
                                            FRAUD_WORKED_PERCENTAGE
              VALUES(
                     P_TYPE_OTS_REC(i).BUID,
                     P_TYPE_OTS_REC(i).ORDER_NUM,
                     P_TYPE_OTS_REC(i).TREND_VARIABLE,
                     P_TYPE_OTS_REC(i).DEDUCTION_POINTS,
                     P_TYPE_OTS_REC(i).FRAUD_PERCENTAGE,
                     P_TYPE_OTS_REC(i).FRAUD_WORKED_PERCENTAGE
END InsertTrend_ram;Please help me.
Thanks in advance.

For that I have tried the following but it's not working.As you don't specify the error message, and we don't have your table definitions and you posted several hundreds of lines of code, we can not reproduce your problem, so you won't get any responses.
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • Please help me to build the logic

    Hi All,
    Please help me to implement the following logic.
    The conditional statements should not only be executed in sequence, but also if any of them are true they should not be overridden by any subsequent conditional statements being true.
    When actual effort Accepted or Rejected for AST proposals and calculate a flag for “enhance to AST guideline” = Y/N as follows for each employee and display at the employee level
    1)If AST eligibility = N AND proposed AST % >0, then “N”
    2)Else If AST eligibility = N AND proposed AST % = 0 then “n/a”
    3)Else If AST eligibility = Y AND Act Rank = 3 AND proposed AST = 0 then “Y”
    4)Else If AST eligibility = Y AND Act Rank = 3 AND proposed AST >0 then “N”
    5)Else If AST eligibility = Y AND Act Rank = 2 AND proposed AST = 0 then “Y”
    6)Else If AST eligibility = Y AND AST % is greater than or equal to the AST guideline minimum AND less than or equal to the AST guideline maximum, then “Y”
    7)Else If AST eligibility = Y AND AST % is less than the minimum guideline OR greater than the maximum guideline, then “N”
    I tried the following code but I am not getting the expected result .
    Could you Please help me to build the logic.
    Your earliest response is very helpful to me.
    if (upper(P_stat)='ACCEPTED' or upper(P_stat) like 'REJECTED%') then
    else if NVL(P_elgi,'N') <> 'Y' AND P_prop > '0' then
    P_flag := 'N';
    else if(NVL(P_elgi,'N') <> 'Y' AND P_prop = '0') then
    P_flag := 'N/A';
    else if ((NVL(P_elgi,'N')='Y') AND P_rank = '3' AND P_prop = '0') then
    P_flag := 'Y';
    else if((NVL(P_elgi,'N')='Y') AND P_rank = '3' AND P_prop > '0') then
    P_flag := 'N';
    else if((NVL(P_elgi,'N')='Y') AND P_rank = '2' AND P_prop = '0') then
    P_flag := 'Y';
    Else if (P_prop >=ast_min_guide AND P_prop <= ast_max_guide ) then
    P_flag := 'Y';
    else
    ((P_prop < ast_min_guide) OR (P_prop > ast_max_guide)) then
    P_flag := 'N';
    end if;
    end if;

    Thanks for ur quick responce .
    When actual effort Accepted or Rejected for AST proposals and calculate a flag for “enhance to AST guideline” = Y/N
    Once the above condition is satisfied we have to check for remaing conditions
    if (upper(P_stat)='ACCEPTED' or upper(P_stat) like 'REJECTED%') then
    once it is satisfies then we have to go for remaing conditions.
    how can we do it in CASE statement.
    1)If AST eligibility = N AND proposed AST % >0, then “N”
    2)Else If AST eligibility = N AND proposed AST % = 0 then “n/a”
    3)Else If AST eligibility = Y AND Act Rank = 3 AND proposed AST = 0 then “Y”
    4)Else If AST eligibility = Y AND Act Rank = 3 AND proposed AST >0 then “N”
    5)Else If AST eligibility = Y AND Act Rank = 2 AND proposed AST = 0 then “Y”
    6)Else If AST eligibility = Y AND AST % is greater than or equal to the AST guideline minimum AND less than or equal to the AST guideline maximum, then “Y”
    7)Else If AST eligibility = Y AND AST % is less than the minimum guideline OR greater than the maximum guideline, then “N”
    I tried the following code but I am not getting the expected result .

  • Please help!!!! logic 9 keeps crashing!!!!!!!

    i been on here for a few days trying to figure out my problem but still no luck. logic will open up after i made a new account. but still crashes under my original account. here is my report if somebody can please help me with this problem...
    Process:         Logic Pro [754]
    Path:            /Applications/Logic Pro.app/Contents/MacOS/Logic Pro
    Identifier:      com.apple.logic.pro
    Version:         9.1.8 (1700.67)
    Build Info:      Logic-17006700~1
    Code Type:       X86 (Native)
    Parent Process:  launchd [95]
    Date/Time:       2012-12-09 15:25:32.054 -0900
    OS Version:      Mac OS X 10.6.8 (10K549)
    Report Version:  6
    Interval Since Last Report:          181914 sec
    Crashes Since Last Report:           -99
    Per-App Interval Since Last Report:  2885 sec
    Anonymous UUID:                      C36019A3-EC52-4685-BE40-34F1CB4C965E
    Exception Type:  EXC_BAD_ACCESS (SIGBUS)
    Exception Codes: KERN_PROTECTION_FAILURE at 0x000000000004ffc8
    Crashed Thread:  25
    Error Formulating Crash Report:
    *** -[NSCFDictionary setObject:forKey:]: attempt to insert nil value (key: Identifier)
    0x80b94766
    0x8a6fff03
    0x80b945a7
    0x80b94534
    0x8745fcee
    0x00005572
    0x8798a917
    0x0000541c
    0x00007fb4
    0x00008aa0
    0x0000ad72
    0x0000ab4f
    0x805b04c0
    0x0000a256
    0x805a3fd6
    0x805a3e89
    Thread 25 Crashed:
    0   ???                                     0x018bd0bb vtable for GImageMac + 27
    1   com.apple.CoreFoundation                0x91d5642c CFBasicHashFindBucket + 252
    2   com.apple.CoreFoundation                0x91d562f3 CFDictionaryGetValue + 131
    3   com.apple.Foundation                    0x95fb6ea9 _NSThreadGet0 + 513
    4   com.apple.Foundation                    0x9605a37d -[NSConcreteTask waitUntilExit] + 57
    5   com.apple.music.apps.MACore             0x01323067 getPkgInfo + 423
    6   com.apple.music.apps.MACore             0x0132315e getPkgInfo + 670
    7   libSystem.B.dylib                       0x93d17259 _pthread_start + 345
    8   libSystem.B.dylib                       0x93d170de thread_start + 34
    Thread 25 crashed with X86 Thread State (32-bit):
      eax: 0x00050000  ebx: 0x91d4e0b1  ecx: 0x02f187f0  edx: 0xb0bbe000
      edi: 0xb0bbe000  esi: 0x444eefe0  ebp: 0xb0bbde18  esp: 0xb0bbdd7c
       ss: 0x0000001f  efl: 0x00010246  eip: 0x018bd0bb   cs: 0x00000017
       ds: 0x0000001f   es: 0x0000001f   fs: 0x0000001f   gs: 0x00000037
      cr2: 0x0004ffc8

    http://support.apple.com/kb/TS3968
    Had you searched the forums with something like "Logic 9 Crashing" you would've instantly found the answer... it's been answered several times in the last week.

  • URGENT please help Prob in implementing fi validation checking - zrggbr000

    Hi SAP Expert,
    I'm currently working on FI Validation checking (ZRGGBR000) to control amount posted to asset number. Thus, I use an internal table declared in ZRGGBR000 to keep all the balance to be posted from 1 FI doc no and compare it with the limit (taken from customized table). But i'm having a prob,specifically while doing several Goods Issue (GI) posting continously without leaving the transaction MIGO. This is because the internal table i declared previously in ZRGGBR000 was not refresh automatically. The same thing happens while i'm doing the SES (ML81N).
    Is there any way i can do to refresh this internal table?
    any help, assistance and guidances are very much appreciated and will be very greatfull for the fast reply.
    thanks & rgds,
    fn
    Message was edited by:
            fnr n

    Hi SAP Expert,
    Really need your advice and guidance, Please help me.  I'm currently working on FI Validation checking (ZRGGBR000) to control amount posted to asset number. Thus, I use an internal table declared in ZRGGBR000 to keep all the balance to be posted from 1 FI doc no and compare it with the limit (taken from customized table). But i'm having a prob,specifically while doing several Goods Issue (GI) posting continously without leaving the transaction MIGO. This is because the internal table i declared previously in ZRGGBR000 was not refresh automatically. The same thing happens while i'm doing the SES (ML81N).
    Is there any way i can do to refresh this internal table?
    For help, assistance and guidances are very much appreciated and will be very greatfull for the fast reply.
    thanks & rgds,
    fn

  • Please help - CPU trouble (mainly in Logic Pro).

    Hi,
    I've had my Mac Pro for 3 & 1/2 years. It's a Quad-Core Intel Xeon 2.66 GHz with 12GB RAM and 3 640GB HDs. I know this spec is nowhere near the scale of other people's machines at this point in time, but it doesn't justify the speed mine runs at. I primarily use my Mac for music production, mainly in Logic Pro 9 and Sibelius 7.
    Although it generally seems to be running quite slow, my biggest problem is when using Logic. I mainly compose orchestral music, using Eastwest Symphonic Orchestra Gold, Spitfire Albion I (via Kontakt), Ivory Synthogy Grands II and Spectrasonics Omnisphere. For the sake of this thread, I'll use the track I'm working on currently as an example...
    I have 40 tracks with separate instances of Play (for Eastwest Gold) and Kontakt (Albion I) running. (I've tried multi-outputs, but the inability to Freeze tracks is rather obstructing.) There are also a few auxilliary tracks with Logic's compressor & Eastwest Spaces running - no more than 8 separate instances. I also have a 14-minute video running. Currently, I don't have many tracks recorded, but as they begin to build up, Logic just can't handle it - and that's running on 512 samples I/O buffer size and a 'Large' Process Buffer Range. What's more, if I load a single instance of Ivory Grands II in, about 1/7th of my CPU bar is consumed simply when it's idle. I hope this covers all bases, but you get the idea...
    I've researched so much and tried it all - using Freeze tracks extensively; hardware test; disk utility; clearing my system HD, including moving my sample libraries to my other HDs (my main HD is currently at about 20% capacity); and probably a myriad of other things that I can't think of right now. As you can imagine, I've spent a lot of money on this system, and to be behaving like this after 2 years (this has been an ongoing problem for quite some time...) is extremely frustrating and upsetting.
    Any help on the matter would be greatly appreciated — thank you.

    He, the OP, does not appear to have a 3,1 Early 2008 at all.
    Processor upgrades for those are fewer and harder to find and he would already have 8-core.
    A copy paste of the system profile, minus serial number, helps.
    Three SSDs, one for system, and two on Sonnet Tempo Pro PCIe SSD, would go a long ways.
    How To Install and Remove Memory Mac Pro
    https://support.apple.com/kb/HT4433
    2x2GB FBDIMM DDR2 667MHz @ $30
    http://www.amazon.com/BUFFERED-PC2-5300-FB-DIMM-APPLE-Memory/dp/B002ORUUAC/
    Komputerbay 8GB (2x 4GB) DDR2 PC2-5300F 667MHz CL5 ECC Fully Buffered FB-DIMM (240 PIN) 8 GB
    http://www.amazon.com/Komputerbay-PC2-5300F-Buffered-FB-DIMM-Heatspreaders/dp/B0 05HIWD5U/
    eBay (Europe)
    http://viewitem.eim.ebay.dk/KOMPUTERBAY-8GB-2X4GB-MEMORY-for-APPLE-MAC-PRO-EARLY -2008-31-DDR2-800MHz/140962093586/item?transId=808969265004
    2008: Ideal RAM config 8 DIMMs - offers 17% improvement memory bandwidth  performance
    667MHz FBDIMMs are cheap, excellent and 4% 'hit' you would never know about.
    http://www.barefeats.com/harper5.html
    For best performance on Mac Pro, install memory in risers symmetrically
    The Mac Pro comes with two memory riser cards, each with four DIMM slots. With a total of eight slots, you can add up to 32 GB of memory.
    Note: DIMMs must be installed in pairs of equal size from the same vendor. For instance, you must not have one or three DIMMs on either riser at any time. Additionally, two DIMMs from different vendors should not be combined and used as a pair.
    Other configurations of DIMM pairs are still compatible with Final Cut Studio, but may not achieve the same performance levels as when DIMM pairs are installed on both risers evenly.
    https://support.apple.com/kb/TS1957
    SSD: Samsung 840 128GB
    http://www.amazon.com/Samsung-Series-120GB-internal-MZ-7TD120BW/dp/B009NHAF06/
    SSD Maintenance
    Icy Dock $15
    http://www.amazon.com/2-5-3-5-Ssd-sata-Convert/dp/B002Z2QDNE/
    Sonnet Tempo Pro
    http://www.sonnettech.com/product/tempossdpro.html
    http://eshop.macsales.com/item/Sonnet%20Technologies/TSATA6SSDE/
    WD Black 1TB $85
    http://www.amazon.com/Western-Digital-Caviar-Internal-Desktop/dp/B0036Q7MV0/
    Western Digital 3TB WD Black SATA III 7200 RPM 64 MB Cache Desktop Hard Drive WD3001FAEX
    http://www.amazon.com/gp/product/B00B2UWTHE/

  • Please Help for RME fireface400 with Logic Studio 8

    Please I do ask help for configuration of audio interface RME fireface400 with iMac OS 15.5.5, I have problem in output 7/8 monitor phones(no sound or crack sound) and look Fireface Mixer in to the desktop monitor. Where is the problem? I have drive 2.62a.
    Thanks for answer, also in Italiano
    Graz

    Have you tried the RME userforum?
    http://rme-audio.de/forum/index.php
    Maybe you problem is running OS 15.5.5 - must be a beta version

  • Please help, how to implement hasNext() and next() of a HashSet iterator?

    Hi guys,
    Can someone help me out with this? I'm struggling to write an iterator (the hasNext() and next() methods) for a SimpleHashSet class and I keep failing. I have a basic unit test, which goes like this:
    @Test
        public void testIterator() {
            SimpleHashSet<String> instance = new SimpleHashSet<String>();
            assertTrue(instance.iterator() != null);
            Iterator<String> it = instance.iterator();
            assertFalse(it.hasNext()); //Should return false on an empty HashSet
            assertTrue(it.next() == null); //Should return null on an empty HashSet
            instance.add("First");
            instance.add("Second");
            assertTrue(it.hasNext()); // Return true if has first element
            assertTrue(it.next() != null); //Should return first element
            assertTrue(it.hasNext()); //Return true if has second element
            assertTrue(it.next() != null); //Should return second element
            assertFalse(it.hasNext()); //Return false, no third element
            assertTrue(it.next() == null); //Return true, no third element         
        }and I can't figure out a way to pass all of these tests. I have written several variants and none of them works completely, only partially, inconsistently. I just don't know how to write it.
    The SimpleHashSet is declared like this:
    public class SimpleHashSet<E> extends AbstractSet<E> {
        private static final int SIZE = 11;
        LinkedList<E>[] buckets = new LinkedList[SIZE];
    }I appreciate all help and guidance,
    PR.

    Awesome, great answers, very helpful, thanks very much. Careful debugging and testing led me to a working solution. It passes my tests. This is what I have:
        @Override
        public Iterator<E> iterator() {
            final SimpleHashSet<E> here = this;
            Iterator<E> it = new Iterator<E>() {
                private final SimpleHashSet<E> mySet = here;
                private List<LinkedList<E>> bucketList = Arrays.asList(mySet.buckets);
                private Iterator<LinkedList<E>> bucketsIterator = bucketList.iterator();
                private LinkedList<E> currentBucket;
                private Iterator<E> elements;
                    currentBucket = bucketsIterator.next();
                    elements = currentBucket.iterator();  
                @Override
                public boolean hasNext() {
                    while (bucketsIterator.hasNext()) {
                        if (elements.hasNext()) {
                            return true;
                        } else {
                            currentBucket = bucketsIterator.next();
                            elements = currentBucket.iterator();
                    if (elements.hasNext())
                        return true;
                    return false;
                @Override
                public E next() {
                    while (bucketsIterator.hasNext()) {
                        if (elements.hasNext()) {
                              return elements.next();
                        } else {
                            currentBucket = bucketsIterator.next();
                            elements = currentBucket.iterator();
                    if (elements.hasNext())
                        return elements.next();
                    if (!bucketsIterator.hasNext())
                        throw new NoSuchElementException();
                    return null;
            return it;
        }I'm only not sure if it behaves the same as an original HashSet iterator. I doubt. The problem with my implementation is that both hasNext() and next() progress the internal iterators forward, so i.e. calling hasNext() on an empty set will progress the internal iterators to the end, so then adding some elements and calling hasNext() again will return false. I couldn't figure out a way that hasNext() does not progress the iterators, so that only next does that. Both hasNext() and next() are dependent on each other in my example. But it works.
    Thanks,
    PR.

  • Please help can we implement datasource for bluetooth connections

    hi i my application reads data from bluetooth from PC to mobile now iam using streamconnections iam sending audio data from pc to mobile and for this in my mobile side i would like to implement the datasource for incomming bluetooth data is it possible if so how i can do it....

    You should post this in CLDC and MIDP forum and not in this.
    Anyway coming to your question now can you tell why do you want to maintain a datasource and what actually you mean by data source in this context. If you want to maintain a list of the data that is transferred to the mobile then it can be done.
    Sunil

  • Please help me to implement merge

    Hi Experts,

                USING(
                    SELECT
                       stan_number
                      ,s.sid,amount
                      ,l.loc_id
                    FROM SOURCE_TABLE s
                      LOCATIONS_TABLE l
                      where s.sid = l.sid
                ) SOURCE
    then it's possible
                     ) values
                     (  SOURCE.stan_number
                       , SOURCE.sid
                       , SOURCE.amount
                       ,SOURCE.loc_id

  • How can I implement this logic

    Hi,
    I have 3 input parameters. One is a random value .
    Inside a loop I read this random value . bsed on this value I would like to select between the other parameters.Let me use an example.
    X is the random value. Y and Z are the other 2 parameters. 
    1- In the first iteration if X is greater than previous X , I would like to show the value of Z
    2- In the second iteration If X< greater than preious X then I would like to keep showing Z if not I show Y
    3-  ( lets say we are showing y) In the 3rd iteration If X< greater than preious X then I would like to keep showing Y if not I show Z
    So as said the value of X is used to toggle between Z and Y so when the condition is met we keep showing y or Z if not we show the other parameter.
    Could you please help me to implement this logic in LV
    Thanks

    You only need a shift regsiter with a single output, your solution seems a bit convoluted.
    Anyway, if you want to switch whenever the comparison is false, here's what you would do. Modify as needed.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Switch ValueMOD.vi ‏10 KB

  • Implementing Barcode logic

    Hi All,
      Could anyone please help me in providing BARCODE logic/implementation in SAP SCRIPT?

    Hi Gurmeet,
    There is no specific logic invlolved in it.
    You just need to create a character format and chose a font fmaily which supports barcodes.
    Finally you need to use it in text elements.
    like if you want the bar code for a matnr,
    do like this:
    <bc>&matnr&</bc>.
    note that you have defined a character format called bc already.
    Regards,
    Ravi

  • PLEASE HELP ME TO FIND THE SOLUTION REGARDING "LOGICAL SYSTEM CHANGED"

    HAI EVERYBODY,
    PLEASE HELP ME TO FIND THE SOLUTION REGARDING "LOGICAL SYSTEM CHANGED" during the material master replication by using middleware parameters.
    step1 : i have taken SRM client 810 and named it as CHINNISRM
    step2 : i  have taken r3 client 810 and named it as CHINNIR3
    step3: During material master replication i maintained tables like crmconsum,crmrfcpar,crmparoltp in   r3   and smofparsfa in srm client and filtered the objects and loaded the objects through r3ac3,r3ac1,r3as.
    step4 : And later i have checked in r3 queues to activate the objects,but i have seen a message like  "LOGICAL SYSTEM CHANGED:SEE 588701".according to the oss instructions i have checked in CRMPRLS table in se16 in R3 .there i found out there is one logical client  named with T90CLNT810.
    oss :588701
    Solution
    There are different cases in which different forms of processing are
    required or where several options exist:
    - The logical system name of an R/3 Backend client was changed in
    current operation. In this case, the data hangs in the outbound
    queues of the R/3 Backend system as specified under point 1 of
    the symptom. In this case, the logical system name must be
    changed back to the original value. Then the outbound queues
    can be reactivated. If no data was transferred to the EBP/CRM
    server before the change, also a correctioin of the check table
    is possible.
    - The same logical system name was used again in a new client of
    an R/3 Backend system that was linked to the EBP/CRM server. In
    this case, the data is in the inbound queue of the EBP/CRM
    server with the exception GUID_FOR_LOGSYS_CHANGED. In this
    case, the queue entries which have status SYSFAIL must be rejected, however, not the entire queues. If the new client of  the R/3 Backend system you have linked has exactly the same
    data as the old client and if it is meant to replace the old
    client (that is, this was deactivated), also a correction of
    the check tables is possible. In this case, the inbound queues
    can be reactivated after the correction.
    oss:765018
    1. If the situation in your system corresponds to the situation described
    under "Reason and Prerequisites" and if symptom 1 occurs, you can
    delete the table entry from table CRMPRLS table (there is just one
    entry). Since there is no maintenance dialog for this table and you
    cannot maintain it using transaction SE16, you must use a report to
    delete it. This report is attached to this note as correction
    instructions.
    Create the report ZZ_DELETE_CRMPRLS in your system and copy the source
    code from the correction instructions. You cannot implement this
    source code using transaction SNOTE.
    You can use the report in every plug-in or plug-in basis system, even
    if it is not specified in the validity section.
    After you have run the report, you can trigger existing queues again
    in transaction SMQ1.
    2. If the situation in your system corresponds to the situation described
    under "Reason and prerequisite" and if symptom 2 occurs, you can
    delete the entry from table CRMMLSGUID (there is just one entry).
    Since there is no maintenance entry for this table and you cannot
    maintain it using transaction SE16, you must use a report to delete
    it. This report is attached to this note as correction instructions.
    If they do not yet exist, add the following messages to message class SMOF in your logon language:
    Message Message short text
    303 User &1 is not allowed to change table &2.
    304 User &1 IS not allowed to display table &2.
    305 Logical system &1 was not found in table &2.
    306 System error! The current client was not
    found in table T000.
    Create the report ZZ_DELETE_CRMMLSGUID in your system and copy the
    source code from the correction instructions. You cannot implement
    this source code using transaction SNOTE.
    You can use the report for every release of the CRM system, even if it
    is not specified in the validity section. The only exceptions are CRM
    releases with Support Package versions that are too low such as CRM
    Release 3.0 with Support Package 12.
    After you have run the report, you can trigger existing queues again
    in transaction SMQ1 of the R/3 back-end system or transaction SMQ2 of
    the CRM system.
    so what should i do to do the replication.please suggest me .untill and unless i solve my problem i cant move to the further activity.i hope you people can solve my problem.thanks in advance.
    thanks and best regards,
    n.chakradhar

    Hi chakradhar,
    Did you find a solution to your issue? We are facing a similar issue and looking to figure out how this can be resolved.
    BR// 420

  • Need help in OBIEE BMM layer logic implementation

    Hi All,
    I have a requirement in my RPD development.
    I have two tables account and site.
    Table_Name:*Account*
    Column_Name:                    
    AccountID     Store_Name     Site Data_1_Name     Site_Data_2_Name     Site_Data_3_Name
    264364     Wegmans_ Food_Markets     GSF     Floor_Type     BSC
    999999     Walmart     Floor_Type     BSC     
    999998     Walgreens     BSC     Avg_Cust_Count     GSF
    Table_Name:*Site*                                   
    Column_Name:
    Site_ID     Store_Name     Account_ID     Account_Name     Site_Name     Site Data_1_Value     Site Data_2_Value     Site Data_3_Value
    264367     Wegmans_Food_Markets     264364     Wegmans_Food_Markets     Alberta_Drive_#82     96114     Vinyl     Kellermeyer
    264368     Wegmans_Food_Markets     264364     Wegmans_Food_Markets     Alberta_Drive_#83     96109     Poly_Vinly     ABC
    123     Walmart     999999     Walmart     Alberta_Drive#1000     Vinly     XYZ     
    1678     Walgreens     999998     Walgreens     Calgary_ Drive#9009     ABC     10000     56565
    Site Logical/ Presentation Table in OBIEE
    Site_ID     Store_Name     Account_ID     Account_Name     Site_Name GSF     Floor_Type     BSC
    264367     Wegmans_Food_Markets     264364     Wegmans_Food_Markets     Alberta_Drive_#82     96114     Vinyl     Kellermeyer
    264368     Wegmans_Food_Markets     264364     Wegmans_Food_Markets     Alberta_Drive_#83     96109     Poly Vinly     ABC
    123     Walmart     999999     Walmart     Alberta_Drive#1000          Vinly     XYZ
    1678     Walgreens     999998     Walgreens     Calgary_ Drive#9009     56565          ABC
    for account table we have the Site Data_1_Name ..Site Data_3_Name columns values which is the column name for the values in Site table(i.e the values in the columns "Site Data_1_Value..Site Data_1_Value") . this values change dynamically based on the column name(Site Data_1_Name ..Site Data_3_Name ) in Account Table . how do i map this column values in RPD level ? or do we have any logic to implement this. PLEASE HELP ME TO SOLVE THIS ...
    Thanks in advance ,
    Mohan Mano

    HI mohan the information you provided holding some sensitive data please delete some of them otherwise you might be in trouble.
    Make join between the account_ID and the SITE_ID based on the inner join columns which match in both tables will retrieved in the report. If you want to see the null values as well you can use outer join.
    Thanks,
    chak

  • How to implement drop down list in WDP Abap....very urgent...please help me

    Hi Gurus,
    I wanted to implement the drop down list button in the WDP Abap interactive form. Once the users clicks on the drop down button, an RFC should be called and display the details under the drop down button. Please give me the logic with code. Its very urgent...please help me. Please note that it is in WDP Abap interactive forms. We are using NW2004S, ECC6.0.

    Hello,
    you have to use ZCI form to use DDLB in WD-ABA. The content of the DDLB has to be present at rendering time, there is no dinamic call when you click the "dropdown".
    The attribut you map to the DDLB has to be an element with a value-set, and the value set has to contain the text / value pairs.
    >> this will be displayed when you click the dropdown.
    Best regards,
    Dezso

  • Please help me on the logic.

    Hi,
      Please help me the logic below my requirement.I found one function module to calculate the age
    HR_RU_AGE_YEARS.But iam not able to implement the logic.Please help me.
    If the value in table P0021-SUBTY = 1 send 'SP'
    If the value in table P0021-SUBTY = 2 send 'CH'
    Also use Condition Logic to check the age of Child in IT0021-FGBDT. If FGBDT =21 years or greater then Check the Student indicator on IT0021 if it is checked then set 'ST' on full file else set 'CH'.
    For Disabled Dependent check to see if the indicator in P0106-DISAB is set to X i.e. yes. If its Yes then set 'DD' on full file.
    DD takes precendence over 'CH'.  Send termination record for students on their 26th Birthday.
    Regards,
    Sujan

    Hi,
    You can use function module HR_HK_DIFF_BT_2_DATES with date1 as sy-datum and date2 as DOB from pa0002 to calculate age.
    Regards,
    Kanupriya

Maybe you are looking for