Skip to Content
avatar image
Former Member

Dates read from an RFC service are incorrect in Visual Composer

Hi,

We are having trouble with dates being returned by RFCs in Visual

Composer.

To test the problem I have created a simple RFC that returns todays

date using data type DATUM. When I run via SAPGui it returns 22.07.2009.

When I test this RFC service in Visual Composer, it returns the

date "Wed Jul 22 00:00:00 BST 2009". Interestingly this looks like a

timestamp.

When I use the RFC Service in a model and run it, it display the date

30/11/1921 which is obviously wrong.

We are having this problem across a number of RFC services.

Any ideas would be greatly appreciated.

Many Thanks

Gary

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Jul 23, 2009 at 05:02 AM

    Hi Gary,

    Use DSTR function to change the date format. Check the below link for details.

    http://help.sap.com/saphelp_nw70/helpdata/en/2b/6c37121f28462a8710c0c7493506dd/content.htm

    Regards

    Basheer

    Edited by: Basheer on Jul 23, 2009 10:33 AM

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 23, 2009 at 07:08 AM

    Hi

    Check the following wiki link i think this will help -

    https://wiki.sdn.sap.com/wiki/display/VC/DateandTime+Formats

    If you have ant doubts please let me know.

    Regards

    Sandeep

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 23, 2009 at 08:11 AM

    Hello,

    Check the below link for details and look at my answer:

    parse-a-value-from-text-to-date

    this may help you, good luck

    Martin

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Martin,

      Thanks for the response. I think I followed your solution. This is obviously a bug in VC.

      I changed the RFC to return a CHAR8 field that contained the date in the format YYYYMMDD (i.e. SAP internal date format). This is received into VC as a text field.

      I then used the expression DATE(LEFT(@E_DATE,4),MID(@E_DATE,4,2),RIGHT(@E_DATE,2)) to assign the date string to the form field in VC.

      I tried going via a Data Store value and using this as a default for my form field but this didn't work. I assume this is down to a timing issue (i.e. the form was displayed before the value got into the data store.

      Thanks for the help

      Gary