Need to do data selection on a column basis.
Post Author: rconner
CA Forum: Data Connectivity and SQL
I need to do different data selection on a column basis instead of on the whole report. Example, I have 3 General Ledger account numbers.
5100.HOURS
5100.OT
5100.ONCALL
I need to see the units for each of these accounts per customer. My report lists each of the 3 accounts on separate rows and I need them to be side by side in order to do caluculations on the 3 fields.
Th report should look like:
Customer Name Account HOURS Units OT Units ONCALL UNITS Total
XYZ Corp. 5100 Hours 15 OT 3 ONCALL 2 20
At this time the report looks like the example below:
XYZ Corp. 5100 Hours 15
XYZ Corp. 5100 OT 3
XYZ Corp. 5100 ONCALL 2
Does anone know if this is possible and if so, how to do it?
Thanks,
Rick
Post Author: yangster
CA Forum: Data Connectivity and SQL
A simple way to do this would be to group on customer name\account #.create 3 formulas@hoursif account = hours then units else 0@OTif account = OT then units else 0@OnCallif account = ONCALL then units else 0put these in the details section, sum each formulaand simply put in text fields for hours, ot, and oncall next to each of the sums and you will get the desired layout you are after
Similar Messages
-
Need help in Data selection in Smartforms
Hi All,
this data selection is for displaying data in smartforms.
I have a internal table passed on to the Smartforms where i have the Main item and its batches.
posnr text
10 line text1
90004
90005
20 line text2
90006
90007
And in the coding i have made the posnr for batches as 00000 for someother purpose.
now i need to display a text after an item and its batches.
like :
Item Prodcode description Qty uom Picked Factor
batchNo batch qty reel size to ship qty
10 19501 material description 200 M 0 3
Batch1 200 482448
Batch2 200 482448
Special instructions :
i used the following code in the Smartforms to display the Text.
V_SPL = 'Special Line Instructions:'.
V_INDEX1 = V_INDEX + 1.
CLEAR IT_FINAL.
READ TABLE IT_FINAL INDEX V_INDEX1.
CLEAR V_INDEX1.
IF IT_FINAL-POSNR > 0.
CLEAR IT_FINAL.
READ TABLE IT_FINAL INDEX V_INDEX.
V_INDEX1 = '9999'.
V_ITEMTEXT = IT_FINAL-ITEMTEXT.
V_PACKTEXT = IT_FINAL-PACKTEXT.
ENDIF.
V_INDEX = V_INDEX + 1.
DESCRIBE TABLE IT_FINAL LINES V_LINE.
IF V_INDEX > V_LINE.
V_INDEX1 = '9999'.
its ok now if the data in the internal table is like this without any batches.
10
20
30
if the data in the internal table is like :
posnr text
10 line text1
0000
0000
0000
20 line text2
0000
0000
30 line text3
0000
it is not getting the data for the text.
Actually in the code i have written to read the next record in the internal table and if it is greater than 0, i will write the TEXT before writing the next item.
But if the next record is 0000, how to code it.
and the main this is , the text has to be written only after writing the item and its batches.
please tell me how to do this.
Waiting for your replies.
Vikki.Hi,
Just use the internal table to print the data in main window.
for first line which has not batchspitted(main line item) put condition as POSNR NE INITIAL.
and for batch split items, you already made posnr as '0000',
so put condition as POSNR eq INITIAL.
I think this will solve your problem.
Regards,
S Raju. -
Hi All,
this data selection is for displaying data in smartforms.
I have a internal table passed on to the Smartforms where i have the Main item and its batches.
posnr text
10 line text1
90004
90005
20 line text2
90006
90007
And in the coding i have made the posnr for batches as 00000 for someother purpose.
now i need to display a text after an item and its batches.
like :
Item Prodcode description Qty uom Picked Factor
batchNo batch qty reel size to ship qty
10 19501 material description 200 M 0 3
Batch1 200 482448
Batch2 200 482448
Special instructions :
i used the following code in the Smartforms to display the Text.
V_SPL = 'Special Line Instructions:'.
V_INDEX1 = V_INDEX + 1.
CLEAR IT_FINAL.
READ TABLE IT_FINAL INDEX V_INDEX1.
CLEAR V_INDEX1.
IF IT_FINAL-POSNR > 0.
CLEAR IT_FINAL.
READ TABLE IT_FINAL INDEX V_INDEX.
V_INDEX1 = '9999'.
V_ITEMTEXT = IT_FINAL-ITEMTEXT.
V_PACKTEXT = IT_FINAL-PACKTEXT.
ENDIF.
V_INDEX = V_INDEX + 1.
DESCRIBE TABLE IT_FINAL LINES V_LINE.
IF V_INDEX > V_LINE.
V_INDEX1 = '9999'.
its ok now if the data in the internal table is like this without any batches.
10
20
30
if the data in the internal table is like :
posnr text
10 line text1
0000
0000
0000
20 line text2
0000
0000
30 line text3
0000
it is not getting the data for the text.
Actually in the code i have written to read the next record in the internal table and if it is greater than 0, i will write the TEXT before writing the next item.
But if the next record is 0000, how to code it.
and the main this is , the text has to be written only after writing the item and its batches.
please tell me how to do this.
Waiting for your replies.
Vikki.Hi,
Just use the internal table to print the data in main window.
for first line which has not batchspitted(main line item) put condition as POSNR NE INITIAL.
and for batch split items, you already made posnr as '0000',
so put condition as POSNR eq INITIAL.
I think this will solve your problem.
Regards,
S Raju. -
Need to print data sequential in 3 columns in the same page.
hi mates
i have to print values in smarform sequentially in 3 columns in same page. see the below details for clear understanding of the requirement. the ouptup should be printed as shown below on the page and same logic is applicalbe when the data flow to the next page as well.
value1 value5 value9
value2 value6 value10
value3 value7 value11
value4 value8 value12
next page: contined
value13 value17 value21
value14 value18 value22
value15 value19 value23
value16 value20 value24
hlep me with the solution for this requirement.
regards
mano1) Define new window as type MAIN in Windows tab.
2) then go to "Page Windows" tab
select Edit > Create Element
select MAIN window from selection which is defined in step 1
3) enter window margin and width / height for window 1 (Column 1)
4) Repeast steps 2 & 3 for two more windows (for co;umn 2 & 3)
so you will have 3 windows as 3 columns of type MAIN, then if you try to print something, it will automatically flow through columns to next page
Thanks. -
Sql loader Need to load data with "," only in one filed
Hi,
I need to load data my in one column my data is in CSV format like this
Shahzaib ismail, Imran aziz, Shahmir mehmood, Shahzad khan
i want to upload this data on my table which contain only one column which is name ?
What will be the query for upload data through sql loader
Thanks
Shahzaib ismail
Oracle database Express Edition Developer 6ISince you mention you're using database version XE, I'll assume you're database version is at least 10.2
SQL> select * from v$version;
BANNER
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Productand so you have the power of:
- external tables
http://www.oracle-base.com/articles/9i/ExternalTables9i.php
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:6611962171229
- regular expressions
http://nuijten.blogspot.com/2009/07/splitting-comma-delimited-string-regexp.html
and you don't want to be using SQL*Loader anymore, never ever.
I simply put your string 'Shahzaib ismail, Imran aziz, Shahmir mehmood, Shahzad khan' in a file called test.csv and told Oracle that file is in my Oracle directory DATA_DIR (that actually points to: c:\data on my 'filesystem' ) and then:
SQL> create table t(name varchar2(155));
Table created.
SQL> -- instead of SQL*Loader use an External Table:
SQL> create table ext_t
2 ( textstring varchar2(4000)
3 )
4 organization external ( type oracle_loader
5 default directory DATA_DIR
6 access parameters (fields terminated by '' )
7 location ('test.csv')
8 );
Table created.
SQL> -- Now you can query your file as if it were a table!
SQL> select * from ext_t;
TEXTSTRING
Shahzaib ismail, Imran aziz, Shahmir mehmood, Shahzad khan
1 row selected.
SQL> -- and use the powers of SQL to do whatever you want (instead of cludging with those dreaded ctl files):
SQL> select regexp_substr (textstring, '[^,]+', 1, rownum) names
2 from ext_t
3 connect by level <= length(regexp_replace(textstring, '[^,]+'))+1;
NAMES
Shahzaib ismail
Imran aziz
Shahmir mehmood
Shahzad khan
4 rows selected.
SQL> -- Voilà, the data is loaded into the table in one single SQL statement:
SQL> insert into t
2 select trim(names)
3 from ( select regexp_substr (textstring, '[^,]+', 1, rownum) names
4 from ext_t
5 connect by level <= length(regexp_replace(textstring, '[^,]+'))+1
6 );
4 rows created.
SQL> --
SQL> select * from t;
NAME
Shahzaib ismail
Imran aziz
Shahmir mehmood
Shahzad khan
4 rows selected.Don't use SQL*Loader, use an External Table. -
What bean for date selection should I choose?
I need bean for date selection with folowing features:
1) Period selection
2) Internatioanization
I foung some components:
1) http://www.java-calendar.com/
(+) supports all need features
(-) 50$ :(
2) http://www.toedter.com/
(+) free, interationalization
(-) no period selection
3) http://sourceforge.net/projects/jdatechooser
(+) free, supports all need features
(-) project is too young, i'm searching more mature project
I have no time for long searches, so advise me component please.From your own findings it's between 1 and 3, but 3 is "too young" so it looks like 1. Spend the 50.
-
Add date (selection criteria) in MB52/MB58
Hi friends,
I must add date selection in selection screen of MB52. I have been creating ZMB52 but I don't know how can I add date field in selection screen.
Also i need to add date selection in MB58.
Can anybody help me?
Thanks,
Jawahar.hi,
data : date2 type date.
or u can use some standard fields
if u r using mara table in report u can use
data : date1 like mara-erdat.
selection-screen : begin of block blk1 with frame title text-001.
select-options : s_date2 for date2.
selection-screen : end of block blk1.
Reward with points if helpful.
Message was edited by:
Vinutha YV -
Need a single point of view on date selections for Delta and Full load IP's
Hi Experts,
Every year we are facing issues on date selections for data extraction, for example the Delta or Full selections for particular IP is like 2005 to 2008 , in this situation, for the year 2009, this IP is picking 0 records as the selections are upto 2008 only.
My requirement is, I need to check the selections of all the IP's in the system and want to change on need base if the selections are getting expired instead of going and checking manually to each and every IP as the system is having around 3000 IP's, which is a tedious job.
Guys, please let us know if there exits a Table/Program or any other way to check it.
Inputs appreciated.
Regards
NanduHi
Persistent through module RSSM_SHIP_PSEUDO_DVERSION_WRI
Primary table RSLDPIOSH
RSLDPIO Links datasource to infopackages
RSLDPIOT InfoPackage Text Description
RSLDPRULE ABAP source code for InfoPackages
RSLDPSEL Hardcoded selections in InfoPackages
RSMONICDP Contains the request-id number by data target
RSPAKPOS List of InfoPackage Groups / InfoPackages
http://help.sap.com/saphelp_nw70/helpdata/en/2e/20d704d45be7458582cdfcc5487090/frameset.htm
Hope it helps -
In JDBC Sender Adapter , the server is Microsoft SQL .I need to pass current date as the input column while Executing stored procedure, which will get me 10 Output Columns. Kindly suggest me the SQL Query String , for executing the Stored Procedure with Current date as the input .
Hi Srinath,
The below blog might be useful
http://scn.sap.com/community/pi-and-soa-middleware/blog/2013/03/06/executing-stored-procedure-from-sender-adapter-in-sap-pi-71
PI/XI: Sender JDBC adapter for Oracle stored procedures in 5 days
regards,
Harish -
Date selection in query : logic needed!
Hi,
we have one calendar day depending on which the query result is displayed!
Now the requirement is such that when user enters one date the query has to generate the result for the multiple date ranges including the one which he has entered.
example: if user has entered 15/9/2007 then query should not only display the result of the date 15/9/2007 but also the results of -5 to +2 ( means 10/9,11/9,12/9,13/9 and 14/9 plus 16/9 and 17/9 )
simlarly other ranges like -8 to + 7 and so on
How to define this in query?
Thanks,
RaviHello ,
I need to make a graph conveying the information of the deliveries by comparing the goods issue date and promised date !
report also requires how many deliveries were on time, how many were late and how many were early!
for this requirement, i had thought of making a date selection field which is promised date and make furthur more date ranges selections by query it self so that late deliveries and early deliveries also covered in these date ranges.
-5 to + 2 is that one range which is on time delivery range
if the delivery is more eally than the -5 days then it is early delivery. even in ealry delivery i want to make how early it is.
and suppose the delivery has crossed the promised date 2 days more then it is late delivery.
all has to be acheived by single date selection and there after the logic which takes care of all the date ranges i had explained.
i am looking for that logic which i am not finding
Hope this is clear now
Thanks,
Ravi -
Date format needs to be in selection screen mm/dd/yyyy but in alv output ..
hi
i need help on displaying date in alv output
date format needs to be in selection screen mm/dd/yyyy but in alv output ..it should be displayed as yyyymmdd
regards
Nishanthi,
you are passing the value to ALv using an internal table.
so store the format YYYYMMDD date in the internal table and pass it to ALV.
use the below FM
DD/MM/YYYY -> YYYYMMDD
<b>CONVERSION_EXIT_PDATE_INPUT</b>
rgds
Anver -
Why do we need the "Modify Date" column?
The subject says it all. Why do we need that column? It just occupies real estate.
I don't mean to be critical of you, Dave, but a "That's just the way it is" response leads to apathy, and apathy leads to junkware, and junkware leads to hate...
Nobody needs the modification date to be on the screen.
-Noel -
Need help with JTable data selection.
Hi,
I have a table with multiple rows and each row has a checkbox.user might select checkbox for any row. i want to capture data of all those rows where checkbox is checked. i need to capture data on the click event of my Jbutton.kindly suggest how to proceed.
Thankshii,
1/ capture = PrintScreen
2/ capture = New Window
3/ capture = somehow to save selected row(s)
... kopik -
Read data in the first column selected in a Multicolumn listbox
When a row is selected in a multicolumn listbox (1 item), how do I go about reading the data in the first column?
Solved!
Go to Solution.The multicolumn listbox itself is numeric array data type. If you have allowed selection of only 1 item and selection mode of select entire row, it returns the row number. Use the "Item Names" property node to return a 2d array of strings of the items in your box. Index it by the row from the value of the listbox and column 0. See attached code.
Charles Chickering
Architecture is art with rules.
...and the rules are more like guidelines
Attachments:
MultiColumnListbox.vi 5 KB -
Need help in writing SELECT (strange, to many data in output?)
Hi,
I have:drop table jk_t1;
drop table jk_t2;
create table jk_t1 (
c1 number,
c2 varchar2(3),
c3 number
create table jk_t2 (
d1 number primary key,
d2 varchar2(4)
alter table jk_t1 add constraint t1_t2_fk foreign key (c3) references jk_t2(d1);
insert into jk_t2 values (1,'T2_1');
insert into jk_t1 values (1,'A11',1);
insert into jk_t1 values (2,'A21',1);
commit;I need to write a SELECT to get an output as:<ALL>
<D1>1</D1>
<D2>T2_1</D2>
<INN>
<T1>
<ROW><C1>1</C1><C2>A11</C2><C3>1</C3></ROW>
<ROW><C1>2</C1><C2>A21</C2><C3>1</C3></ROW>
</T1>
</INN>
</ALL>I'm trying:SELECT XMLElement("ALL",
extract(XMLType(CURSOR(SELECT t2.*, XMLElement("T1",extract(XMLType(CURSOR(
SELECT t1.*
FROM jk_t1 t1
WHERE t1.c3=t2.d1
)), '//ROW')) as inn
FROM jk_t2 t2
ORDER BY d2)
),'//ROW/*')
) AS output
FROM dual;but the output is<ALL>
<D1>1</D1>
<D2>T2_1</D2>
<INN>
<T1>
<ROW><C1>1</C1><C2>A11</C2><C3>1</C3></ROW>
<ROW><C1>2</C1><C2>A21</C2><C3>1</C3></ROW>
</T1>
</INN>
<C1>1</C1>
<C2>A11</C2>
<C3>1</C3>
<C1>2</C1>
<C2>A21</C2>
<C3>1</C3>
</ALL>What SELECT should it be to give me the correct output?
Thanks in advance,
JackKHi,
Drop the CURSOR thing, and use only SQL/XML functions :
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
CORE 10.2.0.5.0 Production
TNS for 64-bit Windows: Version 10.2.0.5.0 - Production
NLSRTL Version 10.2.0.5.0 - Production
SQL>
SQL> set long 5000
SQL>
SQL> select xmlelement("ALL",
2 xmlelement("D1", d1)
3 , xmlelement("D2", d2)
4 , xmlelement("INN",
5 xmlelement("T1",
6 xmlagg(
7 xmlelement("ROW",
8 xmlforest(c1, c2, c3)
9 )
10 )
11 )
12 )
13 ).extract('/*') -- for display purpose only
14 from jk_t2 t2
15 join jk_t1 t1 on t1.c3 = t2.d1
16 group by t2.d1, t2.d2 ;
XMLELEMENT("ALL",XMLELEMENT("D
<ALL>
<D1>1</D1>
<D2>T2_1</D2>
<INN>
<T1>
<ROW>
<C1>1</C1>
<C2>A11</C2>
<C3>1</C3>
</ROW>
<ROW>
<C1>2</C1>
<C2>A21</C2>
<C3>1</C3>
</ROW>
</T1>
</INN>
</ALL>
{code}
Maybe you are looking for
-
How can a family share an iPad, specifically, using email? Seperate account
I know, you can have multiple email accounts. i have 3 on my iphone 4. But if my wife, daughter, and I all use the ipad. Can you set up email to ask for what account to load? Again, i know you can switch after the fact. I am trying to avoid the scena
-
I am curious as to why you can't direct print an XML Publisher Report just like any other Oracle report. If you can print Oracle reports in PDF straight to the printer, why do XML Publisher reports require ps2pdf (note:338990.1)? We are having many i
-
Can I use a pen stylus on my Touchsmart 310 desktop?
or can I only use my finger?
-
Error when installing Oracle 11g
Hi, I downloaded Oracle 11g last week, which is in two zip files. I extracted the files into the same folder as per instructions. The problem is that when I tried to install I got error "Could not find main class. program will now exit" I am installi
-
Full screen crosshair for partial screenshot with import
I frequently use import to take partial screenshots, but the tiny crosshair cursor that comes up after calling import is not very useful in helping me select the screen area that I want. Can I change the cursor to a full-screen crosshair, i.e. a hori