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

Regarding date and time

Former Member
0 Likes
941

Hi guys,

I got an scenario given below and please provide me the logic if possible.

The program should capture the date and time when you execute the report i.e F8. And display this captured date and time above the report. This date and time should not keep changing on the output screen of the report once the report is executed. The purpose of this is that if they take the print of this report and show to their superiors, they can show that when the report was executed on so and so date and time, this was the output.

Regards

ABAPer

Hi guys,

I got an scenario given below and please provide me the logic if possible.

The program should capture the date and time when you execute the report i.e F8. And display this captured date and time above the report. This date and time should not keep changing on the output screen of the report once the report is executed. The purpose of this is that if they take the print of this report and show to their superiors, they can show that when the report was executed on so and so date and time, this was the output.

Regards

ABAPer

7 REPLIES 7
Read only

Former Member
0 Likes
899

data: v_date like sy-datum,

v_time like sy-uzeit.

START-OF-SELECTION.

v_date = sy-datum.

v_time = sy-uzeit.

"rest of the code....

Read only

Former Member
0 Likes
899

Hi,

You can use sy-datum & sy-uzeit for date & time.

Store these values into some variables at the begining of execution of your program & they can be displayed/used where ever you need.

Regards,

Naga Sai Swapna

Read only

Subhankar
Active Contributor
0 Likes
899

Hi ,

Get the date and time in the INITIALIZATION event.

initialization.

v_curr_time = sy-uzeit.

v_curr_date = sy-datum.

Read only

GauthamV
Active Contributor
0 Likes
899

Hi,

you can use system variables to capture date and time.

sy-datum,sy-uzeit.

use top of page event of alv to get those details in header.

Once the users execute the report they can save the same with

those details or print it.

Read only

Former Member
0 Likes
899

Hi,

You have two system variables sy-datum and sy-uzeit for storing current date and time.

write them under the event

TOP-OF-PAGE.

write: / sy-datum , sy-uzeit.

Regards,

Sumalatha

Read only

Former Member
0 Likes
899

Hi Jansi,

You could create your own table for your report where you could store the header data of the report every time a user executes it. Like you can store Company code, customer number, po number, etc. and of course the date and time it was executed.

Now in your program, when a user executes your report, check first your customized table if the report was already executed. If not, then you could insert now the header details of your report on your customized table before displaying the report.

But if the user is executing the report the second time, you could now point on your customized table and retrieve the date and time it was first executed.

Read only

0 Likes
899

Hi santos.

Thanks

Regards

Abaper