Parse Date object for AM/PM
how do we parse whether it is AM /PM from Date() object?
You asked this question yesterday already with the same degree of vagueness.
Please return to your thread from yesterday and continue posting vague dribblings as they occur to you there http://forum.java.sun.com/thread.jspa?threadID=5198538
Similar Messages
-
Error while getting data objects for instance
Hello Expert,
I am getting some weird error - whenever there is a new process is triggered and I check context Data, I get following error -
"Error while getting data objects for instance processinstanceid"
Thanks is advance
PriyaHi Priya,
this is a known issue in the xml processing of the Java Virtual Machine. Please refer to the SAP Note for this issue: 1949395
This should solve your issue.
Best regards,
Stefan -
Converting Date.toString() back to a Date object for compare
I know this is beating a dead horse to death but I have wasted a whole day trying to get this to work. Here is the problem.
I need to convert a Date().toString (format returned: Dec 19, 2006 3:39:58 PM EST) back to a Date object. What I am doing is writting this string a text file and then revisiting it to compare later to a current Date object to find the difference in the two stamps in milliseconds.
J2SE 1.4.2 being used
Date date = new Date();
String newDateStr = log[1].trim(); // entry from log file
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date logDate = dateFormat.parse(newDateStr);
// get difference between the two
long timeSpan = date.getTime() - logDate.getTime();
if(timeSpan > 60000){
// TO DO
}So should I look at a different approach at either:
A) Storing the date/time stamp in the text file
B) The conversion back to Date object is wrong
Really appreciate any insight on this.
Thanks
JLW
Message was edited by:
jlwestsrThen my friend you are in the same status as Tim.:o)
I don't know as much as him and I don't care to write
an elaborate reply most of the time. :D
Merry ChristmasSame to you.I don't pretend to know that much, but When I see something I do know, I tend to give examples.
Most probably that is because at the present time I am in a situation where most of my time is spent waiting for a call from the customer, and the app I am supporting works so well that those calls are few and far between. Lucky for me, they pay me for sitting around and answering questions on a forum.
At least it is a java forum, where I can justly claim that I am improving my knowledge of java.
~Tim -
Parse PDF object for input values
Hi,
can somebody tell me how I can access the values entered into an offline PDF document? Or can anybody tell me where I could finde apporpriate documentation?
Many thanks!
BirgitHello.
You can use the method transferPDFDataIntoContext from WDInteractiveFormHelper to populate your context with the data filled in the offline pdf.
http://help.sap.com/javadocs/NW04S/current/wd/com/sap/tc/webdynpro/clientserver/adobe/api/WDInteractiveFormHelper.html
You have to define the same Context structure used to generate the pdf in your app that reads/uploads it.
Something like:
WDInteractiveFormHelper.transferPDFDataIntoContext(wdContext.currentContextElement().getPdfSource(), wdContext.nodePDFData());
Regards,
Paulo. -
How to set Timezone in a date object
Hi,
I need to write a method setTimeZone(Date d,TimeZone t) which should take a Java.util.Date and a Timezone object and set the time zone to the date object.
for example...
Date d=new Date();
TimeZone tz=TimeZone.getTimeZone("PST");
//should print the timezone as EDT because the current system timezone is EDT
System.out.println(d);
setTimeZone(d,tz);
//should print the timezone as PST
System.out.println(d);
public void setTimeZone(Date d,TimeZone tz){
Calendar c=Calendar.getInstance(tz);
c.setTime(d);
c.setTimeZone(tz);
d=c.getTime();
System.out.println("Timezone in calendar is "+c.getTimeZone().getDisplayName());
But today is still showing up EDT timezone and Timezone in calendar is shown as PST.The new timzone is not aplied to date object @ d=c.getTime();
statement.
Could any one please help me...
Edited by: mchepuri on Apr 10, 2009 7:27 PM
Edited by: mchepuri on Apr 10, 2009 7:29 PMDates don't have any concept of time zones. Think of a Date as a wrapper for a long.
Use SimpleDateFormat. Read the javadocs for some useful methods. -
Import Data object using web service adapter
Hello experts,
In DOE, theres a way to import Data Object from a wsdl using webservice adapter. We got to know that there are some guidelines(constraints) on the operations provided in the wsdl to be able to use webservice adapter. Could you please give a sample wsdl which can be used to import Data object for our reference?
Thanks in Advance,
SrilathaHi Srilatha,
SAP Netweaver 7.3 is not yet released to customers. Once, this happens we will post sufficient documentation related to the Import of Data Objects through WSDLs. In case you require the information urgently, kindly get in touch directly with the colleagues from DOE Mobile team.
Best Regards,
Kranti -
How to move multiple decision tables values into results data object
Hi Carsten and other experts,
I am building a BRF+ function and have a question, I would probably try to give an example to better explain the issue.
1. Function Signature
Context elements: C1, C2, C3
2. Ruleset has two decision tables DT1 and DT2.
DT1 take C1, C2, C3 as inputs to provide C4 and C5.
DT2 takes C5 takes as inputs to provide C6.
What should be results data object for function to get C4,C5 and C6 as Function Output parameters?
I have tried different combination of structures and table and couldn't figure out how it behaves.
Thank you
KrisThe function gets a result structure with components C4, C5, C6.
In a ruleset assigned to the function you have a rules that calls the two decision tables DT1/2.
Create a structure for DT1 with C4 and C5 as components. Make the structure the result of your decision table.
DT2 has C6 as a result. -
If I have created selection packages to load to a master data object for example:
1. Load to 0MAT_PLANT
2. Five packages created filtered by plant range
If I kick off the first package do I need this load to finish before the second package can load into the object i.e. 0MAT_PLANT is locked by the first package or can I load packages in parallel to a master data object? If so how? ThanksThanks for that, have carried that out. I have observed the following would be grateful if someone could confirm
1. Have a package running 2+ million lines
2. Kick off a package with a few hundred thousand lines after the first package, will complete before first package
3. Get an error since the extract completes in R3. However cannot load to the object since it is locked by the first
4. Message below:
User BWR3REMOTE is preventing you from loading master data for
characteristic 0MAT_PLANT . The lock was set by the master data loading
process with the request number (DataPackage number)
REQU_46MIUD73IBHYLLD9KZCAX4P47(000226) on 20070729,171630(711753) . -
Customizing JTree data rendering for Dates
I have a JTree that has different data types in each column that I'm sorting. I'd like to be able to control the String that appears in the table cell(s) based on the value in the model. I'm trying to make it so that if a Date is less than some predeterminded Date value that a custom string is output to the Table cell instead of the normal Date string.
I thought a JTable took the toString() of the Date object for its value and that I could just subclass the java.util.Date object and override the toString() with a conditional. such as (toString() in my CustomDate subclass that extends java.util.Date):
public String toString() {
defaultDate = new java.util.Date();
if (defaultDate.getTime()>this.getTime()){
return "Date entered in the past";
} else { //get the normal Date toString
return new String(super.toString());
}I'm not so much asking what is wrong with my code, but how to accomplish this task, the code is simply to show the direction I've taken. Am i close, or way out in left field?
Thanks for any help guys!Zulfi100 needs a BrainCellRenderer.He is strangely disturbing yet amusing at the same time. It worries me that he is going to use the skills he learns here to teach.
-
I need to be able to parse out the month, day of month and the time from a date object into separate fields. I know I can use the getTime() method to retrieve the milliseconds which I believe I can work with, but I also need the month and day.
Use the Calendar object.
Date myDate = ....;
Calendar cal = Calendar.getInstance();
cal.setTime(myDate);
int day = cal.get(Calendar.DAY);
int month = cal.get(Calendar.MONTH);Note that the month returned by the Calendar class is ZERO based.
ie 0 = Jan, 1 = Feb, 2=Mar.
Of possible use to you would be the java.text.SimpleDateFormat class which converts between Dates and Strings for you.
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");
Date d = sdf.parse("15/09/2005");Check out the API for java.util.Date, java.util.Calendar and java.text.SimpleDateFormat.
Cheers,
evnafets -
WD4VC Callable Object: No parser configuration entry for the tag Invoke
I am trying to use a Visual Composer model as a callable object. I can deploy OK (as a Web Dynpro model, having checked the copmiler options "Deploy Model with PAR" and "Add Guided Procedure information").
When I try to test the Callable Object, I get the following error:
com.sap.tc.wd4vc.intapi.info.exception.WD4VCRuntimeException: No parser configuration entry for the tag Invoke.
No idea how to get around this.
Any help greatly appreciated.
Kind Regards,
Tony.Hi Mario,
We have only three runtime in VC 7.0
1. XGraph
2. Flash
3. Webdynpro.
In your blog on wiki Flex runtime is mentioned as given below:
Webdynpro runtime is not fully supported in NW04s and some tags may not be supported as stated in the error. The reccomendation is to use the flex runtime.
Is Flex runtime and Flash runtime is same ,
I have tried to deploy the model in Flash runtime and Portal runtime error ocurs by diasply renderning JSP Component,
But when i deploy it in Webdynpro runtime , it works fine for displaying data in Table.But gives error :No parser configuration entry for the tag ChartView , when i used chart in place of table .
Thanks. -
Error while generating Data Objects in sdoe_wb SAP for Basis component
Dear all,
While generating SAP BASIS Components getting error
After installations of SAP Netweaver Mobile 7.1 SP11 and all the Notes applied for SP11 i have done the Generation for all the SAP BASIS Data Objects
All the Data objects are generated except AGENT_CONFIG, ARCHIVE
When i check the same in smq2 it shows the error in Function module SDOE_GENERATE_MBO for the user FUNC001,in status text it shows "connection closed (no data)"
kindly help on this issue.
Regards
RevanthHi,
well, I guess if you mean you did reset the queue - you deleted all emtries with error. Try to avoid this in the future - you will get unwanted side effects by that. There are only a few errors that make this behaviour necessary.
Usually you should select the entry on the first screen - so you see the status of the queue on the second one. On there you can select the queue and while pressing the green tick, you can restart it. If it is a timeout - this restart usually helps.
Wondering why you have an issue with basis objects - did you run through the complete setup guide up to this point?
Regard,
Oliver -
Date formats for SQL statements used by recordset object
Hi,
Date formatting appears to be quite problematic for Business One. I did a forum search for date issues and I don't think I saw any of them with an "answered" status. I have an issue with formatting a date for the creation of an SQL statement that the DI sends to SQL Server 2005. I need to format a date so that the localization parameters don't matter for either the client machine or SQL Server's machine. We don't have a problem as long as our machines are localized as USA.
I have PL 22 and I have a form - ours - where I use the Today() function to fill a date field. So this is a date that is not entered by the user. The result of this function is consistent with the localization parameters on my machine. We have two other date fields on the form where the user must type in the date.
As a test, I changed my machine to the UK parameters. I then set up the language parameters of Business One for English(United Kingdom). I changed the date format specifications in Business One so that its format is dd/mm/yy. I then brought up the form and the field that is formatted by the above function arrived in the form's field as dd/mm/yy. I then typed in the two other dates in the same format and added the record to the database. The form's table is user-defined.
I dismissed the form then brought it back up loaded with the new record. The date that was entered by the function appeared in USA format (mm/dd/yy). The dates that were typed in appeared in the Business One format (dd/mm/yy). This of course is not consistent.
When I looked at what got into the database, the formats were the opposite. Weird! To make matters really confusing, I run an SQL statement within SQL Server Mgt Studio, and use the WHERE clause to filter on the date that was based on the function. It didnt matter what format I used for the WHERE clause, the record came up. Does anyone have any idea about how I can ensure that I always use the correct date format for SQL statements passed by Business One to SQL Server regardless of where in the world the application is being run?
Thanks,
MikeIan,
Here's what I'm concerned about: Im using the date in a WHERE clause.
Assume the date is Aug 3, 2007.
"SELECT * FROM Table WHERE StartDate > 8/3/2007"
OR
"SELECT * FROM Table WHERE StartDate > 3/8/2007"
If the client machine is set up as USA, the today function will provide the date as formatted in the first query. If the database server is setup as lets say the UK, I believe that SQL Server query parser will interpret the date as Mar 8, 2007.
If the client machine is set up as UK, the today function will provide the date as formatted in the second query. If the database server is setup as lets say USA, I believe that SQL Server query parser will also interpret the date as Mar 8, 2007.
In both cases it would be wrong.
I know I could use the DATEPART function to get the three parts and this will make the code indifferent to the localization specs of the client machine. I need to then be able to concatenate those date parts for the WHERE clause so that the localization specifications of the database server dont matter.
Thanks,
Mike -
Using Oracle Stored Proc as Data Source for PowerBuilder Data Window Object
Hi,
I'm trying to use an Oracle stored procedure as the data source for a PowerBuilder data window object. I'm using the following (which is a variation of an example given on Sybase's web site, with the appropriate database/column name changes and use of %TYPE):
======================
CREATE OR REPLACE PACKAGE pkg_dw_sp_example
AS
TYPE typ_example_rec1 IS RECORD(
v_comcodsa st_sa.comcodsa%TYPE,
v_comnamsa st_sa.comnamsa%TYPE,
v_cocitysa st_sa.cocitysa%TYPE);
TYPE cur_example_cur1 IS REF CURSOR;
RETURN typ_example_rec1;
END;
======================
CREATE OR REPLACE PROCEDURE sp_dw_example1
(arg_teamid IN st_sa.comcodsa%TYPE,
cur_team IN OUT pkg_dw_sp_example.cur_example_cur1)
AS
BEGIN
OPEN cur_team FOR
SELECT comcodsa,
comnamsa,
cocitysa
FROM st_sa
WHERE st_sa.comcodha = arg_teamid;
END sp_dw_example1;
======================
The package is created okay, but the procedure is saved with compilation errors. Unfortunately, Oracle does not indicate what the errors are (great product), so I have no idea what it is complaining about.
Questions:
1) Can anyone point me to/or provide a better example?
2) The examples in books I have seen all would have declared the procedure in the package specification - is the above valid?
3) This is a PowerBuilder specific question, but if the package does not show up in the stored procedure list when creating a data window object, how does one use it as a data source?
Oracle 8.1.7
PowerBuilder 8.0.1
Thanks,
Ed Holloman1) Everything looks fine with your code. You did not mention the environment you are compiling your code in, but if it is SQL*Plus, you can type 'show errors' after the compile and it will list the errors and line numbers for you.
2) You can include the procedure in the package - in which case you would have a procedure declaration in the spec and the actual procedure in the body. You would no longer include the 'create or replace' - the declaration and procedure would just start with 'procedure'. The spec would look include:
PROCEDURE sp_dw_example1
(arg_teamid IN st_sa.comcodsa%TYPE,
cur_team OUT cur_example_cur1);Note the removal of the package reference (since we are now IN the package) and the second parameter is just OUT instead of IN OUT.
3) Not much, but I know that in PB8, our developers have said they have visibility now to the package when creating a DW - something they didn't have in PB7. Previously, we had to create a dummy standalone procedure that they would select and they would later modify the code to include the package prefix.
Hope this helps a bit. -
Unable to get database format for date object
Hi,
I am using UDT to build an universe against Oracle DB, We are using a view to get date object to filter the dates in our reports. Format for the date column in the view is "dd-MMM-yy". Desired format at the WebI layer is also "dd-MMM-yy"
However, when I pull this object in WebI in filter pane, I am still getting Timestamp with date and the format is also coming as "mm/dd/yyy hh:mm:ss a"; and, if I pull the date column in results pane I am getting the correct format "dd-MMM-yy". I tried typing the value for prompt, using calender (this also gives default timestamp) none of them worked
I tried using with and with out the TRUNC(date) function, changed object properties at universe level but, still I am getting the same result
Can you please guide me on, how to get the date value in "dd-MMM-yy" when used in prompt and, is there a possibility to not show timestamp in calendar selection (screenshot: Date parameters2)
Thanks in advance
SriHi Jacq,
Thanks for your reply. We are on BO4.0 SP04 FP03 with Oracle 11g as back end
Object type is defined as Date in universe. In the report and the SQL generated are showing as per the backend column format 'dd-MMM-yy'
However, same date object is showing with timestamp, as 'dd/mm/yyyy hh:mm:ss a' format when showing LOV's & when selected using calender GUI in prompt screen
I already tried the below options in various combinations, none of them worked
1) TRUNC(date)
2) Object Properties - Advanced
3) Object Format - custom
Thanks,
Sri
Maybe you are looking for
-
How to disable Header and Footer in MS word with VB code
Hi Tea, We need to disable Header & Footer in MS word (Restrict user to edit Header and Footer). So we are trying to write a VB code. What ever code we tried it is not working . Can you please provide any solution how to diable H & F in word using VB
-
Moving iTunes Library to an external drive. My itunes cant connect to the library
I have tried to move my iTunes Library to an external drive. When I open the iTunes app i can not get the app to read the library on the external drive. I have gone into iTunes preferences and redirected the app to read the external file and I stil
-
Valuated GR not allowed in case of multiple account assignment
Hi Friends, While creating Asset PO with multiple account assignment categories from SC i received the following error message in RZ20. PO 0030065837: No instance of object type PurchaseOrder has been created. External reference: PurchOrder 003006583
-
Hey there folks. I have a bit of a problem. When I record video on my N95 it's fine if the camera is completely still but on panning shots the picture visibly 'wobbles' no matter how smoothly or steadily I move the camera. It does this both with and
-
Implement Survey Application using Siebel
Hi there, We are looking to an option to implement a few web surveys using Siebel. Is Siebel a good candidate? I saw SmartScript has some functionalities for question/answers. Can I use it to design a web survey? Is there any limitation? Would you al