Skip to Content
3
Jun 26, 2020 at 03:43 PM

Convert JSON Date from external OData to YYYYMMDD in ABAP Program

2495 Views Last edit Jun 26, 2020 at 03:45 PM 2 rev

Hi SAP Experts,

I am calling an external OData Service in my SAP ECC System (Netweaver version 7.0) using CL_HTTP_CLIENT.

When I call the service, I get the Date in JSON format, which the Unix/Epoch Format : “\/Date(1567981296000)\/”

As per the Unix format this value means 01.01.1970 + 1567981296000 seconds.

I want to convert this date into a regular SAP date-time format (YYYYMMDD HH:MM:SS) in my ABAP Code.

However, I'm not able to find any readymade FM which can do this conversion and give me the real date.

Can someone please provide the solution for this?

Regards,

Bharat Bajaj