cancel
Showing results for 
Search instead for 
Did you mean: 

C4C SDK: Fetching Day for the specified Date

chandansb
Active Contributor
0 Kudos

Hello Experts,

Can anybody help to understand how will I fetch the Day for the specified date?

Example: If Input is 06182015, I need to return as Thursday.

Kindly help me understand this.

Thanks in Advance.

Regards,

Chandan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

As mentioned by Horst there is no standard library, but you can create your own reuse function

chandansb
Active Contributor
0 Kudos

Hello Alessandro and Horst,

I am at least now clear that I would not have to utilize my time finding the standard functionality. 

I will surely try to create own Reuse functionality for this but I will need your expertise on this. Can you please elaborate more so that I can understand how this can be achieved.

Appreciate your quick help.

Thanks,

Chandan

Former Member
0 Kudos

1) Create a reuse function that have in import the date and returns a string

2) in the reuse function start with:

var day = this.date.GetDay();

var month = this.date.GetMonth();

var year = this.date.GetYear();

3)

[implement the algorithm that you can find here Determination of the day of the week - Wikipedia, the free encyclopedia) in the section A Tabular method to calculate the day of the week)

case dayoftheweek

1: return "Monday"

2: return "Tuesday"

etc. etc.

Former Member
0 Kudos

Last: share your reuse function with the community

chandansb
Active Contributor
0 Kudos

Thanks for the hint Alessandro.

I will keep you posted on this and surely would share this with the community.

Regards,

Chandan

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Chandan,

I had a quick look into the ABAP coding for the Reuse Library "Date".

It took me only less time to ad a new function "GetWeekday" to this library.

It will come with the next release 1508.

HTH,

    Horst

chandansb
Active Contributor
0 Kudos

Thanks for considering the request.

Meanwhile I will try to create my first Reuse Library

Will keep you posted and complete the thread accordingly with complete solution on this,

Thanks a lot.

Regards.

Chandan

chandansb
Active Contributor
0 Kudos

Hello Alessandro/Horst,

I have created the reuse function. It took me to time since I also had additional requirement related to same but I have finally created the blog for same to share with Community. Here is the link for same.

Your expertise to improvise this will motivate me to learn more.

Thanks once again.

Cheers,

Chandan

Former Member
0 Kudos

Saw it in my favourites!

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Good job

Answers (1)

Answers (1)

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Chandan,

Sorry, but there ios no function in the reuse library for Dat efor this.

Especially as the language would play a vital role in the translation.

Sorry,

     Horst