Mapping issue in Date Format

Hi Experts,
I have a mapping problem in my object.
I have two filelds coming from the Control record of an IDoc CREDAT and CRETIM. Now, I need to concate them and put them in a target field DateandTimeCreated in the format: YYYYMMDDHHMMSS
Is their an UDF or message mapping for this. Messge mapping will be better for me.DateTrans will work over here??
Please reply.
Thanks and regards,
Aniruddha

Sample UDF code:
Execution Type:  Single Values
Date UDF
a)if your input date field declared as string then,
public String dateValue(String value,  Container container) throws StreamTransformationException{
String input =value;
String strDate ="";
if (input !=null)
Date date1 = new java.util.Date(Long.parseLong(input));
SimpleDateFormat  formatter = new SimpleDateFormat("yyyyMMdd");
strDate = formatter.format(date1);
return strDate;
Time UDF
a) if your input time field declared as string then,
public String timeValue(String value,  Container container) throws StreamTransformationException{
String input = value;
String strTime="";
if (input !=null)
Date date = new java.util.Date(Long.parseLong(input));
SimpleDateFormat  formatter = new SimpleDateFormat("HHmmss");
strDate = formatter.format(date);
return strTime;
Note: include import statement
import java.text.*
If you have question, let us know. This code will work for sure.

Similar Messages

  • Issue with Date Format

    Hi All,
    I m facing an issue with Date format in the prompt. I have used date presentation variables in my column formula as shown below:
    FILTER("SKU Order Details"."Fulfilled Quantity" USING Time."Calendar Date" <= DATE '@{todate}{2900-01-01}')
    The report returns data when I don't select any date range for start & end date prompts on the page. But when I select the start & end date values in the prompt, I m getting the following error:
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 46047] Datetime value 10/22/2009 12:00:00 AM from 10/22/2009 12:00:00 AM does not match the specified format. (HY000)
    I included the following formulas for start & end date prompts:
    Start Date prompt: case when 1=2 then License."Ips Creation Date" else cast ('1.1.1900' as date) end
    End Date prompt: case when 1=2 then License."Ips Creation Date" else cast ('1.1.2900' as date) end
    Can you please help me resolve the issue.
    Thanks,
    Kartik

    Hi Nico,
    I tried putting the format that you mentioned, I m getting an error message.
    My prompts have the following formula :
    Start: case when 1=2 then License."Creation Date" else cast('1.1.1900' as DATE) end
    End: case when 1=2 then Time."Calendar Date" else cast('1.1.2900' as DATE) end
    My column formula has the following syntax:
    FILTER("SKU Order Details"."Fulfilled Quantity" USING Time."Calendar Date" between DATE '@{start}{1900-01-01}' AND DATE '@{end}{2999-01-01}')
    Error Message:
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 46047] Datetime value 11/17/2009 from 11/17/2009 does not match the specified format. (HY000)
    Can you please let me know if something needs to be changed.
    Thanks,
    Kartik

  • Message Mapping Issue with data without namespace

    Hi,
    I have a common xsd imported which has its own target namespace into my SWC namespace. Based on this xsd I have generated a Message Interface and webservice and given the wsdl to third party system for invoking my webservice.
    The problem is I have done the message mapping based on xsd which has namespace but whereas the third party system which is consuming my webservice is sending the xml data without any namespace and because of which my mapping is failing (target structure is not getting generated as expected). I have tested the mapping with namespace and without namespace from IR already. I have explained this below with example.
    I cannot change the xsd as it is a common and even cannot ask the end system to change the data format they are sending as they are sending the same data to some other systems also, which are not complaining.
    How to resolve this issue in XI?
    Actual xml data generated from my imported xsd (with namespace)
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:Root xmlns:ns0="http://employee/types">
       <ns0:EmployeeDetails>
          <ns0:EmployeeId>12</ns0:EmployeeId>
            <ns0:EmployeeName>XYZ</ns0:EmployeeName>
    </ns0:EmployeeDetails>
    </ns0:Root>
    Actual Data coming from third party system (without namespace)
    <?xml version="1.0" encoding="UTF-8"?>
    <Root>
       <EmployeeDetails>
          <EmployeeId>12</EmployeeId>
            <EmployeeName>XYZ</EmployeeName>
    </EmployeeDetails>
    </Root>
    Thanks
    Amit

    Just  wild guess:)
    I am not 100% sure but i guess XSLT mapping does not checks the incoming payload against the sender message type.Within XSLT mapping you can add/remove namespace as you would like,use this XSLT mapping before your actual message mapping in interface mapping.
    I am saying this coz recently i was able to generate XSLT mapping(in altova Map Transform) without even specifying any sender or receiver Message type and it worked just fine.
    Thanx
    Aamir

  • Issue with Date format - ABAP to XML

    Dear Users,
    We are currently facing an issue with the date formats in XML.
    We have a system (.Net), which has a webservice that we are calling for information from SAP. We created a Proxy class in SAP from the WSDL file and have attempted to use the method that gets us required information based on the Timestamp passed from SAP. However, the timestamp that the INPUT structure uses has a data element XSDDATETIME_Z.
    All we can send from SAP is a simple TIMESTAMP, but the .Net system doesn't accept it since it wants the timestamp in XML format i.e. <dd-mm-yyyy>T<hh:mm:ss>Z. SAP documentation says that the field should automatically do conversion from ABAP to XML format, but that doesn't happen. We don't want to build a string from Timestamp in the XML format and send it out since we might surely miss out on the different cases involved.
    Can anyone please suggest a way for us to send the date out in the required XML format?
    Many thanks!

    Hi Vijay,
    Look at the below sample code and it works fine, i guess there is something wrong in your code or conversion, post the actual code if you are still not able figure it out with the below example.
    DATA: l_xml_string TYPE string,
          l_dat_time TYPE xsddatetime_z.
    CALL FUNCTION 'CACS_DATE_GET_TIMESTAMP'
    EXPORTING
       I_DATE                         = sy-datum
       I_TIME                         = sy-uzeit
    IMPORTING
       E_TIMESTAMP                    = l_dat_time
    EXCEPTIONS
       DATE_NOT_FILLED_BUT_TIME       = 1
       DATE_HAS_NO_VALID_FORMAT       = 2
       OTHERS                         = 3.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL TRANSFORMATION id
      SOURCE root = l_dat_time
      RESULT XML l_xml_string.
    IF sy-subrc EQ 0.
    write: l_xml_string.
    ENDIF.
    Regards,
    Chen

  • Issue in Date Format in Production

    Hi ,
    I have written for Invoice Prining SAP SCript for F.62.
    In developemt and Quality system Date format is coming" MM/DD/YYYY" But in Production system it is showing "YYYY/DD/MM'.
    I have checked the Program aslo, which is also same in every server and checked the User Profile also, which is showing 'MM'DD'YYYY'.
    I am trying to get the solution, what may be the reason for the same.
    Rgds
    Mohit

    HI Mohit,
    if possible provide your sap script printing code. so that we will analyse the issue.
    For time beeing try  to use below code during Invoice Prining
    DATA: year(4),
          mnth(2),
          day(2),
          l_v_date  TYPE sy-datum.
    CLEAR: date,
           year,mnth,day.
    CLEAR: year,
           mnth,
           day,
           l_v_date.
        year = g_wa_head1-lfdat+0(4).
        mnth = g_wa_head1-lfdat+4(2).
        day  = g_wa_head1-lfdat+6(2).
    CONCATENATE mnth '/' day '/' year INTO date.
    regards
    sudheer

  • Issue with Date Format for Presentation Variables

    Hi,
    I am using dashboard prompts to capture begin date and end date in presentation variables. The dates selected from calendar are in the format mm/dd/yyyy.
    In Asnwers I need to get a count of days between begin and end dates. I am using the column formula as shown:
    TIMESTAMPDIFF(SQL_TSI_DAY, DATE '@{pBeginDate}', DATE '@{pEndDate}')
    When ever I run the report from dashboard I get the following error:
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 46046] Datetime value 1/1/2005 does not match the specified format. (HY000)
    SQL Issued: {call NQSGetQueryColumnInfo('SELECT "Transaction Dates"."Transaction Date", TIMESTAMPDIFF(SQL_TSI_DAY, DATE ''1/1/2005'', DATE ''1/2/2006'' FROM "Dates"')}
    SQL Issued: SELECT "Transaction Dates"."Transaction Date", TIMESTAMPDIFF(SQL_TSI_DAY, DATE '1/1/2005', DATE '1/2/2006') FROM "Dates"
    Can anyone help me to reolve this date format issue?
    Thanks,
    Aravind

    Hi,
    see this below links
    Issues with Prompts calender date
    Regards
    Naresh

  • Obiee 11g upgrade issue for date format

    Hi,
    I am facing a date format issue with obiee 11g report. This statement cast(cast(current_date as char) as timestamp) is failing with "not a valid month" error in obiee 11g. This worked fine with obiee 10g.
    I am basically trying to set the date to 12:00:00 am of the sysdate. Below is what I am trying to achieve:
    timestampadd(sql_tsi_hour, 1, cast(cast(current_date as char) as timestamp)))
    the above statement fails in obiee 11g.
    Thanks for your help,
    AP

    I dont think you need any functions to get the required output, try to set the date format as below
    [FMT:timeStampShort]
    If helps mark
    Thanks
    Edited by: Srini VEERAVALLI on Apr 23, 2013 4:18 PM
    I think with format and then the below should work with no issues.
    timestampadd(sql_tsi_hour, 1,current_date)
    I think you are wasting time by posting here, just do it. You no need any ones permissions to do it ;)
    Edited by: Srini VEERAVALLI on Apr 24, 2013 8:55 AM

  • Mapping issue in Data Services

    Hello, Experts!
    I'm just starting to learn DS. Can anybody help me with the following question:
    I have a table, for example:
    id  Curr value
    1  USD  100
    2  JPY  200
    3  USD  300
    4  JPY  400
    5  EUR  500
    And the issue is to map it so as to check the condition of belonging "Curr" to the sets (JPY, USD) and (EUR, USD), and the following table would be obtained:
    id Code Curr Value
    1  AAA  USD  100
    2  AAA  JPY  200
    3  AAA  USD  300
    4  AAA  JPY  400
    4  BBB   USD  100
    5  BBB   USD  300
    6  BBB   EUR  500
    The main difficulty lies in putting the checking parameters into an additional table, so user can vary the members and quantity of combinations
    The mapping should exist in Query transform
    BR, Alexey
    Edited by: Alexey Veselov on Dec 12, 2011 2:20 PM

    Hi Alexey,
    Could you elaborate on the requirement? It is still not clear to me what you want to achieve.
    What I do understand is that the users should be able to make adjustments to the mapping/lookup entries.
    If that is the case, what exactly is going to be maintained in the 'additional table' and how are you suggesting end users are going to maintain this?
    Ideally, your query transformation should not change when parameter values change, so you have to think about what logic you put where.
    My suggestion would be to use a file or a table which can be maintained by users. In your query transformation you can then use the lookup or lookup_ext function.
    Especially with lookup_ext you can make it as complicated as you want. The function is well documented but if you need help then just reply and explain in a bit more detail what you're trying to do.
    If you do think the 'hard-coded' option would suit you better, you can look into the 'decoce' function. Again, it is well documented in the technical manual.
    Jan.

  • Issue with Date Format in line Graph X-AXIS

    Hi all,
    I have a line graph, with data in x-axis and integer values in y-axis.
    I am fetching data in Mon-dd-yyyy format but in graph (x-axis) it showing in yyyy-mm-dd format.
    How to change this format.
    Regards,
    Krishna Prasad

    Hi,
    Basically you are trying to convert a date into date which is not advisable. Hence convert it to char and then equate it against a character value. Also do not use trunc as it will trim out the time part of the date.
    select * from test
               where to_char(dob,'RRRR/MM/DD HH24:MI:SS')=:p1Then pass the parameter
    cheers
    VT
    Edited by: VT on Oct 26, 2010 4:16 PM

  • Issue in Date format in process

    Hi,
    I am using format-dateTime-withFormat() function in process to convert the format to mm-dd-yyyy. While formatting the date its subtracting date and month by 1.
    Example: current-date() gave the output as "2012-01-17". When I am formatting this using
    format-dateTime-withFormat
    Please let me know is there some bug in this function or am I missing out something in the parameter.
    Thanks and Regards,
    Ambika(current-date(),'mm-dd-yyyy'). I am getting output as "00-16-2012".

    I got the solution to this problem.
    mm - stands for minutes
    MM - stands for month.
    When I changes the pattern to "MM-dd-yyyy". I got the correct month.

  • Issue with date formating

    Hi All,
    I  want to print the date in YYYYMMDD  format  in my coversheet template. Presently i am using DD.MM.YYY in the coversheet template .How to mask  this? ( No generation variant changes are applicable here)
    Please let me know your inputs in detail if possible.
    Thanks&regards
    George

    hi
    what i believe is the problem with your date profile
    to make the time as user time zone ,you need to make following settings
    Customer Relationship Management--->Basic Functions--->Date Management---->Define Date Profile
    Here for a Date Profile, u need to create the reference object adn then assign this object to your date type
    the date profile works in following way ,first we have to create our date type and assign the date rule to it and then assign this date type to the date profile
    so in similar way u need to first do changes in the refernce object ,which will be user user time zone in time
    and then assign it to the date profile
    Also after this just check inside the T code ZTAC
    hope it will end ur probs
    best regards
    ashish

  • Issue in date format while running from page

    Hi
    I have the following SQL which is well executing in DataBase...
    SELECT to_char(to_date('05-JUN-2010','DD-MON-YYYY'),'DD-MM-YYYY') param_Val FROM dual
    But when i am using the same query in the JSP page...
    it is giving the invalid month exception:1863
    Please Help me in this issue
    Thanks

    I got the solution to this problem.
    mm - stands for minutes
    MM - stands for month.
    When I changes the pattern to "MM-dd-yyyy". I got the correct month.

  • Date Format for the input Variable

    Hi all,
    I got an issue with Date format we enter in the input variable screen for the BEx Analyzer.
    We have given a format of MM/DD/YYYY. But when the users accessed the report, it is not taking the format of the variable i.e MM/DD/YYYY but it is taking the format of the users system.
    If the user's system format is DD/MM/YYYY, it is accepting the input inthe same format only.
    Why this strange behaviour?
    My questions are
    Is the input for BEx system specific? or variable specific?
    Rgrds
    Kumar

    Hi,
    I think it is user specific... you can maintain the date format for user ....
    Go to SU01 transaction or.. Go to SYSTEM -> User Profile -> Own data
    Here in defaults tab you can see the date formet for user...
    Hope this helps...
    Thanks,
    Vikrant Mahajan

  • "Date formatting not supported yet"??

    When I add imports to get around the problem described in my previous
    email, I run into an exception that says "Date formatting not supported
    yet". The exception is thrown in util/HtmlUtil.java. What's the
    intention here? Why don't we just return the value unformatted? How
    should I handle this so I can take advantage of the formatting if it is
    supported someday? Are there any other formatting types which I need
    to "handle" in order to run?

    Dan--
    When I add imports to get around the problem described in my previous
    email, I run into an exception that says "Date formatting not supported
    yet". The exception is thrown in util/HtmlUtil.java. What's the
    intention here? Why don't we just return the value unformatted? How
    should I handle this so I can take advantage of the formatting if it is
    supported someday? Are there any other formatting types which I need
    to "handle" in order to run?The exception lets you know that there is a specific issue you need to work
    around during migration. The reason we don't just return the unformatted
    value is that we didn't want to give the impression that date formatting
    worked when it doesn't (yet).
    If you just want the value to come through without an attempt at formatting,
    the correct thing to do is to change your JSP tags to eliminate the date
    formatting attributes. If this is a loss of data (the format masks), then
    you should just comment them out rather than delete them.
    The whole issue of date formatting is unfortunately complex. Suffice to say
    that it is far easier for the developer to format the date as they wish in
    their code then it is for us to try and provide generic date formatting.
    The issue revolves around having all the necessary information in order to
    do the formatting in a generic way.
    Todd

  • Date format in prompts

    Hi all,
    I'm having an issue with dates formats in infoview, I have users in different regions and they are seeing  different date formats and sometimes the reports show errors because of the date format. I don't want to tell the users to change their regional settings, is there an option to display the same date format in infoview using date types?
    Thank you,
    Marcela

    Hi Amr,
    Yes, I fixed issue, the problem was because I was using opendocument and I was sending the parameters like this:
    ="<a href=\"../../scripts/openDocument.aspx?sType=wid&sDocName=ReportName&sWindow=NEW&lsMPartnerId=" + [Partner Id] +"&lsSFrom=" [Reportdate]"&lsSTo="+RelativeDate([Reportdate];1) "\">" [Partner Name]"->"[Reportdate]+"</a>"
    The RelativeDate funtion was changing the format; the format for lsSFrom was different of the lsSTo format, I applied the same function for lsSFrom and lsSTo, and now it's working fine. I had this issue is some regions, not in all. Now they see different format but the reports are working fine.
    Best regards,
    Marcela

Maybe you are looking for

  • How can I print more than one page of an internet site?

    When I try to print pages from internet sites (Facebook, Merchant Circle, Linked In, NBC.com, etc.), Firefox will only print the first page. In order to print more information, it is necessary to reduce the scale of the print so more of the informati

  • Running ISQL Plus over a home network

    I have a small wireless home network (3 machines), and installed Oracle 10g on one machine. ISQL works fine on this machine. However, I would like to be able to run queries from the other machines using ISQL PLUS. Have tried, //<<machinename>>:5560/i

  • How can I make Mobile column ?

    we here in Egypt have specific format for mobiles number ..... it's like that :- 0129231239 0109283746 0168483873 ect,. so .... I want create table with mobile column whither this column be ten numbers only no more no less , and first two numbers be

  • Does anyone know how to hide the export option for excel 2007

    Does anyone know how to hide the export option for excel 2007? We are having an issue with negative numbers downloading as text field in excel 2007, works fine in excel 2003. We are on version 11.1.1.7.0 of OBIEE. Thanks for any response.

  • DTP got inactivated

    Hi Experts , In BW system one DTP failed with below message "No object directory entry for object R3TR DTPA DTP_4DV1PPE2E9AK4OC1NW16WQ66T Assign a package System setting does not allow changes to be made to object DTPA DTP_4DV1PPE2E9AK4OC1NW16WQ66T"