Formatting a date according with user settings (user defaults)
Hi All,
I need to format a date I receive via JS in YYYYMMDD format according with user defaults <b>without</b> server side action (I know, this is not a good issue, but they want it).
My solution is to write a JS function (there are a lot of it on WWW) which accepts two strings and formats the first according to the second, something like:
userFormattedDate = formatDate('20060613','DD.MM.YYYY');
paying attention to generate 'DD.MM.YYYY' string on server side, according to user settings.
But if this isn't a weblog, where is the question? :-D
The question is: is there a JS function (in DatePicker or dateNavigator BSP) provided by standard libraries which serves similar functionality?
Does exist a JS public standard library?
Thanks.
Dany
Hi Durairaj,
Tags <% %> are for server side actions.
The question is about obtaining the same effect, but client side.
Thanks.
Dany
Similar Messages
-
Value conversion according to User default
Hi,
I have a Problem in a BDC. I am trying to populate pick quantity filed in my BDC ( Tcode VL02N ) the BDC works fine for a particular user default setting( NNN,NNN.NN ). But is the same program is used by some other user whose Default settings are different ( NNN.NNN,NN ) BDC fails .
I need to convert the value based on user default before passing it to the field in BDC.
pl. suggest me the solution .
Thanks.
HiteshHi
Try to use the WRITE command before transfering the value to BDC table
DATA: QUANTITY(20) TYPE C.
WRITE <QUANTITY> UNIT <UNIT> TO QUANTITY.
<BDC>-VALUE = QUANTITY.
APPEND <BDC>.
In this way the WRITE statament'll write the quantity in the format according to user default parameters.
Max -
Function module converts sy-datum to date according to user settings in SAP
Hi experts,
I need such a function module which converts sy-datum to a date format
according to user settings in SAP.
Thanks,
YogeshUse these function modules.
CONVERSION_EXIT_PDATE_OUTPUT
CONVERT_DATE_TO_EXTERNAL
Please mark points if the solution was useful.
Regards,
Manoj -
Date according to user requirement
Hi experts
I have a selection-screen date field when user enter date with the help of F4 it shows error message like this
Input date format like this : 09/01/2010
Please Enter date in the format : __.__.____ like this
is there any function modules to convert date like this format .
Thanks & Regards
Siva Krishna.To solve this purpose, a function module has been created which takes the date and format (in which date needs to be converted) as input and gives the date in the desired format as output. It also raises an exception if the format is incorrect.
For achieving this functionality, a ztable is to be created which contains all the possible formats of a date. Then the format given on the screen is to be validated against this table.
STRUCT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YYYY
MMM/DD/YYYY
MMM/YYYY/DD
YYYY/MMM/DD
YYYY/DD/MMM
DD/YYYY/MMM
DDMMMYYYY
MMMDDYYYY
MMMYYYYDD
YYYYMMMDD
YYYYDDMMM
DDYYYYMMM
CODE OF FUNCTION MODULE
FUNCTION zdummy_date_conv.
""Local Interface:
*" IMPORTING
*" REFERENCE(DATE) TYPE SYDATUM
*" REFERENCE(FORMAT) TYPE CHAR15
*" EXPORTING
*" REFERENCE(DATE_FINAL) TYPE CHAR15
*" EXCEPTIONS
*" INCORRECT_FORMAT
Local variables declaration
DATA: l_y1 TYPE numc1,
l_y2 TYPE numc1,
l_y3 TYPE numc1,
l_y4 TYPE numc1,
l_m1 TYPE numc1,
l_m2 TYPE numc1,
l_d1 TYPE numc1,
l_d2 TYPE numc1,
l_len TYPE int1,
l_ctr TYPE int1,
w_t247 TYPE t247,
l_flag_m1 TYPE char1,
l_flag_init TYPE char1,
l_flag_d TYPE char1,
l_flag_y TYPE char1,
l_format TYPE char15,
l_final_date TYPE char15.
Local constants declaration
CONSTANTS: c_d TYPE char1 VALUE 'D',
c_m TYPE char1 VALUE 'M',
c_y TYPE char1 VALUE 'Y',
c_mmm TYPE char3 VALUE 'MMM',
c_yyyy TYPE char4 VALUE 'YYYY'.
Checking the format given by user.
SELECT SINGLE zformat
FROM zformat_date
INTO l_format
WHERE zformat = format.
IF sy-subrc EQ 0.
Processing Logic of the routine
l_y1 = date+0(1).
l_y2 = date+1(1).
l_y3 = date+2(1).
l_y4 = date+3(1).
l_m1 = date+4(1).
l_m2 = date+5(1).
l_d1 = date+6(1).
l_d2 = date+7(1).
l_len = STRLEN( format ).
CLEAR : l_flag_m1, l_flag_init, l_flag_d,l_flag_y.
WHILE l_ctr < l_len.
IF format+l_ctr(1) = c_m.
IF NOT format CS c_mmm.
l_final_date+l_ctr(1) = l_m1.
l_ctr = l_ctr + 1.
l_flag_m1 = l_flag_m1 + 1.
l_final_date+l_ctr(1) = l_m2.
l_ctr = l_ctr + 1.
l_flag_m1 = l_flag_m1 + 1.
ELSE.
SELECT SINGLE * FROM t247 INTO w_t247
WHERE spras = sy-langu
AND mnr = date+4(2).
IF sy-subrc EQ 0.
l_final_date+l_ctr(3) = w_t247-ktx.
l_ctr = l_ctr + 3.
ENDIF.
ENDIF.
ELSEIF format+l_ctr(1) = c_y.
IF format CS c_yyyy.
l_final_date+l_ctr(1) = l_y1.
l_ctr = l_ctr + 1.
l_final_date+l_ctr(1) = l_y2.
l_ctr = l_ctr + 1.
l_final_date+l_ctr(1) = l_y3.
l_ctr = l_ctr + 1.
l_final_date+l_ctr(1) = l_y4.
l_ctr = l_ctr + 1.
ELSE.
l_final_date+l_ctr(1) = l_y3.
l_ctr = l_ctr + 1.
l_flag_y = l_flag_y + 1.
l_final_date+l_ctr(1) = l_y4.
l_ctr = l_ctr + 1.
l_flag_y = l_flag_y + 1.
ENDIF.
ELSEIF format+l_ctr(1) = c_d.
l_final_date+l_ctr(1) = l_d1.
l_ctr = l_ctr + 1.
l_flag_d = l_flag_d + 1.
l_final_date+l_ctr(1) = l_d2.
l_ctr = l_ctr + 1.
l_flag_d = l_flag_d + 1.
ELSE.
l_final_datel_ctr(1) = formatl_ctr(1).
l_ctr = l_ctr + 1.
ENDIF.
IF NOT l_final_date IS INITIAL.
date_final = l_final_date.
ENDIF.
ENDWHILE.
ELSE.
CLEAR date_final.
RAISE incorrect_format.
ENDIF.
ENDFUNCTION. -
Unable to Access Data Form with Users Provisioned as 'Planner'
Hello,
I am currently experiencing an issue that I can't seem to resolve. I was hoping someone else might have some insight and/or have come across this issue.
I created two data forms. Users have been assigned permissions to the dimensions included in the data form. I have also assigned users access to the data form. The model is a single currency model.
Upon logging into the application, the user is unable to open the data form unless he/she is provisioned as an 'Administrator'. Provisioning the user as a 'Planner' or 'Interactive User' does not allow the user to open the data form. The following message appears:
*"Security and/or filtering has resulted in a required dimension not being represented on this data form."*
My data form uses the following dimensions:
POV: ELEMENT
PAGE: SCENARIO, YEAR, VERSION, ENTITY
ROWS: ACCOUNT
COLUMNS: PERIOD
We are currently implementing Hyperion Planning 11.1.2.0. The operating system is Windows Server 2008 64-bit R2.
Any advice/suggestions on how to resolve this would be greatly appreciated. Thank you.
CoreyI went ahead a created a data form that just used level 0 members and confirmed that the user had access to the members defined in the form. Still no luck.
I also checked to make sure the filters existed in Essbase. Here is what I found in Essbase:
Access: None
Member Specification: @IDES("Account"),@IDES("Scenario"),@IDES("Version"),@IDES("Entity"),@IDES("NTTA_ELEMENT")
I have no issues accessing the data through the Essbase Add-in.
I did notice some additional items in my Planning setup:
1. Task>Manage Process - Sub-Status states 'Failed' when I attempt to validate
2. Task>Manage Process - Status changes from 'Not Started' to 'Under Review' when I start the cycle.
3. Dimension Security - Users are attached to a group that has write access at the Descendent(Inclusive) level.
4. In the Account, Department, Scenario and Version dimensions I also setup the user to have write access at the member level.
As for my earlier post with the data forms, that was just my way of showing the dimensions used. I do have two data forms, 1) with top level and descendants/children and 2) with level 0 members only.
I checked the logs and there isn't really much info there. I have a case open with Oracle and a webex scheduled for tomorrow.
Thoughts?
Thanks
Corey -
FORMCALC (or JS) Default date today with user override questions
I have a date field where if null, I want today to be inserted. If the user overrides the today date and saves the form, I want the user entered date to stay.
What I have in FORMCALC is:
if ($.isNull)
then
$.rawValue = num2date(date(), DateFmt(2))
endif
The first part works, it populates with today, and I can overrided the date. When I save and then reopen the form, the date is "0".
Any ideas here?I'm having the same problem as described above but I am using JavaScript to reflect the current date:
var msNow = (new Date()).getTime();
var d1 = new Date(msNow);
this.rawValue = util.printd("mm/dd/yyyy", d1);
The user can override the current date and save the form, BUT when the form is reopened it will run again and insert the current date over the user entered date.
(I've tried several variations of "if (this.isNull)" to the above code which results in "01/00/0000" when opening the saved form --so it still doesn't retain the date entered by the user.)
Does anyone know what code I need to add to to keep the user entered date that was saved with the form? Or if there is a better way to make the date calendar default to today, allow user override and save that user entered date on the form? -
Open XML file with user default browser and not the default editor.
Hi,
I'm writing a java program that appends numerous XML files together. The result is a NEW well formed XML document. Since i have an XSLT that performs several UI modifications on this xml file, the file extension must remain '.xml'. I need to open this xml file with the users default web browser. The problem is that:
Runtime.getRuntime().exec(cmd);
....opens the xml file with the users default program for opening xml files which in my case is Oxygen. I want to force java to open this xml file with the users default web browser and nothing else.
I guess i need the Windows command to perform the 'open with' feature but i have no idea what that command is or how to find it.
Any ideas?
Thanks,
Varun Singh
Edited by: Jagara00 on Jul 2, 2009 3:49 PMsabre150 wrote:
Jagara00 wrote:
Your right, but my question relates to the java issue and not the XSLT aspect of the problem. I am looking for a java solution for reasons i will no go into here. You have lost me.Me too.
People do not often ask questions (or make challenges or observations) idly for the sake of 'theory'. It is most useful to explain to the best of your ability.
As to
"Since the Desktop class was only released with SE 6 I am forced to find another alternative. "
There is an 'alternative'. You can import it into a 1.5 project. It was available as a free standing API before 1.6 - through JDIC. See [https://jdic.dev.java.net/documentation/Examples.html|https://jdic.dev.java.net/documentation/Examples.html] for more info.
Edit 1:
To a later reply
"Do u .."
..want to spell incorrectly when you get frustrated?
"..do not wish to.."
..get any help? That is the way you are heading.
Edited by: AndrewThompson64 on Jul 3, 2009 9:27 AM -
Report layout with User default and gobal default
hi,
any authorization to control report layout, only some user ID can use "user default" layout, and part of user available to set the layout as default
thanksIs is a custom-developed ALV report or an SAP-supplied one?
If if is custom-developed, you can register the following user-commands
&AVE - Save layout
&OL0 - Change layout
&OAD - Select layout
in parameter IT_EVENT_EXIT of REUSE_ALV_LIST_DISPLAY. When these user-commands are triggered, control passes to the user command routine in your callback program. In the callback routine, you can implement authorization/security checks.
Also look at parameters IS_VARIANT and I_SAVE to control use of variants.,
If it is an SAP-supplied program, try using the auth-object mentioned in my earlier post. -
Calculating data according to user entry
Dear All ,
i need to design a query where i need to calculate proportionate budget according to the month entered by the user . for eg
if total budget is 50000 then proportionate budget should be total budget * ( entry by the user any month)/12.
how can i do it . help shall be highly appreciated.
thanks
RituSales group Sales Representative Formula 6 "PROP BUDGET
(UPTO DECEMBER 2011)" "ANNUAL BUDGET CONTRACT SALE
2011 -2012"
Delhi - Region 100 Contract Sales - A 752 B.D. Sharma 289,998,000.00 INR 326,247,750.00 INR 434,997,000.0 INR
878 Vijay Arya
952 Ashok Agarwal
1005 Aman Malhotra 599,994,000.00 INR 674,993,250.00 INR 899,991,000.0 INR
1231 R.K. Gupta
1251 Satyendra Shahi
1305 Sanjeev Angra
1393 Bikram Jamwal
1455 N. C. Basu
1494 Shailender Kumar
1515 Krishna Mitra
1743 Jitendra Dadlani
1754 Ajay Malhotra
1799 Sudhir Arya
1877 Pankaj Garg
1957 Bipin Agnihotri
2027 Ishwar Chander Goel
2031 Sukesh Kakkar
2069 Anil Luthra
2281 Munjesh Chaudhary
2303 Bhojpal Sirohi
2386 Abhinendra Singh
2406 Ratan Singh
2568 Jitendra Gupta
2630 Rajeev Kumar Verma
2645 Jitesh Kumar
2654 Shailendra Singh
3131 Arun A
3702 Shekhar Chaturvedi
3736 Subodh Nigam
3797 Umesh Khanna 160,002,000.00 INR 180,002,250.00 INR 240,003,000.0 INR
# Not assigned
Result 1,181,243,250.00 INR 1,181,243,250.00 INR 1,574,991,000.0 INR
110 Contract Sales - B 752 B.D. Sharma
878 Vijay Arya
1005 Aman Malhotra
1305 Sanjeev Angra
1494 Shailender Kumar
1513 U Srivastava
1754 Ajay Malhotra 15,626,250.00 INR 28,127,250.00 INR 37,503,000.0 INR
1877 Pankaj Garg
2027 Ishwar Chander Goel
2031 Sukesh Kakkar 156,251,250.00 INR 281,252,250.00 INR 375,003,000.0 INR
2173 Abhishek Singh 62,501,250.00 INR 112,502,250.00 INR 150,003,000.0 INR
2645 Jitesh Kumar
# Not assigned
Result 421,881,750.00 INR 421,881,750.00 INR 562,509,000.0 INR
120 Contract Sales - C 752 B.D. Sharma
878 Vijay Arya
1005 Aman Malhotra
1251 Satyendra Shahi
1305 Sanjeev Angra
1494 Shailender Kumar 424,998,000.00 INR 478,122,750.00 INR 637,497,000.0 INR
1754 Ajay Malhotra
1957 Bipin Agnihotri 325,002,000.00 INR 365,627,250.00 INR 487,503,000.0 INR
2303 Bhojpal Sirohi
2526 Digambar Singh
2645 Jitesh Kumar
2654 Shailendra Singh
2675 Shailendra Singh
3699 Dharmender Yadav
# Not assigned
Result 843,750,000.00 INR 843,750,000.00 INR 1,125,000,000.0 INR
130 Contract Sales - D 752 B.D. Sharma
1251 Satyendra Shahi
1305 Sanjeev Angra
1754 Ajay Malhotra
1877 Pankaj Garg
2027 Ishwar Chander Goel
2042 Suresh Saraf 85,938,750.00 INR 154,689,750.00 INR 206,253,000.0 INR
2245 Prosenjit Mukherjee 132,813,750.00 INR 239,064,750.00 INR 318,753,000.0 INR
3797 Umesh Khanna
# Not assigned
Result 393,754,500.00 INR 393,754,500.00 INR 525,006,000.0 INR
200 Product Sales - 1 1501 Sanjeev Sharma
1819 Girish Luthra
2027 Ishwar Chander Goel
2069 Anil Luthra
# Not assigned
Result
210 Product Sales - 2 1501 Sanjeev Sharma
1819 Girish Luthra
2069 Anil Luthra
2364 Anil Kumar
2397 Ashok Kumar
2594 Vikram Malhan
2654 Shailendra Singh
# Not assigned
Result
220 Product Sales - 3 3736 Subodh Nigam
# Not assigned
Result
300 Marketing &Technical 1515 Krishna Mitra
2221 Ashu Sharma
# Not assigned
Result
# Not assigned 1501 Sanjeev Sharma
# Not assigned
Result
Result 3,471,880,500.00 INR 2,840,629,500.00 INR 3,787,506,000.0 INR -
Export userdata along with user mapping
Hi,
Can any body explain how to export user data along with user mapping.
Thanks in advance.
Regards,
Ashok.hi,
Any input or suggestion of the above request.
My request is,i want to export user data along with user mapping and i am using EP 6.0.
can any body give the details of exporting data with user mapping.
Thanks in Advance.
Regards,
Ravi.M -
Formatting DATEs with FORMAT clause and not with "to_date()" ?
Well I know I could format a DATE inline with the to_date() function.
But is there a way to format it in a separate FORMAT clause similar to
numbers?
If yes how would a format of
dd.mm.yyyy
or
yyyy.mm.dd hh:mm:ss
look like?user559463 wrote:
Ok, again I am searching something like
COLUMN "expiry" FORMAT "YYYY.MM.DD HH:MM:SS"No, it can only be done via TO_CHAR or NLS_DATE_FORMAT. I think you should read SQL*Plus COLUMN command.
SY. -
Error when executing Query with user date settings = mm/dd/yyyy
Hi all,
I created a remote cube with datasource = TCURR table with proper conversion of the date etc.
The query on top of this remote cube works fine if my user date settings is set to dd.mm.yyyy
But when a user in USA, with user date settings = mm/dd/yyyy, executes the same query, they get a message
SYST: Date 31/05/2006 not expected.
Message no. FGV004
The input variable on the Query is on 0CALMONTH.
This message appears immaterial of what calmonth input I give.
has anyone encountered this error? if yes, what could be the solution please?
thanks
EmmanuelHi,
This is in regard to the user settings maintained in transaction /nsu3.Please follow the below link.
http://web.mit.edu/sapr3/docs/webdocs/getstarted/gsSETTINGS.html
You need to change the settings as required.
Hope this helps.
Thank you,
Prem -
In LSMW flat file date format to be converted to user profile date setting.
hi all,
i got a flat file in which date is in mm/dd/yyyy format.i converted the data using lsmw but this conversion is valid only if user has set his date profile as mm/dd/yyyy in his user profile setting->own data. now if user has some other setting then it will give error. so how to convert date and how to do mapping with same . please help.Sunil,
use below fm to get current user date format:
data: idate TYPE sy-datum,
tdat8 type string.
CALL FUNCTION 'DATUMSAUFBEREITUNG'
EXPORTING
IDATE = idate
IMPORTING
TDAT8 = tdat8.
Amit. -
Filter omni portlet output data according to portal user
We have created an omniportlet that connects to a database, and retrives some values into a defined HTML layout.
We want to filter output data according to our portal current user name
When we try to use portal.wwctx_api.get_user inside of omni portlet select statement fallowing error occurs.
Error in executing Query : [ORA-06510: PL/SQL: unhandled user-defined exception ORA-06512: at "PORTAL.WWCTX_SSO", line 1803 ORA-06510: PL/SQL: unhandled user-defined exception ORA-06512: at "PORTAL.WWCTX_SSO", line 1637 ORA-06502: PL/SQL: numeric or value error ORA-06512: at "PORTAL.WWCTX_SSO", line 1865 ORA-06512: at "PORTAL.WWCTX_API", line 183 ]
Thanks a lotThis is because the Omniportlet is actually operating within a different context--a separate database connection from the Portal connection. We have similar issues with Java portlets. You might try creating a public parameter on the portlet, then mapping that to the system variable USER (done on the Parameters tab of the page where you deploy it--if you don't see a parameters tab, you must enable Parameters and Events at the page group properties level). I haven't tested any of this, but it should get you going in the right direction.
-
How to read the data from a file in another computer with user name and password login
How to read read the data from a file in anohter computer which need to login with user name and password?
duplicate post: http://forums.ni.com/t5/LabVIEW/log-on-the-other-computer-with-user-name-and-password/m-p/2061478
duplicate post: http://forums.ni.com/t5/LabVIEW/do-need-to-enter-the-user-name-and-password-when-TCP-ip/m-p/2061612
duplicate post http://forums.ni.com/t5/LabVIEW/log-on-the-other-computer-with-user-name-and-password/m-p/2060682
Maybe you are looking for
-
How do I print black and white on Mountain Lion?
Hey. Does anyone know how to print black and white on Mountain Lion? I searched the community and Google but I couldn't find anything... Regards, TeaDragon
-
Opening an application in a new window
Hi, I have an ordinary java class, which has access to request and response objects. From here, I need to open a third party application in a new window. Please let me know how I can do this. Thanks,
-
Validate input value against calculated value
Hi Chaps, Need a bit of guidence with some PHP code. I have a Query that estimates a quote ($price_total) for a job. The estimate ($price_total) is the value of an input (jobquote), and the database is updated once the form is submitted (using a sepe
-
Hello! I have two ods: ODS 1 with charac C1 & C2 (C2 = date) & C3and KF KF1. ODS 2 with charac C4 & C2 & C3and KF KF2. My customer want in the report to have on lines the charac C1 and on columns charac C2 and KF1 and KF2. I need your help to do this
-
Transferring data from one custom field to another
Dear SAP gurus, I have requirement that we create custom field in Shopping Cart and PO, and when creating PO referring to the Shopping Cart the content of the custom field in SC need to be defaulted automatically in PO. For example I create SC 'A' an