on 12-23-2005 3:20 PM
Hello,
In infopackage I need to select current and previous month. What would be better : OLAP variable or ABAP routine?
If ABAP routine please tell how it returns the value.
hi,
for abap routine, try following code :
data: l_idx like sy-tabix,
l_month(6) type c,
l_dtlastmonth like sy-datum.
read table l_t_range with key
fieldname = '[your field month]'.
l_idx = sy-tabix.
*....
DELETE l_t_range
WHERE iobjnm = '[month infoobject name]'
and fieldname = '[your field month]'.
L_t_RANGE-SIGN = 'I'.
L_t_RANGE-OPTION = 'EQ'.
current month
concatenate sy-datum3(2) sy-datum0(4) into l_month.
L_t_RANGE-LOW = l_month.
append l_t_range.
last month
clear l_month.
l_dtlastmonth = sy-datum - 31.
concatenate l_dtlastmonth4(2) l_dtlastmonth0(4) into l_month.
L_t_RANGE-LOW = l_month.
append l_t_range.
modify l_t_range index l_idx.
p_subrc = 0.
$$ end of routine - insert your code only before this line -
endform.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In this code please tell me how can i get data which is for current week and then just the one 10 weeks ago.So just 2 of them.This week and this week - 10.
Please just provide me the modifications as its a bit confusing and the requirement is urgent
data: l_idx like sy-tabix,
l_month(6) type c,
l_dtlastmonth like sy-datum.
read table l_t_range with key
fieldname = '[your field month]'.
l_idx = sy-tabix.
*....
DELETE l_t_range
WHERE iobjnm = '[month infoobject name]'
and fieldname = '[your field month]'.
L_t_RANGE-SIGN = 'I'.
L_t_RANGE-OPTION = 'EQ'.
current month
concatenate sy-datum3(2) sy-datum0(4) into l_month.
L_t_RANGE-LOW = l_month.
append l_t_range.
last month
clear l_month.
l_dtlastmonth = sy-datum - 31.
concatenate l_dtlastmonth4(2) l_dtlastmonth0(4) into l_month.
L_t_RANGE-LOW = l_month.
append l_t_range.
modify l_t_range index l_idx.
p_subrc = 0.
$$ end of routine - insert your code only before this line -
endform.
Thanks
U can create a ABAP Routine of the type 6 (ABAP Routine),The field you are trying to populate is a select-option so you have to define both Sign and Option along with Low and High values.
As u want to load current month, from a system values , u can do it from sy-datum.
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = ''/BIC/Z_APOSNAP'.
l_idx = sy-tabix.
l_t_range-low =
l_t_range-high =
l_t_range-sign =
l_t_range-option =
modify l_t_range index l_idx.
p_subrc = 0.
Just u can fill Sign as 'I' and Option 'EQ'.
Fill Low and High with values u get from System Data.
Hope this Helps
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.