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: 

Function Module

Former Member
0 Kudos

Hi All,

In my program there is date field is there it is in display mode we may not able to change it, in the output it is showing system date and time when we are using that program in india,

but I want to show it in the US date and time wherever it will open for this is there any function module is there.

Thanks and regards,

Krish...........

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Check the difference of time with GMT.

Check the Function Module ADD_TIME_TO_DATE. To add the time to get the US time and u can show it. I think this function module will be helpful.

Regards,

Kasuladevi

6 REPLIES 6

GauthamV
Active Contributor
0 Kudos

hi,

just add the time difference to the variable in which u r passing ur date.

Former Member
0 Kudos

Try SET COUNTRY,

try the following link,

http://www.geocities.com/rmtiwari/main.html?http://www.geocities.com/rmtiwari/Resources/Utilities/AB...

or SAP online help.

Edited by: avinash ravipati on Sep 4, 2008 11:51 AM

Mohamed_Mukhtar
Active Contributor
0 Kudos

hi Krrish ,

DATE_TIME_CONVERT

Always Learner

Former Member
0 Kudos

Here you go...

Use the function module IB_CONVERT_INTO_TIMESTAMP and convert the time to the GMT.

The input parameters are DATE, TIME and the TIMEZONE(user's timezone, default value SY-ZONLO).

The output parameter is the timestamp in GMT.

The function module IB_CONVERT_FROM_TIMESTAMP is used to get the time in required timezone. The input parameters for this are the time stamp obtained from the above function module and the timezone, to which the time needs to be converted.

The output parameters are the date, time in the required timezone.

Sample Code

REPORT ZTIMEZONES .

***************************************************

  • This program is used to convert the times between *

  • different timezones. This program deals with the *

  • conversion of time from INDIA timezone to the PST *

  • timezone *

*****************************************************

  • Declaring the work variables.......................

DATA :

timestamp like TZONREF-TSTAMPS,

time like sy-uzeit,

date like sy-datum.

  • The following function module is used to convert the

  • time and date into GMT timestamp

CALL FUNCTION 'IB_CONVERT_INTO_TIMESTAMP'

EXPORTING

i_datlo = sy-datum

i_timlo = sy-uzeit

I_TZONE = 'INDIA'

IMPORTING

E_TIMESTAMP = timestamp.

  • The following function module is used to convert the

  • above obtained timestamp to PST timezone date and time.

CALL FUNCTION 'IB_CONVERT_FROM_TIMESTAMP'

EXPORTING

i_timestamp = timestamp

I_TZONE = 'PST'

IMPORTING

E_DATLO = date

E_TIMLO = time.

write 😕 'Date and Time at PST zone is ',date, time.

Former Member
0 Kudos

Hello Krish.

Every date field possibly is LIKE sy-datum and the Time field is LIKE sy-uzeit.

Whether it is run anywhere it will show the current date and time of that place.

That should not be a problem.

But, Still If I have mis-interpreted your question. Do let me know.

Good Luck & Regards.

Harsh Dave

Former Member
0 Kudos

Hi,

Check the difference of time with GMT.

Check the Function Module ADD_TIME_TO_DATE. To add the time to get the US time and u can show it. I think this function module will be helpful.

Regards,

Kasuladevi