V arying date ranges
<p>I have a problem designing a report in such a way that the date range is easily selectable. I want a number of options.</p><ol type="1"><li>Display everything</li><li>Display all records in a given range, e.g. 10 Jun 2007 to 17 Jun 2007</li><li>Display everything before a given date</li><li>Display everything after a given date</li></ol><p> It's easy enough to pass a start and end date in as parameter fields, but then it gets tricky. I think I should be able to use a "range" parameter field of type string and use formula with a select to set start and end dates as appropriate. As a first attempt, I have tried setting an early start date, if the range is set to all. The formula I have is:</p>
<pre> {EVENT.WHEN} in ( select {?Range} case "All": Date( 2000, 1, 1 ) default: {?Start} ) to {?End}<br /></pre>
<p>When Range is set to "Between" and the dates are set to 10 Jun 2007 and 17 Jun 2007 this displays the expected data. When I set Range to "All" nothing is displayed. This is unexpected, at least to me.</p>
<p>First question is, is there a better way of approaching the problem?</p>
<p>Second question is why the formula behaves this way?</p>
<p>BTW the data is coming from a Derby database accessed via JDBC.</p>
<p> After some more adventures with Google, I have found that <p>
<code>
select {?Range}
case "All":
true
case "Before":
{EVENT.WHEN} < {?End}
default:
{EVENT.WHEN} in {?Start} to {?End}
</code>
<p>works and is also clearer.</p>
<p>It still doesn't explain why the original formula didn't work, but we all love a mystery, don't we? </p>
Similar Messages
-
Calculating fractions of hours from time date range
Hello friends,
I'm using sql server 2008 r2 and I have a table called attendance with the following fields
attendance_no int
attendance_date date
attendance_timein time(7)
attendance_timeout time(7)
emp_id int
and another table called employee with the following fields
emp_id int
emp_name varchar(50)
emp_tel varchar(50)
I need to calculate the total minutes worked as well as total hours worked for each employee with in a specified date range and I created the below query which working fine but it is not calculating the fractions of hours, I mean when an employee works
for example 7 and half hours, its showing just 7 hours instead of 7.5 hours.
SELECT a.attendance_date As 'Date',e.emp_id As 'ID',e.emp_name As 'Name',e.emp_tel As 'Telephone',left(a.attendance_timein,8)[Time in],left(a.attendance_timeout,8)[Time out],
+ CAST(DATEDIFF(second, attendance_timein, attendance_timeout) / 60 AS NVARCHAR(50)) As 'Total minutes',
CAST(DATEDIFF(second,attendance_timein,attendance_timeout) / 60 /60 % 60 AS NVARCHAR(50)) As 'Total hours'
from attendance a join employee e on e.emp_id=a.emp_id and a.attendance_date between '2014-11-06' and '2014-11-08' and e.emp_tel='65098009'
I would appreciate any help about this.
Thanks in advance
MohamoudIf I understand correctly, according to
Mohamoud's data sample, there is already Total minutes in the input (the above
table Mohamoud posted)
and all he need is a simple convert to decimal and the divided by 60.
select [Total minutes] / 60.c
Mohamoud,
is that correct?
The result show that you might need some rounding. for example 31/60 is 0.516666 while you show us 0.5
Please clarify if you need rounding and how many characters after the dot you need (this can be done using declaring decimal(x,y), converting, or multipla and using floor function, etc')
Ronen Ariely
[Personal Site] [Blog] [Facebook] -
Multi-month, year, and date-range views
My apologies for wasting everyone's time if I've missed something really obvious here, but am I correct in concluding that there is no way to generate anything beyond a static one-month view in iCal? No multi-month view? No year view? No "view date range"? At this stage of the game, how is it possible that something so elemental could be omitted from this program?
At this point I'm reduced to exporting each month to a pdf file and then arranging them as tiles on the screen. But there has to be a better way.
Short of a new version from Apple, are there any plug-ins that would do this? Does anyone have any other work-arounds? Thanks in advance.A quick search of the forums shows that this is a HIGHLY sought after feature (including by me). We all need to use the feed back link (below) to let Apple know this. In my experience with the tech support folks, they seem to have NO idea about what these forums say. In the past I have actually had them log in to these forums and search the issue I was calling them about and they have been blown away when they see the hundreds / thousands of posts with the very same thing they're discussing with me. So, as the wise man says .. "you don't ask, you don't get!" Use the form and let them know...
http://www.apple.com/feedback/ical.html -
How to get top 11 values per date range
I want to get the top 11 values by date range.
Sample Data
CREATE TABLE SAMPLE_DATA
DOMAIN_NAME VARCHAR2(100),
QTD NUMBER,
LOAD_DATE DATE
-- Insert
BEGIN
FOR lc IN 1..20
LOOP
FOR ld IN 1..30
LOOP
INSERT
INTO SAMPLE_DATA VALUES
'DM_'
||lc,
round(dbms_random.value(0,1000)),
SYSDATE-ld
END LOOP;
END LOOP;
COMMIT;
END;
SELECT *
FROM
(SELECT DOMAIN_NAME,
QTD,
LOAD_DATE
FROM
(SELECT DOMAIN_NAME,
QTD,
LOAD_DATE
FROM SAMPLE_DATA
WHERE LOAD_DATE = TRUNC(SYSDATE-3)
ORDER BY QTD DESC
WHERE ROWNUM <=10
UNION ALL
SELECT 'Others' DOMAIN_NAME,
SUM(QTD) QTD,
LOAD_DATE
FROM
(SELECT DOMAIN_NAME,
QTD,
LOAD_DATE
FROM
(SELECT rownum rn,
DOMAIN_NAME,
QTD,
LOAD_DATE
FROM
(SELECT DOMAIN_NAME,
QTD,
LOAD_DATE
FROM SAMPLE_DATA
WHERE LOAD_DATE = TRUNC(SYSDATE-3)
ORDER BY QTD DESC
WHERE rn > 10
GROUP BY LOAD_DATE
ORDER BY QTD DESC
-- Result
DOMAIN_NAME QTD LOAD_DATE
Others 2888 24/03/13
DM_1 1000 24/03/13
DM_20 933 24/03/13
DM_11 913 24/03/13
DM_3 743 24/03/13
DM_13 572 24/03/13
DM_12 568 24/03/13
DM_9 564 24/03/13
DM_6 505 24/03/13
DM_5 504 24/03/13
DM_2 480 24/03/13
Please, Help me get in one query this result using a range of date.
e.g
using LOAD_DATE BETWEEN '24/03/13' AND '25/03/13'
DOMAIN_NAME QTD LOAD_DATE
Others 2888 24/03/13
DM_1 1000 24/03/13
DM_20 933 24/03/13
DM_11 913 24/03/13
DM_3 743 24/03/13
DM_13 572 24/03/13
DM_12 568 24/03/13
DM_9 564 24/03/13
DM_6 505 24/03/13
DM_5 504 24/03/13
DM_2 480 24/03/13
Others 1948 25/03/13
DM_1 807 25/03/13
DM_8 764 25/03/13
DM_7 761 25/03/13
DM_11 656 25/03/13
DM_18 611 25/03/13
DM_17 523 25/03/13
DM_14 467 25/03/13
DM_19 447 25/03/13
DM_15 437 25/03/13
DM_6 380 25/03/13 Thank you in advance.I got the solution. Just sharing.
I used analytic functions that make my job easy.
Sample Data
DOMAIN_NAME QTD LOAD_DATE
DM_1 807 25/03/2013
DM_1 1000 24/03/2013
DM_2 226 25/03/2013
DM_2 480 24/03/2013
DM_3 244 25/03/2013
DM_3 743 24/03/2013
DM_4 48 25/03/2013
DM_4 413 24/03/2013
DM_5 164 25/03/2013
DM_5 504 24/03/2013
DM_6 380 25/03/2013
DM_6 505 24/03/2013
DM_7 761 25/03/2013
DM_7 212 24/03/2013
DM_8 764 25/03/2013
DM_8 308 24/03/2013
DM_9 354 25/03/2013
DM_9 564 24/03/2013
DM_10 214 25/03/2013
DM_10 367 24/03/2013
DM_11 656 25/03/2013
DM_11 913 24/03/2013
DM_12 37 25/03/2013
DM_12 568 24/03/2013
DM_13 332 25/03/2013
DM_13 572 24/03/2013
DM_14 467 25/03/2013
DM_14 87 24/03/2013
DM_15 437 25/03/2013
DM_15 450 24/03/2013
DM_16 238 25/03/2013
DM_16 299 24/03/2013
DM_17 523 25/03/2013
DM_17 143 24/03/2013
DM_18 611 25/03/2013
DM_18 145 24/03/2013
DM_19 447 25/03/2013
DM_19 464 24/03/2013
DM_20 91 25/03/2013
DM_20 933 24/03/2013 Top 11 QTD of DOMAIN_NAME per Data Range.
SELECT *
FROM
(SELECT DOMAIN_NAME,
QTD,
LOAD_DATE
FROM
(SELECT LOAD_DATE,
DOMAIN_NAME ,
QTD,
(DENSE_RANK() OVER (PARTITION BY LOAD_DATE ORDER BY QTD DESC )) AS RANK_QTD
FROM SAMPLE_DATA
WHERE trunc(load_date) BETWEEN '24/03/2013' AND '25/03/2013'
WHERE RANK_QTD <= 10
UNION ALL
SELECT 'Others',
SUM(QTD) AS QTD,
LOAD_DATE
FROM
(SELECT LOAD_DATE,
DOMAIN_NAME ,
QTD,
(DENSE_RANK() OVER (PARTITION BY LOAD_DATE ORDER BY QTD DESC )) AS RANK_QTD
FROM SAMPLE_DATA
WHERE trunc(load_date) BETWEEN '24/03/2013' AND '25/03/2013'
WHERE RANK_QTD > 10
GROUP BY LOAD_DATE
ORDER BY LOAD_DATE ASC,
QTD DESC
DOMAIN_NAME QTD LOAD_DATE
Others 2888 24/03/2013
DM_1 1000 24/03/2013
DM_20 933 24/03/2013
DM_11 913 24/03/2013
DM_3 743 24/03/2013
DM_13 572 24/03/2013
DM_12 568 24/03/2013
DM_9 564 24/03/2013
DM_6 505 24/03/2013
DM_5 504 24/03/2013
DM_2 480 24/03/2013
Others 1948 25/03/2013
DM_1 807 25/03/2013
DM_8 764 25/03/2013
DM_7 761 25/03/2013
DM_11 656 25/03/2013
DM_18 611 25/03/2013
DM_17 523 25/03/2013
DM_14 467 25/03/2013
DM_19 447 25/03/2013
DM_15 437 25/03/2013
DM_6 380 25/03/2013 -
Can not set data range for a numerical control
I want to set the maximum of data range to 5000, but it always went back to default value of 127.
WHy I can not change the data range? Thanka for explanations.
Message Edited by Dejun on 11-14-2007 11:47 PM
Attachments:
datarange.jpg 74 KBSo hit the 'Representation' button.
Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas
LabVIEW, programming like it should be! -
I am trying to develop a query in MS Access 2010 to join two tables using three joins, one of which is a (between) date range. The tables are contained in Access. The reason
the tables are contained in access because they are imported from different ODBC warehouses and the data is formatted for uniformity. I believe this cannot be developed using MS Visual Query Designer. I think writing a query in SQL would be suiting this project.
ABCPART links to XYZPART. ABCSERIAL links to XYZSERIAL. ABCDATE links to (between) XYZDATE1 and ZYZDATE2.
[ABCTABLE]
ABCORDER
ABCPART
ABCSERIAL
ABCDATE
[ZYXTABLE]
XYZORDER
XYZPART
XYZSERIAL
XYZDATE1
XYZDATE2Thank you for the looking at the post. The actual table names are rather ambiguous. I renamed them so it would make more sense. I will explain more and give the actual names. What I do not have is the actual data in the table. That is something I don't have
on this computer. There are no "Null" fields in either of the tables.
This table has many orders (MSORDER) that need to match one order (GLORDER) in GLORDR. This is based on MSPART joined to GLPART, MSSERIAL joined to GLSERIAL, and MSOPNDATE joined if it falls between GLSTARTDATE and GLENDDATE.
[MSORDR]
MSORDER
MSPART
MSSERIAL
MSOPNDATE
11111111
4444444
55555
2/4/2015
22222222
6666666
11111
1/6/2015
33333333
6666666
11111
3/5/2015
This table has one order for every part number and every serial number.
[GLORDR]
GLORDER
GLPART
GLSERIAL
GLSTARTDATE
GLENDDATE
ABC11111
444444
55555
1/2/2015
4/4/2015
ABC22222
666666
11111
1/5/2015
4/10/2015
AAA11111
555555
22222
3/2/2015
4/10/2015
Post Query table
GLORDER
MSORDER
GLSTARTDATE
GLENDDATE
MSOPNDATE
ABC11111
11111111
1/2/2015
4/4/2015
2/4/2015
ABC22222
22222222
1/5/2015
4/10/2015
1/6/2015
ABC22222
33333333
1/5/2015
4/10/2015
3/5/2015
This is the SQL minus the between date join.
SELECT GLORDR.GLORDER, MSORDR.MSORDER, GLORDR.GLSTARTDATE, GLORDR.GLENDDATE, MSORDR.MSOPNDATE
FROM GLORDR INNER JOIN MSORDR ON (GLORDR.GLSERIAL = MSORDR.MSSERIAL) AND (GLORDR.GLPART = MSORDR.MSPART); -
No Data in Reports Details in Custom date range
Hello, iTunes U Public Site Manager Admins.
As the iTunes U Public Site Manager admin, I've been trying to access our institution's iTunes U Reports Details for a couple of days. (I send a monthly report of usage to our course/collection contributors.) When I custom the date range, under Details, there is zero entry; "No data available in table" message is shown.
This feature had been working well since Apple iTunes U added this enhancement on August 13, 2013. The report Details showed the exact stats for Browse, Subscribe, Download, Stream, and Enclosure for each course/collection in the custom date range.
Now under "Details", the data is shown only when the date range is Last 30 Days. It shows no data in custom date range when the Calendar is used to select a Start Date and End Date.
Has anyone else noticed this problem?
Thanks.
Q. WangErik.
I used your suggestion and it worked very well. This is how I did it.
Export the range of data that includes Feb. 1-Feb. 28, 2014 as .tsv file.
Open that file in Excel.
Add a blank column next to the Date column. Use function =Month() to just extract the month into the new column. Fill down the whole column. Then copy and paste special (value) into the same column (I have over 26,000 rows of data in the file.) Converting to Value will allow for the next step of PivotTable.
Create a PivotTable for the 26,000 rows of data. Use Month as the Report filter, iTunes_ID as the Row Labels, Select Browse, Subscribe, etc. as the Sum Values. (The result is a summary table with about 200 rows.)
I then do a Vlookup to my premade Master file to add Category (course, collection, resources) and Instructor Name to each of the 200 rows.
That will do it for my monthly report.
Thanks for your tip again. I did not know the .tsv file would have DATE for each item.
Sincerely,
Q. Wang -
Continious data range algorithm
I have in my database table 2 important date columns: StartDate (Not null) and EndDate(Allowed Null).
I want to ensure that all records in the table would always create perfect contiues date ranges with no holes inside.
Wor example there may not be records [1-may..1-may, 3-may-...] because there would be a hole [2-may...2-may]. Holes are not allowed.
And overlapping is not allowed, for example [1-may..1-may, 1-may-2may, 3-may-...] is not allowed because overlapping occures on day 1-may. Overlapping and holes are not allowed. But it is allowed that table has no records at all. But all DML manipulations with existing records must ensure that overlapping and holes won't occur.
How to write such check? How to ensure that data ranges would stay continous with no holes and no overlaps?
Oracle 11g.You're setting the wrong value for the start of a group when there is no (null) lagging end date. In my example I set the value to 0 when it was null as I was expecting each group to start at 1. In your case you've set the date to 1/1/1900 which isn't necessarily the day before the first start date of the group. Instead just default it to the start date - 1 to force a match...
SQL> ed
Wrote file afiedt.buf
1 with t as (select 1 as id, to_date('01.04.2013', 'DD.MM.YYYY') as val1, to_date('04.04.2013', 'DD.MM.YYYY') as val2 from dual union all
2 select 1, to_date('05.04.2013', 'DD.MM.YYYY'), to_date('06.04.2013', 'DD.MM.YYYY') from dual union all
3 select 1, to_date('07.04.2013', 'DD.MM.YYYY'), null from dual union all
4 select 2, to_date('01.04.2013', 'DD.MM.YYYY'), to_date('03.04.2013', 'DD.MM.YYYY') from dual union all
5 select 2, to_date('04.04.2013', 'DD.MM.YYYY'), to_date('07.04.2013', 'DD.MM.YYYY') from dual union all
6 select 2, to_date('09.04.2013', 'DD.MM.YYYY'), to_date('12.04.2013', 'DD.MM.YYYY') from dual union all
7 select 2, to_date('13.04.2013', 'DD.MM.YYYY'), null from dual union all
8 select 3, to_date('01.04.2013', 'DD.MM.YYYY'),to_date('03.04.2013', 'DD.MM.YYYY') from dual union all
9 select 3, to_date('04.04.2013', 'DD.MM.YYYY'), null from dual union all
10 select 4, to_date('01.04.2013', 'DD.MM.YYYY'), to_date('01.04.2013', 'DD.MM.YYYY') from dual union all
11 select 4, to_date('01.04.2013', 'DD.MM.YYYY'), null from dual
12 )
13 --
14 select id
15 ,val1 as "start"
16 ,val2 as "end"
17 ,lag(val2) over (partition by id order by val1)
18 ,case when
19 nvl(lag(val2) over (partition by id order by val1),val1-1) != val1-1 then
20 'hole or overlap'
21 else null
22 end as chk
23 from t
24* order by 1, 2
25 /
ID start end LAG(VAL2)OVER(PARTIT CHK
1 01-APR-2013 00:00:00 04-APR-2013 00:00:00
1 05-APR-2013 00:00:00 06-APR-2013 00:00:00 04-APR-2013 00:00:00
1 07-APR-2013 00:00:00 06-APR-2013 00:00:00
2 01-APR-2013 00:00:00 03-APR-2013 00:00:00
2 04-APR-2013 00:00:00 07-APR-2013 00:00:00 03-APR-2013 00:00:00
2 09-APR-2013 00:00:00 12-APR-2013 00:00:00 07-APR-2013 00:00:00 hole or overlap
2 13-APR-2013 00:00:00 12-APR-2013 00:00:00
3 01-APR-2013 00:00:00 03-APR-2013 00:00:00
3 04-APR-2013 00:00:00 03-APR-2013 00:00:00
4 01-APR-2013 00:00:00 01-APR-2013 00:00:00
4 01-APR-2013 00:00:00 01-APR-2013 00:00:00 hole or overlap
11 rows selected. -
Date range query problem in report
Hi all,
I have created a report based on query and i want to put date range selection but query giving problem.
If i am creating select list selection then it is working fine means it will display all records on the particular date.
But what i need is that user will enter date range as creation_date1,creation_date2 and query should return all the records between these date range. i want to pass it by creating items, i created two items and passing creation_date range to display all records but not displaying and if not passing date then should take null as default and display all records
Here is the query:
/* Formatted on 2006/12/10 20:01 (Formatter Plus v4.8.0) */
SELECT tsh."SR_HEADER_ID", tsh."SALES_DEPT_NUMBER", tsh."COUNTRY",
tsh."LOCAL_REPORT_NUMBER", tsh."ISSUE_DATE", tsh."SUBJECT",
tsh."MACHINE_SERIAL_NUMBER", tsh."MACHINE_TYPE", tsh."MACHINE_HOURS",
tsh."STATUS"
FROM "TRX_SR_HEADERS" tsh, "TRX_SR_PARTS" tsp
WHERE (tsh.status LIKE :p23_status_sp OR tsh.status IS NULL)
AND (tsh.machine_type LIKE :p23_machine_type_sp)
AND ( tsh.machine_serial_number LIKE
TO_CHAR (:p23_machine_serial_number_sp)
OR tsh.machine_serial_number IS NULL
AND ( TO_CHAR (tsh.failure_date, 'DD-MON-YY') LIKE
TO_CHAR (:p23_failure_date_sp)
OR TO_CHAR (tsh.failure_date, 'DD-MON-YY') IS NULL
AND ( TO_CHAR (tsh.creation_date, 'DD-MON-YY')
BETWEEN TO_CHAR (:p23_creation_date_sp)
AND TO_CHAR (:p23_creation_date_sp1)
OR TO_CHAR (tsh.creation_date, 'DD-MON-YY') IS NULL
AND (tsh.issue_date LIKE :p23_date_of_issue_sp OR tsh.issue_date IS NULL)
AND (tsh.country LIKE :p23_country_sp OR tsh.country IS NULL)
AND ( tsh.local_report_number LIKE TO_CHAR (:p23_local_rep_num_sp)
OR tsh.local_report_number IS NULL
AND ( tsp.part_number LIKE TO_CHAR (:p23_part_number_sp)
OR tsp.part_number IS NULL
AND tsh.machine_type IN (
SELECT DISTINCT machine_type
FROM trx_sales_dept_machine_list
WHERE sales_department_id IN (
SELECT DISTINCT sales_department_id
FROM trx_user_sales_department
WHERE UPPER (user_name) =
UPPER ('&APP_USER.'))
AND SYSDATE >= valid_from)
AND tsh.sr_header_id = tsp.sr_header_id
can any one tell me wat is wroung in this query.
Any other way to write this?
Thank You,
AmitHi User....
Here is some date range SQL that my teams uses with some success:
For date columns that do not contain NULL values, try this (note the TRUNC, it might help with your "today" problem).
The hard coded dates allow users to leave the FROM and TO dates blank and still get sensible results (ie a blank TO date field asks for all dates in the future.
AND TRUNC(DATE_IN_DATABASE)
BETWEEN
decode( :P1_DATE_FROM,
TO_DATE('01-JAN-1900'),
:P1_DATE_FROM)
AND
decode( :P1_DATE_TO,
TO_DATE('31-DEC-3000'),:
:P1_DATE_TO)
For date columns that contain NULL values, try this (a little bit trickier):
AND nvl(TRUNC(DATE_IN_DATABASE),
decode( :P1_DATE_FROM,
decode( :P1_DATE_TO,
TO_DATE('30-DEC-3000'),
NULL),
NULL)
BETWEEN
decode( :P1_DATE_FROM,
TO_DATE('01-JAN-1900'),
:P1_DATE_FROM)
AND
decode( :P1_DATE_TO,
TO_DATE('31-DEC-3000'),
:P1_DATE_TO)
Note the 30-DEC-3000 versus 31-DEC-3000. This trick returns the NULL dates when the FROM and TO date range items are both blank.
I hope this helps.
By the way, does anyone have a better way of doing this? The requirement is given a date column in a database and a FROM and a TO date item on a page,
find all of the dates in the database between the FROM and TO dates. If the FROM date is blank, assume the user want all dates in the past (excluding NULL dates). If the TO date is blank, assume that the user wants all of the dates in the future (excluding NULL dates). If both FROM and TO dates are blank, return all of the dates in the databse (including NULL dates).
Cheers,
Patrick -
Report for open invoice value against GR done within a date range
Dear experts ,
I need a report between date ranges for which there is a GR done , but invoice is pending .
Where can i get this ?
Regards
Anishi,
You can check few default PO reports wid proper paramater in it
or
Can check table EKBE
or
Check PO history in the PO doc
Or
Check the ME80FN
Regards
Priyanka.P -
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. -
How to create a date range in Web Application Designer
I am using 3.1 version of Web App Designer. I need to create a report with date ranges. I can get one date to work but not two (I need a start date and end Date). My Query has 0CALMONTH with a variable for Interval. When I select it as a dropdown (??) in Web App Designer, I only get one date prompt in web app designer.
Any suggestions??
Thanks
KristenHi Kristen,
I'm sorry i'm not coming to solve your problem,but for the trouble I have had,and I want to create a date picker in Web Application Designer,so if you have solved the problem ,please email to me? [email protected] ,thx very much!
best regards
zegion chan -
Query for all open sales order with a date range
Hi Experts!
I wrote this query that will look up all open sales order of a particular customer and how much was served:
SELECT T0.[DocNum] 'OS #', T0.[DocDate] 'Posting Date', T0.[CardName] 'Customer', T1.[Dscription] 'Item Description',T4.[SalUnitMsr] 'Sales UOM', T4.[InvntryUom] 'Invty UOM', T1.[UseBaseUn] 'Use of Invty UOM' , T1.[Quantity], T1.[Quantity]-T1.[OpenQty] 'Served Qty', T1.[OpenQty] 'Unserved Qty' FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCTG T2 ON T0.GroupNum = T2.GroupNum INNER JOIN OSLP T3 ON T0.SlpCode = T3.SlpCode INNER JOIN OITM T4 ON T1.ItemCode = T4.ItemCode WHERE T0.[DocStatus] = 'O' and T0.[CardName] =[%0]
However, I don't know how to input a parameter for the date range in a query. Can anyone help with this issue?
Your input will be highly appreciated.
Warm regards,
JenHiiiiiii
Try This.....
SELECT T0.DocNum 'OS #', T0.DocDate 'Posting Date', T0.CardName 'Customer', T1.Dscription 'Item Description',T4.SalUnitMsr 'Sales UOM', T4.InvntryUom 'Invty UOM', T1.UseBaseUn 'Use of Invty UOM' , T1.Quantity, T1.Quantity, T1.OpenQty 'Served Qty', T1.OpenQty 'Unserved Qty' FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCTG T2 ON T0.GroupNum = T2.GroupNum INNER JOIN OSLP T3 ON T0.SlpCode = T3.SlpCode INNER JOIN OITM T4 ON T1.ItemCode = T4.ItemCode WHERE T0.DocStatus = 'O' and T0.CardName ='[%0]' and (T0.DocDate>='[%1]' and T0.DocDate<='[%2]')
Regards, -
I am creating a report from a series of inputs using a customizable date range. I need to select a start and end date (i was going to use two calendars for that) and place the data from the range into a pivot table. Any help on how to do this would be
great.use the date picker control, see the thread:
http://superuser.com/questions/59939/date-selector-popup-in-excel
KR
Maybe you are looking for
-
I got a replacement ipod and did the restore data through itunes with its sync in my laptop, however, after itunes process is finished the ipod does not let me choose to continue or to finish the process, what should I do?,
-
Problems with the examples in NWDS
Hi All, Running the Welcome example project in NWDS i have the included error. I have problems with other examples too. I did all the step by step tutorials. I have NWDS 2.0.3 J2EE 6.40 SP15 EP 2004 I am new in NWDS and i have not
-
I have never heard the fans in this 20-inch 2.4 GHz iMac and yesterday the temp was showing just over 140 degrees F while updating some software. Three questions: At what temp should the fans turn ON? At what temp will the iMac shut down? Anyway to m
-
You know that bar that you type in a website, mines gone. How do i get it back?
I'm missing the bar at the top where you type in at the website you want to go to.
-
Miscellaneous and random error...
Heya, So I was just working away as usual, and my Time Machine application started backing up, as it does every hour. And then it popped up this error. It just said: "Time Machine Error: Unable to complete backup. An error occurred while copying file