How convert date/time from xml in xdp(Designer)?
Hi, i want to convert date/time format from xml in Designer, date/time value in xml is NOT in common format YYYY-MM-DD (if is in a common format i can do this with pattern)
I have a "DateTime" Field in Xdp can get from Xml date and time:
In XML <DateTime>DD-MM-YYYY</DateTime> i want to convert in XDP in DateTime Field in "DD-April-YYYY"
Can i do this?
You can do this way..
Bind the date field to your XML tag.
Set the display pattern for the date field.
In the initialize event of the date field place the following code.
Set JavaScript as language.
var dtStr = this.rawValue;
var pos1=dtStr.indexOf("-");
var pos2=dtStr.indexOf("-",pos1+1);
var strMonth=dtStr.substring(0,pos1);
var strDay=dtStr.substring(pos1+1,pos2);
var strYear=dtStr.substring(pos2+1);
//Assign the formatted value to the Date field.
this.rawValue = strYear + "-" + strMonth + "-" + strDay;
Thanks
Srini
Similar Messages
-
Hi All,
I have a requirement in my project like to convert the date time from one format to another.my situation is like to convert the date time from MM-DD-YYYThh:mm:ss to YYYY-MM-DDThh:mm:ss format. I am using the soa suite 11.1.1.6.
Can any one suggest me how to convert in the BPEL transformation.
Thanks,
Sanju.Hi Sanju,
Store the date to be converted into a variable viz. dateVar. Now, process an expression in assign as: xp20:format-dateTime($dateVar,'[Y0001]-[M01]-[D01] [h]:[m01]:[s01]').
Regards -
Batch file - how to Date & Time Format as January 6, 2014 - 8:54 PM Eastern
Batch file - how to Date & Time Format as January 6, 2014 - 8:54 PM Eastern
Hi Dhiravia,
If you want to convert the month format, please refer to the batch script below:
SET Month=%DATE:~4,2%
if %Month%==01 set Month=JAN
if %Month%==02 set Month=FEB
if %Month%==03 set Month=MAR
if %Month%==04 set Month=APR
if %Month%==05 set Month=MAY
if %Month%==06 set Month=JUN
if %Month%==07 set Month=JUL
if %Month%==08 set Month=AUG
if %Month%==09 set Month=SEP
if %Month%==10 set Month=OCT
if %Month%==11 set Month=NOV
if %Month%==12 set Month=DEC
echo %Month%
To convert the date format via cmd, please also check this article:
http://myblog4fun.com/archive/2012/01/06/getting-the-current-date-and-time-from-bat-files.aspx
If there is anything else regarding this issue, please feel free to post back.
Best Regards,
Anna Wang
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected] -
How to retrieve value from xml file
hi all,
can somebody pls tell me how to retrieve value from xml file using SAXParser.
I want to retrieve value of only one tag and have to perform some validation with that value.
it's urgent .
pls help me out
thnx in adv.
rituhi shanu,
the pbm is solved, now i m able to access XXX no. in action class & i m able to validate it. The only thing which i want to know is it ok to declare static ArrayList as i have done in this code. i mean will it affect the performance or functionality of the system.
pls have a look at the following code snippet.
public class XMLValidator {
static ArrayList strXXX = new ArrayList();
public void validate(){
factory.setValidating(true);
parser = factory.newSAXParser();
//all factory code is here only
parser.parse(xmlURI, new XMLErrorHandler());
public void setXXX(String pstrXXX){
strUpn.add(pstrXXX);
public ArrayList getXXX(){
return strXXX;
class XMLErrorHandler extends DefaultHandler {
String tagName = "";
String tagValue = "";
String applicationRefNo = "";
String XXXValue ="";
String XXXNo = "";
XMLValidator objXmlValidator = new XMLValidator();
public void startElement(String uri, String name, String qName, Attributes atts) {
tagName = qName;
public void characters(char ch[], int start, int length) {
if ("Reference".equals(tagName)) {
tagValue = new String(ch, start, length).trim();
if (tagValue.length() > 0) {
RefNo = new String(ch, start, length);
if ("XXX".equals(tagName)) {
XXXValue = new String(ch, start, length).trim();
if (XXXValue.length() > 0) {
XXXNo = new String(ch, start, length);
public void endElement(String uri, String localName, String qName) throws SAXException {
if(qName.equalsIgnoreCase("XXX")) {
objXmlValidator.setXXX(XXXNo);
thnx & Regards,
ritu -
How to remove Unicode from XML file
I get following error when unmarshal xml:
[java] org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x15) was found in the element content of the document.
Anyone know how to remove Unicode from xml file? Can I remove the unicode by rebuild the file?
ThanksThese sort of error usually occur when you're using a different character encoding to read the file than the one you wrote it with. Perhaps if you were to post the problem section of the file and/or the code that created it in the first place.
-
FUNCTION MODULE TO CONVERT DATE / TIME INTO WORDS.
HI EXPERTS,
FUNCTION MODULE TO CONVERT DATE / TIME INTO WORDS.
PLS DO HELP.....Hiii gita
we have another FM SPELL_AMOUNT
regards
Jaipal -
Function module to convert date format from yyyymmdd to mmddyyyy format
function module to convert date format from yyyymmdd to mmddyyyy format
Hi Rajitha,
Do like this
Data: Var1 type sy-datum,
var2(8) type c.
var1 = sy-datum.
Concatanate var1+4(2) var1+6(2) var1+0(4) into var2.
write var2.
Reward Points if this helps,
Satish -
How to subtract time from dateTime in xquery?
How to subtract time from dateTime in xquery??
In ALDSP i tried to use the function xf:add-days but it is showing an error saying invalid function name. I think this namespace is not valid for ALDSP. Is there is any way to add this function in ALDSP???xquery functions and operators documentation is here :
http://www.w3.org/TR/xpath-functions/
It sounds like you want to ..
op:subtract-dayTimeDuration-from-dateTime
this is not an xquery function that you can call, it is an xquery operation defined by the specification
I believe you can simply use the '-' operator to use that operation.
<newDateTime>
{ $myDateTime - $myTime }
</newDateTime> -
Converting date format from in mapping
hi xi friends.
in my scenario i just want to convert date format from 12022007 which is file to 12.02.2007 which is in target bapi.
waiting for u.
bye.
regards.
seeta ram.Hi,
if I understood you correctly you want to transform from ddMMyyyy (your format in the external file) to yyyyMMdd (format of ABAP datatype DATS):
Then all you need to do is to use the standard function TransformDate (as already described above).
Enter in the field "Format of source Date": ddMMyyyy
Enter in the field "Target Format": yyyyMMdd
That's it.
Regards,
Helmut -
Converting date format from 14/07/08 to 14-jul-08
hi all ,
i want to convert date format from 14/07/08 to 14-jul-08 . is there any function module for this ?.
kindly reply.
regards,
siyaHi Siva,
Check the code below.
For getting date format in the form like 10.Dec.2008*
WHEN '01'.
CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
EXPORTING
input = date2
IMPORTING
output = date_format.
IF sy-subrc EQ 0.
date_format1 = date_format.
ENDIF.
For getting date in the format like 10.December.2008*
WHEN '02'.
CALL FUNCTION 'CONVERSION_EXIT_SDATE_OUTPUT'
EXPORTING
input = date2
IMPORTING
output = date_format.
IF sy-subrc EQ 0.
Get Month Long text
SELECT SINGLE ltx
FROM t247 INTO ws_month
WHERE ktx EQ date_format+3(3)
AND spras EQ 'E'.
IF sy-subrc EQ 0.
CONCATENATE date_format0(2) ws_month date_format7(4) INTO date_format1 SEPARATED BY space.
ENDIF.
ENDIF.
Hope this helps,
Manish -
Convert Date to Calendar week in Query Designer
Hi experts,
Is it possible to convert date to week in the query designer?
Thanks in advance for your help.
Best Regards,
RoseHi,
Can you please explain more about virtual char you mentioned?
What i am actually doing is i am using a formula variable (getting the value from customer exit) and i based the calculation of other keyfigures basing on this value. The input value.. (data type date ) does not filter my query output.. it is only purely used for calculating other keyfigure values. The data types (Dimension Settings ) available in formula variable are only quantity, amount, pice and number, date and time.. there is no week there. So currently I am using the date. If I can convert date to week then.. I can make my query a lot simpler.
Thanks for your reply...
Regards,
Rose -
How to send data one row at a time from xml to flex
I want to setTimerEvent while sending data from xml to flex, one row at a time.
I have attached the xml.
Thanks in advance.Hi Greg,
Thanks for the reply. You must have seen the xml which i have attached.Here is the .mxml code which i have written:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="accountData.send()">
<mx:Script>
<![CDATA[
import mx.controls.*;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;
[Bindable]
private var AccountInformation:ArrayCollection;
private function AccountHandler(evt:ResultEvent):void
AccountInformation = evt.result.xml.AccInfo;
private function faultHandler(evt:FaultEvent):void
var faultMessage:String = "Could not connect with XML file";
Alert.show(faultMessage, "Error opening file");
]]>
</mx:Script>
<mx:HTTPService id="accountData" url="pgm1.xml" result="AccountHandler(event)" fault="faultHandler(event)" />
<mx:DataGrid x="20" y="24" width="950" dataProvider="{AccountInformation}" />
</mx:Application>
This reads and displays all the rows. But I want to display single row at a time with sometime time gap between the display of two consecutive rows.I am new to flex and this is my first code, so need your help on this.
I hope i have made myself clear. If there is anything else please let me know.
Looking forward to some solution.
Thanks in advance.
Regards,
praj58 -
Convert Data type from Oracle Data time string to SQL Date time data type
I have a time stamp column pulled from oracle into a SQL server db table varchar datatype column.
Now i want to change that column to date time.
Following is the data present in the table:
01-APR-11 02.15.00.026000 AM -08:00
01-APR-11 04.15.00.399000 AM -08:00
01-APR-11 06.15.00.039000 AM -08:00
I want to convert this data into sql server datetime data type.
Please advice.
Thanks,
Sam.
I am unable to find the solution in other sites which is why I have posted it in Oracle forum for seeking solution.
Thanks in Advance.
Sam.Sam,
How are you actually loading the data into SQL*Server - are you using something like an Oracle gateway, BCP or another Microsoft utility of some sort ?
If you are using an Oracle problem then we may be able to help but if using a Microsoft utility then you should really follow up with Microsoft to know what format the data should be in to use a Microsoft utility.
Regards,
Mike -
How to convert date-time according to the Time Zone the client
Urgent! Help wanted!
I extract a date-time field (which is GMT time) from the central database but I need to convert it accordding to the TimeZone of the user and also the so-called winter time and summer time in the local. Any one has any good solution?
Thanks.Use a Calendar, Timezone and Locale objects like this,
TimeZone tz = TimeZone.getTimeZone("Germany/Berlin");
Calendar cal = Calendar.getInstance(tz, Locale.GERMAN);
long date = 0; // assign your central database value to this variable
cal.setTime(new Date(date));
Now you can use the Calendar object 'cal' to retrieve the time according to the set locale and timezone.
These objects provide tonnes of features for finding out timezones and day light savings times. So check out the APIs as well.
I hope this helps you out. -
I have a Column that is defined as "DATE".it also Contains Time.........
I want to Get the Time only....so when i am using this
to_date(var_date,'hh12:mi:ss PM'),it is giving me date also and when i am using this
to_char(var_date,'hh12:mi:ss PM') then it is giving me all values similar to one of the top values in Column....
Then i Used EXTRACT function as
Select EXTRACT(HOUR FROM VAR_DATE).......
THEN IT THRWOING ERROR.......INVALID EXTRACT FIELD FOR EXTRACT SOURCE........
pLZ HELP HOW TO GET TIME...................................ONLY WITH AM AND PM......
Thanks in AdvanceHi,
to_char function should give the result as expected.
SQL> select to_char(sysdate, 'hh12:mi:ss PM') from dual ;
TO_CHAR(SYS
11:39:16 AM
SQL> select to_char(sysdate, 'hh12:mi:ss AM') from dual ;
TO_CHAR(SYS
11:39:32 AM
SQL> select to_char(sysdate,'hh:mi:ss') from dual ;
TO_CHAR(
11:40:04
SQL> select to_char(sysdate,'hh:mi:ss am') from dual ;
TO_CHAR(SYS
11:40:18 am
SQL> select to_char(sysdate,'hh:mi:ss pm') from dual ;
TO_CHAR(SYS
11:40:31 am
Thanks,
Siva
Maybe you are looking for
-
Adobe Reader drawing without Comment Tools or Method to set "Make Properties Default" without popup
Hi everyone, Spending a few days to find a solution for drawing lines, polylines, polygons, circles, rectangles, etc. It looks like a "dead end" since I want to develop a plugin for Adobe Reader that can draw custom Lines, Polylines, Polygons, ... (o
-
i have recently had a few problems with my headphones, every pair that i put into the ipod ends up with my left headphone not working. it is a 2nd gen ipod nano.can someone please help me
-
Hello - I'm about to purchase an Airport Express to connect to my home stereo receiver via audio-cable. Planning to be able to output the sound usually coming out of my iPad thru my big stereo system, from Apps such as YouTube, Pandora, TuneIn Radio,
-
How to contact a RIKLA Program representative?
Hi. I have contacted RIKLA support through e-mail several times to know more about that program and to get detailed pricing information. I would like to setup a meeting with a sales rep that could give me a proposal for engaging the RIKLA program, re
-
Backup requires 1099GB , but only 300GB available !
I have at least figured out part of this problem. First I get the message: "Are you sure you want to back up on the disk your original data is on." But I am choosing the first partition of Bay 2 HD which is a 1TB partitioned into 2 500GB's. I have a