‎2009 Jan 21 8:55 PM
Hi
I got to write simple code for the selection screen , thing is i got from date as 14-01-2009 and to date as 22-01-2009 . I would like to subtract a week from the to value of selection screen.
this is related to BW. I am giving selection on BEDAT of EKKO that is DOC.DATE
&----
*& Include RSBC_SEL_ROUTINE_TPL
&----
program conversion_routine.
Type pools used by conversion program
type-pools: rsarc, rsarr, rssm.
tables: rssdlrange.
Global code used by conversion rules
$$ begin of global - insert your declaration only below this line -
TABLES: ...
DATA: ...
$$ end of global - insert your declaration only before this line -
-------------------------------------------------------------------
Fieldname =
data type =
length = 000000
-------------------------------------------------------------------
form compute_
tables l_t_range structure rssdlrange
changing p_subrc like sy-subrc.
Insert source code to current selection field
$$ begin of routine - insert your code only below this line -
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = 'bedat'.
l_idx = sy-tabix.
*....
if l_idx <> 0.
modify l_t_range index l_idx.
else.
append l_t_range.
endif.
p_subrc = 0.
$$ end of routine - insert your code only before this line -
endform.
Thanks in Advance
‎2009 Jan 21 10:41 PM
Check this code:
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = sy-datum "input date
days = '7' " seven days
months = '00'
signum = '-' "subract from Input date
years = '00'
IMPORTING
calc_date = lv_default_date."output date
‎2009 Jan 21 10:46 PM
Hi,
Simply subtract 7 days from the date.
Data p_date type sy-datum default '20080108'.
p_date = p_date - 7.
Now p_date will have '20080101'.
‎2009 Jan 21 10:57 PM
Hi Avinash
Thanks for ur answer , but i am working on selection screen named x for instance where I got two values one is from value and other is to value , in my program i want to take to value and need to change that every time and to value must become the from value in next data load.
‎2009 Jan 21 11:06 PM
Hi,
can you please explain when these upload takes place periodically or continuously.please explain the date concept with example.