Skip to Content
avatar image
Former Member

Expression error: Invalid date format of parameters in: datetoxmlformat

Hi All,

I am using SAP MII 12.

I have a strange problem. I am extracting Data from SAP (RFC) and trying to write to SQL Server.

Since SAP Returns Date and Time Seperately i am using the datetoxmlformat function. The usage of this i found in one of the sample SAP MII BLS transactions. Below is the usage

Function:

datetoxmlformat(Repeater_ForEveryActivityInGroup.Output{/item/CREATED_DT}& " " & Repeater_ForEveryActivityInGroup.Output{/item/CREATED_TM}, "yyyy-MM-dd HH:mm:ss")

When I evaluate this (in the Designer or when execute the BLS) i get the error :

[ERROR]: STEP EXCEPTION (Sequence_2) : Expression Evaluation error: Invalid date format of parameters in: datetoxmlformat.

But when i replace

Repeater_ForEveryActivityInGroup.Output{/item/CREATED_DT}& " " & Repeater_ForEveryActivityInGroup.Output{/item/CREATED_TM}

with a static date like "2008-09-09 06:01:01" in the expression editor as below

datetoxmlformat( "2008-09-09 06:01:01", "yyyy-MM-dd HH:mm:ss" )

MII returns : 2008-09-09T06:01:01 (which is the result expected).

Can you please help me find out what is the issue and why i keep getting the error ?:

Invalid date format of parameters in: datetoxmlformat

Help is greatly appriciated.

Regards

Suraj

Edited by: Suraj Prabhu on Jul 1, 2011 11:59 PM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    avatar image
    Former Member
    Jul 02, 2011 at 02:48 AM

    Hi,

    what is the output of

    (Repeater_ForEveryActivityInGroup.Output{/item/CREATED_DT} & " " & Repeater_ForEveryActivityInGroup.Output{/item/CREATED_TM}

    Regards,

    Musarrat

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 04, 2011 at 06:46 AM

    Hi Suraj,

    As Musarat suggested first check your expression

    (epeater_ForEveryActivityInGroup.Output{/item/CREATED_DT}& " " & Repeater_ForEveryActivityInGroup.Output{/item/CREATED_TM} )alue

    Following is example.

    suppose your expression is giving "2011-07-04 00:00:00" than use following code

    datetoxmlformat("2011-07-04 00:00:00", "yyyy-MM-dd HH:mm:ss")

    or your expression is giving "20110704 000000" than use following code

    datetoxmlformat("20110704 000000", "yyyyMMdd HHmmss")

    you have to pass date format based on your date string pattern.

    Hope this Helps!!

    Regards,

    Manoj Bilthare

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 05, 2011 at 08:57 PM

    Thanks Musarrat & Manoj.

    You guided me in the right direction. I was able to identify 2 issues and resolve the problem

    1. While I was testing the RFC from the UI using my User ID, the Batch / Communication User used by MII was not returning the same date format.

    2. I also found that the once the security issue was resolved, one of the filed was not a Date + time string but was a SAP Time stamp which MII was not able to decipher.

    I have not found the root cause and should be able to fix the problem.

    Thanks again.

    Suraj

    Add comment
    10|10000 characters needed characters exceeded