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?

Former Member
0 Likes
1,036

Hello!

I need to extract 1 hour from:

timefrom = ls_prof_head-day_offset

How can I do that?

Thanks!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
999

Hi Andrei Algaier,

You can use the FM CATT_ADD_TO_TIME

Pass 1.00- in the parameter STDAZ its for hours need to be substracted...

Note Don't forget to keep minus sign in STDAZ parameter

Also try out...

START_TIME_DETERMINE

SUBTRACT_TIME_FROM_DATE

Hope it will solve your problem..

Reward points if useful..

Thanks & Regards

ilesh 24x7

6 REPLIES 6
Read only

Former Member
0 Likes
999

hi,

what is timefrom??

if you want to extract one hour from time then you can take time in one variable of type c.

use offset to get an hour from that variable & store in one variable of type i..

then subtract 1 from that variable.

t_time type c.

hour type i.

hour = t_time+2(6).

hour = hour - 1.

t_time+2(6) = hour.

reward points if useful.

thx.

twinkal.

Read only

Former Member
0 Likes
999

Like this


data: mytime    like sy-UZEIT.

mytime = sy-UZEIT.
mytime = mytime + 3600.  "<== # of seconds in an hour
write: mytime, sy-UZEIT.

Edited by: Paul Chapman on Jun 9, 2008 7:31 AM

Read only

Former Member
0 Likes
1,000

Hi Andrei Algaier,

You can use the FM CATT_ADD_TO_TIME

Pass 1.00- in the parameter STDAZ its for hours need to be substracted...

Note Don't forget to keep minus sign in STDAZ parameter

Also try out...

START_TIME_DETERMINE

SUBTRACT_TIME_FROM_DATE

Hope it will solve your problem..

Reward points if useful..

Thanks & Regards

ilesh 24x7

Read only

0 Likes
999

Thanks! But i have such structure:

CALL FUNCTION 'BAPI_ISUPROFILE_GET'

EXPORTING

profile = ls_config_data-profile

datefrom = imp_prof_val-value_date

timefrom = ls_prof_head-day_offset

dateto = lv_dateto

timeto = ls_prof_head-day_offset

timezone = ls_prof_head-time_zone

    • STATUSUPDATE = 'X'*

TABLES

profilevalues = lt_get_values

    • profilevalues = lt_val_data*

return = lt_get_return .

In this BAPI there are timefrom and timeto. They have to be 1 hour extracted, and shown in the table lt_get_values

How can I do it?

Thanks!

Read only

0 Likes
999

Check the code below:

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.

Regards

Kannaiah

Read only

0 Likes
999

Sali Andreji

Got small problems with FM BAPI_ISUPROFILE_GET while reading Daily Profile.

I found that the profile must be older than 3 month otherwise got error of time frame.

Is anyone has idea how to fix or Customizing this issue please reply

Thanks

A. Landsmann