Generating number depending on the condition
Dear All,
I have table with following structure.
formno number(5)
name Varchar2(100)
centreno number(2)
rollno Varchar2(10)
I want to generate rollno depending on the following condition.
1. Roll number should be generated based on the centreno
2. Roll number should be generated based on the alphabets but not in a sqeuence.
For eg.
my data is like
form no name centreno rollno
200 A1 01 1
206 A2 01 4
502 A3 02 6
234 A4 03 10
400 B1 01 2
501 B2 02 7
788 C1 01 3
100 C2 02 8
343 C3 01 5
130 C4 02 9
232 C5 03 11
i.e. first I need to sort names alphabetically by centreno. But then I need generate number in a sequence that first A, B, C...Z will be generated. Then it starts again from A, B, C...Z for that centre. Then it will run same process for other centres.
Any ideas how to do this?
Regards
Trusha
Edited by: trusha on Oct 10, 2008 3:53 PM
Something like .. (for given sample data)
SQL> select * from test;
C1 C2 C3
200 A1 01
206 A2 01
502 A3 02
234 A4 03
400 B1 01
501 B2 02
788 C1 01
100 C2 02
343 C3 01
130 C4 02
232 C5 03
11 rows selected.
SQL> select c1,c2,c3,
2 row_number() over(order by c3,rn,c2) regno
3 from(
4 select c1,c2,c3,
5 row_number() over(partition by c3,substr(c2,1,1) order by c2) rn
6 from test)
7 order by c2;
C1 C2 C3 REGNO
200 A1 01 1
206 A2 01 4
502 A3 02 6
234 A4 03 10
400 B1 01 2
501 B2 02 7
788 C1 01 3
100 C2 02 8
343 C3 01 5
130 C4 02 9
232 C5 03 11
11 rows selected.
Edited by: jeneesh on Oct 10, 2008 4:51 PM
corrected
Similar Messages
-
Hiding text depending on the condition
Hi All,
I am new to reports, I want to know how can I hide and show text information depending on the condition....
Thanks,
Pavan.Then, u should kindly mention it pls to help others and state the version of reports u r using..!
Regards,
Abdetu.. -
Measure pulse width and generate pulse depends on the width
Hi,
i have a serias of pulses ... 600 micro,30 micro,30 micro (around 10 times) ........ nothing for 1 mili second ..
so i need to generate a pulse after the first pulse arrives ... (its width around 600microSecond)
1. use the first counter to measure the pulses ...
2. if arrived pulse ... 500microSecond<the pulse width<700microSeconds .... then generate pulse with second timer ....
the problem is that i dont want to use the while loop inside the labview ...
can i programm the counters to make the width calculation and if the width is bigger to generate trigger to the second counter .... ?
the hardware is 6014 sample card ....
thanks
gena
(see attached)
Attachments:
F0087TEK.JPG 27 KBHi Gena,
I am assuming you are using the DAQmx drivers in LabVIEW for your
PCI-6014. Avoiding a While loop may be difficult if you need to
perform this measurement many times and you might not know when the
signal is going to begin. Without a While loop, you'll have to
set up your timeout period long enough so the pulses will begin before
your VI stops.
With this in mind, you may want to look at some of the shipping
examples with the DAQmx driver. You can find these in LabVIEW's
Help menu by going to Find Examples. For measuring the pulse
width, browse the folders in the Example finder by going to Hardware
Input and Output>>DAQmx>>Counter Measurements>>Period
or Pulse Width. In this folder, there is the Meas Pulse Width.vi,
which measures the pulse width once and stops. You should be able
to take the pulse width measurement you get from here and check to see
if it's in your range, then output a pulse on the other counter if it
is in the range. The pulse output examples can be found in
Hardware Input and Output>>DAQmx>>Generating Digital
Pulses>>Gen Dig Pulse.vi.
Thaison V
Applications Engineer
National Instruments -
Generating a list depending on the condition of checkboxes
I have a table with a list of items with a checkbox next to each of them. On a second table I'd like items from the first table to appear if they are checked off. Below is an screenshot of the result I'd like.
I apologize if this question has already been answered, I spent an hour looking and couldn't find an answer. I suspect it has something to do with VLOOKUP but I can't figure it out for the life of me.noafe wrote:
I have a table with a list of items with a checkbox next to each of them. On a second table I'd like items from the first table to appear if they are checked off. Below is an screenshot of the result I'd like.
What you're looking for is a 'breakout table'.
See my post at the end of this discussion from last September.
A search of this forum for 'breakout' over the last year will bring up other examples.
Regards,
Barry -
Calling multiple webservices depend on the condition
Hi friends,
i need a solution for my ccbpm flow.
we are getting request from Webservice1 , and it is going to Webservice2. Here it will check the conditon in webservice2.
if the conditon is true from there it will go to Webservice3.
Unless Webservice2 will send a message to Webservice1.
we are using CCBPM flow for this.
for this i taught like if-else conditon.
but i do't know how to use this condition.
could any one provide solution for this.
are if there is any other way to do this in CCBPM .
note: i need it in CCBPM only.
please help me on this.Firstly, you dont need ABAP proxy any more for a scenario which involves commmunication only between WS and BPM (i should say PI).
in the above given flow can I take at first receiver mode u201CS/A Bridgeu201D because need to send response to the first webservice1.
And could you tell if I used this S/A bridge , where can I close this S/A bridge.
Sync-Async bridge should be used only if you want to send response to WS1 in any case i.e. response should always be sent to WS1 irrespective of any condition.
The send step in which you are sending the response to WS1 will close the S/A bridge.
From webservice3 the response need to go to webservice1.
So can I take here the step like SyncSend(WS3Req_To_Ws1Res).
When WS3Rep needs to be send to WS1 then you need not include it as a SYNCSend...it should be an ASYNCSend..... SYNCSend should be used only if WS1 is again going to send you some details back
Question 3:
How to replace ABAP Proxies in my Entire flow.
Case1-->
You need not worry about proxies anymore.....now you will be importing WSDL into External Definitions in Integration repository and using the same to build Message Mapping and Message Interface.
You will get these wsdl files from the webservice applications with whom BPM (PI) will be talking.
Case2 -->
In your case firstly WS1 will send you a request....so now you need to provide them with the wsdl generated in PI....so that they can establish the communication.
How to create the wsdl file?...check it here: /people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi
Just refer till Pt.2 of Testing section
All the sender/ receiver protocol in your case will be SOAP.....i.e. only SOAP sender/ receiver channels needs to be created
No channel is to be ccreated when BPM is the sender/ receiver
Regards,
Abhishek. -
To hide a button in a column field depending on the condition in ALV
Hai,
I have a column in ALV with buttons.I need to make that button Visible or invisible based on a condition.
i have fiels with value x and blank.
if the value is x i need to make the button visible and viceversa.
Cheers,
Madhu.Hi,
I assume when you say that you have a field with value X or blank that you have a internal table with one of the field as mentioned above and also a context node with
the same structure of the internal table so that you bind the internal table to the node
and display the same in ALV.
If my assumptions are right you must proceed as follows.
1.Create an internal table with the same structure that u had passed for ALV.Add one more column to that table with type wdui_visibility.
2.Create one more node with the structure of the internal table created above.
3.Move the coresssponding data from your old internal table to the new internal table.
4.For the new column of type wdui_visibility fill values by comparing the field with value X or blank.ie. IF value = X wdui_visibility_column-value = '02' .
IF value = blank wdui_visibility_column-value = '01' .
5.Save the changes in the new internal table.
6.Bind the new internal table to the new node.
7.Use the new node to display data in ALV.
8.Create an attribute "alv_table" of type "CL_SALV_WD_CONFIG_TABLE" in the view.
9.In the wd_init method add the following codes.
* create an instance of ALV component
DATA:
lr_salv_wd_table_usage TYPE REF TO if_wd_component_usage.
* get ALV component
DATA:
lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
* set cell editor for input fields (~make colum Wt editable)
DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings,
lr_column type ref to CL_SALV_WD_COLUMN,
lr_column_hdr type ref to CL_SALV_WD_COLUMN_HEADER,
lr_button_1 TYPE REF TO cl_salv_wd_uie_button.
lr_salv_wd_table_usage = wd_this->wd_cpuse_<Alv component usage name>( ).
IF lr_salv_wd_table_usage->has_active_component( ) IS INITIAL.
lr_salv_wd_table_usage->create_component( ).
ENDIF.
lr_salv_wd_table = wd_this->wd_cpifc_<Alv component usage name>( ).
wd_this->alv_table = lr_salv_wd_table->get_model( ).
lr_column_settings ?= wd_this->alv_table.
lr_column = lr_column_settings->get_column( '<column name which you want to show
as button>' ).
CREATE OBJECT lr_button_1.
lr_button_1->set_text( '<some releavnt text>' ).
lr_button_1->SET_VISIBLE_FIELDNAME('<new column name of type
wdui_visibility>').
lr_column->set_cell_editor( lr_button_1).
Hope this helps.
Thanks,
G.Jayaprakash -
Is there any number generated when we save a condition record in VK11
HI,
Is there any number generated when we save a condition record in VK11Dear Raj,
No Number will be generated when you save the Condition record in the VK11 transaction , but wiil get saved in the data base.
If you want to see you can go to VK12 or VK13 transaction enter condition type the select key combination then execute.
i hope ti will help you'
regards,
murali. -
Creation of PO for an already generated number !!
Hi All,
The Requirement is to create a Purchase Order for an already generated number.
Ex: The generated number is 4500026080.
Now a purchase Order 4500026080 need to be created.
Please let me know if more clarification required.
Thanks & Regards,
DeebaFrom where you are getting this no.? Because when you will create the PO it will automatically generates the PO # for you.
I think you can find some enhancement option(User exit/badi/enhancement spot) at the place right after the system is generating the PO and then replace with the once you have created. -
In which table the condition records get stored in sap crm
hi everybody any one can help me in this,
In which table the condition records get stored in sap crm.
Regards,
BabuHi Babu,
The table name depends on the condition table you have chosen while adding a condition record. Like if it is SAP001, the database table will be CNCCRMPRSAP001.
Regards,
Shalini Chauhan
Edited by: Shalini Chauhan on Jun 23, 2008 10:18 AM -
Purchase order(me21) number range depending upon the plant
Hello All,
I have to generate differant number range for purchase order depending on the plant.
I have found one User exit MM06E003 but it has only ekko as importing structure.
In whiih exit , I cam get plant (ekpo-werks ) and import it to memory id , which will be further used in
MM06E003.
Regards
MohitHi Mohit,
You can try the Enhancement MM06E005. Both EKKO and EKPO structures are available in various function exits in the above Enhancement.
Also you can try using BADI ME_PROCESS_PO_CUST. This BADI is called whenever transactions ME21N/22N/23N are called.
Hope the above info will help.
Regards.
Abhisek Biswas. -
Sir/madam,
I am quite new to the Labview FPGA module.
I am currently working on an application where i have to generate a pwm to control the ON time duration . The pwm ON time depends on the frequency of an input signal.I want to retrieve the ON time value from a lookup table which contain the duty cycle values for the pwm at different frequencies of the input.This input also has to work as a trigger. The input is pulsed and the trigger has to generate the pwm at every rising edge. I am using a PCI 7831R- RIO series. I am urgently in need of some help and i have hardly a couple of weeks before i meet the deadline.
I am trying hard to learn the basics from the shipping examples but not able to quite make my vi work.
Kindly lend a helping hand and i would be very grateful to anybody who can help. Thanks a lot in advance.
Do ask in case of any clarifications required. I think i have explained my problem quite well.Hello Manu,
You can refer
Developing a PWM Interface using LabVIEW FPGA or PWM Output with LabVIEW FPGA
How this helps.
Best Regards,
Hardik Asawa
AE
National Instruments
Message Edited by Hardik Asawa on 05-05-2010 12:46 AM -
Return specific number of rows depending on the data in a column in table
Hi,
I have a table named orders which has column orderid and noofbookstoorder in addition to other columns.
I want to query the orders table and depending on the value of the 'noofbookstoorder' value return that number of rows.
Eg
Orderid noofbookstoorder
1 1
2 3
3 2
when I query the above data saying
select * from orders where orderid=2;
since it has noofbookstoorders value as 3 the query should return 3 rows and when I query
select * from orders where orderid=3;
it should return 2 rows and
select * from orders where orderid=1;
should return 1 row.
Is it possible to achieve this. If yes, then how do I write my query.
Thanks in advance.with t as (
select 1 Orderid,1 noofbookstoorder from dual union all
select 2,3 from dual union all
select 3,2 from dual
select t.*
from t,
table(cast(multiset(select 1 from dual connect by level <= noofbookstoorder) as sys.OdciNumberList))
where Orderid = <order-id>
/For example:
SQL> with t as (
2 select 1 Orderid,1 noofbookstoorder from dual union all
3 select 2,3 from dual union all
4 select 3,2 from dual
5 )
6 select t.*
7 from t,
8 table(cast(multiset(select 1 from dual connect by level <= noofbookstoorder) as sys.OdciNumberList))
9 where Orderid = 2
10 /
ORDERID NOOFBOOKSTOORDER
2 3
2 3
2 3
SQL> with t as (
2 select 1 Orderid,1 noofbookstoorder from dual union all
3 select 2,3 from dual union all
4 select 3,2 from dual
5 )
6 select t.*
7 from t,
8 table(cast(multiset(select 1 from dual connect by level <= noofbookstoorder) as sys.OdciNumberList))
9 where Orderid = 3
10 /
ORDERID NOOFBOOKSTOORDER
3 2
3 2
SQL> with t as (
2 select 1 Orderid,1 noofbookstoorder from dual union all
3 select 2,3 from dual union all
4 select 3,2 from dual
5 )
6 select t.*
7 from t,
8 table(cast(multiset(select 1 from dual connect by level <= noofbookstoorder) as sys.Odc
iNumberList))
9 where Orderid = 1
10 /
ORDERID NOOFBOOKSTOORDER
1 1
SQL> -- And if you want to select multiple orders
SQL> with t as (
2 select 1 Orderid,1 noofbookstoorder from dual union all
3 select 2,3 from dual union all
4 select 3,2 from dual
5 )
6 select t.*
7 from t,
8 table(cast(multiset(select 1 from dual connect by level <= noofbookstoorder) as sys.Odc
iNumberList))
9 where Orderid in (2,3)
10 /
ORDERID NOOFBOOKSTOORDER
2 3
2 3
2 3
3 2
3 2
SQL> SY.
Edited by: Solomon Yakobson on Oct 26, 2009 7:36 AM -
Table name to store the Condition of service number in ML81N
Hi All,
Is anyone can advise where does the condition values stored for each service number in ML81n.
Can you please provide the table name. Thanks,Hi,
I required to get the item conditions values for each services in ML81N. Is these conditions value are stored in KONV table and what are the Key data i need to pass in to KONV to retrieve those data? Appreciate your advise. Thanks. -
How to set colors in cells depending the conditions in alvtree
Hi All,
Could you please provide me idea or sample program how to set colors in cells depending the conditions in alvtree.
Thanks,
SureshWhen running vim in a terminal, it will use whatever colour scheme is defined by the terminal. You should have a look at this thread:
http://bbs.archlinux.org/viewtopic.php?id=51818
Also, check the wiki article on Xdefaults. -
DropDownByKey display changes depending in the number of records
Hello,
I've noticed that the UI component dropdownbyKey change depending in the number of items it has, with few records it appears like a normal dropdown box and with a huge amounts of records it appears like a combobox (table). This is a great feature.
However, I want to know the cause of this? What is the limit of records that causes this behaviour. It's possible to assign the way I want to display it?
Regards
SUhi soauniverse ,
For what huge amount of records you are able to see the drop by key like a combo box (table)...... like what is the numerical value of the huge amount , that behaviour u r able to see .
if the values are less than 30 then we go for svs , for values more than 30 and less than 300 we use EVS and for value or record more than 300 we go for OVS .
if you have done svs code for a feild and bind that value to the DD by key it remains to be normal Drop down by key and if the same field is bound to an input feild then the EVS will come .
so what have you done can i know in detail please .....
Please paste the scree shot of the UI (that is the combo box) .......
Maybe you are looking for
-
Account group with Internal Number Range
Hello Gurus, With Internal number range assignment to the Customer Account Group, I am unable to extend the customer from one sales area to another sales area with the same Customer number. If I am not it is a standard feature that irrespective of th
-
I have migrated Scrippt as smartform but in pdf O/P chinese chars corrupted
Hi Experts, we have migrated sap script as smartform and modified the driver program accordingly. In print preview output is fine and no data corruption. we are converting this output as PDF and sending via email. For this we have used FM 'CONVERT_O
-
Amendment to Datasource using Function Module
Alright Guys, Can someone help me? I have amended the '0PU_IS_PS_43' datasource and I need to 'unhide' the new fields I have added. I have logged into trans RSO2 to unhide these fields, but received the following warning - how do I resolve this? "Dat
-
HT4063 How do I turn back on "automatic uploads" to Apple?
Having, at some point in the past, turned off the automatic error reporting to Apple, I now find that it would be a good idea if I did send the data to them. However, the option to turn on the automatic upload appears to be a one way route and so I w
-
Apple Mighty Mouse: covered under AppleCare?
I've got a Mighty Mouse that is connected to an iMac that we have in our lab. The mouse has stopped working altogether (no response no matter what computer it's connected to). The iMac is registered under an AppleCare agreement for 3-years and it's s