CRM and CX Blogs by Members
Find insights on SAP customer relationship management and customer experience products in blog posts from community members. Post your own perspective today!
cancel
Showing results for 
Search instead for 
Did you mean: 
Ananthu_R_Biju
Explorer
Hello Developers!!!

I hope you’re doing well.

The blog is about the Date and time format in the response while querying a C4C OData service with a technical user through Postman. Later, we will also discuss how to assign a fixed time zone for a Technical User as well.

Issue:

We created a KUT field in the UI and wrote code to capture the date & time on save based on conditions. Then these fields were extended to the OData services as well.

When we began to test the OData service via Postman I noticed that the newly added Data Time fields in the response body are being populated like below.
{
"d": {
"results": [
{
"__metadata": {
"uri": "Removed due to security reasons",
"type": "sapbyd.RPZVVVVVVVVVVVAD3DQueryResult"
},
"CVDOC_CREATEDATE_LOCAL": "/Date(1690070400000)/",
"CVDOC_ID": "1XX55",
"CVYLD0005Y_D2E80000A9": "5XX4",

"CVs1A000000000031DB8A": "08/01/2023 11:49:45 INDIA"",
"CVs100000000000047919": "08/01/2023 09:49:45 INDIA",

"TDSC_ZSALPHASE_01": "In-Progress",
"TUSER_ZSTATUS_CODE_01": "Converted"
}
]
}
}

(I have separated the two new fields in the middle of the above response.)

Here in the response, we are receiving the time zone as INDIA for both fields. When I checked the Technical user time format, it was empty.

In our case, we are using a third-party middleware so they require all the possible time zones to be configured to transform the data, else the data being displayed will be irrelevant in the destination system.

Resolution:

Hence the time zone configuration will be a lengthy process in the middleware we have set a Time Zone for that specific Technical user so whenever you query, in the response you will have the fixed time zone.

You may follow the below steps to navigate to Technical User settings & view the current time zone for the user.

1) Go to Administrator > General Settings & from there open  Support and Technical Users.


Support and Technical Users


2) Click & Open the Technical user, to view the current time zone settings before change.


Choose User


 

3) Scroll down and navigate to the Regional Settings, where you can see the current Time zone.



Current Time Zone


 

Kindly follow the below steps to assign a constant Time Zone for the Technical User.

1) Login to C4C using Technical User.


Navigate to Settings


2) Go to My Settings > Regional Settings & Choose the preferred time zone.


Time Zone Changed


Result:

When we set a fixed time zone for the Interface/Technical User. Thereafter, the response had a constant Time Zone.

The below sample response will give you the result of the change.
{
"d": {
"results": [
{
"__metadata": {
"uri": "Removed due to Privacy reasons",
"type": "sapbyd.RPZVVVVVVVVVVVAD3DQueryResult"
},
"CVDOC_CREATEDATE_LOCAL": "/Date(1690070400000)/",
"CVDOC_ID": "1XX55",
"CVYLD0005Y_D2E80000A9": "5XX4",

"CVs1A000000000031DB8A": "08/01/2023 11:49:45 UTC+3"",
"CVs100000000000047919": "08/01/2023 09:49:45 UTC+3",

"TDSC_ZSALPHASE_01": "In-Progress",
"TUSER_ZSTATUS_CODE_01": "Converted"
}
]
}
}

 

Hope you enjoyed the blog. We have a lot more coming, so do like and follow for more such content.

Bye bye!! 🙂

Ananthu R Biju

Senior C4C Consultant
1 Comment