Select a range of alphanumeric values
hi,
i have a column with values like this:
001A45
124323
V1234C
these values have a theoretical order.
numbers have higher priority than chars.
the ranking of the chars is like: A = 1, ... , Z = 26.
is there a possibility to select an alphanumerical range in oracle?
thanks a lot!
Do you mean something like this?
SQL> ed
Wrote file afiedt.buf
1 with t as (select '001A45' as txt from dual union all
2 select '124323' from dual union all
3 select 'V1234C' from dual)
4 -- END OF TEST DATA
5 select txt, replace(sys_connect_by_path(case when ascii(ch) between ascii('A') and ascii ('Z') then to_char(ascii(ch)-64,'fm09') else to_char(ascii(ch),'fm09') end,','),',') as ord
6 from (
7 select txt, rn, ch
8 from (
9 select txt, row_number() over (partition by txt order by rn) as rn, substr(txt,rn,1) as ch
10 from t, (select rownum as rn from dual connect by rownum <= (select max(length(txt)) from t))
11 )
12 where ch is not null
13 )
14 where connect_by_isleaf = 1
15 connect by txt = prior txt and rn = prior rn + 1
16 start with rn = 1
17* order by 2
SQL> /
TXT ORD
V1234C 224950515203
001A45 484849015253
124323 495052515051
SQL>I've displayed the ORD column (the one being ordered on) so you can see how each character, whether alpha or numeric is converted to an ascii equivalent, but with the alphas being assigned the values 1 thru 26 whereas the numbers have their natural ascii values 48 thru 57
You can change that as you require if it's not quite what you mean.
Similar Messages
-
Alphanumeric values in Select-Options
Hi ABAP gurus,
There is a select-options for a report like
data : opt1(4) type c.
select-options : g_count for opt1.
g_count would take alphanumeric values like for example
A123 to AB46 . Now it is required to take all the values range
from A123 to AB46 in an internal table .
How do i solvthis .
thanks
ABAP Developer1hi ,
it is not possible for select-option to get values between 'A123' AND 'AB1234' ETC ...
you have to pass those values with static values while passing in selection screen .
OR you can maintain one table with this values and after selecting those values you can pass through ranges .
regards
Deepak. -
How do I select a range of values in MySQL using a drop down menu
Hi,
I have a database of picture frames that have a value of
frame width. I want to be able to select a range of values (i.e.
.50" to 1") instead of each and every value (i.e. .50", .56", .76",
etc.). I have a drop down menu (mnuWidth) with 5 ranges (see
attached code).
Each selection has a value from 1 to 5 indicating the range I
want to search. In my results page I have let DW set up a recordset
(see attached code)
Can anyone tell me how to get this to choose a range instead
of just the value entered by my menu?
Thanks in advance.
TomI have been growing fond of lookup tables. Your lookup table would have your numbers in one column and the values you want returned in the next.
Lookup table
item
Name
1
a
2
b
3
c
4
d
5
e
6
f
7
g
8
h
9
i
Input table
input
Name
1
a
B2 and copied down:
LOOKUP(A2,lookup::$A$2:$A$11,lookup::$B$2:$B$11)
Caution: Lookup will return the closest value so it it looks for "10" in this example it will return "i"
If you don't want to see the error messages from blank inputs, wrap Lookup in IFERROR.
hope this helps
q -
Select a range of rows to be displayed using ROWNUM
I am trying to select a range of records to be displayed using Rownum
It works using MINUS
SQL> select rownum,department_id,department_name from departments where rownum <= 20
minus
select rownum,department_id,department_name from departments where rownum < 11;
but does not work if a range is specified
select rownum,department_id,department_name from departments where rownum >= 11 and rownum <= 20;
What has gone wrong?
Details of what I have tried are as follows:
Connect to the sample schema HR
SQL> connect hr/hr
SQL> desc departments
Name Null? Type
DEPARTMENT_ID NOT NULL NUMBER(4)
DEPARTMENT_NAME NOT NULL VARCHAR2(30)
MANAGER_ID NUMBER(6)
LOCATION_ID NUMBER(4)
List all records in Departments
SQL> select rownum,department_id,department_name from departments;
ROWNUM DEPARTMENT_ID DEPARTMENT_NAME
1 10 Administration
2 20 Marketing
3 30 Purchasing
4 40 Human Resources
etc......
26 260 Recruiting
27 270 Payroll
27 rows selected.
List the first 10 records in DEPARTMENTS
SQL> select rownum,department_id,department_name from departments where rownum <= 10;
ROWNUM DEPARTMENT_ID DEPARTMENT_NAME
1 10 Administration
2 20 Marketing
etc.....
10 100 Finance
List row number from 11 to 20, but cannot no rows selected. Why?
SQL> select rownum,department_id,department_name from departments where rownum >= 11 and rownum <= 20;
no rows selected
Use of MINUS can retrieve row number from 11 to 20
SQL> select rownum,department_id,department_name from departments where rownum <= 20
minus
select rownum,department_id,department_name from departments where rownum < 11;
ROWNUM DEPARTMENT_ID DEPARTMENT_NAME
11 110 Accounting
12 120 Treasury
13 130 Corporate Tax
14 140 Control And Credit
15 150 Shareholder Services
16 160 Benefits
17 170 Manufacturing
18 180 Construction
19 190 Contracting
20 200 Operations
10 rows selected.For each row returned by a query, the ROWNUM pseudocolumn returns a number indicating the order in which Oracle selects the row from a table or set of joined rows. The first row selected has a ROWNUM of 1, the second has 2, and so on.
Conditions testing for ROWNUM values greater than a positive integer are always false. For example, this query returns no rows:
SELECT * FROM employees
WHERE ROWNUM > 1;
You can get the selected records based on the rownum using the inline query....
SQL> select rownum, empno from emp;
ROWNUM EMPNO
1 7369
2 7499
3 7521
4 7566
5 7654
6 7698
7 7782
8 7788
9 7839
10 7844
11 7876
ROWNUM EMPNO
12 7900
13 7902
14 7934
14 rows selected.
SQL> select * from (select rownum rn, empno from emp) where rn > 2 and rn < 5;
RN EMPNO
3 7521
4 7566 -
Field in the selection screen as a select option with two default values
Hi All,
can anybody tell me how to put field in the selection screen with two defaul values.
for ex: selection screen the Account Group KNA1-KTOKD as a select option. The defeault value should be Y001 and Y005.
please reply ASAP. Its urgent.
Thanks in advance,
MadhuHi Madhu,
Since Select options are nothing but ranges, you can use the following code to add two distinct values to the select options by default.
s_ktokd-sign = 'I'.
s_ktokd-option = 'EQ'.
s_ktokd-low = 'Y001'.
append s_ktokd.
s_ktokd-low = 'Y005'.
append s_ktokd.
clear s_ktokd.
However, if you want to mention a range like all the values between these given two values to be considered then u may use,
select-options : s_ktokd for KNA1-KTOKD default 'Y001' to 'Y005'.
or
s_ktokd-sign = 'I'.
s_ktokd-option = 'BT'.
s_ktokd-low = 'Y001'.
s_ktokd-high = 'Y005'.
append s_ktokd.
Reward if helpful. -
Sub CopyPasteEntries()
Dim i, g, h As Integer
i = 2
Sheets("Sheet1").Select
Do Until IsEmpty(Cells(i, 1))
i = i + 1
Loop
g = i - 1
h = 2
For i = 2 To g
Sheets("Sheet1").Select
If Cells(i, 1).Value <> "Created" Then 'first cell
Cells(i, 1).EntireRow.Copy
Sheets("Sheet2").Select
Cells(h, 1).Select
ActiveCell.PasteSpecial xlPasteAll
h = h + 1
End If
Next
Application.CutCopyMode = False
End SubInstead of
Cells(i, 1).EntireRow.Copy
use any of these
Cells(i, 1).Resize(1,11).Copy 'A to K
Intersect(Cells(i,
1).EntireRow, Range("A:K")).Copy
Range(Cells(i, 1), Cells(i,11)).Copy
Range(Cells(i, "A"), Cells(i,"K")).Copy
Range("A" & i & ":K" & i).Copy
Cells(i, 1).Range("A1:K1").Copy -
How do I select a range of values? For instance, I need to write a select statement that, among others, selects documents based on a date range. What I am doing is trying to pick billing documents that have a billing date within the last 365 days. Also I need to figure out a way (an easy way) to determine if a particular day is a weekend.
Regards,
AaronRANGES: s_date FOR ekko-aedat.
DATA: lv_day TYPE scal-indicator.
s_date-high = sy-datum.
s_date-low = sy-datum - 365.
s_date-option = 'BT'.
s_date-sign = 'I'.
APPEND s_date.
DATA: t_ekko TYPE STANDARD TABLE OF ekko.
SELECT * FROM ekko
INTO TABLE t_ekko
WHERE aedat IN s_date.
CALL FUNCTION 'DATE_COMPUTE_DAY'
EXPORTING
date = sy-datum
IMPORTING
day = lv_day.
IF sy-subrc = 0.
ENDIF.
LV_DAY = '6' for saturday and '7' for sunday. -
Hi everyone,
I would like to know how to do to select a range of data (for example on a force/time graph during a jump landing (parable), from a certain value to another) to register it on a special file? I tried the module "separate" or "cut out" but I don't think they will be useful when you don't know when will appear the specifical value you're looking for...
Is it also possible in Dasylab to know the director coefficient of this type of curve (quite linear...)?
Thanks!
Solved!
Go to Solution.Perhaps...
Select the values in a block (y values) at given positions (y values).
Calculate the differences, and calculate the quotient.
M.Sc. Holger Wons | measX GmbH&Co. KG, Mönchengladbach, Germany | DASYLab, DIAdem, LabView --- Support, Projects, Training | Platinum National Instrument Alliance Partner | www.measx.com
Attachments:
steigung.jpg 187 KB
steigung.zip 6 KB -
How does the CBO calculate the selectivity for range predicates on ROWID ?
Hi all,
I'm wondering how the CBO estimate the selectivity for range predicates based on ROWID columns.
For example, for the following query the CBO estimates there's going to be 35004 rows returned instead of 7:
SQL> SELECT count(*)
FROM intsfi i
WHERE
ROWID>='AAADxyAAWAAHDLIAAB' AND ROWID<='AAADxyAAWAAHDLIAAH'; 2 3 4
COUNT(*)
7
Elapsed: 00:00:02.31
SQL> select * from table(dbms_xplan.display_cursor(null,null,'iostats last'));
PLAN_TABLE_OUTPUT
SQL_ID aqbdu2p2t6w0z, child number 1
SELECT count(*) FROM intsfi i WHERE ROWID>='AAADxyAAWAAHDLIAAB' AND
ROWID<='AAADxyAAWAAHDLIAAH'
Plan hash value: 1610739540
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers |
| 0 | SELECT STATEMENT | | 1 | | 1 |00:00:02.31 | 68351 |
| 1 | SORT AGGREGATE | | 1 | 1 | 1 |00:00:02.31 | 68351 |
|* 2 | INDEX FAST FULL SCAN| INTSFI2 | 1 | 35004 | 7 |00:00:02.31 | 68351 |
Predicate Information (identified by operation id):
2 - filter((ROWID>='AAADxyAAWAAHDLIAAB' AND ROWID<='AAADxyAAWAAHDLIAAH'))According to Jonathan Lewis' book, for a normal column the selectivity would have been:
(value_column1-value_column2)/(high_value-low_value)+1/num_distinct+1/num_distinct
But here with the ROWID column, how does the CBO make its computation ?
SINGLE TABLE ACCESS PATH
Single Table Cardinality Estimation for INTSFI[I]
Table: INTSFI Alias: I
Card: Original: 14001681.000000 Rounded: 35004 Computed: 35004.20 Non Adjusted: 35004.20Hi Jonathan,
Some Clarifications
=============
DELETE /*+ ROWID(I) */ FROM INTSFI I WHERE
(I.DAVAL<=TO_DATE('12032008','DDMMYYYY') AND (EXISTS(SELECT 1 FROM
INTSFI S WHERE S.COINT=I.COINT AND S.NUCPT=I.NUCPT AND S.CTSIT=I.CTSIT
AND NVL(S.RGCID,-1)=NVL(I.RGCID,-1) AND S.CODEV=I.CODEV AND
S.COMAR=I.COMAR AND S.DAVAL>I.DAVAL) AND I.COMAR IN (SELECT P.COMAR
FROM PURMAR P WHERE P.NUPUR=1))) AND ROWID>='AAADxyAAWAAHDLIAAB' AND
ROWID<='AAADxyAAWAAHDLIAAH'
Plan hash value: 1677274993
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | OMem | 1Mem | Used-Mem |
| 0 | DELETE STATEMENT | | 1 | | 0 |00:00:05.94 | 53247 | | | |
| 1 | DELETE | INTSFI | 1 | | 0 |00:00:05.94 | 53247 | | | |
|* 2 | HASH JOIN SEMI | | 1 | 9226 | 7 |00:00:05.94 | 53180 | 783K| 783K| 471K (0)|
| 3 | NESTED LOOPS | | 1 | 9226 | 7 |00:00:00.01 | 10 | | | |
|* 4 | TABLE ACCESS BY ROWID RANGE| INTSFI | 1 | 9226 | 7 |00:00:00.01 | 6 | | | |
|* 5 | INDEX UNIQUE SCAN | PURMAR1 | 7 | 1 | 7 |00:00:00.01 | 4 | | | |
| 6 | INDEX FAST FULL SCAN | INTSFI1 | 1 | 14M| 7543K|00:00:01.73 | 53170 | | | |
Predicate Information (identified by operation id):
2 - access("S"."COINT"="I"."COINT" AND "S"."NUCPT"="I"."NUCPT" AND "S"."CTSIT"="I"."CTSIT" AND
NVL("S"."RGCID",(-1))=NVL("I"."RGCID",(-1)) AND "S"."CODEV"="I"."CODEV" AND "S"."COMAR"="I"."COMAR")
filter("S"."DAVAL">"I"."DAVAL")
4 - access(ROWID>='AAADxyAAWAAHDLIAAB' AND ROWID<='AAADxyAAWAAHDLIAAH')
filter("I"."DAVAL"<=TO_DATE(' 2008-03-12 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
5 - access("P"."NUPUR"=1 AND "I"."COMAR"="P"."COMAR")
When I force the NESTED LOOP SEMI JOIN the query runs faster:
DELETE /*+ ROWID(I) */ FROM INTSFI I WHERE
(I.DAVAL<=TO_DATE('12032008','DDMMYYYY') AND (EXISTS(SELECT /*+ NL_SJ
*/ 1 FROM INTSFI S WHERE S.COINT=I.COINT AND S.NUCPT=I.NUCPT AND
S.CTSIT=I.CTSIT AND NVL(S.RGCID,-1)=NVL(I.RGCID,-1) AND S.CODEV=I.CODEV
AND S.COMAR=I.COMAR AND S.DAVAL>I.DAVAL) AND I.COMAR IN (SELECT P.COMAR
FROM PURMAR P WHERE P.NUPUR=1))) AND ROWID>='AAADxyAAWAAHDLIAAB' AND
ROWID<='AAADxyAAWAAHDLIAAH'
Plan hash value: 2031485112
| Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers |
| 0 | DELETE STATEMENT | | 1 | | 0 |00:00:00.01 | 94 |
| 1 | DELETE | INTSFI | 1 | | 0 |00:00:00.01 | 94 |
| 2 | NESTED LOOPS SEMI | | 1 | 9226 | 7 |00:00:00.01 | 27 |
| 3 | NESTED LOOPS | | 1 | 9226 | 7 |00:00:00.01 | 9 |
|* 4 | TABLE ACCESS BY ROWID RANGE| INTSFI | 1 | 9226 | 7 |00:00:00.01 | 5 |
|* 5 | INDEX UNIQUE SCAN | PURMAR1 | 7 | 1 | 7 |00:00:00.01 | 4 |
|* 6 | INDEX RANGE SCAN | INTSFI1 | 7 | 14M| 7 |00:00:00.01 | 18 |
Predicate Information (identified by operation id):
4 - access(ROWID>='AAADxyAAWAAHDLIAAB' AND ROWID<='AAADxyAAWAAHDLIAAH')
filter("I"."DAVAL"<=TO_DATE(' 2008-03-12 00:00:00', 'syyyy-mm-dd hh24:mi:ss'))
5 - access("P"."NUPUR"=1 AND "I"."COMAR"="P"."COMAR")
6 - access("S"."COINT"="I"."COINT" AND "S"."NUCPT"="I"."NUCPT" AND
"S"."CTSIT"="I"."CTSIT" AND "S"."CODEV"="I"."CODEV" AND "S"."COMAR"="I"."COMAR" AND
"S"."DAVAL">"I"."DAVAL")
filter(NVL("S"."RGCID",(-1))=NVL("I"."RGCID",(-1)))the above post is from Ahmed AANGOUR
Case 1 - . If you check Plan hash value: 16772749938
=====
TABLE ACCESS BY ROWID RANGE| INTSFI For every row access from INTSFI - it fetches a record from INDEX UNIQUE SCAN | PURMAR1
If we check A-rows = 9226
9226 * 7 = 64582 request across the table - perhaps with hint of rowid it fetches exact rows from PURMAR1
in this case i think going for hash join with ordered hints (jonathan as you suggest go for leading hint's instead of ordered) - from INTSFI - PURMAR1 - instead of going for IN clause would get the rows that satifies the ("P"."NUPUR"=1 AND "I"."COMAR"="P"."COMAR")
|* 2 | HASH JOIN SEMI | | 1 | 9226 | 7 |00:00:05.94 | 53180 | 783K| 783K| 471K (0)|
| 3 | NESTED LOOPS | | 1 | 9226 | 7 |00:00:00.01 | 10 | | | |
|* 4 | TABLE ACCESS BY ROWID RANGE| INTSFI | 1 | 9226 | 7 |00:00:00.01 | 6 | | | |
|* 5 | INDEX UNIQUE SCAN | PURMAR1 | 7 | 1 | 7 |00:00:00.01 | 4 | | | |My understanding with above plan would change to
HASH JOIN
TABLE ACCESS BY ROWID RANGE| INTSFI
INDEX UNIQUE SCAN | PURMAR1
HASH JOIN
INDEX FAST FULL SCAN | INTSFI1
Which migt be feasible.
2 .
DELETE /*+ ROWID(I) */ FROM INTSFI I WHERE
(I.DAVAL<=TO_DATE('12032008','DDMMYYYY') AND (EXISTS(SELECT /*+ NL_SJ
*/ 1 FROM INTSFI S WHERE S.COINT=I.COINT AND S.NUCPT=I.NUCPT AND
S.CTSIT=I.CTSIT AND NVL(S.RGCID,-1)=NVL(I.RGCID,-1) AND S.CODEV=I.CODEV
AND S.COMAR=I.COMAR AND S.DAVAL>I.DAVAL) AND I.COMAR IN (SELECT P.COMAR
FROM PURMAR P WHERE P.NUPUR=1))) AND ROWID>='AAADxyAAWAAHDLIAAB' AND
ROWID<='AAADxyAAWAAHDLIAAH'Ahmed AANGOUR, modified the query by /*+ NL_SJ */ hint, Instead of that in to remove the most of the rows as we join the tables using subquery, I still doubt it
to go push_predicate hints - still doubt it.
Jonathan your comments are most valuable in the above two cases..
Looking forward to calrify my understanding with concepts of indexes for above test cases
- Pavan Kumar N -
Selecting a range of data from a file
Is it possible to only display a selected range of data from a binary file? I can read in my binary files but I would like to only send data within a user defineable range to the data portal for viewing. This range may be over multiple binary files also. I can concatenate these files already but I need to select a range to insert into the data portal.
Thanks,
AJLOK AJL,
This sounds good. It's convenient to have the start and stop time of each segment file in the name of that file. By the way, you want to check that in the DataPlugin and "Call RaiseError()" if the data file is not named that way, otherwise you will try to read DIAdem *.DAT files with your custom DataPlugin. DIAdem will try each DataPlugin that is registered with the file's extension (i.e. *.DAT) one after the other, until one of them does not give an error. So you should always check for some identifying characteristic in your data file and "Call RaiseError()" if you don't find it, in order to abort DIAdem using that DataPlugin for files it was never intended for.
Now to your point. How do you know which series of segment files to read from? Does your VBScript ask the user to select a particular directory that contains all these segment files? I'm going to assume so. My recommendation is that your VBScript also create a time slice configuration file in that directory that contains the information about the time slice you want to read in (start and stop times). Then your DataPlugin can look for that file name in the directory passed to it-- if it finds none it will just load the file path it was passed outright, but if it does find the time slice file it will load any and all *.DAT files in that same directory which correspond to that time slice. This includes loading only parts of one or more of the existing binary files.
It is straightforward enough to pick out the section of the binary file you want to load with the DataPlugin, once you know the time slice information inside the DataPlugin's callback. Use the File.Position property to move the file cursor to the position of the first data point in the time slice, and use the Block.BlockLength property to specify the number of values to read in each of the channels from that starting point (to exclude the values after the desired time slice). I assume that your binary data is stored interleaved and that you are using DirectAccessChannels to read the values in your DataPlugin.
Finally, for time slices that span multiple segment files, you will need to load these to separate groups in the Data Portal with the DataPlugin. Then the VBScript can consolidate these channels into long concatenated channels in a new group and delete the temporary segmented groups. In a future version of DIAdem the DataPlugin API will have the ability to do this mapping for you, but not yet. I also have VBScripts that do this concatenation already-- you can download them from www.ni.com/support/diasupp. They're designed for concatenating channels from multiple ASCII/Excel/DAT files.
Let me know what else you need,
Brad Turpin
DIAdem Product Support Engineer
National Instruments -
Query to sort a column containing alphanumeric values
Hi,
I have a table whose column contains ALPHANUMERIC values. The column is of type VARCHAR(1).
I tried many queries (using UNION) to fetch records in Alphabets first and Numbers as last
I.e. A-Z should come first and then 0-9 values.
Please do the needful
Regards,
MradulI.e. A-Z should come first and then 0-9 values.Edit: Whoops, I forgot the ascii values for numbers were lower.
WITH t AS
(SELECT '0' c FROM DUAL
UNION
SELECT '9' c FROM DUAL
UNION
SELECT 'A' c FROM DUAL
UNION
SELECT 'B' c FROM DUAL
SELECT c
FROM t
ORDER BY TRANSLATE( UPPER(c)
, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'
, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
, TRANSLATE( UPPER(c)
, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
, '0123456789'
C
A
B
0
9Message was edited by:
vg -
Select- Color Range- Results in Blue Screen (PC) (driver out of date)
I've been using the CS6 beta about two days. While experimenting with color range I experienced two consecutive blue screen crashes. The first time it happened,I was working with the color range selector and was replacing the selected areas with another color using the paint bucket. About the third time I attempted this, my PC blue screened. The second time, I opened a photo, went to Select>Color Range and got an immediate blue screen crash.
I then went back to CS5 and I've been playing with the same scenario with no apparent problems.
My PC is a store built computer. It consists of an MSI 990-FXA GD80 motherboard, an AMD Phenom 1100t CPU, Asus GTX550 Ti graphics card and 8 gig of RAM. It boots from a 60 gig SSD and my programs reside on a 500 gig hard drive. The OS is Windows 7 Professional 64 bit. CS6 is using the hard drive for its scratch disk and Photoshop is using 4339 mb of the 7232 mb of available RAM - I haven't changed that. I'm running CS6 as administrator because the way it installed, it would only run in that fashion.
One disappointment during the installation was CS6 made no attempt to read my preferences from the CS5 install. That may be covered in another post, I've not yet looked.
Please keep us informed as new betas are released, because I would like some time to work with this puppy before plunking down big bux for the upgrade. As it is now, I'm going back to CS5. I get mighty nervous when my super computer blue screens!
Gerry
gswetsky AT bellsouth DOT netThe GPU is often at root of issues like yours. I've had so many problems with Nvidia drivers for their gaming-oriented adapters (like yours) that I finally went with one of their workstation cards. I have a Quadro card with just enough RAM to make Photoshop happy. The workstation drivers are optimized for reliability, the consumer card drivers are optimized for gaming and that often means they're less stable and reliable with Photoshop.
-
Devolped an ALV report for daily cash receipts for selected date range
hi,
how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report.hi,
how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report. -
Devloped an ALV report for daily cash receipts for selected date range
hi,
how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report.Hi,
You can develop simple reports using Report Painter.
You may be also interested in:
Check report SAPMF05A for credit memo
See the following Std reports on Payment Advices execute the Tcodes:
S_ALR_87009888
S_ALR_87009889
S_ALR_87009890
S_ALR_87009891
S_ALR_87009892
S_ALR_87009893
S_ALR_87009978
S_ALR_87009979
S_ALR_87009980
S_ALR_87009981
S_ALR_87009982
S_ALR_87009983
S_ALR_87010056
S_ALR_87010057
S_ALR_87010058
S_ALR_87010059
S_ALR_87010060
S_ALR_87010061
S_ALR_87010066
S_ALR_87010067
S_ALR_87012106
S_ALR_87012107
S_ALR_87012108
S_ALR_87012109
S_ALR_87012110
S_ALR_87012111
S_ALR_87012116
S_ALR_87012117
S_ALR_87012200
S_ALR_87012201
S_ALR_87012202
S_ALR_870122
S_ALR_87012204
S_ALR_87012205
S_ALR_87012350
S_ALR_87012351
S_ALR_87012352
S_ALR_87012353
S_ALR_87012354
S_ALR_87012355
sample ALV report:
tables:
marav. "Table MARA and table MAKT
Data to be displayed in ALV
Using the following syntax, REUSE_ALV_FIELDCATALOG_MERGE can auto-
matically determine the fieldstructure from this source program
Data:
begin of imat occurs 100,
matnr like marav-matnr, "Material number
maktx like marav-maktx, "Material short text
matkl like marav-matkl, "Material group (so you can test to make
" intermediate sums)
ntgew like marav-ntgew, "Net weight, numeric field (so you can test to
"make sums)
gewei like marav-gewei, "weight unit (just to be complete)
end of imat.
Other data needed
field to store report name
data i_repid like sy-repid.
field to check table length
data i_lines like sy-tabix.
Data for ALV display
TYPE-POOLS: SLIS.
data int_fcat type SLIS_T_FIELDCAT_ALV.
select-options:
s_matnr for marav-matnr matchcode object MAT1.
start-of-selection.
read data into table imat
select * from marav
into corresponding fields of table imat
where
matnr in s_matnr.
end-of-selection.
Now, we start with ALV
To use ALV, we need a DDIC-structure or a thing called Fieldcatalogue.
The fieldcatalouge can be generated by FUNCTION
'REUSE_ALV_FIELDCATALOG_MERGE' from an internal table from any
report source, including this report.
The only problem one might have is that the report and table names
need to be in capital letters. (I had it )
Store report name
i_repid = sy-repid.
Create Fieldcatalogue from internal table
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = sy-repid
I_INTERNAL_TABNAME = 'IMAT' "capital letters!
I_INCLNAME = sy-repid
CHANGING
CT_FIELDCAT = int_fcat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = i_repid
I_STRUCTURE_NAME = 'marav'
I_DEFAULT = 'X'
I_SAVE = 'A'
TABLES
T_OUTTAB = imat.
IF SY-SUBRC <> 0.
WRITE: 'SY-SUBRC: ', SY-SUBRC .
ENDIF.
Hope this will help.
Regards,
Naveen. -
Bind Variable in SELECT statement and get the value in PL/SQL block
Hi All,
I would like pass bind variable in SELECT statement and get the value of the column in Dynamic SQL
Please seee below
I want to get the below value
Expected result:
select distinct empno ,pr.dept from emp pr, dept ps where ps.dept like '%IT' and pr.empno =100
100, HR
select distinct ename ,pr.dept from emp pr, dept ps where ps.dept like '%IT' and pr.empno =100
TEST, HR
select distinct loc ,pr.dept from emp pr, dept ps where ps.dept like '%IT' and pr.empno =100
NYC, HR
Using the below block I am getting column names only not the value of the column. I need to pass that value(TEST,NYC..) into l_col_val variable
Please suggest
----- TABLE LIST
CREATE TABLE EMP(
EMPNO NUMBER,
ENAME VARCHAR2(255),
DEPT VARCHAR2(255),
LOC VARCHAR2(255)
INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (100,'TEST','HR','NYC');
INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (200,'TEST1','IT','NYC');
INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (300,'TEST2','MR','NYC');
INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (400,'TEST3','HR','DTR');
INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (500,'TEST4','HR','DAL');
INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (600,'TEST5','IT','ATL');
INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (700,'TEST6','IT','BOS');
INSERT INTO EMP (EMPNO,ENAME,DEPT,LOC) VALUES (800,'TEST7','HR','NYC');
COMMIT;
CREATE TABLE COLUMNAMES(
COLUMNAME VARCHAR2(255)
INSERT INTO COLUMNAMES(COLUMNAME) VALUES ('EMPNO');
INSERT INTO COLUMNAMES(COLUMNAME) VALUES ('ENAME');
INSERT INTO COLUMNAMES(COLUMNAME) VALUES ('DEPT');
INSERT INTO COLUMNAMES(COLUMNAME) VALUES ('LOC');
COMMIT;
CREATE TABLE DEPT(
DEPT VARCHAR2(255),
DNAME VARCHAR2(255)
INSERT INTO DEPT(DEPT,DNAME) VALUES ('IT','INFORMATION TECH');
INSERT INTO DEPT(DEPT,DNAME) VALUES ('HR','HUMAN RESOURCE');
INSERT INTO DEPT(DEPT,DNAME) VALUES ('MR','MARKETING');
INSERT INTO DEPT(DEPT,DNAME) VALUES ('IT','INFORMATION TECH');
COMMIT;
PL/SQL BLOCK
DECLARE
TYPE EMPCurTyp IS REF CURSOR;
v_EMP_cursor EMPCurTyp;
l_col_val EMP.ENAME%type;
l_ENAME_val EMP.ENAME%type;
l_col_ddl varchar2(4000);
l_col_name varchar2(60);
l_tab_name varchar2(60);
l_empno number ;
b_l_col_name VARCHAR2(255);
b_l_empno NUMBER;
begin
for rec00 in (
select EMPNO aa from EMP
loop
l_empno := rec00.aa;
for rec in (select COLUMNAME as column_name from columnames
loop
l_col_name := rec.column_name;
begin
l_col_val :=null;
l_col_ddl := 'select distinct :b_l_col_name ,pr.dept ' ||' from emp pr, dept ps where ps.dept like ''%IT'' '||' and pr.empno =:b_l_empno';
dbms_output.put_line('DDL ...'||l_col_ddl);
OPEN v_EMP_cursor FOR l_col_ddl USING l_col_name, l_empno;
LOOP
l_col_val :=null;
FETCH v_EMP_cursor INTO l_col_val,l_ename_val;
EXIT WHEN v_EMP_cursor%NOTFOUND;
dbms_output.put_line('l_col_name='||l_col_name ||' empno ='||l_empno);
END LOOP;
CLOSE v_EMP_cursor;
END;
END LOOP;
END LOOP;
END;user1758353 wrote:
Thanks Billy, Would you be able to suggest any other faster method to load the data into table. Thanks,
As Mark responded - it all depends on the actual data to load, structure and source/origin. On my busiest database, I am loading on average 30,000 rows every second from data in external files.
However, the data structures are just that - structured. Logical.
Having a data structure with 100's of fields (columns in a SQL table), raise all kinds of questions about how sane that structure is, and what impact it will have on a physical data model implementation.
There is a gross misunderstanding by many when it comes to performance and scalability. The prime factor that determines performance is not how well you code, what tools/language you use, the h/w your c ode runs on, or anything like that. The prime factor that determines perform is the design of the data model - as it determines the complexity/ease to use the data model, and the amount of I/O (the slowest of all db operations) needed to effectively use the data model.
Maybe you are looking for
-
How to connect DAQ with ARM9?
please help me to connect DAQ with ARM9. Solved! Go to Solution.
-
When i close firefox the text i have copied from my browser to the clipboard vanishes?
Many many times a day i copy text from my browser, close the browser then go paste it to my friends, links and such.... After the update, this no longer works i spend most of my time loading the page i just viewed to recopy. Is this some kinda securi
-
Linking rather than embedding movies
Hi, I have been using Keynote for several years and have always embedded my movies within my presentation (i.e., selecting "copy audio and movies into document" during the initial save). Despite embedding the movies, I still keep a local copy of each
-
Soceket failure loading index.html
I just installed Weblogic 5.1 on NT 4.0 spk5. (This is an evaluation download that I got on 7/7/00 ). Everything installed okay, but to test the server, I entered the following URL http://localhost:7001 The page comes up but the console shows an exce
-
Podcast to iPod - only on 1 computer?
I've got iTunes set up at home and at work. Whe I update (add podcasts from iTunes) at home, they appear on the iPod. When I do the same from work, no joy. Any reason for this? I have it set to add manually as am worried that the automatic option wil