Multiple input on one line

Originally had a program to input 5 numbers then put into an array and sort in order. I used seperate lines for each inputted number but want to get the user to put all five numbers on the same line therefore reducing the amount of code. For this I've used args[0] to args[4] as the five different numbers but I now get an arrayindexoutofbounds exception. I can't see where the difference is from the first program to this new one. It's probably an oversight somewhere. Any ideas?
Thanks,
Chris
//The purpose of this is to take 5 numbers from the user and puts numbers into order and also calculates average
import java.io.BufferedReader;
import java.io.InputStreamReader;
class Statistics1
     static BufferedReader b;
     public static void main(String[]args)
     throws java.io.IOException
          //Define variables
          b=new BufferedReader(new InputStreamReader(System.in));
          double input_number[]; //creates array called input_number which will be a double
          input_number=new double[5]; //5 elements in array
          double one,two,three,four,five;
          String str; //5 numbers inputted by user
          //This part of the program takes the five inputs from the user and converts them into an integer and puts into array.
          System.out.println("Input 5 numbers and press [Enter]");
          str=b.readLine();
          one=Integer.parseInt(args[0]);
          input_number[0]=one;
          two=Integer.parseInt(args[1]);
          input_number[1]=two;
          three=Integer.parseInt(args[2]);
          input_number[2]=three;
          four=Integer.parseInt(args[3]);
          input_number[3]=four;
          five=Integer.parseInt(args[4]);
          input_number[4]=five;
          //This loop is designed to use the bubblesort method to arrange numbers in order and print them to screen
          double tmp; //has to be double as array is a double
          for(int x=0;x<input_number.length-1;x++)
               for (int y=x+1;y<input_number.length;y++)
                    if (input_number[x]>input_number[y])
                         tmp=input_number[x];
                         input_number[x]=input_number[y];
                         input_number[y]=tmp;
          for (int x=0;x<input_number.length;x++)
          System.out.println(input_number[x]);
     System.out.println("These are your numbers in order");
          //This loop is to calculate the average and prints to screen
          int e; //representing the individual elements of the array
          double sum=0;
          for(e=0;e<5;e++) //e<5 as arrays are numbered from 0
          sum=sum + input_number[e];
          System.out.println("The average is " + sum/5);
}

Sorry about late reply. To explain I'm a complete biff at java and have scoured a few reference books on how to implement the string tokenizer. My effort is below but str1 to str5 don't initialise. Could you please point me in the right direction.
Thanks again,
Chris
//The purpose of this is to take 5 numbers from the user and puts numbers into order and also calculates average
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
class Statistics1
     static BufferedReader b;
     public static void main(String[]args)
     throws java.io.IOException
          //Define variables
          StringTokenizer st=new StringTokenizer(" ");
          b=new BufferedReader(new InputStreamReader(System.in));
          double input_number[]; //creates array called input_number which will be a double
          input_number=new double[5]; //5 elements in array
          double one,two,three,four,five;
          String str; //5 numbers inputted by user
          String str1,str2,str3,str4,str5;
          //This part of the program takes the five inputs from the user and converts them into an integer and puts into array.
          System.out.println("Input 5 numbers and press [Enter]");
          str=b.readLine();
          while(st.hasMoreTokens())
               str1=st.nextToken();
               str2=st.nextToken();
               str3=st.nextToken();
               str4=st.nextToken();
               str5=st.nextToken();
          one=Integer.parseInt(str1);
          two=Integer.parseInt(str2);
          three=Integer.parseInt(str3);
          four=Integer.parseInt(str4);
          five=Integer.parseInt(str5);
          input_number[0]=one;
          input_number[1]=two;
          input_number[3]=three;
          input_number[4]=four;
          input_number[5]=five;
          //This loop is designed to use the bubblesort method to arrange numbers in order and print them to screen
          double tmp; //has to be double as array is a double
          for(int x=0;x<input_number.length-1;x++)
               for (int y=x+1;y<input_number.length;y++)
                    if (input_number[x]>input_number[y])
                         tmp=input_number[x];
                         input_number[x]=input_number[y];
                         input_number[y]=tmp;
          for (int x=0;x<input_number.length;x++)
          System.out.println(input_number[x]);
     System.out.println("These are your numbers in order");
          //This loop is to calculate the average and prints to screen
          int e; //representing the individual elements of the array
          double sum=0;
          for(e=0;e<5;e++) //e<5 as arrays are numbered from 0
          sum=sum + input_number[e];
          System.out.println("The average is " + sum/5);
}

Similar Messages

  • How do I input multiple numbers to go to multiple variables in one line?

    I was wondering what I had to do to input 5 variables on one line. I have the program running fine, but I'm stuck at the part where it says "The numbers will be input five per line, on four lines".. Aside from poor grammar, it doesn't make any sense to me. Here's the whole question:
    Write code that will fill the array twoDArray(declared in the line of code below) with numbers typed in at the keyboard. The numbers will be input five per line, on four lines. Use the following array declaration:I don't need any immediate help with the array itself, just the input (unless the input is directly related to the array). Just in case, I'm going to post my code. This is still very messy, because I'm not done, and it's might be somewhat sloppy as I'm new to 2d arrays (in java).
    Thanks for the help.
    import java.io.*;
    class darrays
    public static void main(String[] args) throws IOException
    InputStreamReader inStream = new InputStreamReader (System.in);
    BufferedReader stdin = new BufferedReader(inStream);
    int[][] twoDArray = new int[4][5];
    int x,y;
    String input;
    for (x = 0; x <= 3; x++)
         for (y = 0; y<=4; y++)
    input = stdin.readLine ();
    twoDArray[x][y] = Integer.parseInt (input);
    for (x = 0; x <= 3; x++)
         for (y = 0; y<=4; y++)
    System.out.print(twoDArray[x][y] + " ");
    System.out.println("");
    }     

    Slightly off-topic
    When I was learning Basic (good old Kemeny & Kurtz style, when Basic was simply a simplified Fortran, not Bill Gates style) you simply have to write
    READ A, B, C, D, E
    DATA 10, 20, 30, 40, 50
    or something like
    INPUT "A", A: INPUT "B", B etc.
    In Java you are required to handle the mysteries of StringTokenizer...
    Java 1.5 is promising to make it easier:
          Scanner sc = Scanner.create(new File("myNumbers"));
          while (sc.hasNextLong()) {
              long aLong = sc.nextLong();
          }where you get the longs (decimal formatted, separated with blanks) from a text file.
    But not so easy as the good old INPUT statement.
    Even C's scanf is not so easy, because has lots of subtleties
    (when you finally mastered the esoteric art of using char* as strings, you are really fed up of char* strings, because they usually blow up due to buffer overflows or mere programmer errors, and start to use Java instead, even having to master the StringTokenizer and other classes.).

  • Bash script question, how do I create multiple directories on one line

    I am making a package for amavisd-new (yes I am aware that there is one in community but I can't say I like the way it is done).
    I have an install script from which I want to create multiple directories if they do not exist.
    So I want to create a directory /var/spool/amavis with subdirectories of var tmp virusmails spammassassin .
    I can't seem to be able to find a way to do this on one line.

    pelle.k wrote:
    peets wrote:Hehe because it's less typing!
    Good one!
    Also, it's by far the more dynamic method.
    If you want to get pedantic, it's also far less efficient in terms of execution time: each iteration of the loop forks a new process, whereas using a single mkdir command forks only once.  The "best" way is the curly-braces method demonstrated above by chimeric.

  • How to trigger Condition Access sequence multiple times for one line item?

    Hi,
    We have a situation that, User will enter a Promo code (custom Field) in Sales order Header Additional data B tab to apply discount for line items.
    Logic goes like this:
    1. For each Promo code .. there may be multiple sale deals (Max 3 at this point).
    2. For each line item (refering to tkomp table) we have to apply the sale deals (found above) the Condition access sequence will pick the right sale deal to apply the line item.
    3.we have enhanced the tkomp structure to hold the sale deal.
    Challenge:
    As we have the standard logic to trigger the condition access sequence once for each line item, how we can apply 3 sale deals for single line item. Is there any logic or way to trigger the condition access sequence multiple times for single line item with diffrent sale deals. ~ There may be one valid sale deal for one line.
    Functional team maintained diffrent access tables in the access sequence!!!
    Fnds, please help me to get some clue
    Thanks,
    Sunil Y

    Hi Eduardo , Thanks for the response.
    I am trying to explain again, this is the requirment given by the functional guys.
    we have Promo code in Hearder Addtional data B tab --> Have to retrieve Sale Deals -->
    At this point of time we may have at max 3 Sale Deals. we don't know which sale deal is vallied for which item we have in TKOMP.  We have enhanced the TKOMP structure to hold one sale deal only (ZZPROMO).
    We have enhanced USEREXIT_PRICING_PREPARE_TKOMP in RV60AFZZ to populate the value in TKOMP. Then it will go for diffrent access sequence to find the proper condition.
    Our challenge is that, for each line item we have 3 sale deals, we don't know which one is valid for which line. but we have to apply the vallied sale Deal to the line items.  Line item 10  may have Sale Deal 2 , item 20 may have Sale Deal3 and 30 may have sale deal 1.
    We may have solution, by fixing some thing in the code or through config. But i am confused that is it a valid requirment?
    Please help me ...
    Thanks,
    Sunil Y

  • How to Print Multiple Barcode in one line

    Hi All,
    I am printing barcode using <c1>&lwa_itab-matnr</>. now i have a query i want to print in the same line one more bar code with the values. but i m not able to print it. will any one pls help me out in this how i will print more than one barcode in one line.
    i have tried this syntax also
    <c1>&lwa_itab-matnr&      &lwa_itab-matnr&</>.
    But it is not giving gap between two barcode. it is considering space and converting space also in barcode which i don't want. I want to print two barcodes separately with some space. How will i do this.
    Pls answer it. it is very urgent.
    I am doing this in smartforms.
    Thanks
    Garima
    Edited by: Garima Mittal on Jun 18, 2008 12:34 PM

    hi,
    try like this.
    <c1>field1_</c1>_      <c1>field2_</c1>_
    give the two fields in the same line.
    so this will help u in printing the barcodes in the same line
    please reward me if helpful.
    regards,
    Reddy.

  • Writing multiple rows in one line, mysql statement. No strings are saved

    Hi, I dont know how to make multiple rows inputs into the table in one sentence. Ive got an error: "java.sql.SQLException: Statement parameter 2 not set" provided by code below. It works fine for one Date row (saves in the db corectly) however when I use for two different date types two single statements it will write databes two times putting 2x Null in the every other row. I dont want that, I need it to be written in one connection and statement.
    try{
         String userName = "user";
              String password = "pass";
              String url = "jdbc:mysql://dbadress/dbname";
              Class.forName ("com.mysql.jdbc.Driver").newInstance();
              Connection con = DriverManager.getConnection (url, userName, password);
              Statement  st1=con.createStatement();
           Date BirthDate = wdContext.currentPeopleElement().getBirthDate();  //People - context node, BirthDate - context attribute
           Date FillDate = wdContext.currentContextElement().getFillDate();
           String sql1 = "INSERT INTO table1 (BirthDate1,FillDate1) VALUES (?,?)"; //BirthDate1,FillDate1 - rows in the "table1" table
           PreparedStatement stmt1 = con.prepareStatement(sql1);
           stmt1.setDate(1, BirthDate);
           stmt1.setDate(1, FillDate);
           stmt1.executeUpdate();
           stmt1.close();
         catch(Exception e) {
         wdComponentAPI.getMessageManager() .reportWarning( e.toString() ); }
    I would like to know how to fix it.
    Other issue is that code below:
    try{
         String userName = "user";
              String password = "pass";
              String url = "jdbc:mysql://dbadress/dbname";
              Class.forName ("com.mysql.jdbc.Driver").newInstance();
              Connection con = DriverManager.getConnection (url, userName, password);
              Statement  st1=con.createStatement();
           Date BirthDate = wdContext.currentPeopleElement().getBirthDate();  //People - context node, BirthDate - context attribute
           String sql1 = "INSERT INTO table1 (BirthDate1) VALUES (?)"; //BirthDate1 row in the "table1" table
           PreparedStatement stmt1 = con.prepareStatement(sql1);
           stmt1.setDate(1, BirthDate);
              stmt1.executeUpdate();
           stmt1.close();
         catch(Exception e) {
         wdComponentAPI.getMessageManager() .reportWarning( e.toString() ); }
    works perfectly fine. It does write date in the database as shown on the monitor hoever it doesnt work if we change Date type with String. Of course context nodes are String type as well. Code below will write "Null" value in the db. Dont know why. Of course I write some string down in the input field and save after, just like do it with Date type which works fine. Please advice.
    try{
         String userName = "user";
              String password = "pass";
              String url = "jdbc:mysql://dbadress/dbname";
              Class.forName ("com.mysql.jdbc.Driver").newInstance();
              Connection con = DriverManager.getConnection (url, userName, password);
            Statement  st2=con.createStatement();
         String signature = wdContext.currentContextElement().getsignature(); //signature - context
         String sql2 = "INSERT INTO table1 (signature1) VALUES (?)"; //signature1 - name of row in the table1
         PreparedStatement stmt2 = con.prepareStatement(sql2);
         stmt2.setString(1, signature);
         stmt2.executeUpdate();
         stmt2.close();
         catch(Exception e) {
         wdComponentAPI.getMessageManager() .reportWarning( e.toString() ); }
    Regards, Blamer.

    Hi,
    Fix for your first issue
    I dont know how to make multiple rows inputs into the table in one sentence. Ive got an error: "java.sql.SQLException: Statement parameter 2 not set" provided by code below. It works fine for one Date row (saves in the db corectly) however when I use for two different date types two single statements it will write databes two times putting 2x Null in the every other row. I dont want that, I need it to be written in one connection and statement.
    try{
         String userName = "user";
              String password = "pass";
              String url = "jdbc:mysql://dbadress/dbname";
              Class.forName ("com.mysql.jdbc.Driver").newInstance();
              Connection con = DriverManager.getConnection (url, userName, password);
              Statement  st1=con.createStatement();
           Date BirthDate = wdContext.currentPeopleElement().getBirthDate();  //People - context node, BirthDate - context attribute
           Date FillDate = wdContext.currentContextElement().getFillDate();
           String sql1 = "INSERT INTO table1 (BirthDate1,FillDate1) VALUES (?,?)"; //BirthDate1,FillDate1 - rows in the "table1" table
           PreparedStatement stmt1 = con.prepareStatement(sql1);
           stmt1.setDate(1, BirthDate);
           stmt1.setDate(1, FillDate);
           stmt1.executeUpdate();
           stmt1.close();
         catch(Exception e) {
         wdComponentAPI.getMessageManager() .reportWarning( e.toString() ); }
    I would like to know how to fix it.
    Change the line  stmt1.setDate(1, FillDate); to stmt1.setDate(2, FillDate);
    As a workarond for your following issue
    works perfectly fine. It does write date in the database as shown on the monitor hoever it doesnt work if we change Date type with String. Of course context nodes are String type as well. Code below will write "Null" value in the db. Dont know why. Of course I write some string down in the input field and save after, just like do it with Date type which works fine. Please advice.
    try{
         String userName = "user";
              String password = "pass";
              String url = "jdbc:mysql://dbadress/dbname";
              Class.forName ("com.mysql.jdbc.Driver").newInstance();
              Connection con = DriverManager.getConnection (url, userName, password);
            Statement  st2=con.createStatement();
         String signature = wdContext.currentContextElement().getsignature(); //signature - context
         String sql2 = "INSERT INTO table1 (signature1) VALUES (?)"; //signature1 - name of row in the table1
         PreparedStatement stmt2 = con.prepareStatement(sql2);
         stmt2.setString(1, signature);
         stmt2.executeUpdate();
         stmt2.close();
         catch(Exception e) {
         wdComponentAPI.getMessageManager() .reportWarning( e.toString() ); }
    Try as follows
    PreparedStatement stmt2 = con.prepareStatement(sql2);
         stmt2.setString(1, (signature == null ? "Value missing" : signature));
         stmt2.executeUpdate();
         stmt2.close();
    If the context attribute is null it will enter the text "Value Missing",
    Regards
    Ayyapparaj

  • Multiple fields on one line on an interview screen?

    Hi
    I need to implement an interview screen with lines on the form:
    "Enter income for 2012 [inputfield] [income2011] [income2010]"
    The user should be able to input the income for 2012 in an editable field and on the same line after the input field, two non editable fields should show the income for the previous years 2011 and 2010. These values are available from a database.
    I am unable to find any hints on how to do this - when the fields are to be shown on the same line...
    kind regards
    Carsten

    Having multiple fields on a single line cannot be configured in the screens file out-of-the-box. It sounds like something which could be done with a custom property though, so you'll need a technical person involved.
    There's information in the OPA Developer's Guide about custom properties: http://docs.oracle.com/html/E38272_01/toc.htm (note that this is different to the OPM User's Guide).
    Cheers,
    Jasmine

  • Can I add multiple keywords on one line in Junk Rules

    Dad forwards me crappy jokes all the time. I have a rule set If "all" conditions are met.
    From Contains : dads email address
    Subject Begins With: : FW
    This works but can add into the same line Fwd.
    It's been a long since programming but I thought maybe using : "FW",Fwd","Fw".
    I know I could set another rule but Its more efficient this way.
    Please let me know it there is a correct syntax which would allow me to do this.
    Thanks,
    Craig

    Never mind just found out I can add multiple lines of : Subject Begins With and keep the "All" Conditions command. I original thought the rule would initiate with the all conditions must be present, but it seems to work.

  • SQL to report multiple values in one line

    I have a question for you SQL experts out there.
    Let's say I have two tables,
    solution
    solution_data
    There is a one-to-many relationship between the solution table and the solution_data table.
    For example,
    solution.id = 1
    solution.name = calendar
    records in the solution_data table
    solution_data.solution_id = 1
    solution_data.supported_os = Windows
    solution_data.solution_id = 1
    solution_data.supported_os = Linux
    solution_data.solution_id = 1
    solution_data.supported_os = Mac
    I want a SQL query to output that data on a single line like this:
    solution name     supported_os
    calendar     windows, Linux, Mac
    I can't use aliases for solution_data, because each solution_data record does not have a known unique identifier, nor do I know ahead of time how many records there are for a particular solution.
    I also don't want to write a PL/SQL procedure for this.
    Any ideas?

    Tom Kyte has a solution called STRAGG
    http://asktom.oracle.com/pls/ask/f?p=4950:8:368216229952376057::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:2196162600402,

  • XML output with multiple tags in one line

    I have not done much XML exporting with SQL. Previously I had just been ending my SQL queries with
    FOR XML RAW ('Company'), ROOT ('Companies'), ELEMENTS;
    and it formatted my query nicely in an XML output. That put every column name as a tag and the cell data within the tag.
    However, now the criteria has changed on me. I need to create a tag with multiple sub tags in it.
    Example: <Location Floor="10" Suite="512" DoorType="Metal">
    But I'll still need other tags to be normal in the XML output such as
    <Address>123 Fake St</Address>
    <City>Springfield</City>
    <Location Floor="10" Suite="512" DoorType="Metal">
    Is there any way to get this XML mixed in the output like above?
    Thank you for any help. 

    Hi, you can FOR XML PATH for a finer degree of control over your XML.  Use the @ symbol to create attributes.  Here's a simple example:
    DECLARE @t TABLE ( rowId INT IDENTITY PRIMARY KEY, [address] VARCHAR(50), city VARCHAR(30), floor INT, suite INT, doorType VARCHAR(20) )
    INSERT INTO @t VALUES
    ( '123 Fake St', 'Springfield', 10, 512, 'Metal' )
    SELECT
    [address] AS "Address",
    city AS City,
    [floor] AS "Location/@Floor",
    suite AS "Location/@Suite",
    doorType AS "Location/@DoorType"
    FROM @t
    FOR XML PATH ('Company'), ROOT ('Companies'), ELEMENTS;

  • Need Multiple Elements on 1 Line?

    How can I put two fields *next* to each other? In a previous form (Acrobat Pro 9) the fields could be arranged on a grid. Now (Acrobat Pro 11) I can't seem to do that. They can only be moved up or down.
    I need to finish the form for a project this week. My employer trained me on the forms wizard, but the program on my computer is totally different. Any help would really be appreciated!

    We are adding support for putting multiple fields on one line. We are adding this at the end of January (not this week - sorry).
    Randy

  • Is there a fax cover template?  If not, how can I have 2 text fields on one line?

    Is there a fax cover template?  If not, how do you add two text fields on one line?    

    No fax cover template. This forum posts explains how to put multiple fields on one line:
    http://forums.adobe.com/message/5032849

  • In this report i have marked one line..if this width 30,i need to multiply by a number 0.3 and if the width =30,it multiplies by 0.37...how to use this logic here..??? anyone can help??

    In this report i have marked one line..if this width < 30,i need to multiply by a number 0.3 and if the width >=30,it multiplies by 0.37...how to use this logic here..??? anyone can help??
    Declare @FromDate Datetime
    Declare @ToDate Datetime
    Declare @SCCode nvarchar(30)
    select @FromDate = min(S0.Docdate) from dbo.OINM S0 where S0.Docdate >='[%0]'
    select @ToDate = max(S1.Docdate) from dbo.OINM s1 where S1.Docdate <='[%1]'
    --Rcpt from PRDN (Condition checked for Return component exclusion also)
    SELECT T2.U_STKNO as 'PRN No', T2.PostDate as Date,
    T2.DocNum AS 'WorkOrderNo',
    b.DocNum as 'Issue Doc No',
    ISNULL(d.DocNum,'') as 'Receipt Doc No',
    b.U_IssPSCName as 'SubContractor Name',
    T2.ItemCode as 'FG Item Code',
    T3.ItemName as 'FG Item Name',
    T2.PlannedQty as 'FG Planned Qty',
    T2.U_OD as 'OD',
    T2.U_ID as 'ID',
    T2.U_OD/25.4 as 'Inches',
    (T2.U_OD-T2.U_ID)/2 as 'Width',
    0 as 'FG Pending Qty',
    0 as 'FG Receipt Qty',
    '' as 'Issue Item Code',
    '' as 'Issue Item Name',
    Sum(ISNULL(a.Quantity,0)) as 'Total Issue Quantity',
    0 as 'Issue Item - Return Quantity',
    '' as 'Return Doc No',
    SUM(ISNULL(a.U_IssPTotWeight,0)) as 'Total Issue Weight',
    SUM(ISNULL(c.U_Quantity,0)) as 'Total Receipt Weight'
    from OWOR T2 inner join WOR1 T4 on T2.DocEntry = T4.DocEntry
    INNER JOIN OITM T1 ON T1.ItemCode = T4.ItemCode inner join OITM T3 on T3.ItemCode = T2.ItemCode
    LEFT join IGE1 a on T2.DocNum = a.BaseRef Inner JOIN OIGE b on a.DocEntry = b.DocEntry and T4.ItemCode not in (a.ItemCode)
    LEFT JOIN IGN1 c ON c.BaseRef = T2.DocNum and T2.ItemCode = c.ItemCode INNER JOIN OIGN d on c.DocEntry = d.DocEntry
    WHERE b.Series in('101','20') and T2.PostDate >= @FromDate and T2.PostDate <= @ToDate and b.U_IssPSCName = '[%2]'
    GROUP BY T2.U_STKNO, T2.PostDate, T2.DocNum, b.DocNum, d.DocNum, b.U_IssPSCName,T2.ItemCode,T3.ItemName,T2.PlannedQty,T2.U_OD,T2.U_ID, T2.U_OD/25.4,(T2.U_OD-T2.U_ID)/2
    UNION ALL
    SELECT T2.U_STKNO as 'PRN No', T2.PostDate as Date,
    T2.DocNum AS 'WorkOrderNo',
    b.DocNum as 'Issue Doc No',
    ISNULL(d.DocNum,'') as 'Receipt Doc No',
    b.U_IssPSCName as 'SubContractor Name',
    T2.ItemCode as 'Item Code',
    T3.ItemName as 'Item Name',
    T2.PlannedQty as 'Planned Qty',
    T2.U_OD as 'OD',
    T2.U_ID as 'ID',
    T2.U_OD/25.4 as 'Inches',
    (T2.U_OD-T2.U_ID)/2 as 'Width',
    (Select (T2.PlannedQty - (Select ISNULL(sum(a1.Quantity),0) from IGN1 a1 inner join OWOR b1 on a1.BaseRef = b1.DocNum and a1.ItemCode in (b1.itemcode) where b1.DocNum = t2.DocNum))) as 'Pending Qty',
    (Select ISNULL(sum(a1.Quantity),0) from IGN1 a1 inner join OWOR b1 on a1.BaseRef = b1.DocNum and a1.ItemCode in (b1.itemcode) where b1.DocNum = t2.DocNum) as 'Receipt Qty',
    a.ItemCode as 'Issued Item Code',
    a.Dscription as 'Issued Item Name',
    Sum(ISNULL(a.Quantity,0)) as 'Total Issue Quantity',
    (Select (Select ISNULL(sum(a1.Quantity),0) from IGN1 a1 inner join OWOR b1 on a1.BaseRef = b1.DocNum inner join WOR1 b2 on b1.DocEntry = b2.DocEntry where b1.DocNum = t2.DocNum and a1.ItemCode in (b2.itemcode))) as 'Issue Item - Return Quantity',
    (ISNULL((Select (Select a2.DocNum from OIGN a2 where a2.DocEntry = a1.DocEntry) from IGN1 a1 inner join OWOR b1 on a1.BaseRef = b1.DocNum inner join WOR1 b2 on b1.DocEntry = b2.DocEntry where b1.DocNum = t2.DocNum and a1.ItemCode in (b2.itemcode)),'')) as 'Return Doc No',
    SUM(ISNULL(a.U_IssPTotWeight,0)) as 'Total Issue Weight',
    SUM(ISNULL(c.U_Quantity,0)) as 'Total Receipt Weight'
    from OWOR T2 inner join WOR1 T4 on T2.DocEntry = T4.DocEntry
    INNER JOIN OITM T1 ON T1.ItemCode = T4.ItemCode inner join OITM T3 on T3.ItemCode = T2.ItemCode
    LEFT join IGE1 a on T2.DocNum = a.BaseRef Inner JOIN OIGE b on a.DocEntry = b.DocEntry and T4.ItemCode in (a.ItemCode)
    LEFT JOIN IGN1 c ON c.BaseRef = T2.DocNum and T2.ItemCode = c.ItemCode LEFT JOIN OIGN d on c.DocEntry = d.DocEntry 
    WHERE b.Series in('101','20') and T2.PostDate >= @FromDate and T2.PostDate <= @ToDate and b.U_IssPSCName = '[%2]'
    GROUP BY T2.U_STKNO, T2.PostDate, T2.DocNum, b.DocNum, d.DocNum, b.U_IssPSCName,T2.ItemCode,T3.ItemName,T2.PlannedQty,T2.U_OD,T2.U_ID,T2.U_OD/25.4,(T2.U_OD-T2.U_ID)/2,a.ItemCode,a.Dscription    order by T2.DocNum desc

    Hi,
    Try this:
    Declare @FromDate Datetime
    Declare @ToDate Datetime
    Declare @SCCode nvarchar(30)
    select @FromDate = min(S0.Docdate) from dbo.OINM S0 where S0.Docdate >='[%0]'
    select @ToDate = max(S1.Docdate) from dbo.OINM s1 where S1.Docdate <='[%1]'
    --Rcpt from PRDN (Condition checked for Return component exclusion also)
    SELECT T2.U_STKNO as 'PRN No', T2.PostDate as Date,
    T2.DocNum AS 'WorkOrderNo',
    b.DocNum as 'Issue Doc No',
    ISNULL(d.DocNum,'') as 'Receipt Doc No',
    b.U_IssPSCName as 'SubContractor Name',
    T2.ItemCode as 'FG Item Code',T3.ItemName as 'FG Item Name',T2.PlannedQty as 'FG Planned Qty',T2.U_OD as 'OD',T2.U_ID as 'ID',T2.U_OD/25.4 as 'Inches',(T2.U_OD-T2.U_ID)/2 as 'Width',case when ((T2.U_OD-T2.U_ID)/2) <30 then ((T2.U_OD-T2.U_ID)/2) *0.3 end, 0 as 'FG Pending Qty',0 as 'FG Receipt Qty','' as 'Issue Item Code','' as 'Issue Item Name',Sum(ISNULL(a.Quantity,0)) as 'Total Issue Quantity',0 as 'Issue Item - Return Quantity','' as 'Return Doc No',SUM(ISNULL(a.U_IssPTotWeight,0)) as 'Total Issue Weight',SUM(ISNULL(c.U_Quantity,0)) as 'Total Receipt Weight'from OWOR T2 inner join WOR1 T4 on T2.DocEntry = T4.DocEntryINNER JOIN OITM T1 ON T1.ItemCode = T4.ItemCode inner join OITM T3 on T3.ItemCode = T2.ItemCodeLEFT join IGE1 a on T2.DocNum = a.BaseRef Inner JOIN OIGE b on a.DocEntry = b.DocEntry and T4.ItemCode not in (a.ItemCode)LEFT JOIN IGN1 c ON c.BaseRef = T2.DocNum and T2.ItemCode = c.ItemCode INNER JOIN OIGN d on c.DocEntry = d.DocEntryWHERE b.Series in('101','20') and T2.PostDate >= @FromDate and T2.PostDate <= @ToDate and b.U_IssPSCName = '[%2]'GROUP BY T2.U_STKNO, T2.PostDate, T2.DocNum, b.DocNum, d.DocNum, b.U_IssPSCName,T2.ItemCode,T3.ItemName,T2.PlannedQty,T2.U_OD,T2.U_ID, T2.U_OD/25.4,(T2.U_OD-T2.U_ID)/2UNION ALL SELECT T2.U_STKNO as 'PRN No', T2.PostDate as Date,T2.DocNum AS 'WorkOrderNo',
    b.DocNum as 'Issue Doc No',
    ISNULL(d.DocNum,'') as 'Receipt Doc No',
    b.U_IssPSCName as 'SubContractor Name',
    T2.ItemCode as 'Item Code',T3.ItemName as 'Item Name',T2.PlannedQty as 'Planned Qty',T2.U_OD as 'OD',T2.U_ID as 'ID',T2.U_OD/25.4 as 'Inches',(T2.U_OD-T2.U_ID)/2 as 'Width',case when ((T2.U_OD-T2.U_ID)/2) >=30 then ((T2.U_OD-T2.U_ID)/2) *0.37 end, (Select (T2.PlannedQty - (Select ISNULL(sum(a1.Quantity),0) from IGN1 a1 inner join OWOR b1 on a1.BaseRef = b1.DocNum and a1.ItemCode in (b1.itemcode) where b1.DocNum = t2.DocNum))) as 'Pending Qty',(Select ISNULL(sum(a1.Quantity),0) from IGN1 a1 inner join OWOR b1 on a1.BaseRef = b1.DocNum and a1.ItemCode in (b1.itemcode) where b1.DocNum = t2.DocNum) as 'Receipt Qty',
    a.ItemCode as 'Issued Item Code',
    a.Dscription as 'Issued Item Name',
    Sum(ISNULL(a.Quantity,0)) as 'Total Issue Quantity',
    (Select (Select ISNULL(sum(a1.Quantity),0) from IGN1 a1 inner join OWOR b1 on a1.BaseRef = b1.DocNum inner join WOR1 b2 on b1.DocEntry = b2.DocEntry
    where b1.DocNum = t2.DocNum and a1.ItemCode in (b2.itemcode))) as 'Issue Item - Return Quantity',
    (ISNULL((Select (Select a2.DocNum from OIGN a2 where a2.DocEntry = a1.DocEntry) from IGN1 a1 inner join OWOR b1 on a1.BaseRef = b1.DocNum inner join WOR1 b2 on b1.DocEntry = b2.DocEntry where b1.DocNum = t2.DocNum and a1.ItemCode in (b2.itemcode)),'')) as 'Return Doc No',
    SUM(ISNULL(a.U_IssPTotWeight,0)) as 'Total Issue Weight',
    SUM(ISNULL(c.U_Quantity,0)) as 'Total Receipt Weight'
    from OWOR T2 inner join WOR1 T4 on T2.DocEntry = T4.DocEntry
    INNER JOIN OITM T1 ON T1.ItemCode = T4.ItemCode inner join OITM T3 on T3.ItemCode = T2.ItemCode
    LEFT join IGE1 a on T2.DocNum = a.BaseRef Inner JOIN OIGE b on a.DocEntry = b.DocEntry and T4.ItemCode in (a.ItemCode)
    LEFT JOIN IGN1 c ON c.BaseRef = T2.DocNum and T2.ItemCode = c.ItemCode LEFT JOIN OIGN d on c.DocEntry = d.DocEntry
    WHERE b.Series in('101','20') and T2.PostDate >= @FromDate and T2.PostDate <= @ToDate and b.U_IssPSCName = '[%2]'
    GROUP BY T2.U_STKNO, T2.PostDate, T2.DocNum, b.DocNum, d.DocNum, b.U_IssPSCName,T2.ItemCode,T3.ItemName,
    T2.PlannedQty,T2.U_OD,
    T2.U_ID,T2.U_OD/25.4,(T2.U_OD-T2.U_ID)/2,a.ItemCode,a.Dscription  
    order by T2.DocNum desc
    Thanks & Regards,
    Nagarajan

  • Multiple paragraph styles in one line

    I'm creating a training manual and I am having trouble with paragraph styles. Here's an example of what I am trying to do:
    "The Dog walks up the hill"
    In the above example, I have created a style for the bolded text and connected it my table of contents. The idea is when I create and update the TOC, "The Dog" will be the entry with the remaining text omitted from the TOC. The issue I am having is because the text is on one line, I cannot have multiple styles. I've tried writing just "The Dog" and then either changing the style or deleting the paragraph break to connect the text below to the main line. Once I erase the paragraph break and the text is on one line, only ONE style is maintained. Now, I can modify the character style; however, because the paragraph style is still the one connected to the TOC, the entire paragraph appears in the TOC.
    Any advice would be greatly appreciated! I've searched everywhere to no avail.
    Thank you very much for your support.

    ajmiddle18 wrote:
    I'm creating a training manual and I am having trouble with paragraph styles. Here's an example of what I am trying to do:
    "The Dog walks up the hill"
    In the above example, I have created a style for the bolded text and connected it my table of contents. The idea is when I create and update the TOC, "The Dog" will be the entry with the remaining text omitted from the TOC. The issue I am having is because the text is on one line, I cannot have multiple styles. I've tried writing just "The Dog" and then either changing the style or deleting the paragraph break to connect the text below to the main line. Once I erase the paragraph break and the text is on one line, only ONE style is maintained. Now, I can modify the character style; however, because the paragraph style is still the one connected to the TOC, the entire paragraph appears in the TOC.
    Any advice would be greatly appreciated! I've searched everywhere to no avail.
    Thank you very much for your support.
    It depends on the breed of dog.
    Is the paragraph always a single line?
    Is this dog the leader of the pack? IE, does the phrase you want to keep always begin the paragraph? If so, then you can separate the dog from the pack in the TOC. One way is to surround the pack with a unique character or marker in the main text, like End Nested Style Here, - one after dog, and another after hill, and create a paragraph style for the doggie paragraph to use in the TOC. This paragraph should contain a nested character style that applies microscopic text properties, like paper character color, font .1pt, and horizontal scale .1%. The TOC entries should use nested paragraph styles; the source paragraphs need you to insert the End Nested Style Here markers. The nested style definition in the TOC paragraph styles should apply no character style through the first end nested style marker, then apply microscopic through the next end nested style marker. This will shrink the walks...hill text to an invisible speck, so small that it shouldn't interfere with tab leaders and page-references.
    Another approach is to use a single-row table for the heading, with the dog pent nicely in the left cell, and the pack in the right cell. Each cell contains a paragraph, so only extract the dog to the TOC.
    Search Google for terms like "InDesign hide part of paragraph in toc knowhowpro," "InDesign suppress part of paragraph in contents knowhowpro," "InDesign two paragraph styles on one line," and similar phrases without quotes for some good discussions and a variety of approaches that include layers, anchored frames, and conditional text.
    Search Google for terms like "InDesign conditional text," and "InDesign nested paragraph styles," without quotes for details.
    http://forums.adobe.com/message/3206266 has a long discussion that may shed some additional light.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • Multiple account assignment category for one line item in PO

    Dear Experts,
    We are on SRM 5.0 ECS
    One line item of a PO has multiple account assignment category with the cost distribution for
    1. Cost Center - 50%
    2. Order          - 50%
    Is it possible?
    As per my understanding one line item in a PO can have only one account assignment category
    Regards
    Mick

    Hi,
    Yes it is possible by Po line item.
    Just go to transaction bbp_poc through the web interface.
    Select your PO
    Select your line item PO.
    goto the account assignment tab (item overview)
    you get a cost distribution field in percentage
    then you get a cost distribution button : click it and you get several lines where now you can split your 100% in as many lines as you want.
    BR,
    Disha.
    Pls reward points for useful answers.

Maybe you are looking for