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 field

Former Member
0 Likes
790

hi all..

how to diaplay the AM and PM next to the st-datum.

venkat

7 REPLIES 7
Read only

Former Member
0 Likes
759

Hi,

Is it SY-DATUM or SY-UZEIT.

THanks,

Naren

Read only

0 Likes
759

sorry its sy-uzeit.

Read only

0 Likes
759

Hello

Use the Function Module

HRVE_CONVERT_TIME

data: time type sy-uzeit,

OUT_TYPE(2) TYPE C.

CALL FUNCTION 'HRVE_CONVERT_TIME'

EXPORTING

TYPE_TIME = 'A'

INPUT_TIME = sy-uzeit

  • INPUT_AM_PM = 'AM'

IMPORTING

OUTPUT_TIME = time

OUTPUT_AM_PM = out_type

EXCEPTIONS

PARAMETER_ERROR = 1

OTHERS = 2

.

Write: time,

out_type.

Reward points if this helps.

Regards

Meera

Read only

Former Member
0 Likes
759

hi

good

your query is confusing,

SY-DATUM ll display the current date .If you want to display , if you want to display AM or PM than you check with the hour if it going beyond than use APPEND statement to append PM into it otherise AM.

You can take AM and PM as a character field.

thanks

mrutyun^

Read only

0 Likes
759

after sy-uzeit i want diaply the AM or PM

Read only

0 Likes
759

hi,

check the FM <b>HRVE_CONVERT_TIME</b>

in that you need to specify

TYPE_TIME 'A'

INPUT TIME

INPUT_AM_PM 'AM' or 'PM'

hope this helps,

do reward if it helps,

priya.

Read only

Former Member
0 Likes
759

Hi,

data: v_time type char10.

data: v_hour type numc2.

v_hour = sy-uzeit+(2).

write: sy-uzeit to v_time.

if v_hour > '12'.

concatenate v_time 'PM' into v_time.

else.

concatenate v_time 'AM' into v_time.

endif.

write: / v_time.

Thanks,

Naren