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

Update TimeStamp

Former Member
0 Likes
925

Hey all ,

I am using below FM to get the timestamp,

CALL FUNCTION 'RKE_TIMESTAMP_CONVERT_INPUT'

EXPORTING

i_date = sy-datum

i_dayst = sy-dayst

i_time = sy-uzeit

i_tzone = sy-tzone

IMPORTING

e_timestmp = l_timestamp

EXCEPTIONS

date_invalid = 1

OTHERS = 2.

Now i want to add 30 mins more to the timestamp and need to change the date accordingly. Can anyone help me out in this.Thank yiou for your reply. Points will be rewarded.

l_timestamp + 30 will not work . Can anyone suggest me the method for this.

5 REPLIES 5
Read only

Former Member
0 Likes
791

HI

RKE_TIMESTAMP_CONVERT_INPUT-E_TIMESTMP means seconds since 1/1/1970. so try to add 30*60 = 1800 seconds to it instead of only 30.

Regards

Aditya

Read only

0 Likes
791

Hey i tried to change this by using seconds but it wont work.Can give me better idea how can i increase this.

Read only

Former Member
0 Likes
791

Hi,

Use class CL_ABAP_TSTMP.


DATA : l_tstamp         TYPE timestamp,
       l_tstamp_out TYPE timestamp.
					
 GET TIME STAMP FIELD l_tstamp.
TRY.
  CALL METHOD cl_abap_tstmp=>add
     EXPORTING
        tstmp = l_tstamp
        secs = 3600 <<<===--- 1 hour = 3600 seconds
     RECEIVING
                r_tstmp = l_tstamp_out.
  CATCH cx_parameter_invalid_range .
                WRITE 'invalid range'.
                EXIT.
  CATCH cx_parameter_invalid_type .
                WRITE 'invalid type'.
                EXIT.
ENDTRY.
					
WRITE l_tstamp time zone 'UTC '.
SKIP.
WRITE l_tstamp_out time zone 'UTC '.

Regards

Kannaiah

Read only

0 Likes
791

Hi Kannaiah Kavuri ,

I am using this but it is giving me the exception invalid range.. I dont understand what is going wrong.

Read only

Former Member
0 Likes
791

Solved.