** How to use TO_DATE function in Stored Proc. for JDBC in ABAP-XSL mapping

Hi friends,
I use ABAP-XSL mapping to insert records in Oracle table. My Sender is File and receiver is JDBC. We use Oracle 10g database. All fields in table are VARCHAR2 except one field; this is having type 'DATE'.
I use Stored procedure to update the records in table. I have converted my string into date using the Oracle TO_DATE function. But, when I use this format, it throws an error in the Receiver CC. (But, the message is processed successfully in SXMB_MONI).
The input format I formed like below:
<X_EMP_START_DT hasQuot="No" isInput="1" type="DATE">
Value in Payload is like below.
<X_EMP_START_DT hasQuot="No" isInput="1" type="DATE">TO_DATE('18-11-1991','DD-MM-YYYY')</X_EMP_START_DT>
Error in CC comes as below:
Error processing request in sax parser: Error when executing statement for table/stored proc. 'SP_EMP_DETAILS' (structure 'STATEMENT'): java.lang.NumberFormatException: For input string: "TO_DATE('18"
Friends, I have tried, but unable to find the correct solution to insert.
Kindly help me to solve this issue.
Kind Regards,
Jegathees P.
(But, the same is working fine if we use direct method in ABAP-XSL ie. not thru Stored Procedure)

Hi Sinha,
Thanks for your reply.
I used the syntax
<xsl:call-template name="date:format-date">
   <xsl:with-param name="date-time" select="string" />
   <xsl:with-param name="pattern" select="string" />
</xsl:call-template>
in my Abap XSL.  But, its not working correctly. The problem is 'href' function to import "date.xsl" in my XSLT is not able to do that. The system throws an error. Moreover, it is not able to write the command 'extension-element-prefixes' in my <xsl:stylesheet namespace>
May be I am not able to understand how to use this.
Anyway, I solved this problem by handling date conversion inside Oracle Stored Procedure. Now, its working fine.
Thank you.

Similar Messages

  • How to use NTILE in a stored proc.?

    My module works in SQL*Plus but not in a stored proc. Have tried dynamic SQL to no avail.
    Has anyone been successful (in 8.1.7)? If so, how did you overcome the problem?

    Thanks, Rich.
    Here is my similar effort:
    create or replace procedure New_CSD_Hist(p_yr IN number,
                                            p_qtr IN number,
                                            p_market IN varchar2)
    is
         TYPE CSD_cur_type is REF CURSOR;
         CSD_cur           CSD_cur_type;
         more_data           BOOLEAN:=TRUE;
    begin
    OPEN CDS_cur FOR
    SELECT client,
              (ntile(3) over(order by sum(csd_spend) DESC)) as csd
    from      csd_hist
    where      csd = '0' and
              csd_spend > 0 and
              market = p_market and
              yr = p_yr and
              qtr = p_qtr
    group by client;
    HERE is another effort, trying to follow an example from Pipelines:
    lv_stmnt :=
    'declare '||
    'lv_yr varchar2(4) := :1; '||
    'lv_qtr varchar2(1) := :2; '||
    'lv_market varchar2(16) := :3; '||
    'begin '||
    'insert into clientspend select client,'||
    'ntile(3) over (order by sum(csd_spend) DESC) as csd '||
    'from csd_hist where csd = ''0'' and csd_spend > 0 and '||
    'market = :3 and yr = :1 and qtr = :2 '||
    'group by client; end;';
    execute immediate lv_stmnt using p_yr,p_qtr,p_market;
    commit;
    Again,
    Thanks for your comments and suggestions.,
    Dick Berry

  • How to use TO_DATE function in OBI having MSSQL DB

    Hello Experts,
    I am facing a problem plz help me.....
    I've just created an business application using Oracle BI Administration Tool of Oracle BI Server version 10.1.3.4.1,with oracle DB.
    But currently we migrate from Oracle to MSSQL Server. Due to which I am facing problem regarding Date Column (TO_DATE(), timestamp).
    As I have created a report with 2 fields
    Incident_Number, TimeStampAdd(SQL_TSI_SECOND,Incident_D.Reported_Date,timestamp '1970-01-01 00:00:00')
    Incident_D.Reported_Date contains integer values which stores total seconds from date 01/01/1970 00:00:00 . I want to convert these seconds from 1970 to datetime.
    when I ran the report with Oracle source it works fine, But with MSSQL as Source it gives me following error ...........
    Odbc driver returned an error (SQLExecDirectW).
    Error Details
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 16001] ODBC error state: 37000 code: 8180 message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement(s) could not be prepared.. [nQSError: 16001] ODBC error state: 37000 code: 195 message: [Microsoft][SQL Server Native Client 10.0][SQL Server]'TO_DATE' is not a recognized built-in function name.. [nQSError: 16002] Cannot obtain number of columns for the query result. (HY000)
    SQL Issued: SELECT Incidents."Incident Number" saw_0, TIMESTAMPADD(SQL_TSI_SECOND, Incidents."Reported Date", timestamp '1970-01-01 00:00:00') saw_1
    FROM "ITSM Information" ORDER BY saw_0, saw_1
    The Sql query log generated is as follow :
    select distinct T728.INCIDENT_NUMBER as c1,
    ( CAST(TO_DATE('1970-01-01 00:00:00' , 'YYYY-MM-DD HH24:MI:SS') as DATE) + ( T728.REPORTED_DATE / 86400 ) ) as c2
    from
    INCIDENT_D T728
    order by c1, c2
    +++Administrator:ce0000:ce0002:----2010-11-30 14:51:38
    -------------------- Query Status: Query Failed: [nQSError: 16001] ODBC error state: 37000 code: 8180 message: [Microsoft][SQL Server Native Client 10.0][SQL Server]Statement(s) could not be prepared..
    [nQSError: 16001] ODBC error state: 37000 code: 195 message: [Microsoft][SQL Server Native Client 10.0][SQL Server]'TO_DATE' is not a recognized built-in function name..
    [nQSError: 16002] Cannot obtain number of columns for the query result.
    Please Help me........
    Thanks and Regards,
    MJ

    I will give a try at it,TO_DATE is not recognised function by the SQLserver
    ( CAST(TO_DATE('1970-01-01 00:00:00' , 'YYYY-MM-DD HH24:MI:SS') as DATE)Instead of it use to_Char and try it like this so on cast(year(your_date) as char) || '-'||cast(month(your_date) as char) OR use this nice blog by saichand http://varanasisaichand.blogspot.com/2010/05/evaluate-function.html
    it says like EVALUATE('TO_CHAR(%1,%2)' ,"Dim- Date".Start Date,'YYYY-MM-DD HH24:MI:SS')
    Hope it helps you.Mark points.
    By,
    KK

  • How to use SQL Functions (eg : GETDATE()) in Receiver JDBC XML message

    Hi,
    I am using receiver JDBC adapter.
    When record is updated in table, "Timestamp" field should be updated with Database timestamp.

    Hi Dipak,
    Check out below helpful links,
    MySQL :: MySQL 5.6 Reference Manual :: 11.3.5 Automatic Initialization and Updating for TIMESTAMP and DATETIME
    MySQL :: MySQL 5.0 Reference Manual :: 11.3.5 Automatic Initialization and Updating for TIMESTAMP
    Regards,
    Krupa

  • How to use a function key on keyboard for executing a non SAP program

    Hello Gurus.
    My client want to run a non SAP program selecting the specific function key on keyboard during the entering data on SAP.
    i knew that it is possible to execute a non sap program after adding special program each by SAP program.  but, it is huge jobs.
    client wants to run a non sap program wherever he is on SAP program.  Is it possible ?

    Hi,
    1. Create a ".exe" file for the .NET application.
    2. Create a PF-STATUS and assign the Function Code for the desired Function Key in the SAP program.
    3. In the USER COMMAND code inside program, when the respective function code is triggered, write the below code with the path to the .NET exe file.
    CALL METHOD cl_gui_frontend_services=>execute
      EXPORTING
        document = '.NET exe file path'
      EXCEPTIONS
        OTHERS   = 1.

  • Using to_date functions in Com Channel for Oracle DB

    I have been trying to mask data while pulling from an Oracle DB.   I run the following SQL in sqlplus and it works correctly
    <b>select to_char(cse_wid, '9999.99') from iprdl</b>
    then when I use XI,  
    I get a successful message in the adapter engine so I go in to look at the payload and receive this message.
    <b> A name contained an invalid character. Error processing resource 'file:///C:/Documents and Settings/CSEIDIT/Local Settings/...
      <TO_CHAR(CSE_WID,9999.99)>   10.70</TO_CHAR(CSE_WID,9999.99)>
    ^2 to_char(cse_wgt,'9999.99' ),
    </b>  then I also get a mapping error in the integration Engine.   I have searched this forums and have found nothing that seems to fit this problem.
    Thank you
    Carl Seidita
    Message was edited by:
            Carl Seidita
    Message was edited by:
            Carl Seidita
    Message was edited by:
            Carl Seidita

    Not passing an XML to Oracle.    Using a JDBC com. channel parmeter  SQL Query option to pull records.  have other fields the SQL but it does not like the TO_CHAR option .  this is the full select
    <b>SELECT PROD_ID, CREATE_DTIM, TO_CHAR ( CSE_WID, '9999.99' ),     TO_CHAR (CSE_WGT ,'9999.99' ),  CSE_UNIT,  TO_CHAR (CSE_LEN, '9999.99' ), TO_CHAR (CSE_HGT, '9999.99' ), cse_cub, inner_pack_wid, inner_pack_wgt, inner_pack_unit, inner_pack_len,  inner_pack_hgt, inner_pack_cub FROM iprdl
    WHERE (iprdl.extr_flag <> 'Y' OR      extr_flag IS NULL)</b>
    The adapter Engine give me a successful Message but when I go to view the payload, I get that error and it does not map to the inegration engine

  • How to use custom password encryptor/decryptor class for jdbc connection

    I am in process of migrating application from Jrun server to weblogic . In jrun we use to provide our custom class which used to decrypt the password provided in resource file as below
    <username>webclt</username>
    <password>AAAAAAASSSSSSSCCCCCCCCCCCCCC</password>
    <encrypted>true</encrypted>
    <encryption-class>com.CustomEncryptor</encryption-class>
    How could i use the same class while configuring datasource in weblogic 10 server.

    1- By default, the jre will read the user's cacerts which runs the program.
    2- You can specify another cacerts this way :
    System.setProperty("javax.net.ssl.trustStore", my_trust);
    For the case 1 and 2, you need to put the certificate in the cacerts.. Or,
    3- You implement a custom TrustManager which, for example, accepts all certificates :
    class X509TrustManagerTrustAll implements X509TrustManager {
    public boolean checkClientTrusted(java.security.cert.X509Certificate[] chain){
    return true;
    public boolean isServerTrusted(java.security.cert.X509Certificate[] chain){
    return true;
    public boolean isClientTrusted(java.security.cert.X509Certificate[] chain){
    return true;
    public java.security.cert.X509Certificate[] getAcceptedIssuers() {
    return null;
    public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) {}
    public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) {}
    and you call it in the right place in the code you wrote (SSLContext,..)
    Hope it helps and deserves a duke star ;)

  • How to use complex function as condition in Oracle Rule Decision Table?

    How to use complex function as condition in Oracle Rule Decision Table?
    We want to compare an incoming date range with the date defined in the rules. This date comparison is based on the input date in the fact & the date as defined for each rule. Can this be done in a decision table?

    I see a couple of problems here.
    First, what you posted below is not a syntactically valid query. It seems to be part of a larger query, specifically, this looks to be only the GROUP BY clause of a query.
    Prabu ammaiappan wrote:
    Hi,
    I Have a group function in the Query. Below is the Query i have used it,
    GROUP BY S.FREIGHTCLASS,
    R.CONTAINERKEY,
    S.SKU,
    S.DESCR ||S.DESCRIPTION2,
    S.PVTYPE,
    RD.LOTTABLE06,
    R.WAREHOUSEREFERENCE,
    RD.TOLOC,
    R.ADDWHO,
    R.TYPE,
    S.CWFLAG,
    S.STDNETWGT,
    S.ORDERUOM,
    R.ADDDATE,
    C.DESCRIPTION,
    (CASE WHEN P.POKEY LIKE '%PUR%' THEN 'NULL' ELSE to_char(P.PODATE,'dd/mm/yyyy') END),
    NVL((CASE WHEN R.ADDWHO='BOOMI' THEN RDD.SUPPLIERNAME END),SS.COMPANY),
    RDD.BRAND,
    S.NAPA,
    RD.RECEIPTKEY,
    R.SUSR4,
    P.POKEY,
    RDD.SUSR1,
    r.STATUS, DECODE(RDD.SUSR2,' ',0,'',0,RDD.SUSR2),
    rd.SUSR3Second, the answer to your primary question, "How do I add a predicate with with a MAX() function to my where clause?" is that you don't. As you discovered, if you attempt to do so, you'll find it doesn't work. If you stop and think about how SQL is processed, it should make sense to you why the SQL is not valid.
    If you want to apply a filter condition such as:
    trunc(max(RD.DATERECEIVED)) BETWEEN TO_DATE('01/08/2011','DD/MM/YYYY') AND TO_DATE('01/08/2011','DD/MM/YYYY')you should do it in a HAVING clause, not a where clause:
    select ....
      from ....
    where ....
    group by ....
    having max(some_date) between this_date and that_date;Hope that helps,
    -Mark

  • How to use read_text function module

    Hi how to use read_text function module to read purchase order header text .what are all tht things to pass in ID,Name and Object
    thanks,
    Mahe

    Dear,
    Use below code.
    DATA:IT_LINE LIKE TLINE OCCURS 0 WITH HEADER LINE,
    V_TDNAME LIKE THEAD-TDNAME.
    V_TDNAME = PO_NUMBER.
    CALL FUNCTION 'READ_TEXT'
      EXPORTING
    *   CLIENT                        = SY-MANDT
        ID                            = 'F01'
        LANGUAGE                      = 'EN'
        NAME                          = V_TDNAME
        OBJECT                        = 'EKKO'
      TABLES
        LINES                         = IT_LINE.
    Thanks and Regards,

  • How to use standard function keys as custom keys

    how to use standard function keys as custom keys.
    i have encountered that problem while developing a screen, there i'm supposed to use standard function key F2 ( which actually meant for choose) for clearing the screen fields where the cursor is present and f1 for saving data that entered in screen fields, etc...
    kindly help me out.

    Hi ,
    Solution to use SAP reserve function keys F1 .. F4 (mostly this requirement comes up for RF screens) can be acheived by assigning your new Function code using the Menu path Utilities --> F key Consistency in the Menu Painter (SE41) . Once you assign your cutom function code to the standard Fn keys the only remaining step is to make sure that you set a curson on any of the field on sceen by using the Key Word "SET CURSOR" .
    If you dont use the key word SET CURSOR in the PBO of the screen then you might not see any response for F4.
    Thanks

  • How to use  date function in my procedure

    hi Gurus,
    i have a requirement
    where user passes the end_date parametre from front end which get convered to
    End Date => 2012/05/31 00:00:00
    now i based on this end date value i have to calculate the start date which is only month less than the end date, i know i can use add_months function for this requirement but
    my problem is
    l_start_date :=add_months(fnd_date.canonical_to_date(p_end_date),-1);
    (OR)
    l_start_date := add_months(to_date(end_date,'DD-MON-YYYY'),-1);
    all these are returning date format as DD-MON-YYYY eg;
    if user passes from front end 31-may-2012 , in the backend to my procedure it is passing as 2012/05/31 00:00:00
    and my procedure calculating start date and returning as '01-MAY-12',
    but my requiremnt is
    it should return
    Start Date => 2012/05/01 00:00:00
    any pointers on this is highly appreciable,
    thanks in advancee

    HuaMin Chen wrote:
    BluShadow wrote:
    HuaMin Chen wrote:
    Try
    select trunc(to_date('22-AUG-03'), 'MONTH') from dual;?? That is so wrong.
    Is that date 22nd August 2003? 22nd August 1903? 3rd August 2022? 3rd August 1922?
    You have no date format specified in your to_date function.That is fine for 10g or above versions. Thank you.It way work, if you're lucky, but it depends on your sessions NLS settings...
    SQL>  select trunc(to_date('22-AUG-03'), 'MONTH') from dual;
    TRUNC(TO_DATE('22-AU
    01-AUG-0003 00:00:00
    SQL> alter session set nls_date_format = 'YYYY-MM-DD';
    Session altered.
    SQL>  select trunc(to_date('22-AUG-03'), 'MONTH') from dual;
    TRUNC(TO_D
    0022-08-01
    SQL> alter session set nls_date_format = 'HH:MI:SS YYYY-MM-DD';
    Session altered.
    SQL>  select trunc(to_date('22-AUG-03'), 'MONTH') from dual;
    select trunc(to_date('22-AUG-03'), 'MONTH') from dual
    ERROR at line 1:
    ORA-01849: hour must be between 1 and 12
    SQL>So it's certainly not "fine". It's bad practice.
    This must be fine
    select trunc(to_date('22-AUG-03','dd-MON-RR'), 'MONTH') from dual;That's better.

  • How to use SQL functions in the queries

    hey guys i wanna know how to use SQL functions in the queries is it possible or not .

    Hi,
    Wat exactly that set values are?
    those from sql query?
    How to use count():
    The COUNT() function returns the number of rows that matches a specified criteria.
    SQL COUNT(column_name) Syntax
    The COUNT(column_name) function returns the number of values (NULL values will not be counted) of the specified column:
    SELECT COUNT(column_name) FROM table_name
    SQL COUNT(*) Syntax
    The COUNT(*) function returns the number of records in a table:
    SELECT COUNT(*) FROM table_name
    SQL COUNT(DISTINCT column_name) Syntax
    The COUNT(DISTINCT column_name) function returns the number of distinct values of the specified column:
    SELECT COUNT(DISTINCT column_name) FROM table_name
    The IN function helps reduce the need to use multiple OR conditions.
    The syntax for the IN function is:
    SELECT columns
    FROM tables
    WHERE column1 in (value1, value2, .... value_n);

  • How to use this function in crm5.2 -   /CEM/ENT_IMPORT_DATAFROMEXCEL

    i am having a problem regarding how to use this function to import values from an excel sheet.
    in call funtion what to specify at place of ct_ent_action = ?
    CALL FUNCTION '/CEM/ENT_IMPORT_DATAFROMEXCEL'
      CHANGING
        CT_ENT_ACTION       =
    EXCEPTIONS
      FILE_ERROR          = 1
      IMPORT_ERROR        = 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.

    Hi
    The use of Standard Parner functions are as follows:
    1. Ordering Address (OA): The PO will be sent this vendor and not the main vendor.
    2. Goods Supplier (WL): In case of return deliveries, Goods will be returned to thsi vendor's address
    3. Invoicing party (RS): The payment will be made to this vendor.
    Hope this clarifies.
    Thansk

  • How to use these function modules

    Hi all,
    can anyone help that how to use these Function modules to update the status of a task, what are all the inputs i required to proceed
    1. FC_USER_AUTHORITY_CHECK
    <b>2. FC_USER_STATUS_CHECK
    3. FC_USER_STATUS_UPDATE</b>
    4. FC_USER_GET_CACTI
    5. FC_USER_CHECK_FOR_OUTPUT
    Thanks in Advance
    Ganesh

    Hi Rob,
    thanks for ur reply,
    but they are not clear what they are meant to be, I understood there are some flags needed to run the Function Modules 2 & 3 which are in bold...
    but how do i populate them.. i am not getting that..
    thanks
    ganesh

  • How to use BAPI_MATERIAL_AVAILABILITY Function Module at batch level?

    How to use BAPI_MATERIAL_AVAILABILITY FM to check material available at batch level?
    And another question is what's the meaning of 'CHECK_RULE' in this FM. Thanks!

    Field name : PRREG
    fcheck more details on  f1 help...
    check_group defines the checking procedure to be used for  availability check in individual applications.
    along with the checkg group, checking rule  specifies the final procedure for chkg..
    eg:
    ST  for  stock transport order
    AQ for SD order project srock
    also chk this help doc.
    http://help.sap.com/saphelp_470/helpdata/en/cf/70124adf2d11d1b55e0000e82de178/content.htm
    search the forum for sample code..
    How to use BAPI_MATERIAL_AVAILABILITY Function Module....

Maybe you are looking for

  • Text field is not working at first time after loading the flash files

    Hi to all,      In my Java application, I'm using a text field and a panel to load flash files. I'm using JDIC 0.9.1 to load the flash files in the panel. The flash files are created by Flash CS4.      While running the application, I can't enter any

  • Importing image or graphic onto working layer?

    I am using Photoshop cs4 When I work in Flash I can import a image or graphic to the library or directly onto the stage...My question is...Can I do this in photoshop? Thank you

  • PDF from Word Perfect

    Why can't I make a PDF from WP file? I could before today!

  • IView in Content Area

    Hi all, I have customized the collaboration UWl iView. I have created one page and assigned to the role. That page contains the UWL iView. In detailed navigation wenever i click that page the page opens in the same window without detailed navigation(

  • G5 strange sudden "sleep" mode

    Just noticed some strange new behavior on this PowerMac G5: left unattended for a while, I came back to the machine running on high fan mode with black screen. Neither mouse nor keyboard activity could to get the G5 out of this strange sleep mode, so