(Assignment) Set an Get InvoiceTest

Hi everyone I am in error city with my InvoiceTest program. Here is my Invoice it runs good,
public class Invoice
private String partNumber;
private int quantity;
private String partDescription;
private double pricePerItem;
public void setpartNumber( String name )
partNumber = name;
public String getpartNumber()
return partNumber;
public void setpartQuantity( int quant )
if ( quant < 0 )
{quant = 0;}
quantity = quant;
public int getpartQuantity()
return quantity;
public void setDescription( String desc )
partDescription = desc;
public String getpartDescription()
return partDescription;
public void setpricePerItem( double price )
if ( price < 0.0)
{ price = 0.0; }
pricePerItem = price;
public double getpricePerItem()
return pricePerItem;
Now my InvoiceTest
import java.util.Scanner:
public class InvoiceTest
public static void main( String args [] )
Scanner input = new Scanner( System.in );
I have the rest, but this is where the errors start. I would really appre. any help or ideas.
Thanks
Message was edited by:
wldctj8

What you posted compiled just fine.
import java.util.Scanner;
public class IT
    public static void main( String[] args )
        Scanner input = new Scanner( System.in );
        Invoice invoice = new Invoice();
        System.out.println("enter partNumber");
        String in = input.nextLine();
        invoice.setpartNumber(in);
        System.out.println("enter description");
        in = input.nextLine();
        invoice.setDescription(in);
        System.out.println("enter quantity");
        in = input.nextLine();
        invoice.setpartQuantity(Integer.parseInt(in));
        System.out.println("enter price");
        in = input.nextLine();
        invoice.setpricePerItem(Double.parseDouble(in));
        scanner.close();
        System.out.println("Invoice:\n" +
                           "partNumber: " + invoice.getpartNumber() + "\n" +
                           "partDescription: " + invoice.getpartDescription() + "\n" +
                           "quantity: " + invoice.getpartDescription() + "\n" +
                           "pricePerItem: " + invoice.getpricePerItem());
class Invoice
    private String partNumber;
    private int quantity;
    private String partDescription;
    private double pricePerItem;
    public void setpartNumber( String name )
        partNumber = name;
    public String getpartNumber()
        return partNumber;
    public void setpartQuantity( int quant )
        if ( quant < 0 )
            quant = 0;
        quantity = quant;
    public int getpartQuantity()
        return quantity;
    public void setDescription( String desc )
        partDescription = desc;
    public String getpartDescription()
        return partDescription;
    public void setpricePerItem( double price )
        if ( price < 0.0)
            price = 0.0;
        pricePerItem = price;
    public double getpricePerItem()
        return pricePerItem;
}

Similar Messages

  • CRM 5.2,  how to define an assignment set in the runtime depository?

    We are using CRM 5.2. I have created a new component and view and the view is exposed as an interface view. Now i have to include this in the overview page of BP_HEAD component. I have enhanced BP_HEAD component and enhanced the view required as well( View Name BPHeadOverview). I have added my new component as the used components in BP_HEAD.
    But when i open the enhanced view, i don't see any available assignment blocks. Standard overview page of BP_HEAD had some available assignment blocks but the enhanced one doesn't. Also following message is shown  "Define an assignment set in the runtime depository". How can i add my new component and interface view to the available assignment blocks of the overview page of BP_HEAD? Thanks for your help.
    Regards
    Hari

    Hi Sudipta,
    Thanks for your help. I am making good progress.
    I believe i am quite close to completion now. Need your help with following questions though -
    1) I have a context node BUILACTIVITY. Now i need to only display partial list from this context node? Is there a way i can do this directly with the context node or i have to create a new node and manipulate? If so any tips there?
    2) When i create new view it doesn't have graphical representation option any more? Is it that way only? If so can i just create table view and use it?
    3) When i create a form view and try to insert a table using <crmic:tableView> tag, i am getting an error messge saying "//BUILACTIVITY/Table" is not a table? What could be the issue?
    Thanks a lot for your help again.
    Regards
    Hari

  • Quickpaint reports not working with assignment set defined with criteria

    Hello,
    I have a problem with quickpaint reports in HRMS. When i run quickpaint report against assignment set defined with criteria it reports following error: APP-PAY-06867 An error occurred during formula execution FFX00_DATA_NOT_FOUND (assignment criteria was &ASG_LOCATION=New York).I defined several assignment sets with different criteria and i always get the same error when i run any quickpaint report.
    The same Quickpaint report works well with assignment set defined by including individual assignment.
    Thanks in advance!
    best regards

    Thanks for uploading the sample reports. 
    I am not abe to reproduce the issue and the graphs generated in both the attached reports are the same except that the width of the graphs being displayed are different as seen in the below images.
    ATML 5.1 Report Graph
    XML Report Graph
    Regards
    Srivinayaka Pandurangan
    National Instruments
    With Best Regards,
    Srivinayaka
    National Instruments

  • Memory Problem with SEt and GET parameter

    hi,
    I m doing exits. I have one exit for importing and another one for changing parameter.
    SET PARAMETER exit code is ....
    *data:v_nba like eban-bsart,
           v_nbc like eban-bsart,
           v_nbo like eban-bsart.
           v_nbc = 'CAPX'.
           v_nbo = 'OPEX'.
           v_nba = 'OVH'.
    if im_data_new-werks is initial.
      if im_data_new-knttp is initial.
        if im_data_new-bsart = 'NBC' or im_data_new-bsart = 'SERC' or im_data_new-bsart = 'SERI'
           or im_data_new-bsart = 'SER' or im_data_new-bsart = 'SERM' or im_data_new-bsart = 'NBI'.
          set parameter id 'ZC1' field v_nbc.
        elseif im_data_new-bsart = 'NBO' or im_data_new-bsart = 'NBM' or im_data_new-bsart = 'SERO'.
          set parameter id 'ZC2' field v_nbo.
        elseif im_data_new-bsart = 'NBA' or im_data_new-bsart = 'SERA'.
          set parameter id 'ZC3' field  v_nba.
        endif.
      endif.
    endif. *
    and GET PARAMETER CODE IS....
      get parameter id 'ZC1' field c_fmderive-fund.
      get parameter id 'ZC2' field c_fmderive-fund.
      get parameter id 'ZC3' field c_fmderive-fund.
    FREE MEMORY ID 'ZC1'.
      FREE MEMORY ID 'ZC2'.
       FREE MEMORY ID 'ZC3'.
    In this code i m facing memory problem.
    It is not refreshing the memory every time.
    So plz give me proper solution.
    Its urgent.
    Thanks
    Ranveer

    Hi,
       I suppose you are trying to store some particular value in memory in one program and then retieve it in another.
    If so try using EXPORT data TO MEMORY ID 'ZC1'. and IMPORT data FROM MEMORY ID 'ZC1'.
    To use SET PARAMETER/GET PARAMETER the specified parameter name should be in table TPARA. Which I don't think is there in your case.
    Sample Code :
    Data declarations for the function codes to be transferred
    DATA : v_first  TYPE syucomm,
           v_second TYPE syucomm.
    CONSTANTS : c_memid TYPE char10 VALUE 'ZCCBPR1'.
    Move the function codes to the program varaibles
      v_first  = gv_bdt_fcode.
      v_second = sy-ucomm.
    Export the function codes to Memory ID
    EXPORT v_first
           v_second TO MEMORY ID c_memid.        "ZCCBPR1  --- Here you are sending the values to memory
    Then retrieve it.
    Retrieve the function codes from the Memory ID
      IMPORT v_first  TO v_fcode_1
             v_second TO v_fcode_2
      FROM MEMORY ID c_memid.                                   "ZCCBPR1
      FREE MEMORY ID c_memid.                                   "ZCCBPR1
    After reading the values from memory ID free them your problem should be solved.
    Thanks
    Barada
    Edited by: Baradakanta Swain on May 27, 2008 10:20 AM

  • Set and get parameter id

    Hi,
    I need to store one variable value and I need to retrieve the same variable value in same program. For this I have written set and get parameter ids in the same program. It is working fine but if I log off the system and if I logon the system it is not working I mean before log off the variable is showing some value if I log on again that variable is showing empty. But I want to capture the field values after log off and log on also. Is there any other option can I use table?
    Please help me I will give points.
    Thanks.

    Hi
    SAP memory is a memory area to which all main sessions within a SAPgui have access. You can use SAP memory either to pass data from one program to another within a session, or to pass data from one session to another. Application programs that use SAP memory must do so using SPA/GPA parameters (also known as SET/GET parameters). These parameters can be set either for a particular user or for a particular program using the SET PARAMETER statement. Other ABAP programs can then retrieve the set parameters using the GET PARAMETER statement. The most frequent use of SPA/GPA parameters is to fill input fields on screens
    SAP global memory retains field value through out session.
    set parameter id 'MAT' field v_matnr.
    get parameter id 'MAT' field v_matnr.
    They are stored in table <b>TPARA</b>.
    ABAP memory is a memory area that all ABAP programs within the same internal session can access using the EXPORT and IMPORT statements. Data within this area remains intact during a whole sequence of program calls. To pass data
    to a program which you are calling, the data needs to be placed in ABAP memory before the call is made. The internal session of the called program then replaces that of the calling program. The program called can then read from the ABAP memory. If control is then returned to the program which made the initial call, the same process operates in reverse.
    ABAP memory is temporary and values are retained in same LUW.
    export itab to memory id 'TEST'.
    import itab from memory Id 'TEST'.
    Here itab should be declared of same type and length.
    http://www.sap-img.com/abap/difference-between-sap-and-abap-memory.htm
    ABAP Memmory & SAP Memmory
    http://www.sap-img.com/abap/difference-between-sap-and-abap-memory.htm
    http://www.sap-img.com/abap/type-and-uses-of-lock-objects-in-sap.htm
    Regards
    Anji

  • Set and get values with vector

    I have a class that that querys a db and sets a value of the result to a vector array. Is it possible to set and retrieve that vector array using the set and get methods?
    ex:
    my class:
    sql = "Select ...";
    Vector fName = new Vector();
    rs = sqlStatement.executeQuery(sql);
    if (rs != null) {
    while (rs.next()) {
    fName.add(rs.getString("fName") + "");
    rs.close();
    setFName(fName);
    how would I set up the set and get methods???
    thanks

    I am unsure of what you are asking:
    A Vector has set and get methods for it, you use indexes of the array to say what element you want to work with.
    If you are asking how do you know what elements of the Vector contain which data columns, you have to remember how you put them in.
    If you are asking if you can use set to load the Vector: then NO, you have to have elemenets already there to change, use the add method.
    If you are asking how to access the elements of the Vector you use an Enumeration:
    for(java.util.Enumeration e = v.elements(); e.hasMoreElements();){
    s = (java.lang.String) e.nextElement();
    vl.add(s.substring(0, 12));
    If you are asking something else: please elaborate what you want--my brain may not be very functional this morning.

  • Default sales org on selection screen using set and get parameter!!

    Hi,
    I need to default value on selection screen using SET n GET parameter...logic to be used should be:
    Sales Organisation:
    This field should be filled by default using the user parameter id VKO. (using sentence GET PARAMETER and SET PARAMETER)...
    Hope i need to write the code in initialisation and what shud b the content?
    Regards
    Gunjan

    hi,
    TABLES <table name>.
      SET PARAMETER ID VKO FIELD <tablename-fieldname>.
    call transaction 'zxx'.
    try this sample program,
    REPORT BOOKINGS NO STANDARD PAGE HEADING.
    TABLES SBOOK.
    START-OF-SELECTION.
      WRITE: 'Select a booking',
      SKIP.
    GET SBOOK.
      WRITE: SBOOK-CARRID, SBOOK-CONNID,
             SBOOK-FLDATE, SBOOK-BOOKID.
      HIDE:  SBOOK-CARRID, SBOOK-CONNID,
             SBOOK-FLDATE, SBOOK-BOOKID.
    AT LINE-SELECTION.
      SET PARAMETER ID: 'CAR' FIELD SBOOK-CARRID,
                        'CON' FIELD SBOOK-CONNID,
                        'DAY' FIELD SBOOK-FLDATE,
                        'BOK' FIELD SBOOK-BOOKID.
      CALL TRANSACTION 'BOOK'.
    regards,
    siva
    Message was edited by:
            Shan

  • Abstract class with set and get methods

    hi
    how to write set and get methods(plain methods) in an abstartc class
    ex: setUsername(String)
    String getUsername()
    and one class is extending this abstract class and same methods existing in that sub class also..... how to write......plz provide some ideas
    am new to programming....
    asap
    thnx in advance

    yes... as i told u.... i am new to coding......
    and my problem is ..... i have 2 classes one is abstract class without abstract methods.. and another class is extending abstract class.....
    in abstract class i have 2 methods...one is setusername(string) and getusername() ..... how to write these two methods.... in abstract class i have private variables username...... when user logins ..... i need to catch the user name and i need to validate with my oracle database and i need to identify the role of that user and based on role of that user i need to direct him to appropriate jsp page.......
    for that now i am writing business process classes..... the above mentioned two classes are from business process.....
    could u help me now
    thnx in advance

  • Report  using Set parameter & get parameters.

    Hi,
           My requirement is from select query  the list of PO will be display. Now i want when i click on one of the purchase order .
    i want to diaplay PO using CALL TRANSACTION 'ME23N'  with the help of set and get parameters .  or can i do it with interactive report.
    Regards,

    Hi,
    1) Write a Report to show the Output(Use HIDE statment for PO filed while outputing the list).
    2) In the event AT LINE-SELECTION write logic.
    GET CURSOR FIELD field VALUE val.
    SET PARAMETER ID 'BES' FIELD dobj.
    CALL TRANSACTION ME23N.
    Regards,
    J.

  • Multiple Prepayment for a single Assignment or specific Assignment Set

    Hi Everyone
    I am working in Payroll Department, and I had a difficulties of running more than one prepayment for the same. We need sometime to pay for an employee a specific element like "Official Assignment Compensation" before the end of the month and we use Quick-pay by select specific element. then I use Prepayment. In the end of the Month, when I do run to the remaining elements it had no problem. but when I do re-prepayment it return to the first prepayment the quick-pay run not the payroll run.
    I appreciate if anyone can explain how to do more than one prepayment for a single employee in a single period.

    Thanks alot ysaadeh
    I did managed to do it by doing the following steps:
    - Quick Pay for a single employee
    - Pre-Payment for this Quick Pay
    - Bank Transfer Report - which shows the Employee No, Employee Name, Employee Bank Name and Ban Account Numbers and Amount for the Quick Pay
    Then
    - Payroll Run @ the end of the Month
    - Pre-Payment for Payroll Run
    - Bank Transfer Report ..
    It worked fine. But I notice one thing. When I do pre-payment for Payroll - the second pre-payment, Bank Transfer Report only take the Data from the last Pre-Payment.
    I cannot do the Bank Report for the Quick Pay After Running the Payroll Pre-Payment ..
    Is there some way I can use Bank Report for these Both Pre-Payment
    and Is there a way I can use Quick-Pay for a set of Employees - An assignment Set .
    Thanks again and appreciate you feedback.
    Regards

  • Japanese Data Set and Get Problem with SQL

    Hi,
    I am not able to retrieve or set data contain Japanese characters.
    Formerly our set up was running just fine. But on doing installation on a new machine, things have gone all haywire.
    I installed Win NT 4.0 Japnese version and SQL 7.0 and later Win 2000 Server Japanese version with same SQL 7.0, but on both get and set I get SQL Exceptions:
    Query 1:
    SELECT DISTINCT MAKER_CD FROM T_MAKER WHERE MAKER_NAME = '�a�l�v�A���s�i' Exception:
    [Microsoft][ODBC SQL Server Driver][SQL Server]Unclosed quotation mark before the character string '�a�l�v�A��'.
    Query 2:
    Insert into Car (intCarID, nvchCustomerID, nvchCarMaker, nvchCarModel,nvchCarDescription, nvchCarCode, nvchCarColor, tintRegistrationCalendar,tintRegistrationMonth, intRegistrationYear,nvchAnnualMileage, nvchPurpose, intNoOfKms,intAirBag, btEcologicalCar, btAntilockBreakSystem,btAntiskid, btSafetyBody, btAntitheft, btFourWheelDrive,btCarModification, nvchLicensePlateArea, intLicensePlateType,nvchLicensePlateHiragana, tintLicensePlateNumber,nvchCarManufacturingNumber, nvchCarOwner, btCurrentlyInsured)Values( 1, 'NI200205040001','','', '', 'HA11S', '���I����������',2,1, 11 ,'5000', '�����E���W���[',0,2,0,0,0,0,0,0,0,'',0,'null', '0' ,'', '�_�������{�l' , 0)
    Exception:
    [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near the keyword 'null'.
    I do not wish to Prepared Statements. I will need to update all my JDBC calls this way.
    Would be grateful if any solutions to this problem could be provided.
    Tahanks and Regards

    If you are using the JDBC-ODBC bridge, then add the 'charset' property (with the name of the japanese charset as value, or whichever you are using) to the Properties instance you pass on to getConnection().
    Alin.

  • Assigning Sourcing rules to Assignment set using API or Interface table

    Hello Gurus,
    We have a requirement to migrate the data from legacy system to Oracle Apps.
    We are given with a data file containing sourcing rules and assignment set information which needs to be assigned to assignment sets.
    Are there any APIs or interface tables to assign the sourcing rule to Assignment set?
    Thanks in Advance.

    HI,
    I have a requirement, API for loading sourcing rules in APPS and attaching the same to Assignment sets at item level..
    I found that ,these are the API's for that..
    MRP_SOURCING_RULE_PUB.PROCESS_SOURCING_RULE ,MRP_SRC_ASSIGNMENT_PUB.Process_Assignment
    Please provide me the code for that.
    Can you please send to my mail -- [email protected]
    Thanks in advance...
    Vijaya

  • When bookmarking a page, I can't get the complete list of bookmark folders to dropdown in order to select any folder in which to bookmark page. What do you set to get whole list of folders in Bookmarks to drop down?

    When bookmarking a page, I can't get the complete list of bookmark folders to drop down in order to select any folder in which to bookmark page. The 'Folder:' bar has 'Bookmarks Menu' showing. The arrow on the bar drops down 5 recent folders to which pages have been saved, but the pop down arrow to the right of the bar just opens to show the three categories and 'New Folder' button. What do you set to get whole list of folders in Bookmarks to drop down?

    To all, embarrassingly enough, I have discovered that I didn't know how to expand the three categories including 'Bookmarks Menu' in the 'Bookmark This Page' pop up interface. It was expanded by default on the initial Firefox opening and first page bookmark attempt. Next use it only showed categories. I clicked and double clicked the 'Bookmarks Menu' line, but failed to see the small, shaded triangle used to expand/collapse list. If it appears collapsed, just tap triangle at left of line to see all folders. It seems to open the same way after I do it for first time. Sorry for the inconvenience, and thanks for all the attempts to help.

  • Script label: Set and get it?

    Hi
    How can I set and get the script label of a frame in my plugin?
    Thanks for the help.
    Best regards
    Hans

    Hi,<br /><br />the IScript-Interface has a GetTag() and SetTag() method. While GetTag() is fine, you'll get Asserts when using SetTag() - thus I changed that to  processing kSetScriptingTagCmdBoss.<br /><br />Example (script-label on a splineitem, stripped of nil-pointer-checks):<br /><br />InterfacePtr<IScript> script(itemRef, UseDefaultIID());               <br />PMString label = script->GetTag();<br />ScriptList scriptList.push_back(script);<br />InterfacePtr<IScriptManager>scriptMgr(Utils<IScriptUtils>()->QueryScriptManager(kScript TagMgrBoss));<br />InterfacePtr<ICommand> cmd( CmdUtils::CreateCommand(kSetScriptingTagCmdBoss));<br />InterfacePtr<IScriptTagCmdData> scriptTagData(cmd, UseDefaultIID());<br />scriptTagData->SetScriptList(scriptList, scriptMgr->GetRequestContext(), label);<br />cmd->SetItemList(UIDList(itemRef));<br />ErrorCode err = CmdUtils::ProcessCommand(cmd);<br /><br />Regards,<br /><br />Bernt

  • Accessing Custom Controller from setter and Getter methods

    Hi Gurus
    How can we access the custom controller from setter and getter methods,is there any way to do that.
    Thanks & Regards
    Rajasekhar

    Hi Steve.
    Thanks very much for valuable information,  the main controller class is getting tracked in mo_owner which is declared as  CL_BSP_WD_VIEW_CONTROLLER, and I'm getting the reference through
    mo_owner ?= owner. (since mo_owner = owner is not getting converted of type mo_owner ). After doing this on whatever the contexnode class (say zl_xxxx_xxx_cnxx) the corressponding context node values are getting turned as  <#ERROR IN METADATA.
    I mean when I'm checking the configuration in bsp_wd_cmpwb configuration tab -> Available Fields->Enlarge the contex node->BTSTATUS (say for Example) there the values are showing as <#ERROR IN METADATA , After executing the above procedure
    I cross checked several times before and after redefining the context node method IF_BSP_MODEL~INIT, before redefining this method UI is working fine, after redefintion UI is throwing below error .
    Exception Details
    CX_SY_REF_IS_INITIAL - Dereferencing of the NULL reference
    Method: CL_BSP_MODEL=>IF_BSP_MODEL_BINDING~IS_ATTRIBUTE_VALID
    Source Text Row: 13
    Thanks & Regards
    Rajasekhar

Maybe you are looking for

  • How best to upgrade from 10.3.9 to 10.4.3?

    Please can someone advise how I should proceed. I want to upgrade but I am a bit concerned as I have been having a few problems recently with my iMac freezing and having to be restarted (after which I have repaired disk, says disk is ok but repaired

  • ACS 5.2 Solution Engine Patches and Installs

    Hi Im trying to upload the 5.2 patches to the ACS Solution Engine so i can install the updates. Does anyone know how to do this or know the links that show how to do this?? The User Guide documentation isnt very helpful. Thanks Marco

  • ABAP proxy method change - from which version?

    Hi, for some new abap proxies when generating them inside SPROXY methods like EXECUTE_ASYNCHRONOUS are no longer available - it's fine I can use the message interface name as the method and the call works fine question: but does any of you know from

  • IPhone freezes/crashes all the time??

    This seems to happen to all time with me, i first brought an iPhone and the screen started going all fuzzy, i cant explain it but it would just crash while im on an app and then go to the apple logo which was on one side of the screen while half the

  • HT201365 After the new IOS 7 uploaded I can not play my favoraite game Immortalis anymore?

    Its werid all my other apps are working just this one after the new upload. I was playing it just before I uploaded so I know it was working.