Declaring values

How to declare a field in the selection screen as single value, ranges or multiple values

Hi,
To declare a single value you have to use PARAMETER and for defining a range you have to define SELECT-OPTION.
For example:
parameters:
p_matnr type mara-matnr.
select-options:
s_matnr for mara-matnr.
Thanks & Regards,
Navneeth K.

Similar Messages

  • How to declare value binding to array list element in a pojo?

    I have a POJO called P, that contains an ArrayList member called w.
    class P {
    private ArrayList w = new ArrayList(5);
    w is initied in the class constructor.
    The POJO is in the SessionBean and I would like to reference individual
    elements in the ArrayList via a value binding like so;
    #{SessionBean1.instanceOfP.w[5]}
    I'm not sure how to declare the getter/setter for member W in POJO P
    so that setter and getter injection work.

    You may not be able to directly set the indexed value.
    Try some thing like this.
    Add a property that returns the indexed value.
    Ex. if you ArrayList objets are of type "String"
    int index = 5;
    public String getMyValue(){
    return w.get[index]
    Now your value binding would look something like
    #{SessionBean1.myValue}
    BTW, if you want to access different index, create another method
    public void setIndex(int index){
    this.index = index;
    - Winston
    http://blogs.sun.com/roller/page/winston?catname=Creator

  • How to declare value null to object at the end of jsp page.

    Hi
    I have two doubts.
    1. Im getting request from request.getParameter() method. i stored that value in one object. after process completion i have set null value to object at the end of jsp page.
    2. I declare jsp scriptlet within the javascript. in that jsp scriptlet i set session.setAttribute() values. i want to get the session.getAttribute value after javascript code completion.
    i tried but i got jasperException.
    please help me to solve this problem
    Thank u in advance

    Hai Sundaram,
    when ever u got the param from request at that time only u set the same parameter to null..
    i am not sure abt this is my idea only

  • Changing A Value Using If Statement in SQL Query

    Hello, I have a very rudimentary question that I'm stuck on.  I have a query that returns one of 3 different integers.  I want to have each integer translate to a string value depending on the number returned.  Unfortunately this is the SCCM
    database which cannot be changed to provide an additional table with the values.
    I have something like this but I'm not getting what I want out of the date - depending on what I do I either get an error, or nothing.
    Declare @NewValue nvarchar
    Declare @Value nvarchar
    If @Value = 1 Set @Value = 'String1'
    If @Value = 2 Set @Value = 'String2'
    If @Value = 3 Set @Value = 'String3'
    Select PrimaryKey,IntegerValue FROM db_Table WHERE @Value=IntegerValue
    I know this is a simple thing but I'm new to SQL and not exactly sure what terms I should even be using to search for this.  Thanks for the help!

    select PrimaryKey, IntegerValue, case IntegerValue when 1 then 'String1'
    when 2 then 'String 2' when 3 then 'String3' else 'Unknown Integer Value' end as [Description]
    from db_Table
    Take a look at
    CASE expression in BOL. You may also find the following article helpful
    http://social.technet.microsoft.com/wiki/contents/articles/21327.t-sql-simplified-case-expression.aspx
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Oracle declare function in shell script

    Please tell me oracle declare function now able to run in shell script?
    I am calling in shell script like @/myscript.sql it is not working properly, reset update and other oracle command is working fine in shell script.

    I am running below code.
    #!/bin/sh
    sqlplus system/manager@prod_db <<ENDOFSQL
    update apps.fnd_concurrent_queues set node_name = 'host1', target_node ='host1' where node_name='host3';
    update apps.fnd_concurrent_queues set node_name = 'host2', target_node ='host2' where node_name='host4';
    commit;
    DECLARE
    VALUE BOOLEAN;
    l_node_id number;
    BEGIN
    select node_id into l_node_id from fnd_nodes where NODE_NAME = 'host5';
    VALUE := fnd_profile.save ('NODE_TRUST_LEVEL', 3, 'SERVER',l_node_id,null,null);
    END;
    ENDOFSQL
    Below ERROR i am getting after running above code via shell script with oracle user
    SQL>
    0 rows updated.
    SQL>
    0 rows updated.
    SQL>
    Commit complete.
    SQL> SQL> DECLARE
    ERROR at line 1:
    ORA-01403: no data found
    ORA-06512: at line 5

  • Does VZW declaer value on FedEx return lables? ($600 smartphone being returned)

    After activating the replacement smartphone from Verizon,  I just had the
    original smartphone dropped off at FedEx using the return label provided
    by Verizon Wireless.
    The FedEx label showed "DECLARED VALUE $*********" with no valued
    filled in.
    If FedEx loses the package, who is responsible?   VZW, FedEX, or me?
    I'm a little nervous because VZW said I would be billed $600 retail price
    of the phone if it's not returned within 5 days.
    Thanks!

    SandraW wrote:
    After activating the replacement smartphone from Verizon,  I just had the
    original smartphone dropped off at FedEx using the return label provided
    by Verizon Wireless.
    The FedEx label showed "DECLARED VALUE $*********" with no valued
    filled in.
    If FedEx loses the package, who is responsible?   VZW, FedEX, or me?
    I'm a little nervous because VZW said I would be billed $600 retail price
    of the phone if it's not returned within 5 days.
    Thanks!
    If you made copies of everything, Verizon or FedEx will be responsible for any lost packages. I've seen posts on here where Verizon claims they never got the returned phone from the customer, and they were charged full price because of that. How or if they got it fixed, I don't know.

  • Creating a string with hiearchical data

    This is being done in Crystal 8 will all updates applied.
    I have a database with records that are linked to a series of "folders" that are hierarchical in nature as shown below:
    Folder 1:
         Folder 1.1
              Folder 1.1.1
    Folder 2
        Folder 2.1
    All of the folders can have data records attached to them.
    The database represents the folder structure in a table with the following attributes:
    Folder ID   (integer)
    Folder Name (String)  (such as "Folder 1"
    Folder Parent ID (integer)
    (other non-related fields)
    If the folder is at the root level, then the value in Folder Parent ID is 0, otherwise, it is the Folder ID of the parent folder.
    I need to be able to create a string field that displays the path for any given folder that I can insert into a group header or footer, or into a report header if the report deals with records in a single folder.  Desired format for the  string is: 
    "Folder 1> Folder 1.1> Folder 1.1.1"
    I need to be able to display at least 6 levels of folder indentation.
    I have tried several ways to create a formula that will reliably produce the desired string, and can get close, but cannot completely address the problem.  My most successful approach was to put multiple instance of the table into the report and link the Folder Parent ID of one level to the Folder ID of the next level down and then use the data to build the string with a formula like this:
    Local StringVar Result := {portfolio_master.portfolio_name};
    local stringvar ExitLoop := "1" ;
    if  ExitLoop = "1" then
        Result := {portfolio_master_1.portfolio_name} + "> " + Result
    else
        ExitLoop := "0";
    if {portfolio_master_1.parent_id} NE 0 AND ExitLoop = "1" then  // NE replaces Crystal not equal symbol which will not show
        Result := {portfolio_master_2.portfolio_name} + "> " + Result
    else
        ExitLoop := "0";
    if {portfolio_master_2.parent_id} NE 0 and ExitLoop = "1" then
        Result := {portfolio_master_3.portfolio_name} + "> " + Result
    else
        ExitLoop := "0";
    if {portfolio_master_3.parent_id} NE 0 and ExitLoop = "1" then
        Result := {portfolio_master_4.portfolio_name} + "> " + Result
    else
        ExitLoop := "0";
    if {portfolio_master_4.parent_id} NE 0 and ExitLoop = "1" then
        Result := {portfolio_master_5.portfolio_name} + "> " + Result
    else
        ExitLoop := "0";
    Result;
    This formula works so long as the folder in question is exactly 5 levels deep.  Changing the nature of the links(inner join, left outer join etc.) between the instances of the table in the Database Expert changes the data that is visible, but I can't find a combination that will show ALL of the needed information for all of the folders. 
    I understand that this is a brute force approach, and that there must be a different way to skin the cat.  My preference would be to "walk the tree" with a loop structure, but I don't see any way to do the needed data look up within the loop.
    Any suggestions would be greatly appreciated!
    Thanks,
    L. Jasmann
    Edited by: ljasmann1 on Jun 23, 2010 9:09 PM
    Edited by: ljasmann1 on Jun 23, 2010 9:33 PM

    I have been working to adapt the code provided above to my application.  Although I have worked with Crystal for quite a while, this is the first time that I have attempted to use SQL in Crystal... and it is just not working.. probably because I am no doing something very basic.
    Here is  the code as currently set up in the SQL Formula Editor.  Only major difference from the code provided above is that the ID fields are integers instead of strings, and the field that I want to print out is a string field separate from the ID fields....  I have substituted the field names from the table I am referencing for the ones in the code above.  The table that I am using has been selected using the Database Expert.
    DECLARE @Value int, @pf int, @FolderPath VarChar(MAX)
    SET @Value = "portfolio_master"."portfolio_id"
    SELECT @pf = "portfolio_master"."parent_id" FROM portfolio_master WHERE "portfolio_master"."portfolio_id" = @Value
    SET @FolderPath = "portfolio_master"."portfolio_name"
    WHILE @pf <> 0
    BEGIN
    SET @Value = @pf
    SELECT @pf = "portfolio_master"."parent_id" FROM portfolio_master WHERE "portfolio_master"."portfolio_id" = @Value
    SET @FolderPath = "portfolio_master"."portfolio_name" + ' > ' + @FolderPath
    END
    SELECT @FolderPath AS FolderPath
    When I test the SQL statement it errors out on the very first statement (the DECLARE statement).  If I substitute a different statement in front of the DECLARE statement, it errors on that statement.
    Here is the error that I get back. The database is using MS SQL Server.
    Error in compiling SQL Expression:
    Failed to retrieve data from the database.
    Details:  ADO Error Code:  0x80040e14
    Source:  Microsoft OLE db Provider for SQL Server
    Description:  Incorrect syntax near the keyword u2018DECLAREu2019,
    SQL State:  42000
    Native Error:  156 [Database Vendor Code:  156].
    Any pointers would be greatly appreciated...
    Thanks,
    Larry Jasmann

  • How to Use AccessibleObjectFromWindow API in VBA to Get Excel Application Object from Excel Instance Window Handle

    I need to get the Excel.application object from a window handle using AccessibleObjectFromWindow. I can't seem to make the code work. First, I successfully search for the XLMAIN windows. Then, when I get a handle, I execute the AccessibleObjectFromWindow
    function. It seems to return a value of -2147467262 in all cases. Therefore, I believe that it is returning an error value. I can't figure out how to determine the meaning of this value.
    If it is an error value, I believe that one or more arguments are in error. My best guess at present is that the GUID argument is incorrect. I have tried two GUID values: {00020400-0000-0000-C000-000000000046} and {90140000-0016-0409-0000-0000000FF1CE}.
    I have seen both used in conjunction with OBJID_NATIVEOM. Neither one seems to work. I really would prefer not to use the second one as it has an Excel major and minor version number. I would hate to have to change this code, if a new minor version appeared.
    The attached code has been commented to show which parts have been shown to work and which not. I'm at my wits end and really need help.
    Thanks
    'This module is located in Access 2010, but this is an Excel question.
    Option Compare Database
    Option Explicit
    ' Module-Level Declarations
    'The GetDesktopWindow function and FindWindowEx function work just fine.
    Public Declare Function GetDesktopWindow Lib "user32" () As Long
    Public Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
    (ByVal hWnd1 As Long, _
    ByVal hWnd2 As Long, _
    ByVal lpsz1 As String, _
    ByVal lpsz2 As String) _
    As Long
    'I'm not getting the expected output from this function (see below)
    Private Declare Function AccessibleObjectFromWindow& Lib "oleacc.dll" _
    (ByVal hwnd&, _
    ByVal dwId&, _
    riid As GUID, _
    xlwb As Object)
    Type GUID
    lData1 As Long
    iData2 As Integer
    iData3 As Integer
    aBData4(0 To 7) As Byte
    End Type
    Function ExcelInstances() As Long
    ' Procedure-Level Declarations
    ' Value of OBJID_NATIVEOM verified by checking list of Windows API constants _
    on this site: http://www.lw-tech.com/q1/base.htm
    Const OBJID_NATIVEOM = &HFFFFFFF0
    Dim hWndDesk As Long 'Desktop window
    Dim hWndXL As Long 'Child window
    Dim objExcelApp As Object 'Final result wanted: Excel application object
    'Following variable (xlapp) to be set by AccessibleObjectFromWindow function
    Dim xlapp As Object
    Dim IDispatch As GUID 'GUID used in call to AccessibleObjectFrom Window function
    'Set up GUID to be used for all instances of Excel that are found
    Dim tmp1 As Variant 'Return value from AccessibleObjectFromWindow
    ' Executable Statements
    SetIDispatch IDispatch
    IDispatch = IDispatch
    'Get a handle to the desktop
    hWndDesk = GetDesktopWindow 'This seems to work
    Do
    'Get the next Excel window
    'The following statement seems to work. We are finding and counting _
    correctly all the instances of Excel. hWndXL is non-zero for each _
    instance of Excel
    hWndXL = FindWindowEx(GetDesktopWindow, hWndXL, "XLMAIN", vbNullString)
    'If we got one, increment the count
    If hWndXL > 0 Then
    'This works. We correctly count all _
    instances of Excel
    ExcelInstances = ExcelInstances + 1
    'Here is the problem. The following statement executes and returns a value of _
    -2147467262. xlapp, which is passed by reference to AccessibleObjectFromWindow, _
    is set to nothing. It should be set to the object for Excel.application. _
    I believe that this value is not an object. I tried to reference tmp1. in the _
    immediate window. There was no Intellisense.
    'I think that the function in returning an error value, but I can't figure _
    out what it is. I believe that AccessibleObjectFromWindow returns error _
    values, but I don't know where to find their values so I can interpret the _
    function's results.
    'As best I can tell, the hWndXL parameter is correct. It is the handle for _
    an instance of Excel. OBJID_NATIVEOM is set correctly (see constant declaration _
    above). xlapp is passed by reference as a non-initialized object variable, which _
    will be set by AccessiblObjectFromWindow. IDispatch may be the problem. It is set _
    as shown below in the procedure SetIDispatch(ByRef ID As GUID). This procedure _
    appears to work. I can see that IDispatch is set as I intended and correctly _
    passed to AccessibleObjectFromWindow.
    tmp1 = AccessibleObjectFromWindow(hWndXL, OBJID_NATIVEOM, IDispatch, xlapp)
    'Need to write code to test tmp1 for error. If none, then set objExcelApp = _
    object. Also, I exect xlapp to be set to Excel.application
    End If
    'Loop until we've found them all
    Loop Until hWndXL = 0
    End Function
    Private Sub SetIDispatch(ByRef ID As GUID)
    'Defines the IDispatch variable. The interface _
    ID is {90140000-0016-0409-0000-0000000FF1CE}.
    'NOT USING {00020400-0000-0000-C000-000000000046}, _
    which could be the problem
    '9 is release version - first version shipped (initial release)
    '0 is release type - retail/oem
    '14 is major version
    '0000 is minor version
    '0016 is product ID - MS Excel 2010
    '0409 is language identifier - English
    '0 is x86 or x64 - this is x86
    '000 reserved
    '0 is debug/ship
    '000000FF1CE is office family ID
    With ID
    .lData1 = &H90140000
    .iData2 = &H16
    .iData3 = &H409
    .aBData4(0) = &H0
    .aBData4(1) = &H0
    .aBData4(2) = &H0
    .aBData4(3) = &H0
    .aBData4(4) = &H0
    .aBData4(5) = &HF
    .aBData4(6) = &HF1
    .aBData4(7) = &HCE
    End With
    End Sub
    DaveInCalabasas

    I don't think you can return a reference to Excel's main window like that as you are attempting to do.
    Ref:
    http://msdn.microsoft.com/en-us/library/windows/desktop/dd317978(v=vs.85).aspx 
    It's relatively straightforward to return any workbook's window in any given instance, and in turn it's parent Excel app. Try the following and adapt as required (and include error handling) -
    Option Explicit
    Private Declare Function FindWindowEx Lib "User32" Alias "FindWindowExA" _
    (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, _
    ByVal lpsz2 As String) As Long
    Private Declare Function IIDFromString Lib "ole32" _
    (ByVal lpsz As Long, ByRef lpiid As GUID) As Long
    Private Declare Function AccessibleObjectFromWindow Lib "oleacc" _
    (ByVal hWnd As Long, ByVal dwId As Long, ByRef riid As GUID, _
    ByRef ppvObject As Object) As Long
    Private Type GUID
    Data1 As Long
    Data2 As Integer
    Data3 As Integer
    Data4(7) As Byte
    End Type
    Private Const S_OK As Long = &H0
    Private Const IID_IDispatch As String = "{00020400-0000-0000-C000-000000000046}"
    Private Const OBJID_NATIVEOM As Long = &HFFFFFFF0
    Sub test()
    Dim i As Long
    Dim hWinXL As Long
    Dim xlApp As Object ' Excel.Application
    Dim wb As Object ' Excel.Workbook
    hWinXL = FindWindowEx(0&, 0&, "XLMAIN", vbNullString)
    While hWinXL > 0
    i = i + 1
    Debug.Print "Instance_" & i; hWinXL
    If GetXLapp(hWinXL, xlApp) Then
    For Each wb In xlApp.Workbooks
    Debug.Print , wb.Name
    Next
    End If
    hWinXL = FindWindowEx(0, hWinXL, "XLMAIN", vbNullString)
    Wend
    End Sub
    'Function GetXLapp(hWinXL As Long, xlApp As Excel.Application) As Boolean
    Function GetXLapp(hWinXL As Long, xlApp As Object) As Boolean
    Dim hWinDesk As Long, hWin7 As Long
    Dim obj As Object
    Dim iid As GUID
    Call IIDFromString(StrPtr(IID_IDispatch), iid)
    hWinDesk = FindWindowEx(hWinXL, 0&, "XLDESK", vbNullString)
    hWin7 = FindWindowEx(hWinDesk, 0&, "EXCEL7", vbNullString)
    If AccessibleObjectFromWindow(hWin7, OBJID_NATIVEOM, iid, obj) = S_OK Then
    Set xlApp = obj.Application
    GetXLapp = True
    End If
    End Function
    Note as written if an instance does not have any loaded workbooks a reference will not be returned (though a workbook can be added using DDE, but convoluted!)
    FWIW there are two other very different approaches to grab all running Excel instances though something along the lines of the above is simplest.
    Peter Thornton

  • How to run sql query in bat file in task schedular at every 10 seconds

    This is my sql script :
    DECLARE @countRows INT,
    @currDate DATE,
    @checkForTasks INT,
    @created_by_id INT,
    @gst_ID int;
    SET @currDate = Getdate()
    SET @countRows = (SELECT Count(*)
    FROM [dbo].[sd_gst_effective_table]
    WHERE isapplied = 0)
    IF @countRows > 0
    -- Check for those GST''s who are not applied yet : if they are greater than 0 then perform next task
    BEGIN
    SET @checkForTasks = (SELECT Count(*)
    -- Check is current date equals to task date or not
    FROM [dbo].[sd_gst_effective_table]
    WHERE effect_date = @currDate AND isapplied = 0)
    IF @checkForTasks > 0
    -- If current date = task date then perform this task
    BEGIN
    SET @created_by_id = (SELECT TOP 1 createdby FROM [dbo].[sd_gst_effective_table] WHERE effect_date = @currDate AND isapplied = 0)
    SET @gst_ID = (SELECT gst_id FROM [dbo].[sd_gst_effective_table] WHERE effect_date = @currDate AND isapplied = 0)
    -- STEP 1 :: InActivate the existing GST according to createdbyID
    UPDATE sd_gst_rate
    SET isactive = 0,
    inactivedate = Getdate()
    WHERE isactive = 1
    AND createdby = @created_by_id
    -- STEP 2 :: Activate the New GST according to implementation date and gstID
    UPDATE sd_gst_rate
    SET isactive = 1,
    activedate = Getdate()
    WHERE id = @gst_ID
    -- STEP 3 :: Inactivate the applied GST from sd_gst_effective_table
    UPDATE [dbo].[sd_gst_effective_table] SET isApplied = 1 WHERE gst_id = @gst_ID
    END
    END
    DECLARE @Text AS VARCHAR(100)
    DECLARE @Cmd AS VARCHAR(100)
    DECLARE @value nvarchar(1000);
    SET @value = (SELECT CONVERT(TIME,GETDATE()) AS HourMinuteSeconds);
    SET @Text = 'File Writed ' + @value
    SET @Cmd ='echo ' + @Text + ' > E:\AppTextFile.txt'
    EXECUTE Master.dbo.xp_CmdShell @Cmd
    This is resided in videos folder of windows , i have created a task schedular in windows 8.1 to run daily at every 10 seconds , but it is not working ... Please tell me how to deal with it.
    Please note : This sql query is running perfectly in sql server. Query have no errors. Please check whats wrong with my time schedular. I just want my schedular to run every 10 seconds regardless of date.

    Hi Emad,
    Is your script in a ".sql" file? May I know how you configure the schedule task action?
    Since you didn't mention how you configure the schedule task, can you confirm you have followed the below step correctly?
    Save your script in a ".sql" file.
    Create a ".bat" file and call the sql file above inside with
    sqlcmd.exe, you can reference
    here.
    Configure a schedule task to run the ".bat" file in a certain interval.
    Have you tried to run the script in you bat file in a standalone commandline window? Please post the script in your bat file, It can help to diagnose the issue.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Convert sql_Varient to integers

    i want to convert the Server_Name value from actual server name to 1 or 2 based on output, which i am already able to do in the code below,now i want to convert the data type of column "Server_Name" to integer after updating the values to 1 or 2please assist.alter procedure ACtiveClusterNodeAOHC
    AS
    IF OBJECT_ID('tempdb..#tempvarienttype') IS NOT NULL
    DROP TABLE ACtiveClusterNodeAOHC
    create table #tempvarienttype(
    Server_Name sql_variant
    insert INTO #tempvarienttype
    select ComputerName=SERVERPROPERTY('ComputerNamePhysicalNetBIOS')
    update #tempvarienttype
    set Server_Name=case
    when server_Name='DBAOHC01A' then 1
    when Server_Name='DBAOHC02A' then 2
    end
    select * from #tempvarienttype
    exec ACtiveClusterNodeAOHC
    k

    create one more column in your temporary table with integer datatype and update that column based on the value of servername column.
    You can select that column instead of select * from
    You wont have to convert then.
    create table #tempvarienttype(
    Server_Name sql_variant,
    serverid int
    insert INTO #tempvarienttype
    select ComputerName=SERVERPROPERTY('ComputerNamePhysicalNetBIOS')
    update #tempvarienttype
    set serverid =case
    when server_Name='DBAOHC01A' then 1
    when Server_Name='DBAOHC02A' then 2
    end
    select serverid from #tempvarienttype
    alternatively you can use this approach as well
    declare @var sql_variant
    declare @value int
    set @var = SERVERPROPERTY('ComputerNamePhysicalNetBIOS')
    if @var = 'DBAOHC01A'
    set @value = 1
    else if @var = 'DBAOHC02A'
    set @value =2
    select @value
    Regards, Ashwin Menon My Blog - http:\\sqllearnings.com

  • New to Graphics, trying to display array output in a single window

    I am trying to figure out how to use the GUI components of JAVA.
    What I am trying to do is take my packaged array output and list it in a single window. All that ever prints is last array data set. The last keeps overwritting the previous. How do I keep the previous data shown while listing the next in the array?
    Below are my three classes. The Frame Class is the class containing the display method. It is called near the bottom of the Product Class.
    Product.java
    // Inventory Program Part 4
    /* This program will store multiple entries
    for office supplies, give the inventory value,
    sort the data by Product Name,
    and output the results using a GUI */
    import javax.swing.text.JTextComponent;
    import javax.swing.JLabel;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JOptionPane; //Uses class JOptionPane
    import java.util.Scanner; //Uses class Scanner
    import java.util.Arrays; //Uses class Arrays
    public class Product
         private String productBrand[]; // Declares the array
         public void setProductBrand( String brand[] ) // Declare setProductBrand method
              productBrand = brand; // stores the productbrand
         } // End setProductBrand method
         public String getProductBrand( int counter )  // Declares getProductBrand method
              return productBrand[ counter ]; // Returns data using counter to define the element
         } // End method getProductBrand
         public double restockingFee( double value ) // Declares restocking Fee method
              double fee = 0; // Declares variable fee
              fee = value * 0.05; // Calculates the sum of values
              return fee;  // Returns the restocking fee
         } // End method restockingFee     
         public String inventoryValue( double value[] , int number, String name[] ) // Declares inventoryValue method
              OfficeSupplies myOfficeSupplies = new OfficeSupplies();  //Creates OfficeSupplies Object
              Product myProduct = new Product();
              double total = 0; // Declares variable total
              for ( int counter = 0; counter < number ; counter++ )
                   total += ( value[ counter ] + myProduct.restockingFee( value[ counter ] ) ); // Calculates the sum of values
                        return String.format( "%s$%.2f", "Total Inventory Value: " , total );  // Returns the total value
         } // End method inventoryValue
         // main method begins execution
         public static void main( String args[] )
              Scanner input = new Scanner( System.in ); //Creates Scanner object to input from command window
              Product myProduct = new Product(); //Creates Product object
              OfficeSupplies myOfficeSupplies = new OfficeSupplies();  //Creates OfficeSupplies Object          
              //Prompt for maxNumber using JOptionPane
              String stringMaxNumber =
                   JOptionPane.showInputDialog( "Enter the number of products you wish to enter" );
              int maxNumber = Integer.parseInt( stringMaxNumber );     
              String prodName[] = new String[ maxNumber ]; // Declares prodName array
              int numberUnits[] = new int[ maxNumber ]; // Declares maxNumber array          
              float unitPrice[] = new float[ maxNumber ]; // Declares unitPrice array
              double value[] = new double[ maxNumber ]; // Declares value array
              String brand[] = new String [ maxNumber ]; // Declares brand array
              String stringNumberUnits[] = new String [ maxNumber]; // Declares array
              String stringUnitPrice[] = new String [ maxNumber ]; // Declares array
              int productNumber[] = new int[ maxNumber ]; // Declares array
              for ( int counter = 0; counter < maxNumber; counter++ ) // For loop for the number of products to enter
                   productNumber[ counter ] = counter;
                   myOfficeSupplies.setProductNumber( productNumber ); // Sends the Product name to method setProductNumber                         
                   //Prompt for product name using JOptionPane
                   prodName[ counter ] =
                        JOptionPane.showInputDialog( "Enter the Product Name" );
                   myOfficeSupplies.setProductName( prodName ); // Sends the Product name to method setProductName
                   //Prompt for brand name using JOptionPane
                   brand[ counter ] =
                        JOptionPane.showInputDialog( "Enter the Brand name of the Product" );
                   myProduct.setProductBrand( brand ); // Sends the Brand name to method setProductBrand
                   //Prompt for number of units using JOptionPane
                   stringNumberUnits[ counter ] =
                        JOptionPane.showInputDialog( "Enter the Number of Units" );
                   numberUnits[ counter ] = Integer.parseInt( stringNumberUnits[ counter ] );
                   myOfficeSupplies.setNumberUnits( numberUnits ); // Sends the Number Units to the method setNumberUnits
                   //Prompt for unit price using JOptionPane
                   stringUnitPrice[ counter ] =
                        JOptionPane.showInputDialog( "Enter the Unit Price" );
                   unitPrice[ counter ] = Float.parseFloat( stringUnitPrice[ counter ]);
                   myOfficeSupplies.setUnitPrice( unitPrice ); // Sends the Unit Price to the method setUnitPrice
                   value[ counter ] = numberUnits[ counter ] * unitPrice[ counter ]; // Calculates value for each item
                   myOfficeSupplies.setProductValue( value ); // Sends the product value to the method setProductValue
              Arrays.sort( prodName, String.CASE_INSENSITIVE_ORDER ); // Calls method sort from Class Arrays
                   Frame myFrame = new Frame();
                   myFrame.displayData( myProduct, myOfficeSupplies, maxNumber );
              // Outputs Total Inventory Value using a message dialog box
              JOptionPane.showMessageDialog( null, myProduct.inventoryValue( value, maxNumber, prodName ),
                   "Total Inventory Value", JOptionPane.PLAIN_MESSAGE );
         } // End method main
    } // end class ProductOfficeSupplies.java ----> This is the data container
    // Inventory Program Part 4
    /* Stores the array values */
    public class OfficeSupplies // Declaration for class Payroll
         private int productNumber[];
         public void setProductNumber( int number[] ) // Declare setProductNumber method
              productNumber = number; // stores the product number
         } // End setProductNumber method
         public int getProductNumber( int counter )  // Declares getProductNumber method
              return productNumber[ counter ];
         } // End method getProductNumber
         private String productName[];
         public void setProductName( String name[] ) // Declare setProductName method
              productName = name; // stores the Product name
         } // End setProductName method
         public String getProductName( int counter )  // Declares getProductName method
              return productName[ counter ];
         } // End method getProductName
         private int numberUnits[];
         public void setNumberUnits( int units[] ) // Declare setNumberUnits method
              numberUnits = units; // stores the number of units
         } // End setNumberUnits method
         public int getNumberUnits( int counter )  // Declares getNumberUnits method
              return numberUnits[ counter ];
         } // End method getNumberUnits
         private float unitPrice[];
         public void setUnitPrice( float price[] ) // Declare setUnitPrice method
              unitPrice = price; // stores the unit price
         } // End setUnitPrice method
         public float getUnitPrice( int counter )  // Declares getUnitPrice method
              return unitPrice [ counter ];
         } // End method getUnitPrice
         private double productValue[];
         public void setProductValue( double value[] ) // Declare setProductValue method
              productValue = value; // stores the product value
         } // End setProductValue method
         public double getProductValue( int counter )  // Declares getProductValue method
              return productValue[ counter ];
         } // End method getProductValue
    } // end class OfficeSuppliesFrame.java ------> Contains the display method
    import java.awt.Color;
    import javax.swing.text.JTextComponent;
    import javax.swing.JLabel;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JOptionPane; //Uses class JOptionPane
    public class Frame extends JFrame
         public Frame() //Method declaration
              super( "Products" );
         } // end frame constructor
         public void displayData( Product myProduct, OfficeSupplies myOfficeSupplies, int maxNumber )
              //Here I attempted to use an array to output all of the array data in a single window
    //          JTextArea myTextArea[] = new JTextArea[ maxNumber ]; // Declares myTextArea array to display output
              JTextArea myTextArea = new JTextArea(); // textarea to display output
              // For loop to display data array in a single Window
              for ( int counter = 0; counter < maxNumber; counter++ )  // Loop for displaying each product
    //               myTextArea[ counter ].setText( packageData( myProduct, myOfficeSupplies, counter ) + "\n" );
    //                add( myTextArea[ counter ] ); // add textarea to JFrame
                   myTextArea.setText( packageData( myProduct, myOfficeSupplies, counter ) + "\n" );
                   add( myTextArea ); // add textarea to JFrame
              } // End For Loop
              setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              setSize( 450, maxNumber*400 ); // set frame size
              setVisible( true ); // display frame
         public String packageData( Product myProduct, OfficeSupplies myOfficeSupplies, int counter ) // Method for formatting output
              return String.format( "%s: %d\n%s: %s\n%s: %s\n%s: %s\n%s: $%.2f\n%s: $%.2f\n%s: $%.2f\n%s: $%.2f",
              "Product Number", myOfficeSupplies.getProductNumber( counter ),
              "Product Name", myOfficeSupplies.getProductName( counter ),
              "Product Brand",myProduct.getProductBrand( counter ),
              "Number of Units in stock", myOfficeSupplies.getNumberUnits( counter ),
              "Price per Unit", myOfficeSupplies.getUnitPrice( counter ),
              "Total Value of Item in Stock is", myOfficeSupplies.getProductValue( counter ),
              "Restock charge this product is", myProduct.restockingFee( myOfficeSupplies.getProductValue( counter ) ),
              "Total Value of Inventory plus restocking fee", myOfficeSupplies.getProductValue( counter )+
                   myProduct.restockingFee( myOfficeSupplies.getProductValue( counter ) ) );
         } // end method packageData
    }

    Lets pretend that your assignment was to manage a list of employees of a store, and that each employee is identified by their name, position, and hourly wage. If you created a program along the lines of your current product program, I picture you creating three separate ArrayLists (or arrays), one for each variable, something like this:
    import java.util.ArrayList;
    public class MyEmployees1
        private ArrayList<String> names = new ArrayList<String>();
        private ArrayList<String> positions = new ArrayList<String>();
        private ArrayList<Double> hourlyWages = new ArrayList<Double>();
        public void add(String name, String position, double wage)
            names.add(name);
            positions.add( position);
            hourlyWages.add(wage);
        public void removed()
            // TODO: I am nervous about trying to manage this!
        //.......... more
    }This program tries to manage three separate parallel arrays (arraylists actually). They are parallel because the 3rd item in the names list corresponds to the 3rd item in the positions list and also the hourlywages list. If I wanted to delete data, I'd have to be very careful to delete the correct item in all three lists. If I tried to sort one list, I'd have to sort the other two in exactly the same way. It is extremely easy to mess this sort of program up.
    Now lets look at a different approach. Say we created a MyEmployee class that contains the employee's name, position, and wage, along with the appropriate constructors, getters, setters, toString method, etc... something like so:
    import java.text.NumberFormat;
    public class MyEmployee
        private String name;
        private String position;
        private double hourlyWage;
        public MyEmployee(String name, String position, double hourlyWage)
            this.name = name;
            this.position = position;
            this.hourlyWage = hourlyWage;
        public String getName()
            return name;
        public String getPosition()
            return position;
        public double getHourlyWage()
            return hourlyWage;
        public String toString()
            // don't worry about these methods here.  They're just to make the output look nice
            NumberFormat currency = NumberFormat.getCurrencyInstance();
            return String.format("Name: %-15s    Position: %-15s    Wage: %s",
                    name, position, currency.format(hourlyWage));
    }Now I can create a MyEmployees2 class that holds a single list of MyEmployee objects, like so:
    import java.util.ArrayList;
    public class MyEmployees2
        private ArrayList<MyEmployee> employeeList = new ArrayList<MyEmployee>();
        public boolean add(MyEmployee employee)
            return employeeList.add(employee);
        public boolean remove(MyEmployee employee)
            return employeeList.remove(employee);
        public void display()
            for (MyEmployee employee : employeeList)
                System.out.println(employee);
        public static void main(String[] args)
            MyEmployees2 empl2 = new MyEmployees2();
            empl2.add(new MyEmployee("John Smith", "Salesman", 20));
            empl2.add(new MyEmployee("Jane Smyth", "Salesman", 25));
            empl2.add(new MyEmployee("Fred Flinstone", "Janitor", 15));
            empl2.add(new MyEmployee("Barney Rubble", "Supervisor", 35));
            empl2.add(new MyEmployee("Mr. Spacely", "The Big Boss", 45));
            empl2.display();
    }Now if I want to add an Employee, I only add to one list. Same if I want to remove, only one list, and of course, the same for sorting. It is much safer and easier to do things this way. Make sense?

  • Problem with buyer case

    hello recently i sold an item (statue) with costly shipping costs  about 70$ to usa to a client,the buyer recieved the item broken so i recent one to him with charge,(i paid the shipping cost) the second one too went bent so i asked the buyer to return them  both to me and be refunded.but the buyer didnt marked these as a return and declared value for them , now these items are stuck in the customs here and im asked to pay taxes for them(the taxes would be 300$) for these items with the value the buyer declared.i cannot posibbly accept to do this ,these are my products also i cant pay 300$ for the broken ones,the buyer opened a case and my sole question is what the paypal would decide for? im not going to accept to get the products back and pay these 300$.also these products woyld be delivered again back to the sender(the buyer) any help  is welcomed thank you

    You asked the buyer to return the items and they did so.They paid you for an item that turned up broken or bent so they deserve a full refund. Its up to you whether you collect them or not but normally if the buyer can prove that they returned the items they are refunded.  

  • How to Use dyanamic table in query?

    Hi,
    can you please tell.in query -
    1] if we define a varibale and in that varibale we have to speacfy the dynamic table name can it's possible.
    2] I tried but it's not working
    3] Every year i have taken a backup table and from that backup table i feteched the data.But i want to do this programmatically
    e.g. Table name is pf_emp_pf_txn20122013 but this is "20122013" this dynamic .How we use in query that dyanamic table .
    Kindly Suggest,
    Regards,
    Sachin

    RHELSENSEI wrote:
    Your EXEC executes in a different context, therefore it is not aware of any variables that have been declared in your original context. You should be able to use a temp table instead of a table variable as shown in the simple demo below.
    create table #t (id int)
    declare @value nchar(1) set @value = N'1' 
    declare @sql nvarchar(max)
    set @sql = N'insert into #t (id) values (' + @value + N')'
    exec (@sql)
    select * from #t
    drop table #t
    Epic. Fail.
    SQL-Server syntax and features for an Oracle problem. Features that are not relevant at all to Oracle, but the very reason why SQL-Server is technically inferior to Oracle...
    Are you a professional idiot, or just a very gifted amateur?

  • NPV Function in oracle

    Hi guys
    I am using the below code For NPV ,But i dont see any result,could you guys help me out.....
    DEFINE RPT DIMENSION TEXT
    MAINTAIN TLGT_RPT ADD 'APRV_AMT' 'CAP_APRV_AMT' 'EXP_APRV_AMT'
    DEFINE cflow VARIABLE DECIMAL <RPT RPT_ID>
    declare
    value number;
    begin
    value:= @NPV(cflow, .08, RPT_ID);
    dbms_output.put_line(value);
    end;
    Am i missing any thing Pls rectify.
    Thanks
    Robert

    This appears to have nothing to do with APEX and is therefore off-topic for this forum.
    Robertsondas wrote:
    DEFINE RPT DIMENSION TEXT
    MAINTAIN TLGT_RPT ADD 'APRV_AMT' 'CAP_APRV_AMT' 'EXP_APRV_AMT'
    DEFINE cflow VARIABLE DECIMAL <RPT RPT_ID>
    This is not any Oracle syntax that I recognise. Where does this come from?
    declare
    value number;
    begin
    value:= @NPV(cflow, .08, RPT_ID);
    @NPV is an Excel function and is not available as a built-in function in Oracle. It would have to be created as a user-defined PL/SQL subprogram using the requisite algorithm.
    dbms_output.put_line(value);
    end;
    DBMS_OUTPUT is generally not a suitable method for returning or presenting information in a production system, particularly not in APEX.

  • Skype accredited Skype phone supplier "Chat & Visi...

     Chat & Vision is OK when everything goes right but when there is a problem beware as you can see from various other reviews.
    We ordered a Skype phone and it was eventually delivered within an agreeable amount of time. not rapid, but fair enough. As we live way out in the countryside here in Spain we have problems with DHL as well as other companies delivering to us.To alleviate this problem we had an arrangement with a Spanish friend in a local village to accept deliveries for us. We ordered this phone with the belief as stated in their website "Worry free ordering all dues taxes and delivery charges included". 2 weeks after delivery our friend receives a demand from the Spanish Customs Authority that she appear before her local Tax authority due to unpaid duty on the goods that she received for us.Which involved a round trip of around 45kms. She was informed that the declared value by Chat & Vision was $12 and they insisted that they see the invoice from Chat and Vision which of course read €75. After another round trip of 45kms with the invoice she was then told she would be informed as to how much duty was to pay and also that there could possibly be a fine. We were of course keeping Chat & Vision informed of all of this ongoing problem.
    Assurance from customer support that we would not suffer as a result of this as they would recompense when it was finally sorted. Well the Duty turned out to be € 15 and no fine, but as we were so embarrassed about the time and cost our friend had incurred we recompensed her for her time and fuel costs € 50 only to be told afterwards that she no longer wished to receive any more goods for us. So a €75 phone from Chat and vision has cost us €140 which we could have purchased from Amazon for €79 and know that we would have had much better service as we are still waiting for any recompense from Chat and Vision that was in May we are now in September and still waiting, for something that is obviously not going to happen.
    Solved!
    Go to Solution.

    Hi rodymoyra,
    Please accept my sincere apologies for the inconvenience caused. I am very disappointed in our handling of the case. I have taken the matter up internally with the relevant agents and departments involved to get the bigger picture on our process flaws and will rectify it if not already done. That includes a thorough review of the email correspondence with our support team which I believe was not up to our usual high standard. Whilst this ongoing, my support team will process a 50EUR refund to your paypal account within the next 24-72 hours. I will be in touch if I need any further info. I appreciate this does not make up the inconvenience experienced but hope it helps reassure you that we genuinely care.
    If I can be of further assistance, please let me know.
    Kind regards,
    ChatandVision Ltd.

Maybe you are looking for

  • HOW DO I CHANGE MY SECURITY SETTINGS ON WINDOWS VISTA SO I CAN DOWNLOAD MOZILLA

    i am trying to download mozilla and my computer (windows vista) says my security settings will not allow this download. how do i change my security settings so i can download mozilla?

  • How do you determine if you need a firmware upd

    I'm an iMac newbie, so if this is a stupid question please forgive me. I need to find out which version of firmware I currently have and what version is current. I have found the Apple web site where they can be downloaded, but these sites do not tel

  • No service and call fail error

    please solve this asvp

  • Exporting playlists, mebbe I'm confused

    I use a plethora of Smart Playlists (SPs) to manage my iTunes database. I use a nice program that manages to sync my iTunes library between two separate Macs, but it won't copy SPs. To avoid having to manually recreate all the playlists on both compu

  • Media Queries: Make a div dissapear in some?

    I'm using media queries to try and make my site more mobile/ tablet friendly. I have two headers, one for desktop, one for mobile. They are in two seperate divs, how can I make only the desired div show up osing the css? I tried, .header width:0px; h