Display month and year in dropdown list on selection screen
Hi
Can anyone tell me how to display months and year in a dropdown list on a selection screen?
also please tell me how to get the first and the last dates upon selecting the month and year on the dropdown list.
Month: January Year:2007 .
After selecting the required month and year, the first date and last date i.e '01.01.2007 - 31.01.2007' should be displayed on the right side.
Reward Points assured..
thanks,
Chetan
Hi..,
<b>
Just copy, paste and execute this program !!</b>
type-pools: vrm.
parameters : p_month(2) type n as listbox visible length 10,
p_year(4) type n as listbox visible length 10.
DATA : W_DATE type d, w_ldate type d.
initialization.
perform user_drop_down_list_fordt.
perform user_drop_down_list_foryr.
start-of-selection.
concatenate p_year p_month '01' into w_date.
call function 'BKK_GET_MONTH_LASTDAY'
exporting
i_date = w_date
IMPORTING
E_DATE = w_ldate
write /: w_date,w_ldate.
build user_drop_down_list
form user_drop_down_list_fordt.
data: name type vrm_id,
list type vrm_values,
value like line of list.
data: t_months type t247 occurs 0 with header line.
clear list. refresh list.
name = 'P_MONTH'.
select * into table t_months
from t247 where spras eq 'EN'.
sort t_months ascending by mnr.
loop at t_months.
clear value.
value-key = t_months-mnr.
value-text = t_months-ltx.
append value to list.
endloop.
Set the values
call function 'VRM_SET_VALUES'
exporting
id = name
values = list.
endform.
for year...
form user_drop_down_list_foryr.
data: name type vrm_id,
list type vrm_values,
value like line of list.
clear list. refresh list.
name = 'P_YEAR'.
do 9999 times.
clear value.
value-key = sy-index.
append value to list.
enddo.
Set the values
call function 'VRM_SET_VALUES'
exporting
id = name
values = list.
endform.
<b>
Hope this solves ur problem..</b>
regards,
sai ramesh
Similar Messages
-
Using htmlb:dateNavigator to only display month and year
Hi all,
I would like to use the dateNavigator to allow the user to choose a month and a year BUT NOT a day. Does anyone know if this is possible? Would it make sense to use htmlb:dateNavigator for this or should I use some other means?
Thanks a lot for your help.
Best Regards
JensI am not sure whether you can use dateNavigator for this case , similar case we have used htmlb:dropdownListBox
<htmlb:dropdownListBox id = "period"
nameOfKeyColumn = "NAME"
nameOfValueColumn = "VALUE"
table = "<%= tab1 %>"
onSelect = "DDLB1Event"
selection = "<%= period %>"
width = "110"
disabled = "<%= dd_disable %>" />
ta1 is of type TIHTTPNVP which we populated with year and month.
Regards
Raja -
How to use dropdown list in selection screen
Hi everyone.
I'm stating a new report and a drop down list is required in initial filtering. I red different articles in google but istill just don't get it... please help...Sample Code:
TYPE-POOLS: vrm.
DATA: name TYPE vrm_id, list TYPE vrm_values, value LIKE LINE OF list.
* List box
PARAMETERS: ps_parm AS LISTBOX VISIBLE LENGTH 10.
INITIALIZATION.
* Populate list box values
name = 'PS_PARM'.
value-key = '1'. value-text = 'Line 1'. APPEND value TO list.
value-key = '2'. value-text = 'Line 2'. APPEND value TO list.
AT SELECTION-SCREEN OUTPUT.
* Set list box with value
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
id = name
values = list.
START-OF-SELECTION.
WRITE: / 'Parameter:', ps_parm.
Regards,
Angelo. -
Dropdown list in selection screen linking with Ztable
Hi,
In selection screen, i coded for parameter with dropdownlist with hardcoded values in the list. Client asking me link this list to Z table fields so that whenever they make entries in future just he need to create a variant for the new entries and program should work accordingly.Hi,
Select the required entries from the Ztable and pass them to the function module VRM_SET_VALUES for populating the list box .
However there is a restriction .
The maximum number of possible entries available (less than 40),If ,suppose large number of entries are there in Z table.
Selection from the drop-down list box menu is hindered by a scroll bar (due to a large number of entries) .
Also Sorting is not supported in drop-down list box menus, so the user is not offered ny help in managing huge number of values.
I would better suggest to go for a select-options or parameters attached with F4 help.
Regards,
Lakshman -
Dropdown list in selection screen
Hi guys,
I am having a drop down list of 5 values in my selection screen.
I am able to show the list of values in the droplist of the selection screen.
How should I set default value in the list.
Regards
macREPORT ztest1234.
type-POOLs : vrm.
PARAMETERS : dr1 as LISTBOX VISIBLE LENGTH 20,
dr2 as LISTBOX VISIBLE LENGTH 20.
DATA : lv_values TYPE vrm_values,
lv_values1 TYPE vrm_values,
gw_values like LINE OF lv_values.
AT SELECTION-SCREEN OUTPUT.
gw_values-key = '1'.
gw_values-text = 'One'.
append gw_values to lv_values.
gw_values-key = '2'.
gw_values-text = 'Two'.
append gw_values to lv_values.
gw_values-key = '3'.
gw_values-text = 'Three'.
append gw_values to lv_values.
CALL FUNCTION 'VRM_SET_VALUES'
EXPORTING
ID = 'dr1'
VALUES = lv_values
EXCEPTIONS
ID_ILLEGAL_NAME = 1
OTHERS = 2
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
else.
dr1 = '1'. ( Just give ur id number which u wants to be default)
ENDIF.
With Regards,
Sumodh.P
Edited by: Sumodh P on Apr 23, 2010 12:25 PM
Edited by: Sumodh P on Apr 23, 2010 12:26 PM
Edited by: Sumodh P on Apr 23, 2010 12:30 PM -
Hi,
I need to display the MON-YYYY format date in a SQL Query, Query Condition is like this
If I run the query today it must display starting from May-2012 to November-2012 ( i.e 6 Months interval )
If I run the same query next month it must show Jun-2012 to December-2012 ( i.e 6 Months interval )
Based on system date it must populate the date rate Please suggest me how to get these date ranges.
Thanks
Sudhirwith table_name as
select add_months(trunc(sysdate,'YYYY'), level -1) column_name from dual connect by level < 13
/* end of test data */
select to_char(column_name,'MON-YYYY') formated_date
from table_name
where trunc(column_name, 'MM') between trunc(sysdate, 'MM') and add_months(trunc(sysdate, 'MM'), 6);
FORMATED_DATE
MAI-2012
JUN-2012
JUL-2012
AUG-2012
SEP-2012
OKT-2012
NOV-2012
7 rows selected. -
List of Month and Year in SSRS report parameter?
Hi, I have two parameters in my SSRS Report i.e. Month and Year. I want to show the list of all Months in dropdown and years for a particular range say 1995-Current Year.
Can any one suggest me the query for how to get it to work.Thanks!!
MCPI am not sure I what you're business needs are for this report. You stated that you need the month and year for parameters. If this is the case then there has to be a date and time column in which you can query against to provide both the month(s) and year. In order to accomplish this using t-sql without querying an existing column would require a loop or cursor based approach,which can negatively impact performance, or a union statement specifying a string literal and the effort to write either of these would exceed the effort required to statically assign the parameter values in reporting services. The below query shows how to statically create a query for each month and its ordinal position in the year and the same could be done with the year(s) 1995-2009, but this process involves more resources than assigning the static values for the parameters
SELECT DATENAME(MONTH, 1 ) AS MONTH,
1
UNION
SELECT DATENAME(MONTH, 2 ) AS MONTH,
2
UNION
SELECT DATENAME(MONTH, 3 ) AS MONTH,
3
UNION
SELECT DATENAME(MONTH, 4 ) AS MONTH,
4
UNION
SELECT DATENAME(MONTH, 5 ) AS MONTH,
5
UNION
SELECT DATENAME(MONTH, 6 ) AS MONTH,
6
UNION
SELECT DATENAME(MONTH, 7 ) AS MONTH,
7
UNION
SELECT DATENAME(MONTH, 8 ) AS MONTH,
8
UNION
SELECT DATENAME(MONTH, 9 ) AS MONTH,
9
UNION
SELECT DATENAME(MONTH, 10) AS MONTH,
10
UNION
SELECT DATENAME(MONTH, 11) AS MONTH,
11
UNION
SELECT DATENAME(MONTH, 12) AS MONTH,
12
David Dye -
How i can get list of months and years from my tables(ex. tab1), when i have start date ex. 072003 and end date ex. 042005 . That i use in report 6i.. . .
months | years| . . . . .
----------------------------------If i am not wrong you want these result
SQL> SELECT hiredate FROM emp;
HIREDATE
17-DEC-80
20-FEB-81
22-FEB-81
02-APR-81
28-SEP-81
01-MAY-81
09-JUN-81
19-APR-87
17-NOV-81
08-SEP-81
23-MAY-87
03-DEC-81
03-DEC-81
23-JAN-82
14 rows selected.
SQL> INSERT INTO emp (empno,hiredate,deptno) VALUES (1,SYSDATE,10);
1 row created.
SQL> COMMIT;
Commit complete.
SQL> SELECT hiredate FROM emp;
HIREDATE
17-DEC-80
20-FEB-81
22-FEB-81
02-APR-81
28-SEP-81
01-MAY-81
09-JUN-81
19-APR-87
17-NOV-81
08-SEP-81
23-MAY-87
03-DEC-81
03-DEC-81
23-JAN-82
01-SEP-06
15 rows selected.
SQL> SELECT TO_CHAR(a,'MON-YYYY') b FROM
2 (SELECT ADD_MONTHS(TRUNC(sysdate,'YYYY'),(rn.r-1)) a FROM
3 (SELECT ROWNUM r FROM user_objects WHERE ROWNUM<=12) rn)
4 MINUS
5 SELECT TO_CHAR(hiredate,'MON-YYYY') FROM emp;
B
APR-2006
AUG-2006
DEC-2006
FEB-2006
JAN-2006
JUL-2006
JUN-2006
MAR-2006
MAY-2006
NOV-2006
OCT-2006
11 rows selected.
SQL> SELECT b FROM
2 (SELECT TO_CHAR(a,'MON-YYYY') b FROM
3 (SELECT ADD_MONTHS(TRUNC(sysdate,'YYYY'),(rn.r-1)) a FROM
4 (SELECT ROWNUM r FROM user_objects WHERE ROWNUM<=12) rn)
5 MINUS
6 SELECT TO_CHAR(hiredate,'MON-YYYY') FROM emp)
7 WHERE b BETWEEN 'NOV-2006' AND 'SEP-2006';
B
NOV-2006
OCT-2006
SQL> Khurram -
Displaying dates from 1 to 31/30/28 depending on month and year
Hi all,
I am working on oracle 10g, how can i display set of dates from (1 to 30) depending on month and year eg, for nov month if i run the query.. the output should be:
1
2
3
30
and this should be accomplished only by using SQL
Regards,
Sreekanth.something like:
select level from dual
connect by level <= to_number(to_char(last_day(to_date('NOV-2009', 'MON-YYYY')), 'DD'))
/ -
Returning 'Day' value based on month and year parameters
Hi,
Is there a code that would return an end of the month Day value based on month and year parameters?
For example if my parameters yield 9 or September for a month value and 08 or 2008 for the year value, can a formula generate a value of 30 (the last day of the given month in the specific year)?
This way the formula would pick up the different last day of the month in February for the leap years.
Thank you.
Vic1. Open the formula workshop.
2. From the Repository Custom Functions, under Crystal and then Date, RIGHT click on cdlastdayofmonth, click on ADD TO REPORT.
3. Create a new formula, in the formula workshop, under FUNCTIONS, go down the list till you see "CUSTOM FUNCTIONS", expand that till you see cdlastdayofmonth.
4. In your formula, type cdlastdayofmonth(currentdate)
5. Save and close and display the formula in your report, you should see 11/30/2008.
If you want just the day then modify the formula to:
totext(day(cdlastdayofmonth(currentdate)),0,'','');
since you have parameters for month and year, do this:
totext(day(cdlastdayofmonth(date({?year},{?month},01))),0,'','');
to give you the last day of the month. -
Hi,
Which variable Displays Month name Year (Exaple: July 2007)???
Help will be gratly appreciated...
Thanks...Hi,
Thanks for your information..
But i am not getting like month and year display( Example: Sept 2007)
I am using Text variable 0P_FPER on 0Fiscal year/period..
and entering Input as 006.2007 then the resultant query displays as 06.
Please suggest me how to do it??
For entry i should give 006.2007 (or) Sept 2007..
But in the result it should display as Sept 2007..
Help will be greatly appreciated...
Thanks -
Table ( In-focus)
CREATE TABLE "LIBRARY"."INFOCUS_LOG"
("LOGDATETIME" DATE,
"COUNTER" NUMBER(6,0)
Procedure
create or replace PROCEDURE IN_FOCUS_PAGE
(ldt INFOCUS_LOG.logdatetime%TYPE,
COT INFOCUS_LOG.counter%TYPE)
IS
BEGIN
INSERT
INTO INFOCUS_LOG
VALUES(ldt, COT);
DBMS_OUTPUT.PUT_LINE('RECORD IS ADDED......!');
COMMIT;
END IN_FOCUS_PAGE;
What do I need to do if I want to insert month and year only for this particular table.
Result Example:
JAN-2007
FEB-2007
MAR-2007
Message was edited by:
user579538A DATE is always going to have a full day and time component, so you cannot store just the month and year. You can, of course, choose to display just the month and year, i.e.
SELECT TO_CHAR( date_column, 'MON-YYYY' )
FROM some_tableor to extract the month and year separately
SELECT EXTRACT( year from date_column ) yr,
EXTRACT( month from date_column ) dt
FROM some_tableJustin -
Entity Descriptions are not displayed correctly in Combo box dropdown list
In Web Analysis, Entity Descriptions are not displayed correctly in Combo box dropdown list when entity descriptions from HFM contains a dot(.)
Example:
'Entity A. LTD' becomes 'LTD'
'Entity B Inc.' becomes blank
It seems that everything before the dot is not displayed when opening the combobox.
It looks like it is acting like the option to show short description for entities in HR where the parent-child relation is not shown. This behaviour I don't expect for descriptions. And in my opinion is not an option in Web Analysis.
Does anybody knows the sollution or have seen this issue before?Hi,
This is a known issue with combo box list of values.
Please follow this workaround:
- Remove ComboboxLOV on Deptno
- Create an updateable transient attribute(Say Dname) of type String
- Define combobox lov with following values:
List Data Source: DeptView1
List Attribute: Dname
List Return Values:
Dname - Dname
Deptno - Deptno
UI Hints: Display Attribute - Dname
- Edit Dname(transient attribute) and provide following groovy expression
oracle.jbo.Key key = new oracle.jbo.Key(Deptno);
return DeptView1.findByKey(key, 1)[0].getAttribute("Dname");- Now, you are done and observe that Dname combo box lov shows Description even on selection and change in this combo box sets the Deptno value
Sireesha -
Hi all Thanks in Advance
I need help in Pivoting Data
SELECT ID,MONTH,COUNT FROM TABLE_PIVOT ORDER BY ID,MONTH
ID MONTH COUNT
10 10/01/2009 60
10 11/01/2009 80
10 12/01/2009 78
10 01/01/2010 81
10 02/01/2010 73
10 03/01/2010 84
10 04/01/2010 100
10 05/01/2010 107
10 06/01/2010 90
10 07/01/2010 0
10 08/01/2010 0
10 09/01/2010 73
20 10/01/2010 71
20 11/01/2010 76
20 12/01/2010 79
20 01/01/2011 79
20 02/01/2011 81
20 03/01/2011 88
20 04/01/2011 97
20 05/01/2011 87
20 06/01/2011 97I tried to pivot with below query
SELECT ID,
SUM(DECODE(to_char(month,'MM'),'01',count,0)) " Jan",
SUM(DECODE(to_char(month,'MMYY'),'02',count,0)) Feb,
SUM(DECODE(to_char(month,'MM'),'03',count,0)) Mar,
SUM(DECODE(to_char(month,'MM'),'04',count,0)) Apr,
SUM(DECODE(to_char(month,'MM'),'05',count,0)) May,
SUM(DECODE(to_char(month,'MM'),'06',count,0)) June,
SUM(DECODE(to_char(month,'MM'),'07',count,0)) July,
SUM(DECODE(to_char(month,'MM'),'08',count,0)) August,
SUM(DECODE(to_char(month,'MM'),'09',count,0)) September,
SUM(DECODE(to_char(month,'MM'),'10',count,0)) October,
SUM(DECODE(to_char(month,'MM'),'11',count,0)) November,
SUM(DECODE(to_char(MONTH,'MM'),'12',count,0)) December
FROM Table_PIVOT
GROUP BY ID
ORDER BY ID
ID Jan FEB MAR APR MAY JUNE JULY AUGUST SEPTEMBER OCTOBER NOVEMBER DECEMBER
10 81 0 84 100 107 90 0 0 73 60 80 78
20 79 0 88 97 87 97 0 0 0 71 76 79I want output to display the column names with Month and Year like below
ID Oct-2009 Nov-2009 Dec-2009 Jan-2010 Feb-2010 ................... OCT-2010 NOV-2010 DEC-2010 JAN-2011 FEB-2011 ......
10 60 80 78 81 73 ...................
20 71 76 79 79 81
CREATE TABLE "TABLE_PIVOT"
( "ID" NUMBER,
"MONTH" DATE,
"COUNT" NUMBER
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('10/01/2009','MM/DD/YYYY'),60);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('11/01/2009','MM/DD/YYYY'),80);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('12/01/2009','MM/DD/YYYY'),78);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('01/01/2010','MM/DD/YYYY'),81);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('02/01/2010','MM/DD/YYYY'),73);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('03/01/2010','MM/DD/YYYY'),84);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('04/01/2010','MM/DD/YYYY'),100);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('05/01/2010','MM/DD/YYYY'),107);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('06/01/2010','MM/DD/YYYY'),90);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('07/01/2010','MM/DD/YYYY'),0);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('08/01/2010','MM/DD/YYYY'),0);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('09/01/2010','MM/DD/YYYY'),73);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('10/01/2010','MM/DD/YYYY'),71);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('11/01/2010','MM/DD/YYYY'),76);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('12/01/2010','MM/DD/YYYY'),79);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('01/01/2011','MM/DD/YYYY'),79);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('02/01/2011','MM/DD/YYYY'),81);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('03/01/2011','MM/DD/YYYY'),88);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('04/01/2011','MM/DD/YYYY'),97);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('05/01/2011','MM/DD/YYYY'),87);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('06/01/2011','MM/DD/YYYY'),97);
COMMIT;Hi,
user1849 wrote:
Any Sample code is appreciated
I didn't see any solution for following one in your linklI think Centinul was specifically referring to:
Help for a query to add columns
but other links from
SQL and PL/SQL FAQ
may help you more.
>
Re: How to pipeline a function with a dynamic number of columns?
Posted: May 9, 2006 2:58 PM in response to: Billy Verreynne Reply
Interesting stuff! It's going to take me awhile to digest it.
For what it's worth, I was trying to build a pivoting function that would take a MYTABLE table like this:
YEAR CITY X Y
2000 BAL 95 96
2000 BOS 101 101
2001 BAL 92 94
2001 BOS 101 101
2002 BAL 98 98
2002 BOS 98 99
2003 BAL 95 96
2003 BOS 105 104
and allow me to do something like:
CREATE VIEW MYPIVOT
AS
SELECT *
FROM TABLE (PIVOT(MYTABLE, [with other params]))
and get the following view MYPIVOT on the table:
YEAR BOS_X BOS_Y BAL_X BAL_Y
2000 101 101 95 96
2001 101 101 92 94
2002 98 99 98 98
2003 105 104 95 96
Where the number of distinct CITY values will vary over time. I am able to build the query I need dynamically, but since the CITY data values in the original table change, the columns are not necessarily static from invocation to invocation. Therefore I didn't want to just create a view using the dynamic SQL once, because it may need to be created next time I need to access the view. I wanted to be able to access the pivoted data on demand.A pipelined function is your best bet for that.
I couldn't do was be able to execute the query and treat it as a pipelined function, hence my original question.Sorry, I don't understand.
I'll dig into the code above to see if it does what I wanted, but if someone has a better suggestion on how to approach this, I'd be interested in hearing it.A completely different approach is String Aggregation , where you would get output like this:
YEAR TXT
BOS_X BOS_Y BAL_X BAL_Y
2000 101 101 95 96
2001 101 101 92 94
2002 98 99 98 98
2003 105 104 95 96Note that this output contains 6 rows and 2 columns. On the first row, year is NULL and txt=' BOS_X BOS_Y BAL_X BAL_Y'. You can do this is pure, static SQL, without knowing the number of cities in advance. -
DRQ: Isolate the Daily, Monthly and Yearly CheckBoxes in Selection Criteria
Module: Financials => Financial Reports => Accounting => General Ledger
Request to Isolate the Daily, Monthly and Yearly Check Boxes in the General Ledger - Selection Criteria screen, instead of an option in the report window.
Problem: If there is BP/General Ledger having long transaction list, then once user un-check any of the check boxes system takes long time to remove/hide those rows which contains Totals. Which is effecting the performance of the report also. Also those checkboxes appeared with check marked by default.
If user has an option in the selection criteria screen, then they can choose which Total they want before previewing the report and mark accordingly.
Thanks & Regards
Anjan BhowmickBeing reached to 10 open question, I am forced to close this thread
Maybe you are looking for
-
I downloaded a form to pay taxes, I compiled it inserting my dates but I wuold like to edit text: how can I do it? thank you and excuse me for my bad english
-
How to set custom size of Close Button e.g. 32x32 of Title Window in Flex 4
How to set custom size of Close Button e.g. 32x32 of Title Window in Flex 4?
-
How to create a popup help page in html db
i'm trying to create a popup up help page in html db by having a help button from the main page and when clicked a popup page will appear... but can't seem to get it working... can somebody pls help me? thanks a bunch!!
-
Can i have a selling price in material master
hi, sap gurus, can i have a selling price in material master if yes where if no why plz help me on this regards, balaji.t
-
Button issues after deployment
We are having a problem with some buttons after importing an application from another workspace. The issue that we are seeing is that some of our processes and branches that are conditional based on "When Button Pressed" are being changed from a name