Application Development 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: 

Invalid values can result when rounding from "TZNTSTMPL" to "TIMESTAMP": what to do in 750?

WRoeckelein
Active Participant
0 Kudos
554

In S/4HANA I get a warning when eg assigning the result of cl_abap_tstmp=>add to a timestamp typed variable: "Invalid values can result when rounding from type "TZNTSTMPL" to type "TIMESTAMP"

The longtext of the warning suggests to use CL_ABAP_TSTMP=>MOVE_TO_SHORT or CL_ABAP_TSTMP=>ADD_TO_SHORT which are not available in in NetWeaver 7.50 .

Any suggestions what to do best in NetWeaver 7.50 to avoid the mentioned possible problems (eg 20001231235959.7500000 getting rounded to 20001231235960 which is not a valid timestamp)? Something involving ROUND with mode=ROUND_DOWN ?

1 ACCEPTED SOLUTION

tom_wan
Advisor
Advisor
306

Have you tried CL_ABAP_TSTMP=>MOVE method?

BTW, I found one SAP Note that fix same issue in standard program:

2160267 - hybris call: wrong timestamp rounding

Maybe the correction of this note could give you some hints.

2 REPLIES 2

tom_wan
Advisor
Advisor
307

Have you tried CL_ABAP_TSTMP=>MOVE method?

BTW, I found one SAP Note that fix same issue in standard program:

2160267 - hybris call: wrong timestamp rounding

Maybe the correction of this note could give you some hints.

WRoeckelein
Active Participant
306

Hi tom.wan ,

thanks, that looks very good, as this is also used by CL_ABAP_TSTMP=>MOVE_TO_SHORT .

I just didn't notice this because of the very generic signature...

The correction instruction do a normalize first and then the move, however directly after add/substract this seems unnecessary to me.

Regards,

Wolfgang