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

Timestamp value getting value 0.

narendra_bendi
Active Participant
0 Likes
909

Hi,

We have a small problem..

We have a standard class CL_ABAP_TSTMP and it is having a method TSTMP2SECS in it. And now I am finding the value of the parameter TSTMP in the method as 0 which is supposed to be the combination of date and time.

Can anyone suggest me what could be the reason or how to resolve it?

And also does it have any relevance with the SP levels.

Regards,

Narendra.

1 ACCEPTED SOLUTION
Read only

Sm1tje
Active Contributor
0 Likes
706

So how are you calling this method? If I do the below, it just works fine. But you do have to supply the timestamp beforehand yourself.


DATA: rt_tstmp TYPE tzntstmpl.

DATA: timestamp TYPE timestampl,
      secs      TYPE bgrfc_processing_time VALUE '3600'.

GET TIME STAMP FIELD timestamp.

TRY.
    rt_tstmp =
     cl_abap_tstmp=>add( tstmp   = timestamp
                         secs    = secs ).
  CATCH cx_parameter_invalid_range .
  CATCH cx_parameter_invalid_type .
ENDTRY.

WRITE:/1 'Timestamp :', rt_tstmp.

1 REPLY 1
Read only

Sm1tje
Active Contributor
0 Likes
707

So how are you calling this method? If I do the below, it just works fine. But you do have to supply the timestamp beforehand yourself.


DATA: rt_tstmp TYPE tzntstmpl.

DATA: timestamp TYPE timestampl,
      secs      TYPE bgrfc_processing_time VALUE '3600'.

GET TIME STAMP FIELD timestamp.

TRY.
    rt_tstmp =
     cl_abap_tstmp=>add( tstmp   = timestamp
                         secs    = secs ).
  CATCH cx_parameter_invalid_range .
  CATCH cx_parameter_invalid_type .
ENDTRY.

WRITE:/1 'Timestamp :', rt_tstmp.