Application Development and Automation 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: 
Read only

time and date function, how to use?

Former Member
0 Likes
581

Hello everyone,

I want to know that how can we make use of these two system functions SY-TIMLO, SY-DATUM ?

What should i write in data? pbo? pai?

Should i write something like this in data?

DATA: Ok_date TYPE SY-DATUM.

DATA: Ok_time TYPE SY-TIMLO.

What should i write in pbo and pai and should i need to make changes in screen elements? do i need to create one?

Please guide and explain with an example. Thanks a lot for writing back.

Regards,

Lucky

Moderator message - Please ask a specific question - post locked

Edited by: Rob Burbank on Aug 4, 2009 12:14 PM

4 REPLIES 4
Read only

Former Member
0 Likes
547

HI,

These are system variables used to hold the date and time. The way you have defined are correct. If you are using a module pool and want the output to display the cuurent date and time as soon as you run the program , just create 2 input box on the screen and set their time as DATS and TIMS for date and time type variables. In the PBO module simply write

ok_date = sy-datum

ok_time = sy-timlo.

for time you may also use sy-uzeit.

Regards,

Sachin

Read only

0 Likes
547

actually i wanted to know how do i make use of them in dialog programmin pbo and pai modules.. it sounds confusin though i only know how to use sy-ucomm in pai and pbo stuff..

thanks for writing back.

Regards,

Lucky

Read only

Former Member
0 Likes
547

Hi,

create two variables in the top include..

data :P_date type Sy-datum default sy-datum,

p_time type sy-uzeit default sy-uzeit.

---

Next go to screen and enter table syst...

and select datum and uzeit and drag to screen..

and rename the field to p_date for syst-date and p_time for syst-uzeit.

Prabhudas

Read only

0 Likes
547

this one sounds useful i will try that.

thanks both of you for writing back.

Regards,

Lucky