Finding Order Lines with only top model and no child items

Hi All,
Can you please help me in finding out the Order lines which are having only top model and no child item and the lines total is zero. I framed a query for this but it takes too long time to retrieve such lines. the query is:
select top_line_id, header_id,flow_status_code ,line_type_id
from (select count(*) lines, top_model_line_id top_line_id, header_id,flow_status_code ,line_type_id
from oe_order_lines_all
where flow_status_code in ('BOOKED','ENTERED')
and line_type_id IN (<line_type_id>))
group by top_model_line_id,header_id,flow_status_code,line_type_id)
where oe_totals_grp.get_order_total (header_id,top_line_id,'ALL')<=0
and lines <=1
order by line_type_id desc;
Can you please help me in this case?
Thanks
Himanshu

Hi,
You can try including the condition top_model_line_id is not null. I think that would make the query faster because it would allow the use of an index. The query would look like:
select top_line_id, header_id,flow_status_code ,line_type_id
from (select count(*) lines, top_model_line_id top_line_id, header_id,flow_status_code ,line_type_id
from oe_order_lines_all
where flow_status_code in ('BOOKED','ENTERED')
and top_model_line_id is not null
and line_type_id IN (<line_type_id>)
group by top_model_line_id,header_id,flow_status_code,line_type_id)
where oe_totals_grp.get_order_total (header_id,top_line_id,'ALL')<=0
and lines <=1
order by line_type_id desc;Hope it helps.
Regards.

Similar Messages

  • Want to display no. of ser. orders closed with in 1 day and outside 1 day

    Hi Experts,
    Im displaying a summary report for Closed call.
    I want to display the Number of Service Orders Closed With in 1 day and Out side 1 day.
    For example:
    Brand......ASP...................With in 1day...............................Outside 1 day
    ABC1........ALPHA Tec...........24................................................5
    BCD2..........BETA Tec.............76................................................7
    The difference of days I have brought using 2 variables (1. is for closed date and 2. is for service order created date)
    In the Formula Variable I have (Subscrated Closed date - Created Date)
    I'm not very sure how to bring the count of the service order that are closed with in 1 day and outside 1day.
    Please help.
    Thanks

    Hi,
    This could be achieved through Data model level as well:
    1. By assuming you have two date char Created date and closing date.
    2. Create a char (On-time) flag and populate flag by ABAP coding if Closing - Created = 1 then field should be Check ("X").
    3. Restrict your report with this Flag to find out number of Service orders on-time.
    4. Define a counter KYF in your data model and maintain fixed value = 1 in your cube / ODS.
    This is one approach let me know if any further information is required.
    Regards,
    Venkat

  • I tried to soft reset my ipod touch with the top button and the screen button.  it turned off and went to the blue screen with the apple.  now it won't do anything-it has stayed on that scren for 4 hours now.  does anyone know how i can fix this?

    i tried to soft reset my ipod touch with the top button and the screen button.  it turned off and then went to the blue screen with the apple like it should.  however, it now just stays on that screen.  it has a sort of clock looking thing at the bottom of the apple that does not move either.  it has stayed on this screen for over 4 hours.  i also can not hard reset it in itunes.  i am not really goood at this sort of thing.  does anyone have this problem or a possible solution?  thanks

    See Here for
    Frozen or unresponsive iPod touch
    The Basic Troubleshooting Steps are:
    Restart..  Reset..  Restore...
    Try this First... You will Not Lose Any Data...
    Turn the iPod Off... ( if it isn’t already )
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    Wait for the Apple logo to Appear and then Disappear...
    Usually takes about 15 - 20 Seconds... (But can take Longer...)
    Release the Buttons...
    Turn the iPod On...
    If that does not help... See Here:
    Backing up, Updating and Restoring
    http://support.apple.com/kb/HT1414

  • My imsg is not working with only one person and her imsg is working perfectly fine with her friends

    My imsg is not working with only one person and her imsg is working perfectly fine with her friends

    See this thread:
    https://discussions.apple.com/thread/5306216?tstart=0
    From Apple:
    MacBook Air (Mid 2013): FaceTime HD Camera might not work after OS X 10.8.5 update
    Yes, a fix is coming soon.

  • How do I search for lines with a particular pattern and delete them when a match occurs

    How do I search for lines with a particular patter and delete them when a match occurs? For example delete lines containing SUB_NAME = "?" where ? is any string. 

    How do I search for lines with a particular patter and delete them when a match occurs? For example delete lines containing SUB_NAME = "?" where ? is any string. 
    Lines in what? And what language are you using to develop with?
    Are the lines in a text file? A RichTextBox? A TextBox? Some other control? A List(Of String)?
    Is there some expectation by you that by providing what you wrote in your question post that the knowledge in your mind about what you are thinking about will mysteriously emanate to anybody reading your post so all of the sudden your knowledge will
    become their knowledge and they will be able to provide you with an answer as they will suddenly understand what you are trying to do? Because that's probably impossible. Most people try providing enough information in a question so anybody, even stupid people
    like me, can understand what they want. Maybe you should try that. As well as selecting an appropriate forum for your question in the future. Usually a question like this is related to programming in a particular language therefore a language forum may be
    a good choice. Or not.
    La vida loca

  • HT1338 can i replace my mac with a newest model and pay a difference

    can i replace my mac with the newest model and pay a difference>>>

    Sorry. No.
    Apple does not have a trade-in policy.
    Best.

  • With only American Dad and Family Guy episodes, it doesn't say HD?

    With only American Dad and Family Guy episodes, it doesn't say HD when it should?
    I bought American Dad and Family Guy episodes in HD.
    Every show and movie that I bought in HD besides those shows on my iPad 3G has the HD symbol.
    Why isn't the HD working on my iPad with those shows?
    On my computer library it shows I have those episodes in HD, but not on my iPad?

    Maybe the iPad has stricter standards for what it considers HD?
    I watch Family Guy on an HD feed of FOX, and I can verify I've never seen a Family Guy in what I'd consider true HD. It's always 4:3 aspect ratio (instead of widescreen 16:9), and while it does look uprezzed from a non-HD channel, I'm not sure it has the clarity of HD. Also, if I look in the program information on the television, it doesn't designate it HD like it would, say, House on the same channel.
    I just looked up the listing in iTunes and strangely the "HD" designation seems sporadic - some episodes have it; others don't, but if I preview them they look the same regardless.
    So if it looks/sounds good, I wouldn't worry about it.

  • Determine LAN MAC-address knowing only the model and serial number

    Laptop Toshiba SN 96592614G
    Is it possible to determine the MAC-address of the network card, knowing only the model and serial number of your laptop?
    How to refer the matter to the addicts Toshiba.

    Knowing the serial number you can check the notebooks details here:
    www.toshiba-tro.de/unitdetails
    but there are no informations about the mac adress... maybe an Toshiba authorized service provider woudl be able to provide an info about that ...

  • Sales order BOm with Both Header material and line item delivery

    Hi,
           We have one requirment   we have two products  Products  A  and B, when we are salling only product B we have some amount for that e.g 1000  rupees   but when we are salling product A  along with this product B is free of cost   so as in SO it is not accepting the 0 amount  thats why while making SO for product A  we reduce 1 rupee from product A   and that 1 rupee we are adding for the Free item B   but now every time we have to add both material in SO
      So is there any way  when we make the So for product A  automatically product B should come in So and price of product A is from VK11  but price of B should always be 1 and while creating delivery with VL01 both material we want to delivery and do the PGi  in the same way we required billing doucment for both the material and in case we are salling only product B price  should be from VK11.
      How to customize the system for above requirement.
    regards,
      zafar

    Hi Zafar,
    Free goods determination is not supported in SAP for structured material like BOM.
    For your requirement, you need not have to create a BOM materiall, simple free goods determination is suitable.
    You can create an Exclusive free goods condition record where material A will be the main item and material B will be the sub item (free of charge).
    So create the Condition record for Exclusive free goods in VBN1.
    When you will create the Sales order for material A, system will take the above materials "A" as Main item (Item category TAN) and "B" Sub-item (Item category TANN) respectively.
    When you will create DELIVERY , both the items will be delivered and you can do PGI.
    As and when required you can also sell material B separately.
    Regards
    Pradyumna

  • Sales order line with status calcelled picked by auto invoice program

    I cancelled  one line in Sales Order and Shipped remaining lines
    after Ship Confirm process ,I ran workflow background process.
    I am getting cancelled line information to AR interface tables
    when I run Auto invoice amount is sitting in Unearned account
    The status of cancelled line -  Cancelled
    Flow status code is cancelled
    INVOICE_INTERFACE_STATUS_CODE I AM SEEING is YES for that line.
    Why the cancelled Sales order line is picked by auto invoice program?
    Thanks,
    John

    Hi Ivruksh,
    Thanks for the reply, the reference you gave was not actually related to the issue I had, let me put it this way,
    Our Auto Invoice Job is scheduled at midnight, it runs and process only few CM's, rest of them are left behind with out any error message in error tables. Al I can see in the ra_interface_lines_all table is interface_line_id is populated, which shows that the Auto Invoice program has picked all the records but it is processing only few, the rest are left out with out any error message.
    Interestingly, when I tried to run those stuck CM's Individual one by one its gets successfully processed.
    Is anyone faced with similar kind of issue, kindly let me know of any solutions you guys had.
    Thanks in advance.
    Regards
    Srinivas

  • Sales Order Lines with inclusive VAT prices

    I am integrating a 3rd party web site order into SAP B1. The site can only provide VAT Inclusive Prices and cannot provide the VAT rate or code - that SAP order will be loaded with the VAT rate taken from the BP / Item matrix.
    This is not a problem when creating order lines as I can use the <PriceAfterVAT> element (using DI Server). However when adding Freight Lines to the B1 order there is no equivalent element. It appears that I can only add a value excluding VAT.
    Is there any way of adding a VAT Inclusine value to a Freight Line?
    Can Freight Items be set up so that the value can be entered as Vat Inclusive?
    I would prefer not to have to caluclate and enter the VAT exlcusive price as this invovles mimicing the Web Sites VAT Matrix calculation and hoping that this mimics the SAP VAT calculation and hopefully not ending up with rounding problems. Note that the Web Site has already taken payment via credit card and the invoice from SAP must match the Web Transaction.
    Any help would be appreciated.

    Hi Nick,
    Have you considered storing the freight costs on the order as a non-stock item on the item rows rather than using the freight lines? In that way you could use the same PriceAfterVAT field to back calculate the exclusive price.
    I'd recommend you also ask your question on the application forum:
    SAP Business One Application
    as they may have other suggestions as to how you could set your tax up.
    Kind Regards,
    Owen

  • Multiple domains names and web sites with only one SLS and one static IP

    I tried to find a post on this topic but I still can't find what needs to be done.
    SLS is configured for one domain with one web site and it's working well. We will call it domain1.com. Here is the config:
    Static IP: 69.x.x.x
    DNS setting under Server Admin:
    hostname: server.domain1.com
    Two DNS entries under domain1.com with:
    www - alias - server.domain1.com
    server - Machine - 10.0.1.x (fixe IP for server on LAN)
    Web settings under Server Admin:
    server.domain1.com - 10.0.1.x - Port 80
    Domain1.com is managed with DynDNS Custom DNS Service with 1 record:
    domain1.com - A-record - 69.x.x.x
    I want to host a second domain (for a website) called domain2.com. It's also registred at DynDNS and I have custom DNS setting to configure.
    What's need to be done to have both domains with seperate web site on SLS under DNS and Web settings (beside the fact that I will have 2 different folders with the website files in it). I understand that I will need a new entry in the DNS for the new domain (domain2.com) and also an entry in the Web Service pane. But what are the details.
    Thanks.

    When you said, "you don't need to do CNAME for both sites…", would this method still allow me to use personal web addresses for both sites?
    Yes. With "Ordinary Forwarding" you normally just type your .Mac url (web.mac.com/username/sitename) into a form at the place where you have your name.
    I thought I was using 'web.mac.com' as the 'www' CNAME (alias) for my personal domain name (web address), so that when someone typed in my personal domain name they would 'go' to the domain registration location, which would then pass it on to the .Mac server, where my web site is hosted.
    That's exactly right. It's just not the only way to do that. Ordinary Forwarding is another way, but it differs in terms of what appears in the address bar of the browser. Either you will see web.mac.com/username/.... or, if you add "masking", you will see your personal name for all pages. The CNAME method results in a address bar that reads www.myname.com/sitename/pagename.html.
    Am I way off?
    All help gratefully received,
    Jeff

  • JTable with custom column model and table model not showing table header

    Hello,
    I am creating a JTable with a custom table model and a custom column model. However the table header is not being displayed (yes, it is in a JScrollPane). I've shrunk the problem down into a single compileable example:
    Thanks for your help.
    import javax.swing.*;
    import javax.swing.table.*;
    public class Test1 extends JFrame
         public static void main(String args[])
              JTable table;
              TableColumnModel colModel=createTestColumnModel();
              TestTableModel tableModel=new TestTableModel();
              Test1 frame=new Test1();
              table=new JTable(tableModel, colModel);
              frame.getContentPane().add(new JScrollPane(table));
              frame.setSize(200,200);
              frame.setVisible(true);
         private static DefaultTableColumnModel createTestColumnModel()
              DefaultTableColumnModel columnModel=new DefaultTableColumnModel();
              columnModel.addColumn(new TableColumn(0));
              return columnModel;
         static class TestTableModel extends AbstractTableModel
              public int getColumnCount()
                   return 1;
              public Class<?> getColumnClass(int columnIndex)
                   return String.class;
              public String getColumnName(int column)
                   return "col";
              public int getRowCount()
                   return 1;
              public Object getValueAt(int row, int col)
                   return "test";
              public void setValueAt(Object aValue, int rowIndex, int columnIndex)
    }Edited by: 802416 on 14-Oct-2010 04:29
    added                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

    Kleopatra wrote:
    jduprez wrote:
    See http://download.oracle.com/javase/6/docs/api/javax/swing/table/TableColumn.html#setHeaderValue(java.lang.Object)
    When the TableColumn is created, the default headerValue  is null
    So, the header ends up rendered as an empty label (probably of size 0 if the JTable computes its header size based on the renderer's preferred size).nitpicking (can't resist - the alternative is a cleanup round in some not so nice code I produced recently <g>):
    - it's not the JTable's business to compute its headers size (and it doesn't, the header's the culprit.) *> - the header should never come up with a zero (or near-to) height: even if there is no title shown, it's still needed as grab to resize/move the columns. So I would consider this sizing behaviour a bug.*
    - furthermore, the "really zero" height is a longstanding issue with MetalBorder.TableHeaderBorder (other LAFs size with the top/bottom of their default header cell border) which extends AbstractBorder incorrectly. That's easy to do because AbstractBorder itself is badly implemented
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6459419
    Thanks for the opportunity to have some fun :-)
    JeanetteNo problem, thanks for the insight :)

  • HT5625 How can i find my id with only email?

    I've got the old id but cannot remember any thing except email address, how can i find the apple id with only email?

    CCC

  • Video plays with only a green and purple screen.  PLEASE HELP

    I rented a movie from the store, but when I pushed play, I only see a purple and green screen with lines that flash. I can hear audio, but can't see anything. It doesn't help to play the video in Quick Time either. I get the same problem. I am running windows XP. Please help!

    +I only see a purple and green screen with lines that flash.+
    With those symptoms, the first thing I'd try is the "Disable Direct3D acceleration in QuickTime" section from the following document:
    Troubleshooting iTunes for Windows XP and 2000 video playback performance issues

Maybe you are looking for

  • How do I stop iCal sending emails?

    I've added an exchange account to iCal.  However, it recently started sending massive amounts of "Declined" emails for events, some of which are far in the past (years ago.)  This happens for multiple events and multiple recipients.  I believe the pr

  • Automatic clearing not happening while doing invoice cancellation

    Hi All, When I reverse a billing document [normal invoice], the accounting document which gets generated is not getting cleared with the previous accounting document. The accounting document type in both original and reversal is u2018DDu2019. I have

  • Clearing of AR items (FB05) - Error (F15 113)

    Dear Experts, Greetings. I have developed a BDC program for clearing  of AR items via FB05 tcode. For certain customers the BDC runs successfully and posting happens. But for certain customers we get the following error. Acct determination not define

  • Dreamweaver, XSLT question

    I'd like to duplicate a node. The duplicate has to be placed as the first child of the root. The original node has to remain intact. Is this possible with XSLT in Dreamweaver?

  • How To place two images in a obiee 11g Report Page header

    Hi , Greetings for the day!. I want to place two images (one at top left and another at top right ) above the table view . I am not sure how it is called as. i think it is page header . Can anyone let me know how to accomplish this ? Kind Regards Sud