Count in package

Is this possible in a package? Count1 is a local variable.
SELECT COUNT(
     SELECT location
     FROM table1
     WHERE IDNo = p_IDNo
     AND orderNo = '1241'
     UNION
     SELECT x.location
     FROM table2 x, table3 y
     WHERE x.name = y.name
     AND y.IDNo = p_IDNo
     ) INTO Count1
FROM dual
Thanks!

i think it is not valid. e.g.
SQL> select count( select empno
  2                  from emp )
  3    from dual;
select count( select empno
ERROR at line 1:
ORA-00936: missing expression
SQL> why not use a sub-query instead. e.g.
SQL> select count(*)
  2    from (select empno from emp);
  COUNT(*)
        14
SQL> your code would look something like:
SELECT COUNT(*)
  INTO Count1
  FROM (SELECT location
          FROM table1
         WHERE IDNo = p_IDNo
           AND orderNo = '1241'
        UNION
        SELECT x.location
          FROM table2 x, table3 y
         WHERE x.name = y.name
           AND y.IDNo = p_IDNo);

Similar Messages

  • R12 - Compile Invalid objects (Fast Formula, Package Body and View) Urgent

    Invalid objects about 43, in this Fast Formula 2 AP Package object, and 1 view
    OWNER     OBJECT_TYPE     COUNT(*)
    APPS     PACKAGE BODY     37.00
    APPS     PROCEDURE     1.00
    SCOTT     PACKAGE BODY     1.00
    APPS     VIEW     1.00
    APPS     FUNCTION     3.00
    any one can give idea to make it valid.
    Awaiting for your reply.
    FYI
    the object list is below.
    OWNER     OBJECT_NAME
    APPS     FFP52474_01010001
    APPS     FFP61059_01010001
    APPS     FFP56168_01010001
    APPS     FFP56167_01010001
    APPS     FFP58579_01052004
    APPS     FFP56169_01010001
    APPS     FFP56170_01010001
    APPS     FFP56171_01010001
    APPS     FFP56172_01010001
    APPS     FFP56173_01010001
    APPS     FFP60309_01010001
    APPS     FFP60306_01010001
    APPS     FFP60308_01010001
    APPS     FFP60310_01010001
    APPS     FFP60307_01010001
    APPS     AP_IMPORT_VALIDATION_PKG
    APPS     FFP58576_01011951
    APPS     FFP60357_01011951
    APPS     FFP57511_01010001
    APPS     FFP57510_01010001
    APPS     FFP52473_01010001
    APPS     FFP60305_01010001
    APPS     FFP60545_01042004
    APPS     FFP60342_01010001
    APPS     FFP58887_01042004
    APPS     FFP58888_01042004
    APPS     FFP58870_01042004
    APPS     FFP58885_01042004
    APPS     FFP58907_01010001
    APPS     FFP58906_01010001
    APPS     FFP58861_01042004
    APPS     FFP61122_01010001
    APPS     FFP58871_01042004
    APPS     FFP58857_01042005
    APPS     FFP60917_01032006
    SCOTT     MK_PLS_XML_REP_TEST
    APPS     MK_PLS_XML_REP_TEST
    APPS     AP_FSX_PAYMENT_ADVICE
    APPS     RA_SITE_USES
    APPS     ZDBAR_CONTACT
    APPS     ZDBAR_FAX
    APPS     ZDBCLOAD
    APPS     ZDBAP_DV_PAYMENT_TYPE
    Advanced thanks for reading and giving solution for this.
    Thamaraiselvan

    any one can give idea to make it valid.Run "Compile APPS Schema" from adadmin.
    For Fast Formulas, refer to:
    Note: 155737.1 - How To Compile Oracle Fast Formulas
    http://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=155737.1

  • Counter class

    Counter increases and decreases by 1, records count nonnegative integer and tests whether the current count value is zero. No method allows the value of counter to become negative. Can anyone assist?public class Counter
    private int count; // definition of counter
    public Counter(int aCount) // Constructor to initialize count
    count = aCount;
    public void setCountToZero() //method to zero out counter
    count = 0;
    public void addOneToCount() //method to add one to counter
    count += 1; // or count++;
    public void subtractOneFromCount() //method to subtract one from counter
    if ((count - 1) >= 0)
    {count -= 1;} // or count--;     
    public void displayCount()
    System.out.println("The count is " + count);
    //tester
    package counter;
    public class CounterTest
    public static void main(String[] args)
    Counter myCounter = new Counter(-1); // Create myCounter Object and give 10 to counter
    myCounter.displayCount(); // Displays the zero value
    myCounter.addOneToCount(); // Now count has value of 11
    myCounter.displayCount(); // Displays the zero value
    myCounter.subtractOneFromCount(); // Subtracted one from count
    myCounter.displayCount(); // Displays count
    myCounter.setCountToZero(); // Resets count to zero
    myCounter.displayCount(); // Displays the zero value
    }

    In Java it's normal not to decorate argument names (or any other names for that matter), so call the 'count' argument 'count'. If there's an ambiguity with a field of an object, use 'this.' to indicate the field. Making the argument final prevents any assignment, which would be an error - it's only use is to input a value to the constructor.
    If a negative value is an illegal value for the argument, then throw an IllegalArgumentException instead of trying to guess the correct value (so far guesses have been 'the client requested -17, perhaps he meant zero' and 'the client requested -2147483648, perhaps he meant, err, -2147483648' ( abs(-2147483648) == -2147483648 as signed 32 bits doesn't have a +2147483648) ) - something is trying to create a counter with a negative count, and that is a bug, so making it show up as an exception means you find the bug earlier.
    public Counter (final int count) {
      if (count < 0)
        throw new IllegalArgumentException("Count must be greater than or equal to zero: " + count);
      this.count = count;
    }

  • Total no. od Packages

    Hi all,
    In the Delivery I am creating packages, I have created a UDF  at header level where i want to know the only the total no. of packages created, i.e. the total packages which we can see in packing detail screen,
    Can any body please help me write this formatted search query
    Regards,
    Atul Joshi

    Hi Atul
    This will be tricky as your main delivery screen is not linked to the packaging screen for a trigger to update when the packages are defined. What will the FMS trigger on? Second problem is that the details are in tables DLN7 & DLN8 and there is no count of packages in either.
    A query after the delivery is added could be as follows:
    SELECT T0.DocEntry, COUNT(T0.PackageNum)
    FROM DLN7 T0 INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry
    WHERE T0.DocEntry = ?
    GROUP BY T0.DocEntry
    What you could do is write a similar query to update the UDF on the Delivery after it is Added, by setting Refresh Regularly.
    Let me know if this helps
    Kind regards
    Peter Juby

  • Install packages from CD

    I have the this OS:
    SunOS 5.10 Generic_127128-11 i86pc i386 i86pcSystem = SunOS
    I have problems to install programs because I don't have all packages installed.
    Is it possible with the CD install all packages?? How can I do this action?

    guif wrote:
    This is a productive environment and i can't make some tests.
    So, can anybody help me with this command to check (with a loop) my actually package and install all packages then?This truly is very basic shell scripting.
    Start by getting a listing of the packages on the machine, and store that in a file so you aren't constantly running pkginfo. I sort it for no good reason other than posterity...
    # pkginfo | awk '{ print $2 }' | sort -o /tmp/pkgs.out
    Then change over to your cd installation directory, I'm sorry I don't know this off the top of my head, something like:
    # /cdrom/Solaris_10/Product
    # for pkg in *
    do
    # Count of packages is stored in X. It's easier for a novice to understand if I break up the steps...X=`grep -c "^%{pkg}$" /tmp/pkgs.out
    if [ $X -eq 0 ]
    then
    pkgadd -d . ${pkg}
    fidone
    You may want to have an answer template defined (man pkgadd / pkgask to help). This can keep the Q/A to a minimum during the package install.
    That's a solid pointing in the right direction.
    Cheers,

  • SCCM 2012 Powershell Redistribute Failed Packages

    I noticed that sometimes a package will not distribute to one of my distribution point.
    Does some know if a powershell script is available which:
    - found out the packages with the failed status at a distribution point
    - redistribute the package to that specific DP
    - will do this check for all packages and for all DP's

    Hi,
    I wrote this script for our environment, it beats clicking stuff.
    $SiteCode = "ABC"
    $PackageState = "3"
    $FailedPackages = Get-WmiObject -Namespace "Root\SMS\Site_$($SiteCode)" -Query "select * from SMS_PackageStatusDistPointsSummarizer where state = $($PackageState)"
    if ($FailedPackages.Count -gt 0)
    Write-Host "There are $($FailedPackages.Count) Failed Packages at the moment."
    elseif ($FailedPackages)
    Write-Host "There is 1 Failed Package at the moment."
    else
    Write-Host "There are 0 at the moment."
    if ($FailedPackages)
    foreach ($FailedPackage in $FailedPackages)
    try
    $DistributionPointObj = Get-WmiObject -Namespace "root\SMS\Site_$($SiteCode)" -Class SMS_DistributionPoint -Filter "PackageID='$($FailedPackage.PackageID)' and ServerNALPath like '%$($FailedPackage.ServerNALPath.Substring(12,7))%'"
    $DistributionPointObj.RefreshNow = $True
    $result = $DistributionPointObj.Put()
    Write-Host "Refreshed $($FailedPackage.PackageID) on $($FailedPackage.ServerNALPath.Substring(12,7)) - State was: $($FailedPackage.State)"
    catch
    Write-Host "Unable to refresh package $($FailedPackage.PackageID) on $($FailedPackage.ServerNALPath.Substring(12,7)) - State was: $($FailedPackage.State)"
    write-host $Error
    Most of our DP's are now PullDPs.  When they fail, we find that restarting ccmexec and BITS helps a bit before redistributing.
    Cheers!

  • 2012 package inventory

    Env - 2012. All packages are stored in SSISDB. I have created folder - 'abc'. Under that, i have added packages. I need to capture SSIS package inventory like.
    -Counts
    -description
    -connections to database
    -tables / views involved.
    -Task type (example - data flow task, common tasks, other transformations, other sources & other destinations tasks) - I want to know the sequence the way the package build.
    How can i achieve this.....thanks in advance...

    You supposed to make some exploration before posting here. MSDN is very clear about what is exposed.
    The starting page is https://msdn.microsoft.com/en-us/library/hh479588.aspx?f=255&MSPPError=-2147217396
    You can make a count of packages/projects (I assume), get description from
    catalog.projects and
    catalog.packages views, but as far as the rest of the things you ask this is not possible. And this is because the packages become not parsable once under SSISDB.
    It seems to me your goal is to document deployed packages, then may be you need specialized tools. These tools look into packages before they are deployed. The tools I would start looking at are from Pragmatic Works (not sure if the name remains BIDocumenter,
    but I test drove it and liked it very much).
    Arthur
    MyBlog
    Twitter

  • HTMLHelp word count

    I'm trying to nail down a word count for a series of merged
    HTML Help chms. I couldn't find a report in RoboHelp that could
    accomplish that, does anyone have a creative trick to get this
    done? Or should I just generate a large Word doc?
    Thanks for any ideas.
    //Lucas

    Hi Lucas,
    There are a few word count software packages out there.
    For example,
    http://www.anycount.com/wordcounting_software/word_count/html_htm_word_count.htm
    24 Euros - you can't buy an abacus for that price these days
    The above even claims to count the words in a .chm file.
    http://www.anycount.com/wordcounting_software/word_count/chm_word_count.html
    Good luck
    Craig

  • Getting count

    Hi,
    I have a table PackageItems, which has two columns PackageId and ItemId.
    Each packageId may have multiple ItemIds.
    So
    Packageid
    ItemId
    1
    1
    1
    2
    1
    3
    2
    1
    3
    1
    3
    3
    4
    1
    4
    2
    4
    3
    I want to know how I can grab the count of packages that contain lets say
    Both ItemId 1 and ItemId 3?
    Thanks for your help.
    in a never-ending learning journey.

    Olaf,
    ItemId in (1,3) would grab all the packages that have either 1 or 3.
    Where as i want all the packages that have both 1 and 3 (combined)
    in a never-ending learning journey.
    Olaf's query will work (very efficiently I might add) as long as the same item doesn't repeat within the same package.
    Creating an index on PackageID & ItemID will make it blistering fast...
    If the ItemID can repeat with the same PackageID (aka they are not unique combinations) you will need to something more akin t this...
    IF OBJECT_ID('tempdb..#temp') IS NOT NULL
    DROP TABLE #temp
    GO
    CREATE TABLE #temp (
    PackageID INT,
    ItemID INT,
    PRIMARY KEY (PackageID, ItemID)
    INSERT #temp (PackageID,ItemID) VALUES (1,1),(1,2),(1,3),(2,1),(3,1),(3,3),(4,1),(4,2),(4,3)
    SELECT DISTINCT
    t.PackageID
    FROM
    #temp t
    WHERE 1 = 1
    AND EXISTS (
    SELECT 1
    FROM #temp t1
    WHERE t.PackageID = t1.PackageID
    AND t1.ItemID = 1
    AND EXISTS (
    SELECT 1
    FROM #temp t3
    WHERE t.PackageID = t3.PackageID
    AND t3.ItemID = 3
    So... Olaf's solution should be your preferred solution as long as your data supports it. If not, the code above will work but at a higher cost.
    HTH,
    Jason
    Jason Long

  • Lost UDP packages

    Hello.
    I am strugling with a client that reads UDP packages from a DatagramChannel. The server is sending 1000 packages every 2 seconds. One package is 1468 bytes. My problem is that I don't get all the packages. I am using Ethereal to count the number of packages sent from server to client. I have set the receiveBuffer on the Socket to 75MB, a lot more than I need right now, but the server will send more data in the future. I have seen that the garbage collector runs quite regularly, and it seems that the more gc, the more data I loose, although this might be accidental. I loose packages even when I only count the packages received, and I loose even more if I try to process the data.
    Is there some process, gc for instance, that prevents the packets from beeing bufferd in the receiveBuffer? Am I simply doing something terrible wrong?
    Thanks in advance,
    Gro
    public void run()
    ByteBuffer bBuf = ByteBuffer.allocateDirect(1500);
    bBuf.order(ByteOrder.LITTLE_ENDIAN);
    Iterator iterator = null;
    Set readyKeys = null;
    long numPackagesReceived = 0;
    try
    while (!stopped)
    int rc = selector.select(6000);
    if (rc > 0)
    readyKeys = selector.selectedKeys();
    if (!readyKeys.isEmpty())
    iterator = readyKeys.iterator();
    while (iterator.hasNext())
    SelectionKey key = (SelectionKey) iterator.next();
    iterator.remove();
    if (key.isReadable())
    bBuf.clear();
    if (!mChannel.isConnected())
    SocketAddress sender = mChannel.receive(bBuf);
    mChannel.connect(sender);
    System.out.println("Connecting to: " + sender.toString());
    else
    mChannel.read(bBuf);
    numPackagesReceived++;
    catch (Throwable e)
    e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
    finally
    System.out.println("Total number of packages : " + numPackagesReceived);
    }

    It wasn't very clear in the last message, but I actually count packets both in my client and in Ethereal. Ethereal receives more packets than I do. I know UDP is not reliable, but as long as Ethereal catches them, why don't I? By the way, I didn't write the server program that uses UDP so I cannot do anything about that.
    -grofon

  • Upgrade oracle 9.06.0 to 10.0.4.0  with invalid sys objs  in window

    Hi Friends,
    We made a cold copy and upgrade database to 10.0.4.0 from 9.0.6.0 in 32 bit window 2003.
    I just find lots of invalid objects in DB even I run these codes (utlrp.sql ,utlprp.sql or EXEC DBMS_UTILITY.compile_schema).
    The invalid objects are still in DB as
    SQL> select owner, OBJECT_TYPE , count(*)from all_objects
    2 where status='INVALID'
    3 group by owner, OBJECT_TYPE
    4 order by owner, OBJECT_TYPE ;
    OWNER OBJECT_TYPE COUNT(*)
    ODM VIEW 1
    OLAPSYS FUNCTION 1
    OLAPSYS PACKAGE 49
    OLAPSYS PACKAGE BODY 47
    OLAPSYS TRIGGER 48
    OLAPSYS VIEW 122
    PUBLIC SYNONYM 146
    OWNER OBJECT_TYPE COUNT(*)
    QS_ADM PACKAGE BODY 1
    SYS PACKAGE BODY 1
    WKSYS FUNCTION 3
    WKSYS PACKAGE 19
    WKSYS PACKAGE BODY 17
    WKSYS PROCEDURE 3
    WKSYS TRIGGER 23
    WKSYS VIEW 2
    based on above SQL results, how to fix this issue?
    Thanks
    JIm

    Hi Friends,
    I check db_registory and all is valid.
    SQL> select COMP_ID , COMP_NAME, VERSION ,STATUS ,
    2 MODIFIED ,NAMESPACE,CONTROL, SCHEMA ,PROCEDURE , STARTUP , PARENT_ID , OTHER_SCHEMAS
    3 from dba_registry;
    COMP_ID COMP_NAME VERSION STATUS
    EM Oracle Enterprise Manager 10.2.0.4.0 VALID
    SDO Spatial 10.2.0.4.0 VALID
    ORDIM Oracle interMedia 10.2.0.4.0 VALID
    AMD OLAP Catalog 10.2.0.4.0 VALID
    XDB Oracle XML Database 10.2.0.4.0 VALID
    CONTEXT Oracle Text 10.2.0.4.0 VALID
    EXF Oracle Expression Filter 10.2.0.4.0 VALID
    RUL Oracle Rules Manager 10.2.0.4.0 VALID
    OWM Oracle Workspace Manager 10.2.0.4.3 VALID
    ODM Oracle Data Mining 10.2.0.4.0 VALID
    CATALOG Oracle Database Catalog Views 10.2.0.4.0 VALID
    COMP_ID COMP_NAME VERSION STATUS
    CATPROC Oracle Database Packages and Types 10.2.0.4.0 VALID
    JAVAVM JServer JAVA Virtual Machine 10.2.0.4.0 VALID
    XML Oracle XDK 10.2.0.4.0 VALID
    CATJAVA Oracle Database Java Packages 10.2.0.4.0 VALID
    APS OLAP Analytic Workspace 10.2.0.4.0 VALID
    XOQ Oracle OLAP API 10.2.0.4.0 VALID
    17 rows selected.
    So what should I need to do for these invalid objects?
    Thanks
    JIM

  • I want  to create dynamic ALV report

    Hi great abapers,
    I want  to create dynamic ALV report.Please help me.
    Regards,
    Billa

    Hi,
    Please check the code below:
    REPORT YMMR_PALLET_OVERVIEW MESSAGE-ID Y_MESSAGE_0001.
    Short description:
    To Display and sum up the Quantity of scanned materials on pallet for*
    each Shipment number for the Packaging Materials. *
    TYPE-POOLS : SLIS.
    TABLES: YYLE0003. " Scanned SSCC No.
    --Structure Declaration--
    Structure for Shipment No. and Date.
    TYPES : BEGIN OF T_VTTK_TAB ,
    TKNUM LIKE VTTK-TKNUM, " Shipment number
    ERDAT LIKE VTTK-ERDAT, " created Date
    END OF T_VTTK_TAB .
    Structure for Shipment No., Packaging Materials and Date.
    TYPES: BEGIN OF T_ITAB2,
    TKNUM LIKE YYLE0003-TKNUM, " Shipment number
    VHILM LIKE YYLE0003-VHILM, " Packaging Materials
    QUANTITY TYPE P,
    ERDAT LIKE YYLE0003-ERDAT, " created Date
    COUNT TYPE I,
    END OF T_ITAB2.
    Structure for Shipment No. and Packaging Materials.
    TYPES: BEGIN OF T_ITAB3,
    TKNUM LIKE YYLE0003-TKNUM, " Shipment number
    VHILM LIKE YYLE0003-VHILM, " Packaging Materials
    QUANTITY TYPE P, " Quantity
    END OF T_ITAB3.
    --Internal table Declaration--
    *Internal tables for the above Declared structures
    DATA: G_VTTK_TAB TYPE TABLE OF T_VTTK_TAB,
    G_ITAB5_TAB TYPE TABLE OF T_ITAB2,
    G_ITAB4_TAB TYPE TABLE OF T_ITAB3,
    G_ITAB3_TAB TYPE TABLE OF T_ITAB2. "#EC NEEDED
    *Internal table Holding Shipment No.and quantity
    DATA: BEGIN OF G_TOTAL_TAB OCCURS 0 ,
    TKNUM TYPE YYLE0003-TKNUM, " Shipment number
    QUANTITY TYPE P,
    COUNT TYPE I,
    END OF G_TOTAL_TAB .
    *Internal table for selection screen data
    DATA: BEGIN OF G_SCANDATA_TAB OCCURS 0,
    VHILM LIKE YYLE0003-VHILM, " Packaging Materials
    EXIDV TYPE EXIDV, " External Handling Unit
    TKNUM LIKE YYLE0003-TKNUM, " Shipment number
    QUANTITY LIKE YYLE0003-QUANTITY, " Quantity
    END OF G_SCANDATA_TAB.
    DATA: BEGIN OF ST_SCANDATA_TAB,
    VHILM LIKE YYLE0003-VHILM, " Packaging Materials
    EXIDV TYPE EXIDV, " External Handling Unit
    TKNUM LIKE YYLE0003-TKNUM, " Shipment number
    QUANTITY LIKE YYLE0003-QUANTITY, " Quantity
    END OF ST_SCANDATA_TAB.
    DATA: BEGIN OF G_SCANDATA_COUNT_TAB OCCURS 0,
    VHILM LIKE YYLE0003-VHILM, " Packaging Materials
    TKNUM LIKE YYLE0003-TKNUM, " Shipment number
    QUANTITY LIKE YYLE0003-QUANTITY, " Quantity
    COUNT TYPE I,
    END OF G_SCANDATA_COUNT_TAB.
    DATA: L_COUNT TYPE I.
    *Internal table for Packaging Materials and quantity
    DATA: BEGIN OF G_ITAB6_TAB OCCURS 0,
    VHILM LIKE YYLE0003-VHILM, " Packaging Materials
    QUANTITY TYPE P, " Quantity
    END OF G_ITAB6_TAB.
    *- Field catalog
    DATA: L_ALV_CAT1_TAB TYPE TABLE OF LVC_S_FCAT.
    --Work area Declaration--
    DATA: WA_VTTK TYPE T_VTTK_TAB,
    WA_ITAB3 TYPE T_ITAB2,
    WA_ITAB5 TYPE T_ITAB2,
    WA_ITAB4 TYPE T_ITAB3,
    WA_ITAB1 LIKE G_SCANDATA_TAB,
    WA_ALV_CAT1 LIKE LINE OF L_ALV_CAT1_TAB.
    ----Variable Defnition -
    DATA: G_CUSTOM_CONTAINER_0100 TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
    G_ALV_GRID_0100 TYPE REF TO CL_GUI_ALV_GRID,
    G_CONTAINER_0100 TYPE SCRFNAME VALUE 'LIST',
    G_MYLAYOUT TYPE LVC_S_LAYO, "#EC NEEDED
    G_WA TYPE REF TO DATA.
    DATA: G_VAR TYPE I, " No of records
    G_VAR1 TYPE CHAR20. " Variable
    --field symbols Declaration--
    FIELD-SYMBOLS : <F_FS> TYPE TABLE,
    <F_FS3> TYPE ANY,
    <F_FS4> TYPE ANY,
    <F_FS5> TYPE ANY,
    <F_WA> TYPE ANY,
    <F_FS15> TYPE ANY,
    <F_FS16> TYPE SY-DATUM,
    <F_FS2> TYPE T_ITAB2,
    <F_FS6> TYPE ANY,
    <F_FS7> TYPE ANY,
    <F_FS12> TYPE ANY,
    <F_FS13> TYPE ANY.
    --Selection Parameters--
    SELECTION-SCREEN: BEGIN OF BLOCK BLCK01 WITH FRAME TITLE TEXT-000.
    "Select options
    SELECT-OPTIONS :
    S_TKNUM FOR YYLE0003-TKNUM , " Shipment number
    S_YYREF FOR YYLE0003-YY_REFERENCE, " Packing reference
    S_YYREFT FOR YYLE0003-YY_REFTP, " Reference type
    S_EXIDV FOR YYLE0003-EXIDV, " External HU
    S_MATNR FOR YYLE0003-MATNR, " Material number
    S_VBELN FOR YYLE0003-VBELN, " SD number
    S_POSNR FOR YYLE0003-POSNR, " Item number
    S_LGTOR FOR YYLE0003-LGTOR, " Door for Wr Hs No
    S_VHILM FOR YYLE0003-VHILM, " Packaging Mat
    S_YYMEIN FOR YYLE0003-YY_MEINH, " Indicator for UOM
    S_QUANTI FOR YYLE0003-QUANTITY, " Quantity
    S_YCHECK FOR YYLE0003-YYCHECKED, " Destination_door
    S_STATUS FOR YYLE0003-STATUS, " Packing status
    S_STASHI FOR YYLE0003-STATUSSHIPTO, " Status on ship-to
    S_LOADTR FOR YYLE0003-LOADTRUCK, " Load truck
    S_ERDAT FOR YYLE0003-ERDAT , " Date
    S_ERZET FOR YYLE0003-ERZET, " Entry time
    S_AEDAT FOR YYLE0003-AEDAT, " Last changed on
    S_ERNAM FOR YYLE0003-ERNAM, " Name of Person
    S_AEZET FOR YYLE0003-AEZET, " Time last change
    S_AENAM FOR YYLE0003-AENAM. " Name of person
    SELECTION-SCREEN: END OF BLOCK BLCK01.
    --INITIALIZATION--
    INITIALIZATION.
    Clear the variables and workarea
    CLEAR :G_VAR,
    G_VAR1,
    WA_VTTK,
    WA_ITAB3,
    WA_ITAB5,
    WA_ITAB4,
    WA_ITAB1,
    WA_VTTK,
    WA_ITAB3,
    WA_ITAB5,
    WA_ITAB4,
    WA_ITAB1.
    --AT SELECTION-SCREEN--
    AT SELECTION-SCREEN.
    To validate the data entered in selection screen
    PERFORM SUB_VALIDATE.
    --START-OF-SELECTION--
    START-OF-SELECTION.
    *To fetch the data from table yyle0003
    PERFORM GET_INPUT_DATA.
    *To create the Dynamic Field Catalog
    PERFORM GET_FIELDCAT.
    To populate the data to final table
    PERFORM GET_FINAL_DATA.
    MODULE status_0100 OUTPUT *
    MODULE STATUS_0100 OUTPUT.
    *set title bar and PF status.
    SET PF-STATUS 'ZVKS'.
    SET TITLEBAR 'ZVKS'.
    CHECK SY-UCOMM IS INITIAL.
    SORT G_SCANDATA_TAB BY TKNUM VHILM.
    *Create object for Custom container
    CREATE OBJECT G_CUSTOM_CONTAINER_0100
    EXPORTING
    CONTAINER_NAME = G_CONTAINER_0100
    EXCEPTIONS
    CNTL_ERROR = 1
    CNTL_SYSTEM_ERROR = 2
    CREATE_ERROR = 3
    LIFETIME_ERROR = 4
    LIFETIME_DYNPRO_DYNPRO_LINK = 5.
    *Create object for ALV grid
    CREATE OBJECT G_ALV_GRID_0100
    EXPORTING I_PARENT = G_CUSTOM_CONTAINER_0100.
    G_MYLAYOUT-GRID_TITLE = 'Display Scanning data'.
    *Call method for table Display
    CALL METHOD G_ALV_GRID_0100->SET_TABLE_FOR_FIRST_DISPLAY
    CHANGING
    IT_OUTTAB = <F_FS>
    IT_FIELDCATALOG = L_ALV_CAT1_TAB
    EXCEPTIONS
    INVALID_PARAMETER_COMBINATION = 1
    PROGRAM_ERROR = 2
    TOO_MANY_LINES = 3
    OTHERS = 4.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    User Interaction
    MODULE USER_COMMAND_0100 INPUT.
    CALL METHOD CL_GUI_CFW=>DISPATCH.
    *To exit , back or cancel
    CASE SY-UCOMM.
    WHEN 'EXIT'.
    LEAVE TO SCREEN 0.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    WHEN 'CANCEL'.
    LEAVE PROGRAM.
    WHEN OTHERS.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Form get_input_data
    This sub routine will get the data from yyle0003 table.
    FORM GET_INPUT_DATA.
    CONSTANTS: C_DOT TYPE C VALUE '.',
    C_CHAR TYPE C VALUE 'D'.
    CLEAR G_SCANDATA_TAB.
    Get the data from yyle0003
    SELECT VHILM " Packaging Materials
    EXIDV " External Handling Unit
    TKNUM " Shipment number
    QUANTITY " Quantity
    FROM YYLE0003
    INTO TABLE G_SCANDATA_TAB
    WHERE TKNUM IN S_TKNUM " Shipment number
    AND YY_REFERENCE IN S_YYREF " Packing reference
    AND YY_REFTP IN S_YYREFT " Reference type
    AND EXIDV IN S_EXIDV " External Handling Unit
    AND MATNR IN S_MATNR " Material number
    AND VBELN IN S_VBELN " SD number
    AND POSNR IN S_POSNR " Item number
    AND LGTOR IN S_LGTOR " Door for warehouse No
    AND VHILM IN S_VHILM " Packaging Materials
    AND YY_MEINH IN S_YYMEIN " Indicator for UOM
    AND QUANTITY IN S_QUANTI " Quantity
    AND YYCHECKED IN S_YCHECK " Destination_door
    AND STATUS IN S_STATUS " Packing status
    AND STATUSSHIPTO IN S_STASHI " Status on ship-to
    AND LOADTRUCK IN S_LOADTR " Load truck
    AND ERDAT IN S_ERDAT " Date
    AND ERZET IN S_ERZET " Entry time
    AND AEDAT IN S_AEDAT " Last changed on
    AND ERNAM IN S_ERNAM " Name of Person
    AND AEZET IN S_AEZET " Time last change
    AND AENAM IN S_AENAM. " Name of person
    If VHILM contains any Decimal '.', replace it with D
    LOOP AT G_SCANDATA_TAB.
    REPLACE C_DOT WITH C_CHAR INTO G_SCANDATA_TAB-VHILM.
    IF SY-SUBRC = 0.
    MODIFY G_SCANDATA_TAB TRANSPORTING VHILM.
    ENDIF.
    CLEAR G_SCANDATA_TAB.
    ENDLOOP.
    *To get the Shipment No Creation date from VTTK.
    SELECT TKNUM
    ERDAT
    FROM VTTK
    INTO TABLE G_VTTK_TAB
    WHERE TKNUM IN S_TKNUM.
    SORT G_SCANDATA_TAB BY VHILM EXIDV. "TKNUM VHILM.
    *To get the repeatition of Pacakaging material for each Shipment.
    *--- to find the count of packaging materials under each shipment
    LOOP AT G_SCANDATA_TAB.
    READ TABLE G_SCANDATA_TAB INTO ST_SCANDATA_TAB INDEX SY-TABIX.
    AT END OF EXIDV.
    L_COUNT = L_COUNT + 1.
    MOVE-CORRESPONDING ST_SCANDATA_TAB TO G_SCANDATA_COUNT_TAB.
    G_SCANDATA_COUNT_TAB-COUNT = L_COUNT.
    CLEAR: ST_SCANDATA_TAB, L_COUNT.
    COLLECT G_SCANDATA_COUNT_TAB.
    ENDAT.
    CLEAR : G_SCANDATA_TAB.
    ENDLOOP.
    ENDFORM. " get_input_data
    *& Form sub_validate
    *This subroutine will validate the data eneterd in the selection screen
    FORM SUB_VALIDATE.
    *Varaiable declaration for Shipment number
    DATA: L_TKNUM TYPE YYLE0003-TKNUM."#EC NEEDED " Shipment number
    *- Condition will not qualify all primary key (IDENT)
    SELECT TKNUM FROM YYLE0003 UP TO 1 ROWS
    INTO L_TKNUM "wa_scandata
    WHERE TKNUM IN S_TKNUM " Shipment number
    AND YY_REFERENCE IN S_YYREF " Packing reference
    AND YY_REFTP IN S_YYREFT " Reference type
    AND EXIDV IN S_EXIDV " External Handling Unit
    AND MATNR IN S_MATNR " Material number
    AND VBELN IN S_VBELN " SD number
    AND POSNR IN S_POSNR " Item number
    AND LGTOR IN S_LGTOR " Door for warehouse No
    AND VHILM IN S_VHILM " Packaging Materials
    AND YY_MEINH IN S_YYMEIN " Indicator for UOM
    AND QUANTITY IN S_QUANTI " Quantity
    AND YYCHECKED IN S_YCHECK " Destination_door
    AND STATUS IN S_STATUS " Packing status
    AND STATUSSHIPTO IN S_STASHI " Status on ship-to
    AND LOADTRUCK IN S_LOADTR " Load truck
    AND ERDAT IN S_ERDAT " Date
    AND ERZET IN S_ERZET " Entry time
    AND AEDAT IN S_AEDAT " Last changed on
    AND ERNAM IN S_ERNAM " Name of Person
    AND AEZET IN S_AEZET " Time last change
    AND AENAM IN S_AENAM. " Name of person
    ENDSELECT.
    IF SY-SUBRC <> 0.
    MESSAGE E987 . " No data found for these selection criterias
    ENDIF.
    ENDFORM. " sub_validate
    *& Form get_fieldcat
    Preparing Field catalog
    FORM GET_FIELDCAT.
    DATA: L_REF TYPE REF TO DATA,
    L_I TYPE I. " Variable
    CONSTANTS: C_CENTER TYPE C VALUE 'C'. " Center Justified
    LOOP AT G_SCANDATA_TAB INTO WA_ITAB1.
    MOVE-CORRESPONDING WA_ITAB1 TO WA_ITAB3.
    APPEND WA_ITAB3 TO G_ITAB3_TAB.
    MOVE-CORRESPONDING WA_ITAB1 TO WA_ITAB4.
    COLLECT WA_ITAB4 INTO G_ITAB4_TAB.
    *To sum up the qunatity field for each TKNUM.
    AT END OF TKNUM.
    SUM.
    MOVE WA_ITAB1-TKNUM TO G_TOTAL_TAB-TKNUM.
    MOVE WA_ITAB1-QUANTITY TO G_TOTAL_TAB-QUANTITY .
    APPEND G_TOTAL_TAB.
    CLEAR G_TOTAL_TAB.
    ENDAT.
    CLEAR : WA_ITAB1,
    WA_ITAB3,
    WA_ITAB4.
    ENDLOOP.
    *--- Begin of change - SKR.EXT - EBDK986377
    SORT G_ITAB4_TAB BY TKNUM.
    *--- End of change - SKR.EXT - EBDK986377
    LOOP AT G_ITAB4_TAB INTO WA_ITAB4.
    MOVE-CORRESPONDING WA_ITAB4 TO WA_ITAB5.
    MOVE-CORRESPONDING WA_ITAB4 TO G_ITAB6_TAB.
    *---- to get the count
    READ TABLE G_SCANDATA_COUNT_TAB WITH KEY TKNUM = WA_ITAB5-TKNUM
    VHILM = WA_ITAB5-VHILM.
    IF SY-SUBRC EQ 0.
    WA_ITAB5-COUNT = G_SCANDATA_COUNT_TAB-COUNT.
    ENDIF.
    APPEND WA_ITAB5 TO G_ITAB5_TAB.
    COLLECT G_ITAB6_TAB.
    ENDLOOP.
    CLEAR : WA_ITAB3.
    SORT G_ITAB4_TAB BY TKNUM VHILM.
    DELETE ADJACENT DUPLICATES FROM G_ITAB4_TAB COMPARING VHILM.
    *To get the Number of fields to be displayed
    DESCRIBE TABLE G_ITAB4_TAB LINES G_VAR.
    L_I = '3'.
    *Field catalog
    WA_ALV_CAT1-FIELDNAME = 'TKNUM'(002).
    WA_ALV_CAT1-COL_POS = 1.
    WA_ALV_CAT1-COLTEXT ='ShipmentNo.'.
    APPEND WA_ALV_CAT1 TO L_ALV_CAT1_TAB.
    CLEAR : WA_ALV_CAT1.
    WA_ALV_CAT1-FIELDNAME = 'ERDAT'(003).
    WA_ALV_CAT1-COL_POS = 2.
    WA_ALV_CAT1-COLTEXT ='Creation_Date.'(005).
    APPEND WA_ALV_CAT1 TO L_ALV_CAT1_TAB.
    CLEAR : WA_ALV_CAT1.
    Create field catalog for each of VHILM
    LOOP AT G_ITAB4_TAB INTO WA_ITAB4.
    IF G_VAR >= 1.
    CONDENSE WA_ITAB4-VHILM NO-GAPS.
    WA_ALV_CAT1-FIELDNAME = WA_ITAB4-VHILM. "l_fieldname.
    WA_ALV_CAT1-COL_POS = L_I.
    WA_ALV_CAT1-COLTEXT = WA_ITAB4-VHILM.
    WA_ALV_CAT1-JUST = C_CENTER. "'C'.
    APPEND WA_ALV_CAT1 TO L_ALV_CAT1_TAB.
    CLEAR WA_ALV_CAT1.
    L_I = L_I + 1.
    ENDIF.
    *TOTAL-last column in the field catalog
    AT LAST.
    WA_ALV_CAT1-FIELDNAME = 'TOTAL'(004).
    WA_ALV_CAT1-COL_POS = L_I.
    WA_ALV_CAT1-COLTEXT = 'TOTAL'(004).
    WA_ALV_CAT1-JUST = C_CENTER. " 'C'.
    APPEND WA_ALV_CAT1 TO L_ALV_CAT1_TAB.
    CLEAR WA_ALV_CAT1.
    ENDAT.
    SORT L_ALV_CAT1_TAB BY FIELDNAME.
    *Non of the field name should not get repeated
    DELETE ADJACENT DUPLICATES FROM L_ALV_CAT1_TAB.
    ENDLOOP.
    SORT L_ALV_CAT1_TAB BY COL_POS.
    *Creating Dynamic Internal table
    CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
    EXPORTING
    IT_FIELDCATALOG = L_ALV_CAT1_TAB
    IMPORTING
    EP_TABLE = L_REF.
    Assigning the Dynamic field Catalog to field symbol.
    ASSIGN L_REF->* TO <F_FS>.
    CREATE DATA G_WA LIKE LINE OF <F_FS>.
    ASSIGN G_WA->* TO <F_WA>.
    DELETE ADJACENT DUPLICATES FROM <F_FS> COMPARING ALL FIELDS.
    ENDFORM. " get_fieldcat
    *& Form display_data
    FORM GET_FINAL_DATA.
    *variable declaration
    DATA: L_TOTAL TYPE I, " Row wise total
    L_FILL TYPE I, " Count
    L_TOT TYPE I. " Grand total
    *To get the TOTAL qunatity in the last line of out put.
    LOOP AT G_ITAB6_TAB.
    CLEAR WA_ITAB5.
    WA_ITAB5-TKNUM = 'TOTAL'(004).
    WA_ITAB5-ERDAT = SPACE.
    MOVE-CORRESPONDING G_ITAB6_TAB TO WA_ITAB5 .
    LOOP AT G_SCANDATA_COUNT_TAB WHERE VHILM = G_ITAB6_TAB-VHILM.
    WA_ITAB5-COUNT = WA_ITAB5-COUNT + G_SCANDATA_COUNT_TAB-COUNT.
    ENDLOOP.
    APPEND WA_ITAB5 TO G_ITAB5_TAB.
    CLEAR WA_ITAB5.
    ENDLOOP.
    DESCRIBE TABLE G_ITAB5_TAB LINES L_TOT.
    *>>>>>>>>
    ****To get total qunatity of all TKNUM
    LOOP AT G_TOTAL_TAB .
    L_TOTAL = L_TOTAL + G_TOTAL_TAB-QUANTITY.
    ENDLOOP.
    *>>>>>>>>
    *To assign ERDAT to g_itab5_tab
    LOOP AT G_ITAB5_TAB INTO WA_ITAB5 .
    READ TABLE G_VTTK_TAB INTO WA_VTTK WITH KEY TKNUM = WA_ITAB5-TKNUM.
    IF SY-SUBRC = 0.
    WA_ITAB5-ERDAT = WA_VTTK-ERDAT.
    MODIFY G_ITAB5_TAB FROM WA_ITAB5 TRANSPORTING ERDAT.
    ENDIF.
    ENDLOOP.
    *Assigning value in each field to respective Field symbols.
    LOOP AT G_ITAB5_TAB ASSIGNING <F_FS2>.
    CLEAR G_TOTAL_TAB-QUANTITY.
    ASSIGN COMPONENT 'TKNUM' OF STRUCTURE <F_FS2> TO <F_FS6>.
    ASSIGN COMPONENT 'TKNUM' OF STRUCTURE <F_WA> TO <F_FS7>.
    <F_FS7> = <F_FS6>.
    CONDENSE <F_FS2>-VHILM NO-GAPS.
    ASSIGN COMPONENT 'VHILM' OF STRUCTURE <F_FS2> TO <F_FS3>.
    ASSIGN COMPONENT 5 OF STRUCTURE <F_FS2> TO <F_FS4>.
    MOVE <F_FS3> TO G_VAR1.
    ASSIGN COMPONENT G_VAR1 OF STRUCTURE <F_WA> TO <F_FS5>.
    <F_FS5> = <F_FS4>.
    ASSIGN COMPONENT 'ERDAT' OF STRUCTURE <F_FS2> TO <F_FS16>.
    ASSIGN COMPONENT 'ERDAT' OF STRUCTURE <F_WA> TO <F_FS15>.
    WRITE <F_FS16> TO <F_FS15> .
    Inorder not to display the date '00/00/000',
    if there is no DATE .
    IF ( <F_FS15> CP '00/*' )
    OR ( <F_FS15> CP '00.*' )
    OR ( <F_FS15> CP '00-*' ).
    <F_FS15> = SPACE.
    ELSEIF ( <F_FS15> CO ' / /' )
    OR ( <F_FS15> CO ' . .' )
    OR ( <F_FS15> CO ' - -' ) .
    <F_FS15> = SPACE.
    ENDIF.
    READ TABLE G_TOTAL_TAB WITH KEY TKNUM = <F_FS6>.
    IF SY-SUBRC = 0.
    ASSIGN G_TOTAL_TAB-QUANTITY TO <F_FS12>.
    ASSIGN COMPONENT 'COUNT' OF STRUCTURE <F_FS2> TO <F_FS12>.
    ASSIGN COMPONENT 'TOTAL' OF STRUCTURE <F_WA> TO <F_FS13>.
    <F_FS13> = <F_FS13> + <F_FS12>.
    L_TOTAL = L_TOTAL + <F_FS12>.
    ENDIF.
    L_FILL = L_FILL + 1.
    IF L_FILL = L_TOT.
    ASSIGN L_TOTAL TO <F_FS12>.
    ASSIGN COMPONENT 'TOTAL' OF STRUCTURE <F_WA> TO <F_FS13>.
    <F_FS13> = <F_FS12>.
    ENDIF.
    AT END OF <F_FS2>-TKNUM.
    APPEND <F_WA> TO <F_FS>.
    CLEAR <F_WA>.
    ENDAT.
    ENDLOOP.
    CLEAR: <F_FS6>,
    <F_FS7>,
    <F_WA>.
    *Call the screen where Custom container is defined
    CALL SCREEN 0100.
    ENDFORM. " display_data
    Regards
    Kannaiah

  • Using Beans in jsp

    hi all,
    i am using bean in my jsp page.but it is not working it shows error. i have run this with even Tomcat or WebLogic. even i have just Copy paste code from net.
    the code is
    index.jsp
    <%@ page errorPage="errorpage.jsp" %>
    <jsp:useBean id="counter" scope="session" class="beans.Counter" />
    <html>
    <head>
    <title>Session Bean Example 1</title>
    </head>
    <body>
    <H3>Session Bean Example 1</H3>
    <center><b>The current count for the counter bean is: </b>
    <%=counter.getCount() %></center>
    </body>
    </html>
    Bean -Counter.java
    package beans;
    import java.io.Serializable;
    public class Counter implements Serializable{
    int count = 0;
    public Counter(){
    public int getCount() {
    count++;
    return this.count;
    public void setCount(int count) {
    this.count = count;
    and error on browser is
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: /index.jsp(3,0) The value for the useBean class attribute beans.Counter is invalid.
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:512)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    root cause
    org.apache.jasper.JasperException: /index.jsp(3,0) The value for the useBean class attribute beans.Counter is invalid.
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
         org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1174)
         org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
         org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
         org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Generator.generate(Generator.java:3320)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:305)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.
    Please let me know how can i handle this situation

    Try this
    After<hsp:useBean>
    <jsp:setProperty name="counter" property="setCounter" value=1 />
    <jsp:getProperty name="counter" property="getCounter" />

  • Need a Help to Run the EJB client

    Hello Friends,
    I'm using EJB3.0. while running my client side bean I got a Exception like this " javax.naming.NameNotFoundException: maheshwaran.count not bound." I'm new to EJB so i couldn't find specifically what is the mistake in my files.
    I created the following files. It are listed below
    FileName: count.java
    "package maheshwaran;
    public interface count {
    public int count();
    public void set(int val);
    public void remove();
    FileName2 : countBean.java
    "package maheshwaran;
    import javax.ejb.*;
    import javax.interceptor.Interceptors;
    @Stateful
    @Remote(count.class)
    @Interceptors(countCallBacks.class)
    public class countBean implements count{
    private int val;
    public int count(){
    System.out.println("count()");
    return ++val;
    public void set(int val){
    this.val=val;
    System.out.println("set()");
    @Remove
    public void remove(){
    System.out.println("remove()");
    FileName3: countCallBacks.java
    " package maheshwaran;
    import javax.annotation.PostConstruct;
    import javax.annotation.PreDestroy;
    import javax.ejb.*;
    import javax.interceptor.InvocationContext;
    public class countCallBacks {
    @PostConstruct
    public void construct(InvocationContext ctx){
    System.out.println("cb:construct()");
    @PostActivate
    public void activate(InvocationContext ctx){
    System.out.println("cb:activate()");
    @PrePassivate
    public void passivate(InvocationContext ctx){
    System.out.println("cb:passivate()");
    @PreDestroy
    public void destroy(){
    System.out.println("cb:destroy()");
    The client side class is following: countClient.java
    "package maheshwaran;
    import javax.naming.*;
    public class countClient {
    public static final int noofClients=3;
    public static void main(String args[]){
    try{
    Context ctx=new InitialContext(System.getProperties());
    count count[]=new count[noofClients];
    int countval=0;
    System.out.println("Instatntiating Beans");
    for(int i=0;i<noofClients;i++){
    count=(count) ctx.lookup(count.class.getName());
    count.set(countval);
    countval=count.count();
    System.out.println(countval);
    Thread.sleep(100);
    System.out.println("Calling count on Beans");
    for(int i=0;i<noofClients;i++){
    countval=count.count();
    System.out.println(countval);
    count.remove();
    Thread.sleep(50);
    }catch(Exception e){e.printStackTrace();}
    The Deployment Descriptor file is following: ejb-jar.xml
    "><?xml version="1.0" encoding="UTF-8?>
    <ejb-jar xmlns="http://java.sun.com/xml/ns/javaee" version="3.0"
    xmlns:xsi="http://www.w3.org/2001/XMLschema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/ejb-jar_3_0.xsd">
    <description>Stateful Session Bean Example</description>
    <display-name>Stateful Session Bean Example</display-name>
    <enterprise-beans>
    <session>
    <ejb-name>countBean</ejb-name>
    <business-remote>maheshwaran_dd.count</business-remote>
    </business-remote>
    <ejb-class>maheshwaran_dd.countBean</ejb-class>
    <session-type>Stateful</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    <interceptors>
    <interceptor>
    <interceptor-class>maheshwaran_dd.countCallBacks</interceptor-class>
    <post-construct>
    <lifecycle-callback-method>construct</lifecycle-clallback-method>
    </post-construct>
    <post-activate>
    <lifecycle-callback-method>activate</lifecycle-callback-method>
    </post-activate>
    <pre-passivate>
    <lifecycle-callback-method>passivate</lifecycle-callback-method>
    </pre-passivate>
    </interceptor>
    </interceptors>
    <assembly-descriptor>
    <interceptor-binding>
    <ejb-name>countBean</ejb-name>
    <interceptor-class>maheshwaran_dd.countCallBacks</interceptor-class>
    </interceptor-binding>
    </assembly-descriptor>
    </ejb-jar> "
    please help me to rectify this problem.
    Thanks & regards,
    Maheshwaran Devaraj

    Hi,
    user586 wrote:
    i want to write the query to select the coupon whose Expiry date in the table is NOT within 30 days.If you mean expirationdate (datatype: DATE) is not within 30 days (past or future) of run time, then:
    SELECT  coupon          -- or whatever columns you want
    FROM    table_x
    WHERE   expirationdate  NOT BETWEEN  SYSDATE - 30
                                AND      SYSDATE + 30
    ;

  • Using SharedObjects to load and save data

    Hello, i am having troubles with using shared objects to save and load data for my highscore feature of my game i am developing in actionscript 3. This is my main code.
    I am trying to update a dynamic text field that acts as an high score function
    [as]
    package
              // initialize;
              import flash.display.MovieClip;
              import flash.utils.Timer;
              import flash.events.TimerEvent;
              import flash.ui.Mouse;
              import flash.events.KeyboardEvent;
              import flash.ui.Keyboard;
              import flash.events.Event;
              import flash.media.SoundChannel;
              import flash.net.SharedObject;
              import flash.text.TextField;
              import flash.display.Stage;
              import flash.events.ProgressEvent;
              public class Game extends MovieClip
                        public static var _stage:Stage;
                        static var so:SharedObject;
                        static var ship:MovieClip;
                        static var healthMeter:HealthMeter;
                        static var score:Score;
                        static var highScore:HighScore;
                        static var enemyShipTimer:Timer;
                        static var gameOverMenu:GameOverMenu;
                        static var startMenu:StartMenu;
                        static var helpMenu:HelpMenu;
                        static var startButton:StartButton;
                        static var returnButton:ReturnButton;
                        static var helpButton:HelpButton;
                        static var pauseButton:PauseButton;
                        static var playButton:PlayButton;
                        static var mainMenuButton:MainMenuButton;
                        public var currentValue:Number;
                        public var loadingProgress:LoadingProgress;
                        public function Game()
                                  loadingProgress = new LoadingProgress();
                                  loadingProgress.x = 550;
                                  loadingProgress.y = 500;
                                  addChild( loadingProgress );
                                  loaderInfo.addEventListener( Event.COMPLETE, onCompletelyDownloaded );
                                  loaderInfo.addEventListener( ProgressEvent.PROGRESS, onProgressMade );
                        public function showMenuScreen():void
                                  _stage = this.stage;
                                  Key.initialize(stage);
                                  ship = new Ship();
                                  healthMeter = new HealthMeter();
                                  var score:Score = new Score();
                                  var highScore:HighScore = new HighScore();
                                  so = SharedObject.getLocal("scores");
                                  if (so.data.score)
                                            highScore.bestScore.text = so.data.score.toString();
                                  else
                                            highScore.bestScore.text = "0";
                                  addChild(score);
                                  addChild(highScore);
                                  gameScore.visible = false;
                                  bestScore.visible = true;
                                  healthMeter.x = 2.5;
                                  healthMeter.y = 576;
                                  gameOverMenu = new GameOverMenu();
                                  gameOverMenu.x = 217;
                                  gameOverMenu.y = 244;
                                  addChild(gameOverMenu);
                                  gameOverMenu.visible = false;
                                  helpMenu = new HelpMenu();
                                  helpMenu.x = 480;
                                  helpMenu.y = 312;
                                  addChild(helpMenu);
                                  helpMenu.visible = false;
                                  returnButton = new ReturnButton();
                                  returnButton.x = 54;
                                  returnButton.y = 52;
                                  addChild(returnButton);
                                  returnButton.visible = false;
                                  gameOverMenu.playAgainButton.addEventListener("mouseDown", newGame);
                                  startMenu = new StartMenu();
                                  mainMenuButton = new MainMenuButton();
                                  startButton = new StartButton();
                                  helpButton = new HelpButton();
                                  startMenu.x = 151;
                                  startMenu.y = 111;
                                  startButton.x = 93;
                                  startButton.y = 426;
                                  helpButton.x = 631;
                                  helpButton.y = 386;
                                  mainMenuButton.x = 656;
                                  mainMenuButton.y = 483;
                                  addChild(mainMenuButton);
                                  mainMenuButton.visible = false;
                                  stage.addChildAt(startMenu, 0);
                                  addChild(startButton);
                                  addChild(helpButton);
                                  startMenu.visible = true;
                                  startButton.visible = true;
                                  helpButton.visible = true;
                                  startMenu.visible = true;
                                  startButton.addEventListener("mouseDown", newGame);
                                  helpButton.addEventListener("mouseDown", helpGame);
                                  mainMenuButton.addEventListener("mouseDown", mainMenu);
                                  returnButton.addEventListener("mouseDown", mainMenu2);
                                  pauseButton = new PauseButton();
                                  pauseButton.x = 896;
                                  pauseButton.y = 63;
                                  pauseButton.addEventListener("mouseDown", PauseGame);
                                  playButton = new PlayButton();
                                  playButton.x = 896;
                                  playButton.y = 63;
                                  addChild(playButton);
                                  playButton.visible = false;
                                  playButton.addEventListener("mouseDown", PlayGame);
                        static function gameOver()
                                  scoreF();
                                  mainMenuButton.visible = true;
                                  healthMeter.visible = false;
                                  pauseButton.visible = false;
                                  gameOverMenu.visible = true;
                                  enemyShipTimer.stop();
                                  for (var i in EnemyShip.list)
                                            EnemyShip.list[i].kill();
                                  ship.takeDamage(-ship.maxHealth);
                        function newGame(e:Event)
                                  addEventListener(Event.DEACTIVATE, PauseGame);
                                  bestScore.visible = false;
                                  gameScore.visible = true;
                                  addChild(pauseButton);
                                  addChild(healthMeter);
                                  addChild(mainMenuButton);
                                  enemyShipTimer = new Timer(750);
                                  enemyShipTimer.addEventListener("timer", sendEnemy);
                                  addChild(ship);
                                  healthMeter.visible = true;
                                  startMenu.visible = false;
                                  mainMenuButton.visible = false;
                                  startButton.visible = false;
                                  healthMeter.visible = true;
                                  pauseButton.visible = true;
                                  playButton.visible = false;
                                  gameOverMenu.visible = false;
                                  helpButton.visible = false;
                                  ship.visible = true;
                                  ship.x = 367;
                                  ship.y = 542;
                                  enemyShipTimer.start();
                                  currentValue = 0;
                                  updateDisplay();
                        function mainMenu(e:Event)
                                  removeEventListener(Event.DEACTIVATE, PauseGame);
                                  bestScore.visible = true;
                                  gameScore.visible = false;
                                  removeChild(mainMenuButton);
                                  removeChild(ship);
                                  healthMeter.visible = false;
                                  startMenu.visible = true;
                                  mainMenuButton.visible = false;
                                  startButton.visible = true;
                                  healthMeter.visible = false;
                                  pauseButton.visible = false;
                                  playButton.visible = false;
                                  ship.takeDamage(ship.maxHealth);
                                  gameOverMenu.visible = false;
                                  helpButton.visible = true;
                                  returnButton.visible = false;
                        function mainMenu2(e:Event)
                                  bestScore.visible = true;
                                  gameScore.visible = false;
                                  healthMeter.visible = false;
                                  startMenu.visible = true;
                                  mainMenuButton.visible = false;
                                  startButton.visible = true;
                                  healthMeter.visible = false;
                                  pauseButton.visible = false;
                                  playButton.visible = false;
                                  gameOverMenu.visible = false;
                                  helpButton.visible = true;
                                  returnButton.visible = false;
                                  helpMenu.visible = false;
                        function PauseGame(e:Event)
                                  enemyShipTimer.removeEventListener("timer", sendEnemy);
                                  stage.frameRate = 0;//
                                  pauseButton.visible = false;
                                  playButton.visible = true;
                        function PlayGame(e:Event)
                                  enemyShipTimer.addEventListener("timer", sendEnemy);
                                  stage.frameRate = 30;//
                                  pauseButton.visible = true;
                                  playButton.visible = false;
                        function helpGame(e:Event)
                                  startMenu.visible = false;
                                  startButton.visible = false;
                                  helpButton.visible = false;
                                  helpMenu.visible = true;
                                  returnButton.visible = true;
                        function sendEnemy(e:Event)
                                  var enemy = new EnemyShip();
                                  stage.addChildAt(enemy, 0);
                                  addToValue(1);
                        function addToValue( amountToAdd:Number ):void
                                  currentValue = currentValue + amountToAdd;
                                  updateDisplay();
                        static function scoreF():void
                                  if (so.data.score)
                                            if (getFinalScore()>so.data.score)
                                                      so.data.score = getFinalScore();
                                                      so.flush();
                                  else
                                            so.data.score = getFinalScore();
                                            so.flush();
                        function updateDisplay():void
                                  if (currentValue>Number(highScore.bestScore.text))
                                            scoreF();
                                            highScore.bestScore.text = currentValue.toString();
                                  TextField(gameScore.getChildByName("scoreDisplay")).text = currentValue.toString();
                                  TextField(bestScore.getChildByName("bestScore")).text = highScore.bestScore.text;
                                  loadingProgress.percentDisplay.text = currentValue.toString();
                        static function getFinalScore()
                                  _stage;
                                  return;
                                  gameScore.currentValue;
                        public function onCompletelyDownloaded( event:Event ):void
                                  gotoAndStop(3);
                                  showMenuScreen();
                        public function onProgressMade( progressEvent:ProgressEvent ):void
                                  setValue( Math.floor( 100 * loaderInfo.bytesLoaded / loaderInfo.bytesTotal ) );
                        public function setValue( amount:Number ):void
                                  currentValue = amount;
                                  updateDisplay();
    [/as]
    when i run this, it crashes with this error.
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at Game/updateDisplay()[C:\Users\Ben\Desktop\SFUR\Game.as:329]
              at Game/setValue()[C:\Users\Ben\Desktop\SFUR\Game.as:356]
              at Game/onProgressMade()[C:\Users\Ben\Desktop\SFUR\Game.as:351]
    help would be greatly appreciated.
    if you need any more details please ask.
    Line 329:  if (currentValue>Number(highScore.bestScore.text))
    Line 356:  updateDisplay();
    Line 351:
    setValue( Math.floor( 100 * loaderInfo.bytesLoaded / loaderInfo.bytesTotal ) );
    -Ben

    Ok, i have changed my classes a bit to try and fix the issue. I found a tutorial online called MJW avoider game or something and so i split some of my code in to seperate classes. But now the score doesnt update. I have fixed the loading issue (hopefully) i can access the main menu etc... but the highscore doesnt show at all after a game. Here are my classes.
    Document class (Game.as)
    package
              // initialize;
              import flash.display.MovieClip;
              import flash.utils.Timer;
              import flash.events.TimerEvent;
              import flash.ui.Mouse;
              import flash.events.KeyboardEvent;
              import flash.ui.Keyboard;
              import flash.events.Event;
              import flash.media.SoundChannel;
              import flash.net.SharedObject;
              import flash.text.TextField;
              import flash.display.Stage;
              import flash.events.ProgressEvent;
              public class Game extends MovieClip
                        public static var _stage:Stage;
                        static var so:SharedObject;
                        static var ship:MovieClip;
                        static var healthMeter:HealthMeter;
                        static var score:Score;
                        static var enemyShipTimer:Timer;
                        static var gameOverMenu:GameOverMenu;
                        static var startMenu:StartMenu;
                        static var helpMenu:HelpMenu;
                        static var startButton:StartButton;
                        static var returnButton:ReturnButton;
                        static var helpButton:HelpButton;
                        static var pauseButton:PauseButton;
                        static var playButton:PlayButton;
                        static var mainMenuButton:MainMenuButton;
                        public var currentValue:Number;
                        public var loadingProgress:LoadingProgress;
                        static var highScore:HighScore;
                        public function Game()
                                  loadingProgress = new LoadingProgress();
                                  loadingProgress.x = 550;
                                  loadingProgress.y = 500;
                                  addChild( loadingProgress );
                                  loaderInfo.addEventListener( Event.COMPLETE, onCompletelyDownloaded );
                                  loaderInfo.addEventListener( ProgressEvent.PROGRESS, onProgressMade );
                        public function showMenuScreen():void
                                  removeChild( loadingProgress );
                                  _stage = this.stage;
                                  highScore = new HighScore();
                                  ship = new Ship();
                                  healthMeter = new HealthMeter();
                                  var score:Score = new Score();
                                  so = SharedObject.getLocal("scores");
                                  if (so.data.score)
                                            highScore.bestScore.text = so.data.score.toString();
                                  else
                                            highScore.bestScore.text = "0";
                                  addChild(score);
                                  addChild(highScore);
                                  gameScore.visible = false;
                                  bestScore.visible = true;
                                  healthMeter.x = 2.5;
                                  healthMeter.y = 576;
                                  gameOverMenu = new GameOverMenu();
                                  gameOverMenu.x = 217;
                                  gameOverMenu.y = 244;
                                  addChild(gameOverMenu);
                                  gameOverMenu.visible = false;
                                  helpMenu = new HelpMenu();
                                  helpMenu.x = 480;
                                  helpMenu.y = 312;
                                  addChild(helpMenu);
                                  helpMenu.visible = false;
                                  returnButton = new ReturnButton();
                                  returnButton.x = 54;
                                  returnButton.y = 52;
                                  addChild(returnButton);
                                  returnButton.visible = false;
                                  gameOverMenu.playAgainButton.addEventListener("mouseDo wn", newGame);
                                  startMenu = new StartMenu();
                                  mainMenuButton = new MainMenuButton();
                                  startButton = new StartButton();
                                  helpButton = new HelpButton();
                                  startMenu.x = 151;
                                  startMenu.y = 111;
                                  startButton.x = 93;
                                  startButton.y = 426;
                                  helpButton.x = 631;
                                  helpButton.y = 386;
                                  mainMenuButton.x = 656;
                                  mainMenuButton.y = 483;
                                  addChild(mainMenuButton);
                                  mainMenuButton.visible = false;
                                  stage.addChildAt(startMenu, 0);
                                  addChild(startButton);
                                  addChild(helpButton);
                                  startMenu.visible = true;
                                  startButton.visible = true;
                                  helpButton.visible = true;
                                  startMenu.visible = true;
                                  startButton.addEventListener("mouseDown", newGame);
                                  helpButton.addEventListener("mouseDown", helpGame);
                                  mainMenuButton.addEventListener("mouseDown", mainMenu);
                                  returnButton.addEventListener("mouseDown", mainMenu2);
                                  pauseButton = new PauseButton();
                                  pauseButton.x = 896;
                                  pauseButton.y = 63;
                                  pauseButton.addEventListener("mouseDown", PauseGame);
                                  playButton = new PlayButton();
                                  playButton.x = 896;
                                  playButton.y = 63;
                                  addChild(playButton);
                                  playButton.visible = false;
                                  playButton.addEventListener("mouseDown", PlayGame);
                        static function gameOver()
                                  scoreF();
                                  mainMenuButton.visible = true;
                                  healthMeter.visible = false;
                                  pauseButton.visible = false;
                                  gameOverMenu.visible = true;
                                  enemyShipTimer.stop();
                                  for (var i in EnemyShip.list)
                                            EnemyShip.list[i].kill();
                                  ship.takeDamage(-ship.maxHealth);
                        function newGame(e:Event)
                                  addEventListener(Event.DEACTIVATE, PauseGame);
                                  bestScore.visible = false;
                                  gameScore.visible = true;
                                  addChild(pauseButton);
                                  addChild(healthMeter);
                                  addChild(mainMenuButton);
                                  enemyShipTimer = new Timer(750);
                                  enemyShipTimer.addEventListener("timer", sendEnemy);
                                  addChild(ship);
                                  healthMeter.visible = true;
                                  startMenu.visible = false;
                                  mainMenuButton.visible = false;
                                  startButton.visible = false;
                                  healthMeter.visible = true;
                                  pauseButton.visible = true;
                                  playButton.visible = false;
                                  gameOverMenu.visible = false;
                                  helpButton.visible = false;
                                  ship.visible = true;
                                  ship.x = 367;
                                  ship.y = 542;
                                  enemyShipTimer.start();
                                  currentValue = 0;
                                  updateDisplay();
                        function mainMenu(e:Event)
                                  removeEventListener(Event.DEACTIVATE, PauseGame);
                                  bestScore.visible = true;
                                  gameScore.visible = false;
                                  removeChild(mainMenuButton);
                                  removeChild(ship);
                                  healthMeter.visible = false;
                                  startMenu.visible = true;
                                  mainMenuButton.visible = false;
                                  startButton.visible = true;
                                  healthMeter.visible = false;
                                  pauseButton.visible = false;
                                  playButton.visible = false;
                                  ship.takeDamage(ship.maxHealth);
                                  gameOverMenu.visible = false;
                                  helpButton.visible = true;
                                  returnButton.visible = false;
                        function mainMenu2(e:Event)
                                  bestScore.visible = true;
                                  gameScore.visible = false;
                                  healthMeter.visible = false;
                                  startMenu.visible = true;
                                  mainMenuButton.visible = false;
                                  startButton.visible = true;
                                  healthMeter.visible = false;
                                  pauseButton.visible = false;
                                  playButton.visible = false;
                                  gameOverMenu.visible = false;
                                  helpButton.visible = true;
                                  returnButton.visible = false;
                                  helpMenu.visible = false;
                        function PauseGame(e:Event)
                                  enemyShipTimer.removeEventListener("timer", sendEnemy);
                                  stage.frameRate = 0;//
                                  pauseButton.visible = false;
                                  playButton.visible = true;
                        function PlayGame(e:Event)
                                  enemyShipTimer.addEventListener("timer", sendEnemy);
                                  stage.frameRate = 30;//
                                  pauseButton.visible = true;
                                  playButton.visible = false;
                        function helpGame(e:Event)
                                  startMenu.visible = false;
                                  startButton.visible = false;
                                  helpButton.visible = false;
                                  helpMenu.visible = true;
                                  returnButton.visible = true;
                        function sendEnemy(e:Event)
                                  var enemy = new EnemyShip();
                                  stage.addChildAt(enemy, 0);
                                  addToValue(1);
                        static function scoreF():void
                                  if (so.data.score)
                                            if (getFinalScore()>so.data.score)
                                                      so.data.score = getFinalScore();
                                                      so.flush();
                                  else
                                            so.data.score = getFinalScore();
                                            so.flush();
                        function updateDisplay():void
                                  if (currentValue>Number(highScore.bestScore.text))
                                            scoreF();
                                            Game.highScore.bestScore.text = currentValue.toString();
                                  TextField(gameScore.getChildByName("scoreDisplay")).te xt = currentValue.toString();
                                  loadingProgress.percentDisplay.text = currentValue.toString();
                        static function getFinalScore()
                                  _stage;
                                  return;
                                  gameScore.currentValue;
                        public function addToValue( amountToAdd:Number ):void
                                  currentValue = currentValue + amountToAdd;
                                  updateDisplay();
                        public function onCompletelyDownloaded( event:Event ):void
                                  gotoAndStop(3);
                                  showMenuScreen();
                        public function onProgressMade( progressEvent:ProgressEvent ):void
                                  loadingProgress.setValue( Math.floor( 100 * loaderInfo.bytesLoaded / loaderInfo.bytesTotal ) );
    Counter Class (Counter.as)
    package
              import flash.display.MovieClip;
              public class Counter extends MovieClip
                        public var currentValue:Number;
                        public function Counter()
                                  reset();
                        public function addToValue( amountToAdd:Number ):void
                                  currentValue = currentValue + amountToAdd;
                                  updateDisplay();
                        public function setValue( amount:Number ):void
                                  currentValue = amount;
                                  updateDisplay();
                        public function reset():void
                                  currentValue = 0;
                                  updateDisplay();
                        public function updateDisplay():void
    LoadingProgress class (LoadingProgress.as)
    package
              import flash.text.TextField;
              public class LoadingProgress extends Counter
                        public function LoadingProgress()
                                  super();
                        override public function updateDisplay():void
                                  super.updateDisplay();
                                  percentDisplay.text = currentValue.toString();
    There not all my classes, but they are the classes where the errors are coming from.
    Please remember i am an actionscript noob
    Thanks again, Nacho

Maybe you are looking for

  • Deploy Java class to database from jDeveloper

    In 10g version I could create a deployment profile for deploying java class directly to the database from within jdeveloper. Looks like when you create a deployment profile in 11g that is no longer an option. Has the process changed, or was that func

  • One Solution For No Sound for imovie on Export to ipod from QT

    In converting edited imovie projects to video ipod movies, I found the video had sound only for the first edited "clip" in the timeline. I finally solved this problem by extracting the audio from the clips- then saving the project. I convert the proj

  • VoIP for Small Office

    Hi all- I am new to VoIP technology and currently working on a study for the business on deploying VoIP. Our business is small and currently is connected to the interent via DSL. We do have some Cisco routers and would like to know what is involved i

  • Why will adobe mix not open my pictures

    When I uploaded some photos, when I attempt to open them in the editor it spools then gives me the message that the image cannot be opened.  I have adequate space.

  • Stuck in Rescue M

    SSR: For some reason I couldn't reply to you in the thread we were in: http://forums.creative.com/creativel...scending&page= The device manager does detect my player as "Other Devices", then "USB 2.0 Device" with big yellow question marks next to the