‎2010 Dec 09 6:10 AM
Hi,
I am using the below code for converting date and time to timestamp.
To convert time of a zone into GMT time in the form of time stamp
CONVERT DATE p_dat_low TIME p_v_times DAYLIGHT SAVING TIME p_v_dst
INTO TIME STAMP p_v_tst TIME ZONE p_p_t_zone.
in timezone I am passing 'LBANON' i,e for country lebanon. But i am getting error i,e sy-subrc = 12.
Can anyone plz help me how to rectify this
Thanks,
Sakti
‎2010 Dec 09 6:26 AM
‎2010 Dec 09 6:43 AM
Hi Sravan,
Thanks for your response.
But in this FM there is no parameter to pass 'daylight saving'.
Thanks,
Sakti
‎2010 Dec 09 6:28 AM
Hi,
Try uing the FM VELO03_CONVERT_INTO_TIMESTAMP to convert to timestamp.
Thanks,
Sri.
‎2010 Dec 10 6:50 AM
Hi,
I have written the below code.
CONVERT DATE p_dat_low TIME p_v_times DAYLIGHT SAVING TIME p_v_dst
INTO TIME STAMP p_v_tst TIME ZONE p_p_t_zone.
For some countries it is working for some it is not working.
Can anyone suggest where is the problem.
Thanks,
Sakti
‎2010 Dec 10 7:01 AM
Have you checked the documentation.......
CONVERT DATE dat [TIME tim [DAYLIGHT SAVING TIME dst]]
INTO TIME STAMP time_stamp TIME ZONE tz.
Sy-Subrc = 12: Time specification could not be converted, because dat, tim, or dst contain invalid or inconsistent values.
If dst has a different value or the specified value does not suit the value in tim and dat, the time_stamp remains unchanged and sy-subrc is set to 12
‎2010 Dec 10 7:24 AM
Hi Satyajit,
Thanks for your response.
I am totally agree with you.
can you explain me more details about the issues as i have already mentioned the same syntax working for some countries and not for other.
e;g for Lebanon it is not working. Because i am passing 'LBANON' in timezone . As lebanon is 2 hrs ahead from UTC time, if i passed 'UTC2' in timezone it is working.
Thanks,
Sakti