Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How does SAP convert the gregorian date to islamic date

Former Member
0 Kudos

If the date format in user profile (defaults) is set to Islamic Date 1 format, how does SAP convert the gregorian date to islamic date while displaying or using write statements in ABAP. When the abap program reads the date field from the database, the value in database is stored as YYYYMMDD, while writing the list output, it converts to islamic date.

My requirement is to read the hiring date from HR infotype 0041, convert into islamic date and add 1 Hijra year to the islamic date to come up with one year hijra period (example 1429/11/29 to 1430/11/28). Note this is not the same as reading the gregorian date and find one year period and then converting to islamic date. Islamic calendar has 354 or 355 days instead of 365.

5 REPLIES 5

Former Member
0 Kudos

Hi,

Use the class CL_ABAP_DATFM

and the method CONV_ISL_TO_GREG_FORMULA

Regards,

IFF

Former Member
0 Kudos

you can use either function - CONVERT_DATE_TO_EXTERNAL but there it will take user default format.

or you can use CL_ABAP_DATFM method CONV_DATE_INT_TO_EXT; here you can specify your date format A or B using parameter IM_DATFMDES

are you the one from BCSS / Aramco?

0 Kudos

It works. I wonder what is the significance of table TISLCAL (islamic calendar) !! I am not sure about the date format parameter in the method A and B. Both gives different outputs. In fact, 1 day difference between A and B.

I am the same one from BCSS and Aramco also ... and you Garg?

Edited by: Shameel Padmanabhan on Nov 24, 2008 12:11 PM

0 Kudos

yep. how are the others? Xee, Nai.. ?

0 Kudos

Hi there,

Another question ... if you select islamic date as your default date type, on any date field, if you do F4 (possible entries), it shows only 2 years of calendar. Whereas, if your default date type is Gregorian, you can scroll N number of years. Why is this restriction? Any idea?

Thanks,

Shameel