Setting Date as YYYY-QX?
I've done some Googling for this with very limited success. I am just getting started in Form Design and one field I am having trouble with is the Date Field in Acrobat Pro 9.
I'm trying to set the Date Field to be entered as YYYY-QX, where YYYY is the year, Q is Quarter and X is either 1, 2, 3, or 4.
I assume I need to put some custom JavaScript in, but I have absolutely 0 experience with the language. Would someone mind helping point me in the right direction?
Thanks in advance!
I can enter it now when it's left to 'General' but to prevent users from going wild with date formats (as they tend to do), I would like the user to be forced to enter it in the YYYY-QX format (and not have it autocalc based on the current date).
Similar Messages
-
Formatting a date in YYYY-MM-DD format in a grid in We dynpro abap
Hi All,
I have the requirement to display a date in YYYY-MM-DD format in a salv_wd_table grid .
when i selecting the date from the calender that attached to a column in the grid will show in DD-MM-YYYY format.
Please help in this.>
Manoj Kumar wrote:
> Hi Abhimanyu ,
>
> I don't want like that.
> Iwant to know is there any other way apart from this or any property to set the format of a column in salv grid.
ABAP is pretty good about automatically using the user's profile settings for formatting. That enforces consistency across applications. If you want to override this, you will need to do it at the data level. Instead of defining this field in the context as a data - define it like a string or char10. Then when you populate the data within your business logic do a WRITE statement from the data field to the character field. During the WRITE command you can specify the date formatting option:
From the online syntax of WRITE:
Addition 15
... DD/MM/YY | MM/DD/YY
| DD/MM/YYYY | MM/DD/YYYY
| DDMMYY | MMDDYY
| YYMMDD
Effect: These additions influence the output of data objects of the data type d. In all other data types, the addition is ignored.
The content of a data object of type d is interpreted as a valid date in the format YYYYMMDD and is output as follows for the individual additions:
DD/MM/YY and MM/DD/YY:
Both additions have the same effect. The date output has a two-digit year value and a separator. The separator and the order are taken from the definition for date output in the user master record.
DD/MM/YYYY und MM/DD/YYYY:
Both additions have the same effect. The date output has a four-digit year value and separator. The separator and the order are taken from the definition for date output in the user master record.
DDMMYY und MMDDYY:
Both additions have the same effect. The date output has a two-digit year value and no separator. The order is taken from the definition for date output in the user master record.
YYMMDD:
This addition provides a date output with a two-digit year value without a separator in the format YYMMDD.
But even this approach is going to have limited impact. It will only let you chose between the allowed formatting types from the user master. YYYY-MM-DD is not one of those formats.
So if you really want a non-SAP formatted date you will have to break it up yourself. The internal date format is always stored as YYYYMMDD. You can just parse it out:
data year type char4.
data month type char2.
data day type char2.
year = sy-datum+0(4).
month = sy-datum+4(2).
day = sy-datum+6(2).
data date_string type char10.
concatenate year `-` month `-` day into date_string. -
Hi Gurus, I have to set date as per the company code REGUP-BUKRS using sap-script. I am unable to get the date..
/: IF ®UP-BURKS& EQ 2000
/: SET DATE MASK = 'DD/MM/YYYY'
®UP-BLDAT&
/: ENDIF
This there is anything wrong in this code ?Please use below syntax in SE71 Text editor ( Before displaying date)
/: PERFORM GET_DATE_FORMAT IN PROGRAM ZGET_DATE
/: USING ®UP-BLDAT&
/: CHANGING &DATE&
/: ENDPERFORM
Now goto SE38 -> create program(ZGET_DATE) -> now use below syntax
FORM GET_DATE_FORMAT
tables in_tab structure itcsy
out_tab structure itcsy.
lOCAL VARIABLES
data: LV_DATE(10) TYPE C,
LV_DAY(2),
LV_MON(2),
LV_YEAR(4),
LV_FDATE(10) TYPE C.
CLEAR : LV_DATE,
LV_DAY,
LV_MON,
LV_YEAR,
LV_FDATE.
read table in_tab with key NAME = 'REGUP-BLDAT'.
if sy-subrc eq 0.
LV_DATE = IN_TAB-VALUE
endif.
Date Formatting
lv_year = lv_date+0(4).
lv_mon = lv_date+5(2).
lv_day = lv_date+8(2).
concatenate lv_day '/' lv_mon '/' lv_year into lv_fdate.
read table out_tab with key NAME = 'DATE'.
if sy-subrc eq 0.
out_tab-value = lv_fdate.
modify out_tab index sy-tabix.
endif.
ENDFORM.
You can use same logic for all dates.
Thanks
Seshu -
Can we configure Oracle 10g xe so that it accept date in yyyy-mm--dd format
I am facing problem in inserting and updating data in oracle server through jdbc. its java.sql.Date class sends date in yyyy-mm-dd format while oracle requires date in dd-mmm-yy format. can we configure oracle server in such a way that we may send date in yyyy-mm-dd format to insert and update?
People should be sure of their information before
posting, even more so if they have an Oracle Ace
credential,as they're more likely to be believed. Not sure what you are saying.
The way I read it, Avi stated that overriding the NLS_DATE_FORMAT as an initialization parameter WILL NOT affect the way XE works, and you still need to set the parameter at the session level.
This is true.
As demonstrated here, where I
- startup my XE (SuSE 10.1 Pro/Linux),
- show the NLS setting,
- log on to a regular user, -
- show the system date,
- change the NLS_DATE_FORMAT system wide by updating my PFILE,
- restart the database
- show the NLS_DATE_FORMAT
- extract the system date.
As you see from the console session, the date still comes out in the format defined by the NLS_TERRITORY, in spite of what the global NLS_DATE_FORMAT indicates.
fcc@fuzzy:~> su - oracle
Password:
oracle@fuzzy:~> sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jul 6 08:06:05 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 448790528 bytes
Fixed Size 1259400 bytes
Variable Size 134219896 bytes
Database Buffers 310378496 bytes
Redo Buffers 2932736 bytes
Database mounted.
show parameter nls_date
Database opened.
SQL>
NAME TYPE VALUE
nls_date_format string
nls_date_language string
SQL> connect test/test
Connected.
SQL> select sysdate from dual;
SYSDATE
06-JUL-07
SQL> alter session set nls_date_format='YYYY Mon DD';
Session altered.
SQL> select sysdate from dual;
SYSDATE
2007 Jul 06
SQL> connect / as sysdba
Connected.
SQL> select sysdate from dual;
SYSDATE
06-JUL-07
SQL> create pfile='/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/xe.pfile' from spfile;
File created.
SQL> !vi /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/xe.pfile
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup pfile=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/xe.pfile
ORACLE instance started.
Total System Global Area 448790528 bytes
Fixed Size 1259400 bytes
Variable Size 134219896 bytes
Database Buffers 310378496 bytes
Redo Buffers 2932736 bytes
Database mounted.
Database opened.
SQL> connect test/test
Connected.
SQL> connect / as sysdba
Connected.
SQL> show parameter nls_date
NAME TYPE VALUE
nls_date_format string YYYY Mon DD
nls_date_language string
SQL> connect test/test
Connected.
SQL> select sysdate from dual;
SYSDATE
06-JUL-07
SQL> -
How to set Date in RFC call.
Hi,
I am trying to set date in structure when calling RFC.
ICall = function.getImportParameterList();
ICall.getStructure("IORDER").setValue(eDate,"EDATE");
EDATE is date field in Structure in RFC with data type "D" and it is taking date in "dd.mm.yyyy"; formate.
I am setting date "dd.mm.yyyy"; in string format with eDate variable and it is throwing error.
Can any one tell me How I can set date for "EDATE" field in proper format.
Can I do JCO.TYPE_DATE date1 = new java.util.Date();
And How I can convert date in acceptable format "dd.mm.yyyy"; for RFC.
Thanks for your help
AshishHi Sateesh,
Thanks for your Answer.
I used java.util.date and it works fine.
Icall.getStructure("IOrder").setValue(new java.util.date(), "EDATE")
I came to know that java date variabel can be passed without any extra conversion to ABAP type D variable .
Is it OK? As I am setting java date variable directly to ABAP type d variable in RFC.
I have awarded you points for very helpful answer.
Thanks.
Ashish. -
How to set Date in input field by hard coding in application
Hi all,
1.I have to make a date(its my choice to set the date) to appear in input field which is date type.
2.How to compare two numbers of type decimal. for example greatest of two numbers
urgent requirementHi
Check the http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Date.html
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Calendar.html
Sample Code
Date now = new Date();
DateFormat df = DateFormat.getDateInstance();
String s = df.format(now);
System.out.println("Today is " + s);
java.sql.Date descends from java.util.Date, but uses only the year, month and day values. There are two methods to create a Date object. The first uses a Calendar object, setting the year, month and day portions to the desired values. The hour, minute, second and millisecond values must be set to zero. At that point, Calendar.getTime().getTime() is invoked to get the java.util.Date milliseconds. That value is then passed to a java.sql.Date constructor:
Calendar cal = Calendar.getInstance();
// set Date portion to January 1, 1970
cal.set( cal.YEAR, 1970 );
cal.set( cal.MONTH, cal.JANUARY );
cal.set( cal.DATE, 1 );
cal.set( cal.HOUR_OF_DAY, 0 );
cal.set( cal.MINUTE, 0 );
cal.set( cal.SECOND, 0 );
cal.set( cal.MILLISECOND, 0 );
java.sql.Date jsqlD =
new java.sql.Date( cal.getTime().getTime() );
The second method is java.sql.Date's valueOf method. valueOf() accepts a String, which must be the date in JDBC time escape format - "yyyy-mm-dd". For example,
java.sql.Date jsqlD = java.sql.Date.valueOf( "2010-01-31" );
creates a Date object representing January 31, 2010. To use this method with a Calendar object, use:
java.sql.Date jsqlD = java.sql.Date.valueOf(
cal.get(cal.YEAR) + ":" +
cal.get(cal.MONTH) + ":" +
cal.get(cal.DATE) );
which produces a Date object with the same value as the first example.
Regards
Ayyapparaj -
How to get the date format yyyy-mm-dd?
Hi,
I have an iphone (3.1.2) and would like to use the date format yyyy-mm-dd (international date format). Is the possible? If yes, how?
CheersI know of no other way to set the date format other than what I mentioned in my previous post. There are third party apps that will do what you want in the app. store, but they are not permitted to access the underlining software.
-
hi all,
Requirement is to diplay todays date in MM.DD.YYYY format in a smartform layout.
We have used the command
/:SET DATE MASK = 'MM.DD.YYYY'
/:SET COUNTRY 'US'
&sy-datum&
But the date appears in the user format DD.MM.YYYY.
Whys the set date command not working here as expected ?
Your ideas appreciated.
Rgds,
stockHi Stock Sys,
Formatting Date Fields: SET DATE MASK
To define the formatting of date fields, use the SET DATE MASK control command. Executing this command causes all subsequent date fields to be printed using the specified format.
Syntax:
/: SET DATE MASK = 'date_mask'
In the date mask, you can use the following codes:
DD: day (two digits)
DDD: day name - abbreviated
DDDD: day name - written out in full
MM: month (two digits)
MMM: month name - abbreviated
MMMM: month name - written out in full
YY: year (two digits)
YYYY: year (four digits)
LD: day (formatted as for the L option)
LM: month (formatted as for the L option)
LY: year (formatted as for the L option)
All other characters found in a date mask are interpreted as simple text and are copied straight into the output.
Assuming the current system date is March 1st, 1997.
/: SET DATE MASK = 'Foster City, MM/DD/YY'
&DATE& -> Foster City, 03/01/97
/: SET DATE MASK = 'MMMM DD, YYYY'
&DATE& -> March 01, 1997
The date mask may be reset to the default setting by using an empty string:
/: SET DATE MASK = ' '
The abbreviated and full forms of the names of the days and months are stored in the language dependent TTDTG table under the following keys:
%%SAPSCRIPT_DDD_dd: abbreviated day name
%%SAPSCRIPT_DDDD_dd: full form of day name
%%SAPSCRIPT_MMM_mm: abbreviated month name
%%SAPSCRIPT_MMMM_mm: full form of month name
dd: day number 01 = Monday,..., 07 = Sunday
mm: month number 01 = January,..., 12 = December
Regards.
Eshwar. -
Setting Date in ORACLE Server.
Hi All,
How to set date for ORACLE server. I.e usually we set the date for system in the system properties or go to control panel and set it in DATE & Time section on a windows PC. But during various circumstatnces i am not given permission to do it and every time i need to do this. Is there a way to achieve this without touching the server date & time. So that when ever i use SYSDATE that will return the date which i have set.
Note - I have already gone through FIXED_DATE built in available in ORACLE.
Would like to know other possibilities for achieving my requirement.
Thanks in advance.Sanju P Ommen wrote:
Hi
Changing the init.ora >> NLS_DATE_FORMAT="DD-MM-YYYY" would do the needful.
Edited by: Sanju P Ommen on Feb 11, 2010 4:07 AMThat does NOT change the date. It only changes the default format by which date values are returned to users. -
P10_STARTDATE Date Picker (YYYY-MM-DD) invalid number
All i have a form that inserts a row into the database one of the fields is defined as
P10_STARTDATE Date Picker (YYYY-MM-DD). This all works and the popup comes up and user selects the date and then inserts the row.
When the user clicks on the id column of the report it takes him to the update page which should load all the data from the database. All i get back is an error that says
ORA-01722: invalid number
If i update the table and set the startdate column to 0 and then click on the id column again to update the record it comes up and i can run the form to update it, why is it saying invalid numberBen,
Can this be reproduced on htmldb.oracle.com?
What is the data type of the column associated with P10_STARTDATE?
Joel -
Need some example of 'SET DATE MASK'.
Hi Gurus,
I need come example of 'SET DATE MASK ' & 'SET TIME MASK'.
Thanking you.
SubashHi Subasha,
/ : SET DATE MASK = 'MMMM DD, YY'
This displays the date as : September 26, 07.
YY Year (2 digits)
YYYY Year (4 Digits)
MM Month (2 Digits)
MMM Month Name (Abbreviated)
MMMM Month Name (Full)
DD Day as two digits
DDD Day name (Abbreviated)
DDDD Day name
Using the SET DATE MASK causes the subsequent date fields to be displayed using the same formatting. To return to the default formatting use the following command:
/: SET DATE MASK = ' '
/: SET TIME MASK = 'HH hrs MM min SS sec'
This displays the time as : 11 hrs 43 min 37 sec'
The following are the codes that can be used in the time mask:
HH Hours
MM Minutes
SS Seconds
The time formatting can be reset to the default setting using:
/: SET TIME MASK = ' ' -
How to set data in rtf document?
Hi friends,
I have a rtf document can anyone suggest how to set data in cells of an rtf document?Is there any way?
Thanks in advance..
Regards ,
SoumyanilConvert the resultSet from the db to a Object[][], let's call it result.
Then create a JTable (jTable1).
On the JTable you need to define the headers, and the data itself.
You can get the headers from ResultSetMetaData. Convert these to an array again (headers).
Now use these methods to create a model and set the model of the JTable.
Model model = new DefaultTableModel(result, headers);
jTable1.setModel(model);That's about the basics.
If you need more info, use at the tutorial at sun's homepage.
How to use Tables:
http://java.sun.com/docs/books/tutorial/uiswing/components/table.html -
Dynamically Set date not changing in schedule Job
Hi,
I have created a report with "Order Date" as one of the parameters on the selection screen. I have created a variant, say 'X' , to set this date parameter dynamiccaly as "Current date - 31 days".
I have scheduled this program to run in background with the 'X' variant daily at certain time.
Now, for the day on which I created this job , the Order Date is set to correct date . For ex if I am scheduling the job tdy it will be set to 06/10/08. However, for next day , that is tom this date is not getting changed. i.e Tommorrow again Order date is 06/10/08 but it should have been 07/10/08.
So basically this dynamically set date is not chaning in the scheduled job.
Any idea why this is happening and what is the corrective measure for this.
Thanks!There is an INITIALIZATION event in the program.......
Do the processing your date in that event only....
for ex....
select-options: date for order-date.
INITIALIZATION.
date-low = sy-datum or wat ever.
Thanks
Saurabh -
How do I set date and time on apple tv?
How do I set date and time on apple tv?
Fixed the same problem, STEPS
1. Reset your apple TV
2.It will again stuck on that setting, ignore it by press menu
3. Unplug ethernet wire
4. Try to connect with wifi, it should be work with wifi connection as mine.
5. Then you can switch back Ethernet wire after get fixed.
Thanks. Lemme know dude if it's work. -
I have not used my Apple TV in a few years, and just got it out of the bag to use on a new TV. I connected it up to power and with an HDMI cable toTV. It attempts to set date and time and cannot. I cannot get the remote to interact with the box also. Could it be something as simple as needing a new battery?
Hi kybriar,
Thanks for using Apple Support Communities. This article has steps you can take to troubleshoot the remote itself:
Troubleshooting the Apple Remote
http://support.apple.com/kb/ht1722
For the issue of setting the date and time, these articles may help:
Apple TV: Basic troubleshooting
http://support.apple.com/kb/ht1551
Reset Apple TV by unplugging it from the power outlet, waiting about five seconds, then plugging it in again.
Power off your TV, wait five seconds, then power it back on.
Apple TV (2nd and 3rd generation): Troubleshooting Wi-Fi networks and connectionshttp://support.apple.com/kb/TS4546
Ensure that Apple TV is within range of your Wi-Fi router or base station.
Confirm that your Wi-Fi router and cable/DSL modem are connected to power and turned on.
Make sure other devices (computers, iPhone, iPad, for example) are able to connect to the Wi-Fi network and access the Internet.
Check your Wi-Fi network settings on Apple TV:
Select Settings > General > Network > Wi-Fi and press the center button on the remote to display nearby networks.
Choose your Wi-Fi network from the list.
If your Wi-Fi network uses a password, make sure you are entering it correctly.
Restart your Apple TV by selecting Settings > General > Restart.
Try restarting your Wi-Fi router or modem by turning it off and then on again.
If possible, connect an Ethernet cable and verify your Internet connection. If you can connect to the Internet using an Ethernet connection, verify that your Apple TV is using the latest software by selecting Settings > General > Software Update. If your Apple TV can be updated, install the update and then try the steps again.
Cheers,
- Ari
Maybe you are looking for
-
How to log Exceptions raised in CAF Application Services
Hi All, When there is an Exception rasing in CAF Application Service custom method implementation what are the steps need to follow for send that exception details to log files & where those log files will be generated i.e either in server, local sys
-
How to use os x yosemite calculator - need decimal points
I updated to OS X Yosemite version 10.10.2 for my Mac. I cannot figure out how to use the calculator! All I want is to add dollars and cents. How do I get a decimal point? I've searched the web and don't see this addressed.
-
How to create an object?
what are the no of ways which we can create a object?Explain in detail?
-
Http authentication failing on all sites, does not even prompt me for user/pass
Hi, After an apt-get update, sites that use HTTP authentication do not prompt for credentials and go straight to HTTP:401. It is only affecting this browser, others have no issues. I also updated a FF in Windows, no issues there after the update.
-
Proxy(asynch) to JDBC(sync) to Proxy (asynch)
Hi , I have a scenario where i'l be triggerin proxy(12 tables data) and will be either inserting or update to JDBC 12 tables and later shud recieve an acknowledgement of all the 12 tables and pass it to the proxy (updatng the 12 ztables field as su