10-20-2008 2:09 PM
Hello everybody!
I need sb to give me a hand with the issue of increasing date (calday). I initializad :
date = '01012006'.
how do I do the the increment? : date = date + 1. (in order to have date = '02012006')
or: CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
days = '+1'
start_date = date
IMPORTING
result_date = date.
10-20-2008 2:11 PM
Hi Adrian,
use this.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = initial_date
days = 01
months = 0
signum = '+'
years = 0
IMPORTING
calc_date = increm_date.
regards,
kais
10-20-2008 2:16 PM
10-20-2008 2:21 PM
What is the data type of the field date ?
you can use the function CALCULATE_DATE
but the date format that it accepts is of type sy-datum ( yyyymmdd)
regards,
Advait
10-20-2008 2:24 PM
Hi,
Use the function is better because its compatible with different format of dates.
You don't need to handle this explicitly.
10-20-2008 2:24 PM
10-20-2008 2:26 PM
Do you need the next working day or the next date only. For next working day you need to know the type of calender you need to use.
10-20-2008 2:39 PM
10-20-2008 2:43 PM
Use the calculate_date function and pass the date in yyyyddmm format.
regards,
Advait
10-20-2008 2:45 PM
Hi,
I think this thread is done.
The required solution was found.
Don't try to wast the time of the guy.
Bye.
10-20-2008 2:52 PM
10-20-2008 2:57 PM
10-20-2008 3:15 PM
I'm new to abap. I intend to write a routine for a transformation rule (in BW). Here's a portion of the code: (I got red in the BW Monitor and the system points towards CALL FUNCTION 'CALCULATE_DATE' - the cursor blinks in front of CALL FUNCTION 'CALCULATE_DATE')
data: e_s_result type tys_TG_1.
data: e_t_result type tyt_TG_1.
data: data like sy-datum.
loop at RESULT_PACKAGE into e_s_result.
data = '20080101'.
do 1000 times.
if data >= e_s_result-/bic/zabdatum and data <=
e_s_result-/bic/zbisdatum.
move data to e_s_result-calday.
append e_s_result to e_t_result.
endif.
data = data + 1.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
days = '+1'
start_date = data
IMPORTING
result_date = data.
*CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
*EXPORTING
*date = data
*days = 01
*months = 0
*signum = '+'
*years = 0
*IMPORTING
*calc_date = data.
*data = '20080102'.
enddo.
endloop.
refresh RESULT_PACKAGE.
move e_t_result[] to RESULT_PACKAGE[].
10-20-2008 3:27 PM
Adrian - you're making this far too complicated. all you have to do is:
REPORT ztest LINE-SIZE 80 MESSAGE-ID 00.
DATA: date_in TYPE sy-datum VALUE '20080101',
date_out TYPE sy-datum.
date_out = date_in + 1.
WRITE: /001 date_in, date_out.
Rob
10-20-2008 3:40 PM
it worked in se38. Thanks
I suppose it's my code in bw routine which is at fault....
10-20-2008 3:47 PM
Function modules can be a great help for re-usability of code. But they do have an interface which must be understood. If there is no documentation and you are new to ABAP, it's often easy to code yourself. You learn more and in this case, it's dead simple.
Rob
10-20-2008 2:38 PM
To get next working day you can use the FM 'BKK_ADD_WORKINGDAY'. Here you need to put the calender type used for your need.
10-20-2008 2:38 PM
To get next working day you can use the FM 'BKK_ADD_WORKINGDAY'. Here you need to put the calender type used for your need.