ROW_NUMBER() and complex expression of ORDER BY

Hi everybody,
I am getting confused and can not figure out how to incorporate different sort order (ASC or DESC) into this complex expression. I can possible do this using IF /ELSE construct but I am not sure I like it.
I am re-writing the stored procedure I wrote 2 weeks ago to incorporate server side paging rather than client site. I have ng-grid working fine and filtering / paging quite quickly client side, but an account can have 400,000 invoices and sending all of
this to the client doesn't seem right.
So, this is what I wrote so far and I am confused as how to add asc/desc order into that procedure:
ALTER PROCEDURE dbo.siriussp_GetAccountInvoices
(@acctName CHAR(10),
@Finalized BIT = 0,
@PageSize INT = 15,
@PageNumber INT = 1,
@SearchText VARCHAR(max) = '',
@OrderBy VARCHAR(20) = '',
@SortOrder VARCHAR(4) = 'ASC',
@TotalRows INT OUTPUT)
AS
BEGIN
SET NOCOUNT ON;
IF OBJECT_ID('TempDb..#AccountInvoices', N'U') IS NOT NULL DROP TABLE #AccountInvoices;
SELECT i.invoice_no, i.descrip1 as Descrip, i.hidden, i.finalized, i.date_time as Created,
COALESCE(Bal.Balance,0) as Balance, ROW_NUMBER() OVER (ORDER BY
CASE WHEN @OrderBy ='InvoiceNo' OR @OrderBy = '' THEN i.invoice_no END,
CASE WHEN @OrderBy = 'Descrip' THEN i.descrip1 END,
CASE WHEN @OrderBy = 'Balance' THEN Bal.Balance END,
CASE WHEN @OrderBy = 'Created' THEN i.date_time END) AS Rn
INTO #AccountInvoices
FROM dbo.invoices i
OUTER APPLY (SELECT SUM(extension) as Balance FROM dbo.transact t
WHERE t.invoice_no = i.invoice_no) Bal
WHERE i.account = @acctName
AND (@Finalized = 0 OR (@Finalized = 1 and i.finalized = 1))
AND (@SearchText = '' OR (CAST(i.invoice_no AS VARCHAR(17)) LIKE @SearchText + '%' OR i.descrip1 LIKE '%' + @SearchText + '%'
OR CAST(Bal.Balance AS VARCHAR(20)) LIKE @SearchText + '%'))
OPTION (RECOMPILE);
SET @TotalRows = @@ROWCOUNT;
SELECT * FROM #AccountInvoices WHERE Rn >= (@PageNumber-1) * @PageSize AND Rn < @PageNumber * @PageSize
ORDER BY Rn;
END
Thanks in advance.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles

I like that, quite creative.
My current procedure is simple enough, I think, although I am not sure that using temp table is a very good idea, but I don't see lots of alternatives. One account can have up to 400000 (or more) invoices for big clients. My current test database only has
28 invoices per account (it's a maximum). I would also want to somehow figure an approach of doing client vs. server side paging on the fly (depending on total numbers) as it seems a bit silly to go to the server for next 15 rows while we have only 30 in total.
That (applying 2 separate approaches on the fly) will be a challenge in itself.
Anyway, here is my current procedure and I'd welcome advices of improving it. The client side filtering right now applies 'contains' filter against all 4 columns but I think it's wrong and we better use filter for only 3 columns (excluding the date column)
and use starts with for the invoice number or balance rather than include.
ALTER PROCEDURE dbo.siriussp_GetAccountInvoicesWithPaging
(@acctName CHAR(10),
@Finalized BIT = 0,
@PageSize INT = 15,
@PageNumber INT = 1,
@SearchText VARCHAR(max) = '',
@OrderByColumn VARCHAR(20) = '',
@SortOrder VARCHAR(4) = 'ASC',
@TotalRows INT OUTPUT)
AS
BEGIN
SET NOCOUNT ON;
IF OBJECT_ID('TempDb..#AccountInvoices', N'U') IS NOT NULL DROP TABLE #AccountInvoices;
CREATE TABLE #AccountInvoices (invoice_no numeric(17,0) NOT NULL,
Descrip VARCHAR(25) COLLATE DATABASE_DEFAULT NOT NULL,
hidden BIT NOT NULL, finalized BIT NOT NULL, Created DATETIME NULL,
Balance MONEY, Rn Int)
DECLARE @Sql NVARCHAR(MAX);
SET @Sql = 'SELECT i.invoice_no, i.descrip1 as Descrip, i.hidden, i.finalized, i.date_time as Created,
COALESCE(Bal.Balance,0) as Balance, ROW_NUMBER() OVER (ORDER BY ' +
CASE WHEN @OrderByColumn ='InvoiceNo' OR @OrderByColumn = '' THEN 'i.invoice_no'
WHEN @OrderByColumn = 'Descrip' THEN 'i.descrip1'
WHEN @OrderByColumn = 'Balance' THEN 'Bal.Balance'
WHEN @OrderByColumn = 'Created' THEN 'i.date_time' END
+ CASE WHEN @SortOrder = 'DESC' THEN ' DESC' ELSE '' END + ') AS Rn
FROM dbo.invoices i
OUTER APPLY (SELECT SUM(extension) as Balance FROM dbo.transact t
WHERE t.invoice_no = i.invoice_no) Bal
WHERE i.account = @acctName ' +
CASE WHEN @Finalized = 0 THEN '' ELSE ' AND i.finalized = 1' END +
CASE WHEN @SearchText = '' THEN '' ELSE ' AND (CAST(i.invoice_no AS VARCHAR(17)) LIKE @SearchText + ''%''
OR i.descrip1 LIKE ''%'' + @SearchText + ''%''
OR CAST(Bal.Balance AS VARCHAR(20)) LIKE @SearchText + ''%'')' END;
PRINT @SQL;
INSERT INTO #AccountInvoices (invoice_no, Descrip, hidden, finalized, Created, Balance, Rn)
EXECUTE sp_executeSQL @Sql, N'@acctName CHAR(10), @SearchText VARCHAR(max)', @acctName = @acctName, @SearchText = @SearchText;
SET @TotalRows = @@ROWCOUNT;
SELECT * FROM #AccountInvoices WHERE Rn >= (@PageNumber-1) * @PageSize AND Rn < @PageNumber * @PageSize
ORDER BY Rn;
END
/* Test
DECLARE @TotalRows INT = 0
execute dbo.siriussp_GetAccountInvoicesWithPaging @acctName = '*GUESTS*', @Finalized = 0,
@TotalRows = @TotalRows OUTPUT, @SearchText = '', @SortOrder = 'DESC', @OrderByColumn = 'Balance'
SELECT @TotalRows
Hmm, I thought I commented out print @SQL, but apparently I didn't.
I am also thinking I'd add a check for ISNUMERIC(@Search) because otherwise there is no need to compare balances and invoices.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles

Similar Messages

  • How does one sync the new time capsule with the old airport extreme and airport express in order to extend range?

    How does one sync the new time capsule with the old airport extreme and airport express in order to extend range?

    Thanks for the additional information.
    Unfortunately, the AirPort Utility application in the Lion and Mountain Lion operating systems, which is used to configure the new Time Capsule does not support the older versions of the products that you have.
    Even if it did, there are no settings on the older AirPorts to "Extend a wireless network", so they are not compatible with the new Time Capsule if you intend to extend the network only using wireless connections.
    If you have the ability to connect each AirPort to the Time Capsule using a permanent wired Ethernet cable connection, it might be possible to use a complicated workaround to install an older version of AirPort Utility to configure the older AirPorts to work with the new Time Capsule.
    If you have another Mac there that is using the Leopard or Snow Leoapard operating system, things would likely be simpler. I have not done this type of procedure to mix a new Time Capsule with older AirPorts, so I would not be able to say whether this would work or not.

  • Dumb with Wirless and Airport Express

    I have thought about purchasing an airport express for a while so that I could play music from my desktop which is connected to a cable modem on my component stereo. By a stroke of Christmas spirit a friend of mine gave me his airport express because he no longer needs it.
    In order to do make this work, do I need to buy a router and a wireless usb adapter for my desktop despite proximity to modem…. Or can I get by with simply the wireless USB adapter and airport express.

    In order to do make this work, do I need to buy a router and a wireless usb adapter for my desktop despite proximity to modem…. Or can I get by with simply the wireless USB adapter and airport express.
    Good news, the AirPort Express Base Station (AX) is a wireless router so you don't need to acquire another to make this work. However, you will need to add wireless capability to the desktop.
    Your network configuration would be something like the following:
    Cable modem > (Ethernet cable) > [Ethernet port] AX > (wireless) > PC, AND
    AX [Audio port] > (Audio cable) > Stereo
    OR
    Cable modem > (Ethernet cable) > [Ethernet port] PC > (wireless) > AX [Audio port] > (Audio cable) > Stereo

  • MTO(Diff between complex make to order and sales order based mass prod)

    Hi
    We are using MTO...Can anyone tell me what is the Diff between complex make to order and sales order based mass prod in finance perspective?

    Hi,
    In the case of complex make to order scenario, through MRP, the Project shall be assigned to the sales order. Then there will be milestone billling and all. In the case of mass production MTO, it is only creation of production order for each sales order item and each sales order item shall have sales order cost estimate.
    Trust this helps much and do encourage our efforts!
    Cheers!
    Edited by: Ashok Singh on Oct 28, 2008 6:53 PM

  • Qualify row_number over(Partition by col order by col) and char2hexint() functions in informatica

    How to implement qualify row_number over(Partition by col order by col) and char2hexint in informatica in a way that is supported by pdo?
    Apart from sql overriding or using stored procedure ,is there any other solution?Can rank transformation help here? ....But, I guess rank transformation cannot be pushed down..
    help please !

    Hi Saichand,
    The links were helpful. But i am not getting how it is working in test and not in live.
    I found one difference while deploying . The column names of the object both in Test and Production had spaces.For E.g: Full Name
    When this column Full Name is pulled to the repsository in test , it automatically put double quotes for the column names in the physical sql when it hits the database.
    But, In production , when I pulled the column the report gave error as Invalid Identifier since OBIEE generated column name as Full Name without double quotes.
    Then I changed the column in Phyiscal Layer repository by having double Quotes for all columns. Afte that report worked fine.
    Whether this has caused any issue in Row Partition.
    Is there any setting to have column name in Double Quotes ?
    Thanks,
    Johnny

  • Understanding row_number() and using it in an analytic function

    Dear all;
    I have been playing around with row_number and trying to understand how to use it and yet I still cant figure it out...
    I have the following code below
    create table Employee(
        ID                 VARCHAR2(4 BYTE)         NOT NULL,
       First_Name         VARCHAR2(10 BYTE),
       Last_Name          VARCHAR2(10 BYTE),
        Start_Date         DATE,
        End_Date           DATE,
         Salary             Number(8,2),
       City               VARCHAR2(10 BYTE),
        Description        VARCHAR2(15 BYTE)
    insert into Employee(ID,  First_Name, Last_Name, Start_Date,                     End_Date,                       Salary,  City,       Description)
                 values ('01','Jason',    'Martin',  to_date('19960725','YYYYMMDD'), to_date('20060725','YYYYMMDD'), 1234.56, 'Toronto',  'Programmer');
    insert into Employee(ID,  First_Name, Last_Name, Start_Date,                     End_Date,                       Salary,  City,       Description)
                  values('02','Alison',   'Mathews', to_date('19760321','YYYYMMDD'), to_date('19860221','YYYYMMDD'), 6661.78, 'Vancouver','Tester')
    insert into Employee(ID,  First_Name, Last_Name, Start_Date,                     End_Date,                       Salary,  City,       Description)
                 values('03','James',    'Smith',   to_date('19781212','YYYYMMDD'), to_date('19900315','YYYYMMDD'), 6544.78, 'Vancouver','Tester')
    insert into Employee(ID,  First_Name, Last_Name, Start_Date,                     End_Date,                       Salary,  City,       Description)
                  values('04','Celia',    'Rice',    to_date('19821024','YYYYMMDD'), to_date('19990421','YYYYMMDD'), 2344.78, 'Vancouver','Manager')
    insert into Employee(ID,  First_Name, Last_Name, Start_Date,                     End_Date,                       Salary,  City,       Description)
                  values('05','Robert',   'Black',   to_date('19840115','YYYYMMDD'), to_date('19980808','YYYYMMDD'), 2334.78, 'Vancouver','Tester')
    insert into Employee(ID,  First_Name, Last_Name, Start_Date,                     End_Date,                       Salary, City,        Description)
                  values('06','Linda',    'Green',   to_date('19870730','YYYYMMDD'), to_date('19960104','YYYYMMDD'), 4322.78,'New York',  'Tester')
    insert into Employee(ID,  First_Name, Last_Name, Start_Date,                     End_Date,                       Salary, City,        Description)
                  values('07','David',    'Larry',   to_date('19901231','YYYYMMDD'), to_date('19980212','YYYYMMDD'), 7897.78,'New York',  'Manager')
    insert into Employee(ID,  First_Name, Last_Name, Start_Date,                     End_Date,                       Salary, City,        Description)
                   values('08','James',    'Cat',     to_date('19960917','YYYYMMDD'), to_date('20020415','YYYYMMDD'), 1232.78,'Vancouver', 'Tester')I did a simple select statement
    select * from Employee e
    and it returns this below
    ID   FIRST_NAME LAST_NAME  START_DAT END_DATE      SALARY CITY       DESCRIPTION
    01   Jason      Martin     25-JUL-96 25-JUL-06    1234.56 Toronto    Programmer
    02   Alison     Mathews    21-MAR-76 21-FEB-86    6661.78 Vancouver  Tester
    03   James      Smith      12-DEC-78 15-MAR-90    6544.78 Vancouver  Tester
    04   Celia      Rice       24-OCT-82 21-APR-99    2344.78 Vancouver  Manager
    05   Robert     Black      15-JAN-84 08-AUG-98    2334.78 Vancouver  Tester
    06   Linda      Green      30-JUL-87 04-JAN-96    4322.78 New York   Tester
    07   David      Larry      31-DEC-90 12-FEB-98    7897.78 New York   Manager
    08   James      Cat        17-SEP-96 15-APR-02    1232.78 Vancouver  TesterI wrote another select statement with row_number. see below
    SELECT first_name, last_name, salary, city, description, id,
       ROW_NUMBER() OVER(PARTITION BY description ORDER BY city desc) "Test#"
       FROM employee
       and I get this result
    First_name  last_name   Salary         City             Description         ID         Test#
    Celina          Rice         2344.78      Vancouver    Manager             04          1
    David          Larry         7897.78      New York    Manager             07          2
    Jason          Martin       1234.56      Toronto      Programmer        01          1
    Alison         Mathews    6661.78      Vancouver   Tester               02          1 
    James         Cat           1232.78      Vancouver    Tester              08          2
    Robert        Black         2334.78     Vancouver     Tester              05          3
    James        Smith         6544.78     Vancouver     Tester              03          4
    Linda         Green        4322.78      New York      Tester             06           5
    I understand the partition by which means basically for each associated group a unique number wiill be assigned for that row, so in this case since tester is one group, manager is another group, and programmer is another group then tester gets its own unique number for each row, manager as well and etc.What is throwing me off is the order by and how this numbering are assigned. why is
    1 assigned to Alison Mathews for the tester group and 2 assigned to James Cat and 3 assigned Robert Black
    I apologize if this is a stupid question, i have tried reading about it online and looking at the oracle documentation but that still dont fully understand why.

    user13328581 wrote:
    understanding row_number() and using it in an analytic functionROW_NUMBER () IS an analytic fucntion. Are you trying to use the results of ROW_NUMBER in another analytic function? If so, you need a sub-query. Analuytic functions can't be nested within other analytic functions.
    ...I have the following code below
    ... I did a simple select statementThanks for posting all that! It's really helpful.
    ... and I get this result
    First_name  last_name   Salary         City             Description         ID         Test#
    Celina          Rice         2344.78      Vancouver    Manager             04          1
    David          Larry         7897.78      New York    Manager             07          2
    Jason          Martin       1234.56      Toronto      Programmer        01          1
    Alison         Mathews    6661.78      Vancouver   Tester               02          1 
    James         Cat           1232.78      Vancouver    Tester              08          2
    Robert        Black         2334.78     Vancouver     Tester              05          3
    James        Smith         6544.78     Vancouver     Tester              03          4
    Linda         Green        4322.78      New York      Tester             06           5... What is throwing me off is the order by and how this numbering are assigned. why is
    1 assigned to Alison Mathews for the tester group and 2 assigned to James Cat and 3 assigned Robert Black That's determined by the analytic ORDER BY clause. Yiou said "ORDER BY city desc", so a row where city='Vancouver' will get a lower namber than one where city='New York', since 'Vancouver' comes after 'New York' in alphabetic order.
    If you have several rows that all have the same city, then you can be sure that ROW_NUMBER will assign them consecutive numbers, but it's arbitrary which one of them will be lowest and which highest. For example, you have 5 'Tester's: 4 from Vancouver and 1 from New York. There's no particular reason why the one with first_name='Alison' got assinge 1, and 'James' got #2. If you run the same query again, without changing the table at all, then 'Robert' might be #1. It's certain that the 4 Vancouver rows will be assigned numbers 1 through 4, but there's no way of telling which of those 4 rows will get which of those 4 numbers.
    Similar to a query's ORDER BY clause, the analytic ORDER BY clause can have two or more expressions. The N-th one will only be considered if there was a tie for all (N-1) earlier ones. For example "ORDER BY city DESC, last_name, first_name" would mena 'Vancouver' comes before 'New York', but, if multiple rows all have city='Vancouver', last_name would determine the order: 'Black' would get a lower number than 'Cat'. If you had multiple rows with city='Vancouver' and last_name='Black', then the order would be determined by first_name.

  • Oracle BPM / SOA Suite and Big and Complex Scenarios

    Hi people,
    I have worked for a company that in the past chose Oracle BPM (ALBPM at the time) and one of the big problems that the company had was in relation about big processes and complex scenarios.
    This company is for the e-commerce area and our processes can have many instances at the same time, for example, a process to all the "order flow" can have thousands, maybe millions instances at the same time.
    So we choose to abort the BPMS option in the past and now we back to talk again about BPMS and one question is always made by the company board: if we use BPM again, the new versions can be support all the our volume data?
    To be honestly, I don't have this answer so I like to know if any people here has a paper or report about Oracle BPM 11g and big scenarios with many instances. If anybody has a case too, it will be relevant.
    Another and the final question: how does the oracle bpm engine treats the case when my engine reboots and before that the engine had many instances active? The istances will be lost?

    11g ADF is not certified with 10g SOA Suite. What I mean by this is that your 11g ADF will need to run on WLS 10.3.1 and SOA Suite 10g will eith run on oc4j or WLS 9.2.
    ADF is just JDeveloper, you deploy to WLS 11g (10.3.1).
    This is the most detailed 10g SOA Suite guide I know for 10g
    http://download.oracle.com/docs/cd/E10291_01/core.1013/e10294/toc.htm
    note that it is for 10.1.3.3, you just need to subsitute for 10.1.3.5 (latest release)
    cheers
    James

  • Computer Sound and Airport Express out of Sync

    Hi, i have a W7-Computer in the living room connected to the Hi-Fi system and the TV and several Airport Express to stream the music to other rooms (e.g. kitchen). Till recently i used a very old Stereo-Amp and everything was fine, the music in the living room and in the kitchen were perfectly in sync. Now i had to change to a new Home Cinema Receiver (ONKYO TX-NR609) and probably because of the data processing the Receiver does there is a delay, so that the music in the kitchen is slightly ahead of the one in the living Room. I tried different connections between Computer and Receiver (now using optical-link) and different music modes the receiver has (Stereo, Direct, Pure Audio) but didnt manage to sync it again. Does anybody have an idea? Is there a way to delay the transmission from iTunes to the Airport Express, in order to leave the Receiver enough time to process the music?

    Use the analog output.
    The AX has an a terrible flaw: optical delay.
    Notes:
    Apple should be able to update this with software. Apple?
    I just tested this today with multiple recievers (onkyo TXSR508, sony STR-DH520).
    Also: be sure your reciever is not set to delay audio. It sounds like you may have already checked this b/c you mentioned pure audio (which is only for european models?): http://www.us.onkyo.com/model.cfm?m=TX-NR609&class=Receiver&p=d. Other people have had this problem and have fixed it by configuring a/v sync.
    See https://discussions.apple.com/message/15785854 for details on my issue.

  • Many pages and complex data model in JHS app

    I am using JHS to create an application containing data that is structured something like:
    - Country
    - Company
    - Department
    - Employee
    - Payments Details
    I have created entity and view objects corresponding to each of these and the appropriate accessors/view links. We need the user to be able to search, work on data and 'drill down' from any level (not always starting with company). In order to make this possible my JHS application has 5 'top level' tabs corresponding to each of the above entities. From each of these top level pages users can drill down to the children.
    This works but we end up with many pages and a large data model with lots of replication and nesting.
    Country - 5 pages
    Company - 4 pages
    Department - 3 pages
    Employee - 2 pages
    Payments - 1 page
    total 15
    You can picture how the data model is structured. Obviously this is a very simple example but I hope it illustrates my concerns. We have so many pages that post-generation changes are going to be difficult to manage. I'm also worried about the size and complexity of the data model. In this case views are almost all entity based so I guess the data is only cached once but supposing they were not?
    Are we using JHS in the best way ? perhaps I'm overcompilcating it ?
    I have started to rewrite the JHS generated application so that it (almost) always reuses the same top level generated pages (with some modifications). When the user wants to navigate to a child I modify the whereClause of the target ViewOjbect appropriately, reexecute it and forward to the corresponding 'top level' page. This approach seems to work well, cuts down the number of pages enormously and simplifies the data model (and has enabled me to put breadCrumbs in).
    In doing this though, am I creating work for myself that JSH could have done if we had used it differently in the fist place?

    This sounds like a valid approach in your situation. We have been playing with the idea of having something like 'Group Links' where you can generate navigation items from one group to the other. Then, you would need to have one, 5 level deep nested group, and 4 other top level groups to provide the search&select on each of the nested groups, but they themselves would not need to have nested groups, but a navigation link to the nested groups in the 5-level deep group.
    Although nice and simple in theory, the details are a bit tricky to work out with all the possible layout- and samePage settings, so we have not implemented this yet. So your approach seems a valid one. If you have any suggestions on a way to generate what you are now doing manually, we'll be interested.
    Kind regards,
    Peter Ebell
    JHeadstart Team

  • How to ignore nulls in analytic functions ( row_number() and count())

    how to ignore nulls in analytic functions ( row_number() and count())

    Iam attaching test data can any one help me please
    thanks in advanceeeee
    CREATE TABLE TEMP_table
    ACCTNUM NUMBER,
    l_DATE TIMESTAMP(3),
    CODE VARCHAR2(35 BYTE),
    VENDOR VARCHAR2(35 BYTE)
    insert into temp_table values (1,sysdate+1/60,'bso','v1');
    insert into temp_table values (1,sysdate+2/60,'bsof','v1');
    insert into temp_table values (1,sysdate+3/60,'bsof','v2');
    insert into temp_table values (1,sysdate+4/60,'','v1');
    ian executing this my ;
    SELECT acctnum,l_date,vendor,code_1,
           CASE
             WHEN code = 'bsof'
              AND COUNT (DISTINCT code) OVER (PARTITION BY acctnum, vendor) > 1
              AND row_number () OVER (PARTITION BY acctnum, vendor ORDER BY vendor, l_date) != 1
             THEN 'yes'
           ELSE 'no' END result
      FROM  (select  acctnum,l_date,vendor, code code_1, case when code IN ('bso', 'bsof') then code
      else null end code   from  TEMP_TABLE
    ORDER BY acctnum ,l_date);
    my result :
    1    3/23/2011 5:24:34.000 PM    v1    bso    no
    1    3/23/2011 5:48:36.000 PM    v1    bsof    yes
    1    3/23/2011 6:36:41.000 PM    v1    bsof    yes
    1    3/24/2011 11:55:53.000 AM    v1        no
    1    3/23/2011 6:12:38.000 PM    v2    bsof    no
    I need to eliminate nulls  in top query not in inner query (not using where condition in inner query)
    [\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Sample bom creation and explosion in sales order

    hi,
         can any one help to create a simple bom with atleast one sub item for the bom and create a sales order in which the bom explodes ( i mean when u enter the main bom item it should list its sub items as its line item below it)...
    (also mention what item categories are to be taken care ... )
    rewards for sure
    thanks
    mmn

    Hi MMn,
    Bill of materials (BOM)
    1. In the SAP System, you can use BOMs to represent different objects (such as materials, equipment, functional location BOMs, and documents) and to maintain object-specific data.
    2. Document BOM: A complex document may be made up of several documents, such as a program, technical drawings, papers, and photographs. These related information and documentation objects are grouped together as a unit using a document structure – a BOM for a document.
    3. Equipment BOMs are used to describe the structure of equipment and to assign spare parts to equipment for maintenance purposes. Bills of material for functional locations group together the elements of a technical structure, such as the functional unit of an entire plant.
    4. You work with order BOMs when you specially tailor the make-to-order production of your products to the requirements of your customers. In order to meet the customer requirements, sales order specific modifications to various assemblies are often required. Furthermore, assemblies are often specially constructed for a particular sales order.
    5. Before you can create a BOM for the component parts of an object, the object must have a valid master record in your system.
    6. A bill of material that you create for a material is known as a material BOM in the SAP System. A BOM explosion answers the question: What is the product made of? This question arises in various situations, such as when you want to:
    Determine material requirements for a product
    Look at the overall structure of a product in a design department
    See an overview of the parts and materials required
    Calculate the effects of changes to costs
    7. BOM is a collection of materials that make up a product. For example – computer, home theatre system. Material BOM is complex and is dependent on sales and distribution, material management or production planning.
    8. The most important rule is that the material type has to be a FINISHED PRODUCT (FERT) in order to categorise it as a BOM.
    9. BOM processing is divided into two different ways – either at the MAIN item level if the item is assembled or at the sub-item level (i.e. at the component level) if the material is not assembled.
    10. BOM is configured at the item category level (VOV7) and transaction code to create a BOM is CS01.
    11. In case of single level BOM, main item categories TAQ and TAP should represent single level BOM in VOV7 and in case of multi level BOM, the main item categories should represent multi level BOM.
    Main item level processing
    1. The material master records should have the item category group ERLA in the sales org.2 screen of the finished product. In this case, the associated sub items function only as text items, and thus are not relevant for delivery. This process ensures that pricing, inventory control and delivery processing is carried out the header level that is for the finished product only. This is mainly relevant to the assembled products.
    2. item category group – ERLA; main item category – TAQ (schedule line – CP) and sub item category – TAE (schedule line – CT)
    Sub-item level processing
    1. If the business prefers to have the sub-items be responsible for pricing, inventory control and delivery processing, the item category group should be LUMF on screen sales org.2 of the respective material master record. This ensures that subcomponents are relevant for processing. This is relevant to the products that are not assembled.
    2. item category group – LUMF; main item category – TAP (schedule line is CT), sub item category – TAN (schedule line is CP)
    Multi-level BOM
    In order to activate the multi-level BOM, structure scope in VOV7 has to be changed from single level explosion to multi level explosion.
    Try this and revert back fr clearifications
    Reward Points if helpful.
    Regards
    Srini

  • My devices not automatically switching between Airport Extreme and Airport Express in extended network

    I have setup an extended network in my home using an Airport Extreme and an Airport Express. The Extreme is connected directly to the FiOS modem and the Express is being used as the extender. The nework is setup fine, but my devices (MBA, iPhone, iPad) are not switching base stations when the signal becomes poor on the one it's connected to. For example, I am upstairs with my MBA and a great signal as I am connected to the Express. When I move downstairs to where the Extreme is setup, the Wi-Fi connection becomes poor even though I am litterally sitting next to the Extreme. To force it to connect to the Extreme, I need to shutoff the Wi-Fi on the MBA and turn back on. At this point, the MBA will connect to the Extreme with a excellent signal.
    Any thoughts on why the MBA is not automatically switching?
    Thanks for the help!
    Brian

    The first troubleshooting step for any kind of network "issue" is a complete power cycle of the network. This gives everything a "fresh start" with new connections.
    Power off the entire network.....all devices....in any order you want
    Wait a minute or two
    Start the modem/router first, and let it run a full minute
    Start the AirPort Extreme next and let it run a full minute
    Keep starting devices one at a time about a minute apart until the entire network is back up
    Check the network again with the MBA and report on your results
    Do not worry about the iPhone and iPad....they are pretty much hopeless as far as automatically switching from one access point to another....but the MBA should if it is working correctly.

  • How to extend wifi range using Airport Extreme and Airport Express connected via ethernet cable

    Hello,
    I'm having an Airport Extreme fifth generation in my living room. I bought yesterday an Airport Express to extend the range of my WIFI in the house and I put in in my bed room. The two devices are connected together via an ethernet cable, from airport extreme (lan 1 port) to airport express to (wan port). Now from the airport utility what configuration I have to set to the airport express in order to extend my wifi range? Inside the wireless tab what i have to select in the network mode?
    1. Create a wireless network (use same same wireless network name and pass work as the airport extreme)
    2. Join a wireless network
    3 Extend a wireless network ?
    Thank you

    You are way overthinking this. The utility will literally configure everything for you automatically. All that you need to do is name the device and click Next during the setup.
    You can use your Mac using Mountain Lion or an iPhone or iPad.
    Post back if you need the steps.

  • ROW_NUMBER() and CONTAINS()

    Hello,
    I'm having a bit of bother with a view that uses ROW_NUMBER() and a query that uses CONTAINS().
    I have a table A (A INTEGER, B VARCHAR2) and view V_A:
    SELECT A, B, ROW_NUMBER() OVER (ORDER BY A) N
    If I execute a query
    SELECT * FROM V_A WHERE CONTAINS(B, 'X')>0
    it doesn't matter what I put in X. The query simply ignores the CONTAINS()>0 clause.
    Does anybody know why this might be and if it is possible to fix it?
    Thanks!

    CONTAINS() works well if I remove ROW_NUMBER() from the view. How did you define the index?
    I seem not even to be able to query a simple view using the contains operator (I am on 11g):
    SQL> create table emp_test as select * from emp
    Table created.
    SQL> create or replace view v_emp_test as select * from emp
    View created.
    SQL> create index emp_test_txt on emp_test (ename) indextype is ctxsys.context
    Index created.
    SQL> select * from emp_test where contains (ename,'SC%') > 0
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7788 SCOTT      ANALYST         7566 19-APR-87       3000                    20
    1 row selected.
    SQL> select * from v_emp_test where contains (ename,'SC%') > 0
    Error at line 0
    ORA-20000: Oracle Text error:
    DRG-10599: column is not indexed

  • Bridging network with AP Extreme base station and AP Express

    OK, here's the deal. I have an Airport Extreme Base Station on a WPA2 Personal network. Works great except that I want to boost the signal to the rest of the house. So, I bought an Airport Express. Airport Utility picks up both devices; but when I select the new Express to configure it, I get a msg asking to confirm that I want to switch networks. Well, I don't. I want to expand the network I have. Last night I did click "yes" and it was a disaster as I lost the Extreme altogether and the Express couldn't pick up a signal because - obviously - it wasn't connected to the ethernet cable as the base station, and also because (I think) the base station is configured to hide my SSID. I ended up working backwards and got the Extreme back to normal and put the Express back in its box until someone can tell me how to do this. I know Apple says it's easy; but it's a challenge for me. HELP!

    A few things:
    1. Please don't configure your base station to "hide its SSID". Doing this is absolutely useless as a security method. It will on the other hand complicate setup of your network, as well as the diagnosis of problems when they arise.
    2. You must allow the Airport Utility to switch networks during the process. What is happening is that the Airport Utility must temporarily switch your Mac's wireless network connection from your existing base station to the wireless network created by your unconfigured Airport Express in order to communicate with and configure that Airport Express. After the Airport Express configuration is complete - if your Mac doesn't automatically switch your Mac's wireless network connection back again then just do so manually from the MacOS Airport menu.
    3. To get a better understanding of what you are doing, start reading at page 42 of Apple's manual "Designing Airport Networks" found at:
    http://manuals.info.apple.com/en/DesigningAirPort_Networks_Using_AirPortUtility.pdf

Maybe you are looking for