Sequence based on a Group

Hi,
I've got a table for example with following entries:
Col1, Col2
A 1
A 2
A 3
B 1
B 2
C 1
C 2
and I need an ID group based like
ID Col1 Col2
1 A 1
1 A 2
1 A 3
2 B 1
2 B 2
3 C 1
3 C 2
cheers,
Bernhard
Edited by: boffman on 17.02.2010 05:59

You can use the analytic function row_number, I would post a link to the documentation reference, but the manuals have been down so long I think people at Oracle have stopped using them as well as everyone else.
SQL> with the_data as
  2      (
  3      select 'A' a, 1 b from dual union all
  4      select 'A', 2 from dual union all
  5      select 'A', 3 from dual union all
  6      select 'B', 1 from dual union all
  7      select 'B', 2 from dual union all
  8      select 'C', 1 from dual union all
  9      select 'C', 2 from dual
10      )
11  select
12      a, b,
13      row_number () over (partition by a order by b) seq
14  from the_data;
A          B        SEQ
A          1          1
A          2          2
A          3          3
B          1          1
B          2          2
C          1          1
C          2          2
7 rows selected.

Similar Messages

  • Restrict Sales order text based on Sales group

    Hi,
       My requirement is currently 12 different text ID's showing in my sales order text.But I want to restrict certain sales order text ID's based on sales group entered in the sales order header. Is there is any user exit or routines available to restrict sales order text ID's.
    Regards,
    Palani

    Hi,
    This is actually a configuration item.  Transaction VOTXN (VOTX in 4.6C) can be used to configure the text types, text procedures, and access sequences for sales order texts as well as other types of texts.  Part of the configuration procedure allows for some ABAP control over the copying requirements. 
    This is from the online help for data element COPNR (on the VOTXN screen SAPMV80T 800, field TTXZI-COPNR) :
    You can create your own routines for text determination. For example, if you want to send different messages to particular groups of customers, you can create routines that automatically assign different messages to different groups (e.g. wholesalers, retailers).
    Note
    The fields available for determining texts are defined in structure TVCOM, which can be found in the routine under FTVCOM. Generally, however, the fields filled in the structure are only those which are used or recognised for text determination by the caller. Other fields can, for example, be filled during sales document processing via user exits USEREXIT_MOVE_FIELD_TO_TVCOM_H and USEREXIT_MOVE_FIELD_TO_TVCOM_I. The user exits are described in the IMG under Sales and Distribution -> System Modification -> User exits.
    I'm not sure if filtering by sales group is possible, but I don't see why not.
    Regards,
    Jamie

  • ACS 5.3 Group Mapping based on AD group membership

    Hi,
    I am configuring a new ACS 5.3 system. Part of the rules is that I want to match the users specific AD group membership, and match appropriatly to an identity group.
    What i'm trying to do is say that if the user is a member of the AD Group (G-CRP-SEC-ENG) then associate them with the Identity Group SEC-ENG. The under the access service, authorization portion, i assign shell profiles and command sets based on Identity Group.
    It seems that the ACS server will not match the AD Group for the user, and it will match the Default of teh Group Mapping portion of the policy every time.
    I tried several configuration choices from : AD1:ExternalGroups contains any <string showing in AD>, AD1:memberOf <group>.
    Is there something special i need to do in the Group Mapping Policy to get it to match and active directory group and result in assigning the host to an Identity Group?
    Thank you,
    Sami

    Ok, my case is like this.
    I use ACS 5.3 for VPN authentication, using AD and an external RSA for token authentication (2 factor authentication)
    I didn't add all the VPN users in the ACS, because it will be troublesome, the users authentication will be managed by AD and RSA server.
    In some cases where we need to restrict a group of user to only access certain resources, downloadable ACL is used.
    Following the Cisco docs, i manage to get downloadable ACL works when the authorization profile matching criteria is username, but when i change the matching criteria to Identity group, the downloadable ACL won't work.
    I have a case with Cisco engineer now and still in the middle to sort things out.
    The advice from the Cisco engineer is to have the Access Service set to Internal User instead of RSA server, but that will require us(the admin) to import all the VPN users into the ACS database.
    Wondering whether there is a fix for this.
    Thanks.

  • How to create a sequence based on name, country, city, year, month, number

    Hello,
    I am using Application Express 4.2.1.00.08
    I am new to apex and i need some help in creating a sequence.
    I am creating an application where i profile people and i need to create an auto sequence that when the person is added to the database he will have his own sequence based on his name, country, city, year he was added, month he was added and his number.
    This is a bit tricky because each person will have a different name, country city etc.
    How can this be done ?

    Hello,
    I have to create a sequence so that when for example an employee is added using a form his ID will be saved based on his name, country, city, year he was created, month he was created and his number.
    However, each employee is diff, so when you add another employee to the form his ID will be different, different name, country, city etc..
    This has to be automatically generated.. is this possible?

  • Spliting a table in to two table based on the groups in SSRS

    Hi,
    I am trying to a split a rows accross two tables based on a group.
    So far I have added a list and added a row group and grouped it using lineof business
    Inside my list i have two identical tables so i can display the data
    for the first table i have set the row visibility as follows: where LineOfbusiness1 is the  groupname of my list group
    =RowNumber(Nothing) >= (IIf(CountRows("LineOfBusiness1")\2 = 1, CountRows("LineOfBusiness1")/2, (CountRows("LineOfBusiness1")/2)+1))
    and for the second table in the i have set the row visibility as follows
    =RowNumber(Nothing)< (IIf(CountRows("LineOfBusiness1")\2 = 1,CountRows("LineOfBusiness1")/2, (CountRows("LineOfBusiness1")/2)+1))
    this set up works fine for the first group but it doesnt display the data the way i want for the subsequent groups.
    so how do i have the table start over after each group... plus in my group i have specified to do a page break after everygroup...
    Any help will be appreciated.
    Thanks
    Karen

    Visakh,
    Thanks for answering.... a sample for the data will look like
    dataset----
    create table #dataset
    Code varchar(5),
    Name varchar(200),
    Lineofbusiness int,
    Statename varchar(10),
    typed int,
    description varchar(2000)
    insert into #dataset
    select 45111,abc,1,AL,4500,policies
    insert into #dataset
    select 45111,abc,1,AL,2500,vehiles
    insert into #dataset
    select 45111,abc,1,AL,3,drivers
    insert into #dataset
    select 45000,bca,2,AL,4500,policies
    insert into #dataset
    select 45000,bca,2,AL,500,house
    insert into #dataset
    select 45000,bca,2,AL,40,theft
    When i display the data i want it to be
    Line of business 1
    policies 4500 drviers 3
    vehiles 2500
    Line of business 2
    Policies 4500 theft 40
    House 500
    but right now the for lineofbusiness 1 its showing the correct way for but the line 2 everything is being displayed in the right.
    Thanks
    Karen

  • PO Qty restruction based on purchase group

    Hi experts
    Can you provide me solution on this requirement that restruction on purchase order qty based on purchase group,
    in detail my user want that if i entered purchase group XYZ ,then for that purchase order po qty system should not allow more than 1 qty for 1234 company code .
    is there any solution for this requirement
    Kumar

    Hi,
    Can you please elaborate? The purchase group is on the Header of the PO. When you say that the quantity needs to be restricted to only 1, does that mean that only one item is allowed on the PO with Qty 1 or multipel items are allowed but each of the items can have quantity as 1?
    Also, the exit ME_PROCESS_PO_CUST is active only in the online mode for ME21N and ME22N. If you have any background jobs generating a PO (Planning ME59N etc.) the exit does not work.
    Regards,
    Naveen

  • How to change the values in custom profiles based on security group ??

    Hi,
    i am facing problem for my requirement, can anybody help me for below scenario...
    i have custom check in profiles , there are content types and sub types. sub type nothing but a categories on for particular content type. For example i have News content type , same in the below subtypes drop down list are press release, events, articles etc.
    what i want to do is, when i open custom checkin profile, subtype values need to be changed( some values in subtype should hide) based on security group changes .
    In the Sub type listed values, some values need to hide only when i choose different security groups.. sub types values should display based on the particular security group only. when ever i change the security group, drop down Values in subtypes needs to change.
    hope understand my requirement.
    How to achieve this task. Any help would be greatly appreciated.
    Thanks,
    yt

    Hi,
    Thanks alot. its working fine
    Can we configure DCL Relation two times in one information filed ??? i should not create not more than fields to this requirement.
    Type -> subtype = DCL already existed
    Now, i want to Create DCL to
    Subtype ---> Security group
    As per my requirement, if i change the security group in checkin form, values should be change in the SubType drop down list.
    Created checkin profile there was DCL relation to " Type and "Sub Type" . now i want to map Relation ( DCL ) for subtype to security group.
    i was trying do for DCL for subtype and security group. but there was already existing DCL created for subtype information field (Relation configuration done for content type). even though i was trying to do for DCL in Security group information field. but, i could not find security group information field in configuration manager.
    Now what should i do ?? how to create DCL to subtype and security group ??
    Help would be appreciated.
    yt

  • GL account master data creation control based on Account group

    While creating GL account in FS00 we need to control to select P&L account or Balance sheet account. At present after selecting P&L accunt group it is allowing to check Balance sheet account. If we select account group belongs to Balance sheet but it is allowing to check P&L. How to control to select P&L or Balance based on account group.
    For example: If we select account group beongs to P&L it should allow to check P&L statement account.
    If we select account group belongs to BS it should allow to check Balance sheet account

    I don't there is any control for this at 'Account Group' level, please use userexit EXIT_SAPMF02H_001 for this.
    Regards,
    Ganesh

  • Commision based on item group & customer group

    Dear all,
    Does anyone have an idea about how to get commission based on item group & customer group sales?
    My customer wanted commission report based on item group or customer group & based on payment collection dated.
    Example
    Term given for customer A is 30 days.
    12/3/09 Inv 1000   RM 10,000   30 days payment
    20/4/09 Inv 2000  RM    5,000   60 days payment
    The term given is 30 days of the invoice month.
    Salesman will get commission if get the collection at May'09 for Inv 1000, & July'09 for iinv 2000 based on the invoice date month.
    The salesman get commission at any date of the month May'09. More longer collection, less commission they will get.
    Example:
    Salesman A
    Customer Group             1st of the month, 2nd of the month, 3rd of the month, 4th of the month
    Normal Dealer                         1.5%         ,  0.75%,              0.00%                   ,    -0.25%
    Sub Distributor                       0.5%         ,  0.25%,               0.00%                  ,    - 0.25%
    Any idea?
    Thanks in advance?
    Regards,
    Eric Tan

    Hi Eric
    SAP does not calculate commissions, but merely provide a mechanism to report on it. The multi level calculation you require can be achived with a custom query linked to a report layout. Standard SAP will not provide this type of calculation. You will need to look at the open transactions such as invoices and link to the relevant payment transaction to get the payment date. Then compare this date to the invoice due date to determine if the terms were adhered to or not. If not payment date - due date in number of days will be needed to calculate the effective commission percentage.
    Kind regards
    Peter Juby

  • RH8 browse sequence based on TOC not working as expected

    I have several standalone projects for which RoboHelp's browse sequence tool correctly generates the browse sequence based on the TOC using a book level of 0 (zero) so that it picks up everything in order.  If a project has books A and B (which are not themselves topics), and each book has two subtopics, A1, A2, B1, B2, the TOC-based browse sequence is A1, A2, B1, B2.  For a project I inherited (originally designed as 40 separate merged projects that I combined into a single .xpj project), "books" A and B for the example above are also topics.  When I generate the browse sequence based on the TOC using zero for the book level, instead of getting A, A1, A2, B, B1, B2, I get A, B, A1, A2, B1, B2.  The TOC runs through all 1st level items first, cycles back through all 2nd level item, then 3rd level, etc.  Has anyone seen this before?  Any ideas how to fix it?  Does the problem have anything to do with the fact that the "books" in this project are also "topics"?

    Create a new TOC and make it a copy of the existing TOC.
    Then remove the topics from the books and try again with the browse sequence.
    I don't know that will fix it but it is what I would try first.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Derivation of fund center based on purchasing group

    Hi,
    It is required to determine the fund center based on purchasing group (during PR creation). I  have gone through one thread which suggests inclusion of the field EKGRP into FMDERIVE, then to COBL.
       However I was trying to check whether it can be done through table lookup using field USERTEMP1 and assigning the same to EKGRP. But in the table lookup screen, the upper part contains the fields BANFN (Purchase Requisition Number) and BNFPO (Item Number of Purchase Requisition) which need to be assigned to source fields. I am not sure what source fields should be assigned and how it will  work.
    Request your input in this regard.
    Thanks in advance!
    Snigdho.

    Hi,
    I am trying to derive fund center based on purchasing group using field USERTEMP1. In the upper part of table lookup screen (I am using table EBAN) what should I assign to the fields BANFN and BNFPO?
    Thanks
    Snigdho

  • Shared Calendars / Room Lists and automatically forcing them to users based on Security Group Membership

    Good morning all,
    I need some help achieving the following in our Exchange 2013 Environment.  First off, we have Exchange 2013, but all our clients have Outlook 2010.
    Here's what I would like to be able to do:
    1) create/manage public calendars / rooms in exchange 2013
    2) force these shared public calendars / rooms to users' calendars who are members of particular security groups
    3) give edit permissions / "booking" permissions for the shared calendars so select users are able to make changes to the shared calendars, as well as accept/deny requests to "book" shared room calendars
    Any one got any resources they can give to point me in the right direction?
    I have already created two mailbox room resources, and have them set up in a room list in AD.  But need to know the above as far as creating a shared calendar for events, and forcing these calendars / room lists out to users based on security group
    membership.
    I don't want my users to have to know how to add a shared calendar...that would be a nightmare explaining.  I just want it to show up.
    Any help on this is greatly appreciated, thank you!

    1) I recommend using Room Mailboxes for resource calendars because it just works better.
    2) This is a standard feature of a Room Mailbox.
    3) You're pretty specific here, but I think this is also more or less available with a Room Mailbox combined with folder rights.
    I don't know any way to just make them "show up".  You'll have to teach them.  Well written instructions can work wonders.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • Splitting Purchase Order based on Loading Group.

    Hi,
    My client is a fashion retailer. They have two Loading Groups, General Merchendise that comes in cartons and Hung garments that com hung on hangers.
    PO`s are created for every Vendor by Follow-on processing of allocation or by replenishment run.
    It is desired to split our Purchase Orders based on loading group.  So that there is a separate PO for General Merchendise and Hung Garments. These can then be handled separately during GR and furthur processing.
    Would like to know how to configure this.
    Thanks
    Barry

    You need to Define Two PO document types one for General Merchendise and other for Hung garments
    and use BADI  ME_PROCESS_PO_CUST  and incorporate the Logic that
    for PO Type General Merchendise the Loading Group of Hung garments Not allowed and Similarly
    for PO type Hung garments the Loading group of General Merchendise not allowed ..

  • Contracts based on Material Groups....

    Can we create Contracts based on material Group?
    Like We want to create a contract for Material Group Casting. We want to negotiate terms for Material Group & then procure the part.
    How do we do this?
    Thanks Anupam

    Create a Quantiy Contract with Item Category 'M'- Material Unknown.
    Then create PO refering to this contract.
    System asks for material number or AAC. It also checks the material group against the one in the contract.
    By defaut a warning message is issued if material groups do not match (message MEPO074).
    This can be set to 'E' in customising but SAP gives a warning when you trying to set this message as error.
    Customising path: SPRO>MM>Purchasing>Environment>Define attributes of system messages.
    It is also possible to code this check in PO user exit and issue a custom message.

  • PO release strategy based on Material Group (CEKKO - MAKTL)

    Hi Experts,
    I have configure the Rel strategy based CEKKO-MATKL (material group) for purchase order, but when i raise the PO Rel strategy is not affecting, Can any body tell me why.
    Regards,
    Kumar

    You can set Release strategy based on Material group & other Line item specific fields..
    You better follow a suitable and hinder less process..
    For PR use Material group & Account Assignment based Release process..
    then for PO use a Release Process based on Header level fields like Doc type, Amount, pur Group etc..
    So that the approved PR line can be converted into PR and then the PO also subjected to Release before sending it to External Vendor..
    Even if you want you can make that the PO can not be created without referencing PR for SOme users or All users..
    based on your business requirement..

Maybe you are looking for

  • Why do the colors in images embedded in word (TIFF/JPEG) export off-color from Acrobat?

    I chose this forum as opposed to the printing and pre-press forum because I have a very limited existing knowledge of color space and profile matching and I didn't want to be (1) shunned and (2) overwhelmed by the level of technical detail. When I at

  • Using 'crossover' on mac to play PC games?

    Hi all, I would really like to play LOTR:battle for middle earth II on my mac. The problem is, its a pc game. I know there are a few applications that will allow me to use windows on my mac but I am worried about how this works. 1) If I install windo

  • 10.2.0.3 Rac upgrade to 11.2

    I have 10.2.0.3 Rac with 2 nodes, i want to upgrade to 11.2, Am not able to find the clusterware patch number to download.Can some one help me to get the patch number and steps for the complete upgrade(metalink note) Os version: Solaris 10 (64bit Spa

  • Tax Classification picking 1 and not 0 in sales order

    i changed the tax classification for MWST from 1 to 0 in customer master and raised a sales order, but the sales order is picking 1 for tax classification instead of 0. i have maintained the conditions for MWST using vk11 and i have specified 0 amoun

  • [SOLVED] Unable to install packages in lxc container

    tl;dr: lxc-console should be used for logging in, not lxc-attach. Also, I had to do some additional work to get the tty to work in systemd, and I plan to update the wiki soon. I created a container using the following command: # lxc-create -n test -t