‎2008 Jun 09 12:18 PM
Hello!
I need to extract 1 hour from:
timefrom = ls_prof_head-day_offset
How can I do that?
Thanks!
‎2008 Jun 09 12:35 PM
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
‎2008 Jun 09 12:28 PM
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.
‎2008 Jun 09 12:31 PM
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
‎2008 Jun 09 12:35 PM
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
‎2008 Jun 09 2:00 PM
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!
‎2008 Jun 09 2:05 PM
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
‎2010 Jun 30 7:31 PM
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