Month and Year Validation
Hi All !
I want to check whether a given date in my form is less than or greater than sysdate..
I used the coding
if trim(:empaply.fromdate)<trim(sysdate) then
message('Check the from date you have given !');This condition checks only the date and not the month and year ..
So, how can i check the month and year is less than the current sysdate in sql?
pls help me with a solution..
Thanks and Regards
user 10685325
Hi in sql when you do the comparision it check the whole date I believe not just the date part.
you can see it for yourself
SQL> select * from emp where HIREDATE<to_date('01-jun-2009','dd-mon-rrrr');
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7839 KING PRESIDENT 17-NOV-81 5000 10
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7900 JAMES CLERK 7698 03-DEC-81 950 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7369 SMITH CLERK 7902 17-DEC-80 800 20
7788 SCOTT ANALYST 7566 09-DEC-82 3000 20
7876 ADAMS CLERK 7788 12-JAN-83 1100 20
7934 MILLER CLERK 7782 23-JAN-82 1300 10
14 rows selected.the hiredate of first employee in 17-NOV-81 and compare it with '01-jun-2009' so it has checked whole date part not just 17 and 01 do not use TRIM
Similar Messages
-
Fetching month and year from CV of Time dim
Hi,
I am working on BPC 7 MS version, SP3. I need to fetch Month and Year values from my Current View (i.e., %TIME_SET%) .... and if the month is AUG and year is Current I then want a logic to run... Is this possible??
I have written the following code, and only if i hardcode the time (WHEN TIME IS 2009.AUG) the logic seems to work. But I want it to be dynamic
*XDIM_MEMBERSET ACCOUNT=INC_REC_IN_AD
*XDIM_MEMBERSET TIME=%YEAR%.AUG,%TIME_SET%
*XDIM_MEMBERSET CATEGORY=ACTUAL
*WHEN ACCOUNT
*IS *
*WHEN TIME.MONTHNUM
*IS 8
*FOR %YEAR%=%TIME_SET%.YEAR
*FOR %MONTH%=AUG,SEP,OCT,NOV,DEC
*REC(FACTOR=1/5,TIME="%YEAR%.%MONTH%",ACCOUNT="TEMPSTUDYEDU")
*NEXT
*NEXT
*ENDWHEN
*ENDWHEN
*COMMIT
Thanks,
Prasanth.I think your formula is correc the %YEAR% is not a valid, Can you trap that and see what is being passed, you may also try to split the year out of %TIME%
hope it helps. -
Date must be truncated to month and year
Hi,
I have a date field
after the user gives F4 help I need to truncate the date , i.e I want only month and year
For Ex.
If the user selects as 12/12/2009
I must display as 12/2009
How can It be done?Hi,
go thru this threads
Re: Date validation and conversion
Re: Is DD/MM/YYYY supported in webdynpro for abap application
it might provide you some guidance -
Needing a multi-month and year-in-view option for ical!
Hello all!
I could really use a multi-month and year-in-view format in ical... I've seen some dated posts - is anyone aware of any new developments/options for this?
thanks and peace-
DWI turn off all calendars but the birthdays. Select [Print]. Choose all the months you want to see. Deselect all calendars but birthdays. Click [Continue]. On the next menu, go to "Layout", select how many pages to print on the paper. I usually print a border around each calendar then you're good to go!
By only printing the birthdays calenar, you won't get too many appointments to get in the way of brain storming and future planning, yet the computer still thinks its printing a useful calendar. -
How to get Week,Month and Year details from a date column
Hi frenz,
I've a column like tran_date which is a date column..... I need the next week details based on this column and so on...
I need month and year details as well based on this tran_date column.... can any one tell me how...
Thanks in advanceMy example for objects:
create or replace type date_object as object
centure number,
year number,
month number,
day number,
hour number,
minute number,
second number,
daypart number,
week number,
constructor function date_object(p_dt date)
return SELF as result
create or replace type body date_object is
constructor function date_object(p_dt date)
return SELF as result
as
begin
SELF.centure:= trunc(to_char(p_dt,'YYYY')/100);
SELF.year:= to_char(p_dt,'YYYY');
SELF.month:= to_char(p_dt,'MM');
SELF.day:= to_char(p_dt,'DD');
SELF.hour:= to_char(p_dt,'HH24');
SELF.minute:= to_char(p_dt,'MI');
SELF.second:= to_char(p_dt,'SS');
SELF.daypart:= p_dt-trunc(p_dt,'DD');
SELF.week:= to_char(p_dt,'IW');
return;
end;
end;
select date_object(sysdate),
date_object(sysdate).year
from dual;Regards,
Sayan M. -
Sales report for current month and year a go month
i could you please guide me builting report for current monthwise for current month and year a ago month
report parameter month_year='06-2010'
tables = sales and below are the table fields
customer_id
invoice_dt
invoice_am
thanks
nhmOkay, Still you did not mention how you will pass value in report while generating.
Anyway the query with UNION ALL will work. For Example.
I am assuming that the parameter for date/month you will pass in range like 01-JUN-2010 to 30-JUN-2010
SELECT customer_id, SUM(curr_value) curr_value, SUM(past_value) past_value
FROM
SELECT customer_id, NVL(SUM(invoice_amount),0) curr_value, 0 past_value
FROM sales
WHERE invoice_dt BETWEEN :P_FROM_DATE AND :P_TO_DATE -- here P_FROM_DATE and P_TO_DATE will be the date range for current year as i showed above.
AND -- Any Condition goes here...
GROUP BY customer_id
UNION ALL
SELECT customer_id, 0, NVL(SUM(invoice_amount),0)
FROM sales
WHERE invoice_dt BETWEEN ADD_MONTHS(:P_FROM_DATE,-12) AND ADD_MONTHS(:P_TO_DATE,-12) -- This add_months function for the previous year same month.
AND -- Any condition goes here...
GROUP BY customer_id
GROUP BY customer_idNow using the above query you can design the tabular report as you showed the format.
-Ammad
Edited by: Ammad Ahmed on Jul 3, 2010 7:55 PM
added GROUP BY -
Daily, Monthly, and Yearly Report
Hi I am new to the BAM. I have a BPM process. I want to generate the daily, monthly and yearly report for it. Please advise how can I achieve it. I have a one dimension variable on the process.
Thanks in advance!Hi,
Try this query to get default ware house and its quantity and modify above query.
SELECT T0.[ItemCode], T0.[WhsCode], T0.[OnHand] FROM OITW T0 INNER JOIN OITM T1 ON T0.ItemCode = T1.ItemCode WHERE T0.[WhsCode] = T1.[DfltWH] and T1.[ItemCode] = [%0]
Thanks & Regards,
Nagarajan -
Table for Material Quantity and Value for particular month and year
Hi All
My requirement is that for a particular month and year I want to know the stock quantity and stock value for a particular material for a given plant.From which SAP table can I get this data as I want to fetch data for my Y report?
Regards
Satish KumarHi,
You can use MB5B table as suggested earlier.also you can use:
MBEW-VMKUM --> stock for previous month period
MBEW-VJKUM --> stock for previous year period
PLease view these links which migh tbe helpful to you:
http://help.sap.com/saphelp_47x200/helpdata/en/39/55fee3bc6111d4b3960050dadf0791/content.htm
TableStock
Thanks
Nisha -
Hi Gurus,
I m Using SPMON(Period to analyze month and year) as input Field in my BSP Application.
If i Click the Input Help i want to call a Function module "popup_to_display_month" ..
How to acheive this.
I have used onValueHelp attribute in which it will call only the Javascript.
Please guide me...
Thanks n Regards
AravindhHi Aravindh,
First thing if this FM 'POPUP_TO_SELECT_MONTH' gives a popup in SAPGUI , you can not use it in BSP since SAP GUI popups are not supported in BSP.
I have used onValueHelp attribute in which it will call only the Javascript.
If triggering a server side event using onValueHelp solves you problem that you can do it as follows..
1)In the layout somewhere use a blankimage that will not be visible in UI.
2)Suppose ID of this image is 'blank'
now call javascript function for onValueHelp
and in this javascript function use
dacument.getElementById('blank').click();
change dacument to document.
This will trigger a server event which you can process in onInputProcessing and call the FM.
Regards,
Anubhav -
Data element for Month and Year
Hello All,
Is there any data element which will have only Month and Year.
I have to introduce this field in a table. It should have convesion exits also.
Ex: If i give 092009, it sould come like 09.2009
Thank you.
Best Regards,
Sasidhar Reddy Matli.Kindly Try this code for Month and year as input and having standard F4 help..
INCLUDE RMCS0F0M.
TYPES : BEGIN OF TY_SELECT,
MONTH TYPE FTI_MONTH_YEAR,
END OF TY_SELECT.
DATA : WA_SELECT TYPE TY_SELECT.
SELECTION-SCREEN : BEGIN OF BLOCK SANDEEP WITH FRAME.
SELECT-OPTIONS : S_MONTH FOR WA_SELECT-MONTH OBLIGATORY NO INTERVALS NO-EXTENSION.
SELECTION-SCREEN : END OF BLOCK SANDEEP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR S_MONTH-LOW.
PERFORM MONAT_F4.
SANDEEP JAIN -
SELECTION SCREEN FIELD FOR MONTH AND YEAR
Hi All.
We are developing a 'Monthly Sales Tax(payable) Report.
they want the report based on the date(in the selection screen it will come only month and year only.).Depends on that month and year for that select-options ,it will pick up the record.
like if, jan 2005 to march 2006.
then it will pick up from 01.01 .20005 to 31.03.2006 records.
Can any body help me to resolve this.
Thanks in advance,
Regards,
VenkatHi Venkat,
Copy the following code.
DATA : ws_billfrom TYPE dats,
ws_billto TYPE dats.
DATA : mon TYPE fcltx.
SELECT-OPTIONS: s_month FOR mon
MATCHCODE OBJECT zsdhtch_sh_mnth
OBLIGATORY. "o get values for F4
PARAMETER : p_year LIKE bkpf-gjahr
MATCHCODE OBJECT zsdhtch_sh_year
OBLIGATORY.
RANGES : s_date FOR sy-datum.
DATA : ws_fcmnr TYPE fcmnr.
START-OF-SELECTION.
SELECT SINGLE mnr
INTO ws_fcmnr
FROM t247
WHERE ltx = s_month-low.
CONCATENATE p_year ws_fcmnr '01' INTO ws_billfrom.
CALL FUNCTION 'HR_JP_MONTH_BEGIN_END_DATE'
EXPORTING
iv_date = ws_billfrom
IMPORTING
ev_month_begin_date = ws_billfrom
ev_month_end_date = ws_billto.
s_date-low = ws_billfrom.
s_date-high = ws_billto.
s_date-sign = 'I'.
s_date-option = 'BT'.
IF NOT s_month-high IS INITIAL.
SELECT SINGLE mnr
INTO ws_fcmnr
FROM t247
WHERE ltx = s_month-high.
CONCATENATE p_year ws_fcmnr '01' INTO ws_billfrom.
CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS'
EXPORTING
day_in = ws_billfrom
IMPORTING
last_day_of_month = ws_billto.
s_date-high = ws_billto.
ENDIF.
APPEND s_date.
WRITE s_date.
You can write your select statement here.
select * from dbtable where date in s_date.
If 'HR_JP_MONTH_BEGIN_END_DATE' is nto there in your server, you can use 'RP_LAST_DAY_OF_MONTHS' in both cases.
Regards,
Susmitha.
Dont forget to reward points for useful answers -
How to set filter criteria for month and year using in timestamp input field?
Hi,
I am using jdev 11.1.2.3,
I have one problem with Report generation,,,,,,I have one report table which is in the form of VO(query based) and i want to search this table as month and year basis
but in this table(query) that field having timestamp based value.. how to search with month name and year only.. Here i am using totally query base VO's for generating
reports........ Can any one guide me.
Thank You.You can use a inputdate, which allows you to selecte a moth, year and a day. Once the selection is made you convert it to only allow moth and date like
<af:inputDate label="Label 1" id="id1" autoSubmit="true" value="#{bindings.myMonthYear1.inputValue}">
<f:convertDateTime pattern="MM/yyyy"/>
</af:inputDate>
<af:outputText value="Selected #{bindings.myMonthYear1.inputValue}" id="ot1" partialTriggers="id1"/>
then you have a string holding month and year only. This value you split into two variables you or pass it as a whole parameter to the query and split it there.
Another way is to add two static lovs one for month and one for year and use them to get to the filter values.
Timo -
hi
In Selection Screen i have Month and Year as input.....
How to give "F4" Option for both Month and Year?
Regards
Smithahi,
this will help u get the month in f4 help .
similarly u can fill up the itab for year and get that f4 help too i guess.
TABLES: T247 ,
DFIES.
PARAMETERS:P_MONTH LIKE T247-MNR.
DATA: BEGIN OF ITAB OCCURS 0,
MNR LIKE T247-MNR,
KTX LIKE T247-KTX,
END OF ITAB .
DATA : LT_FIELDS TYPE TABLE OF DFIES,
LWA_FIELD TYPE DFIES.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_MONTH.
SELECT MNR
KTX
FROM T247 INTO CORRESPONDING FIELDS OF TABLE ITAB
WHERE SPRAS = 'EN'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'P_MONTH'
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = 'MNR'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = ITAB
FIELD_TAB = LT_FIELDS. -
I want to accumulate rain for the day, month and year; What formula can I use?
I want to accumulate rain for the day, month and year; What formula or expression can I use.
I am using a Rain Wise product that converts pulses to an analog value. The Rain Wise device can be
set to measure up to 1", 5", or 10". I will be setting the unit to 10 inches in increments of 0.01 inches.
What I would like to do is everytime the signal increments I would like to count it as 0.01 then after reaching
a period of time whether it be a day or a month reset back to zero.
Need some advise on this problem.
Solved!
Go to Solution.Hello Ryan,
Lookout gets a Modbus over Ethernet signal which originates as a 4-20mA input to a Moxa Ethernet I/O Module (E1240) in the field. In Lookout I created a ModbusEthernet Driver and a tag which scales 0 - 65534 RAW to 0-10 Eng. [0 - 10 is inches of rain] Also, another piece of information is that after the rain gauge maxes out at 10 inches it will zero out and start over.
I though the accumulator was time based and took a sample over a specific time period, for instance, one sample every 30 seconds then accumulate. If this is so then if I have 5 inches of rain and then it stopped raining, then 30 seconds latter it would sample, it would see 5 inches and add that to be 10 inches when actually it had only rained 5 inches.
I really need some help with this process,
David Lopez
City of Corpus Christi -
TO GET WEEKS for a given MONTH AND YEAR
Is there any FM to get the no of weeks for a given month, say 01 2005.
Can i get the week numbers say 1 2 3 4 5 for the given month and year.
Please let me know.
Happy Holidays.
Regards,
Manohar EHi Manohar,
Use FM DATE_GET_WEEK twice; first time pass first day of the month and again pass the last day of the month as a parameter. So u will be having week number(yyyyxx) for the first week of the month and week number for the last week of the month. From these two, in between week numbers u can easily fetch. I hope this will help u out.
Regards,
Kavya Shah
Maybe you are looking for
-
Is there any way to prevent users from ship confirming on a particular date?
Hello All, We have a requirement to prevent users from ship confirming on a particular date. This is due to they are performing Annual Physical Inventory. Is it possible to restrict users performing shipping transactions on this particular date? I ha
-
How to Prohibit Sales Price Lower Than Material Standard Cost
Hi Moderators: I got a problem from our sales departement, because they found a manual mistake, that was, somebody who maintained a incorrect sales price in the condition record which was lower than the standard price in the material master data! Thi
-
Hello TDMS Group Members, We had setup TDMS environment, Our BI 7.0 sandbox system is central system. Production copy sandbox client 100 is sender Production copy sandbox client 120 is receiver Both sender and receiver are on same ECC 6.0 system. Is
-
iMovie 10 does not let me share movies in iTunes that are compatible with iPod. Can anyone help?
-
I had to upgrade to v8 to use the new firmware on my iPhone. With v8 I can not set the type of video file. I used to be able to right click and go to "Get Info", and then in the videao tab choose what kind of video file it was, ie movie, podcast, or