Code for date range
Hi,
In the select option we have a field month range as
SELECT-OPTION : FROM 01.2007 TO 01.2009
where as in one of the internal table we have data without considering the month range as below
MONTH RANGE BUKRS BELNR DMBTR
01.2006 10 1001 50
05.2006 10 1001 20
02.2007 10 1001 30
06.2007 10 1001 40
01.2009 10 1001 90
but now i need to add the DMBTR field considering the month range in the SELECT OPTION i.e., only FROM 01.2007 TO 01.2009 i mean without 2006 data.
if i write the code as below its getting all the data sum up but i dont want 2006 data
LOOP AT LT_DATA.
ls_output-matnr = lt_data-belnr.
ls_output-werks = lt_data-bukrs.
ls_output-lgort = lt_data-dmbtr.
COLLECT ls_output INTO lt_output .
ENDLOOP.
please help with code .
thanks in advance.
>
Sree vignesh wrote:
> Hi,
> In the select option we have a field month range as
> SELECT-OPTION : FROM 01.2007 TO 01.2009 " Let say Ur Selection option is SO_MONTH
> but now i need to add the DMBTR field considering the month range in the SELECT OPTION i.e., only FROM 01.2007 TO 01.2009 i mean without 2006 data.
>
> LOOP AT LT_DATA WHERE month in SO_MONTH. " Here add a Where condition
> ls_output-matnr = lt_data-belnr.
> ls_output-werks = lt_data-bukrs.
> ls_output-lgort = lt_data-dmbtr.
>
> COLLECT ls_output INTO lt_output .
>
> ENDLOOP.
>
> please help with code .
>
> thanks in advance.
Regards,
Suneel G
Similar Messages
-
Hi All,
I have requirement to write code for date range.
Characterstic = Run-Out Date, it was created reference to 0Date.
Requirement is data should load depends on Run-Out Date 7 days old and 14 days future.
Logic is -7 days old >= Run_out date <= 14 days future.
please let me know how I need to proceed with ABAP code for this requirement.
Thanks.
Please do not ask for ABAP code here. Its not a training forum
Edited by: Pravender on Aug 18, 2011 1:46 AM>
Sree vignesh wrote:
> Hi,
> In the select option we have a field month range as
> SELECT-OPTION : FROM 01.2007 TO 01.2009 " Let say Ur Selection option is SO_MONTH
> but now i need to add the DMBTR field considering the month range in the SELECT OPTION i.e., only FROM 01.2007 TO 01.2009 i mean without 2006 data.
>
> LOOP AT LT_DATA WHERE month in SO_MONTH. " Here add a Where condition
> ls_output-matnr = lt_data-belnr.
> ls_output-werks = lt_data-bukrs.
> ls_output-lgort = lt_data-dmbtr.
>
> COLLECT ls_output INTO lt_output .
>
> ENDLOOP.
>
> please help with code .
>
> thanks in advance.
Regards,
Suneel G -
Can i have html code for date select options (SEARCH HELP)
Hi frinds,
I have a BSP Page with input as date.
Can i have html code for date select options (SEARCH HELP)
MoosaHi
Please find the sample code below.
FROM DATE
<htmlb:inputField id = "dd"
width = "45%"
type = "DATE"
showHelp = "X" <- Search help
alignment = "CENTER"
maxlength = "10"
disabled = "TRUE"
value = "<%= w_FROMDATE %>" />
TO DATE
<htmlb:inputField id = "dd"
width = "45%"
type = "DATE"
showHelp = "X"
alignment = "CENTER"
maxlength = "10"
disabled = "TRUE"
value = "<%= w_TODATE %>" />
Thanks
kalyan -
Need to update out put tax classifcation code for a range of items in Orac
Hi,
I need to update out put tax code for a range of items in Oracle EBS. At the moment we update tax code for individual items manually ubder invoice tab. Is there a better way to do this.
RegardsWhere can I find the mtl_system_items_interface table?Under INV schema.
R12 -- INV.MTL_SYSTEM_ITEMS_INTERFACE
http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=MTL_SYSTEM_ITEMS_INTERFACE&c_owner=INV&c_type=TABLE
11i -- INV.MTL_SYSTEM_ITEMS_INTERFACE
http://etrm.oracle.com/pls/trm11510/etrm_pnav.show_object?c_name=MTL_SYSTEM_ITEMS_INTERFACE&c_owner=INV&c_type=TABLE
Thanks,
Hussein -
Query to find first and last call made by selected number for date range
Hi,
query to find first and last call made by selected number for date range
according to filter:
mobile_no : 989.....
call_date_from : 25-april-2013
call_date_to : 26-april-2013
Please helpHi,
It sounds like you want a Top-N Query , something like this:
WITH got_nums AS
SELECT table_x.* -- or list columns wanted
, ROW_NUMBER () OVER (ORDER BY call_date ) AS a_num
, ROW_NUMBER () OVER (ORDER BY call_date DESC) AS d_num
FROM table_x
WHERE mobile_no = 989
AND call_date >= DATE '2013-04-25'
AND call_date < DATE '2013-04-26' + 1
SELECT * -- or list all columns except a_num and d_num
FROM got_nums
WHERE 1 IN (a_num, d_num)
;This forum is devoted to the SQL*Plus and iSQL*Plus front ends. This question doesn't have anything to do with any front end, does it? In the future, you'll get better response if you post questions like this in the PL/SQL.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only), and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the SQL forum FAQ {message:id=9360002} -
Forum search doesn't seem to work for Date Range 'ALL'
Hi there,
Forum search doesn't seem to work for Date Range option: 'ALL' .
For a given search criteria, I get few search results when the date range is chosen as 'last year', but for the same search criteria, when the date range is chosen as ALL, no search results are shown (not even the ones shown earlier for last year selection).
regards,
AJCan you please delete my few duplicate replies in [CJ20n|Re: Long Text at Activity Level in CJ20N] thread?:-)
Cheers,
Amit. -
Which BW variable is used for date(range) when creating a portal service
Hi,
Can any one please let me know which BW variable is to be used for date(range) when creating a portal service for searching based on dates.
Thanks
AbhaiHi Arun,
its just a portal service which would be called when searching a document created on a particular date or betwwen a range of date.so what i require is which BW variable to be used when handling range.As for variable technical name we use VAR_NAME_I and for single value variable we VAR_VALUE_EXT_I
in the similar manner i want BW variable to be used for range of values.
Thanks
Abhai -
Dynamic Date Value for Date Range Parameter - Scheduling in BI
Hi,
I am New to BO Enterprise XI R3. I want to schedule the Crystal report which takes Date Range as parameter. Is any option available to calculate From Date automatically based on Current Date based on the range required?
Currently, Parameter option accepts parameters and enterprise process the report for configured parameters. In this case, report always prints only for configured date range eventhough report generated after one month. I am expecting report has to print data for date range (eg. 1 weeks, 4 days, or any range) based on system current date.
Thanks in Advance,
Venkateswaran.PI'm am in the same situation. I need to be able to have the date parameter dynamically change based on the current day's date when I schedule a report. However, because this parameter comes from a Stored Procedure from the database, it cannot be modified in the Report Designer (as far as I know). I've tried to set a default for it to use "currentdate" but it doesn't seem to take. Anyone know if this can be accomplished in the scheduler?
Thanks
-Tom -
Query for date range? JE
Hi,
I have seem some posts on the JE forum regarding quering for date range, but it is mostly using DPL.
Is there any way to do that using the JE API
Thanks,
MohammadHi Mohammad,
A date range query can be performed as a key range query. There's nothing special about dates except that you'll want to use a key binding that gives a meaningful sort order. If you're representing your dates in milliseconds, then a LongBinding (in com.sleepycat.bind.tuple) will work well. In general, use tuple bindings for keys, because they provide a meaningful sort order.
To perform a range query, this FAQ has some hints:
http://www.oracle.com/technology/products/berkeley-db/faq/je_faq.html#28
On range searches in general, they can be done with Cursor.getSearchKeyRange or with the SortedSet.subSet and SortedMap.subMap methods, depending on whether you are using the base API or the Collections API. It is up to you which to use.
If you use Cursor.getSearchKeyRange you'll need to call getNext to iterate through the results. You'll have to watch for the end range yourself by checking the key returned by getNext. This API does not have a way to enforce range end values automatically.
If you use the Collections API you can call subMap or subSet and get an Iterator on the resulting collection. That iterator will enforce both the beginning and the end of the range automatically.
Does this answer your question?
--mark -
Where can I find the demo code for data mining?
Where can I find the demo code for data mining?
-
How get Mailbox Folder Item Count for date range?
How to make query to Exchange 2013 like this:
query ItemCount (specified Mailbox, specified Folder (with subfolders), specified Date Range)?
I find this script for Exchange 2010: http://gsexdev.blogspot.ru/2012/10/item-age-sample-one-reporting-on-item.html
This script dont work for Exchange 2013 ((I believe you are making the change on both the places in code, as this path version would be different in 2013
C:\Program Files\Microsoft\Exchange\Web Services\1.2\Microsoft.Exchange.WebServices.dll"
Cheers,
Gulab Prasad
Technology Consultant
Blog:
http://www.exchangeranger.com Twitter:
LinkedIn:
Check out CodeTwo’s tools for Exchange admins
Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. -
Dynamic Variant for Date Range
Making the Variant for Date or Date Range Dynamic in the Selection Screen of any Program.
There are actually many ways you can make the Variant for Dateu2019s Dynamic.
1. Providing he Values in the Variant Variables.
2. By creating the variables in the table TVARVC
3. By Initializing the values in the program itself.
I saw many posts with respect to these and found that everyone has their own way of dealing. Even I wrote code in the program initialization to get this done.
Here in this post I am showing you the easiest option which is available in the Variant creation.
EX : If you want to execute the batch job based on a date range.
SY-DATE u2013 60 days , that means always your program should execute the batch job based on System Date. And the variant should change accordingly.
Following are the step by stop to do that.
1. Select your program and select the Variant Radio button and then Click on Display.
2. It will pop up a screen with variant option below the program name.
3. Enter the Variant name and click on Create
4. You will see a screen, with the Attributes button.
5. Once you click on the Attributes button, it will take you a screen with selection option.
6. In my scenario my input is based on Calender Day, so select the Selection Variable for Calender Day: You will find 2 options T & D.
7. Select D: Dynamic date Calculation, then select the Name of Variable (input using f4). You can find many options.
8. Scroll down the Variant Attributes and select current date u2013 xxx, current date + yyy
9.Though it seems to be inactive, just double click on the row to provide the date range.
10. Just enter the value for xxx and yyy to get you dynamic range based on number of days
11. In my scenario I have to consider System Date u2013 60 days. 0 means current day.
12. Click on OK to check the range has been reflected or not. Then save the Variant and check the value by executing the program with saved Variant.
You can check the same in blog with all the screen shots attached but this thing is so easy you don't require screen shots.
Regards
Shankar ChintadaHi Shankar,
It would be great if you can put this information in Wiki .
Pravender -
InfoPackage ABAP Routine for Date Range - Only Start Date Extracted
I am using an ABAP Routine in an InfoPackage to select data for a 2 year period. The routine converts SY-DATUM into the Current Fiscal Year and Period, and then calculates the Starting and Ending Fiscal Year / Period of a 24 month period. The Start and End values are passed to the InfoPackage as l_t_range-low and l_t_range-high.
The Source and Target are both Basic Infocubes.
The InfoPackage executes successfully, and the Selection values on the Header tab of the monitor reflect a 24 month period. Unfortunately, on closer review of the data in the cube, only data for the first month appears to have been loaded. Im guessing that the extract was only performed with the From value, even though a To value was also provided.
I created a simple Infopackage and manually input the selection parameter values just to be sure I wasnt overlooking something. The InfoPackage performed as expected, loading more data which spanned the selection time period.
I can provide the code if it helps, but the fact that the monitor reflects a Start and End value suggests that the problem is with the InfoPackage, not the ABAP routine.
Has anybody ever experienced this before ? Any ideas would be greatly appreciated ?
Thanks,
LyleWe can write ABAP routine in Infopackage with a range of values (From & To). Make sure you fill all the following information while building the final range information as below,
l_s_range-sign = 'I'.
l_s_range-option = 'BT'.
l_s_range-low = lowvalue.
l_s_range-high = highvalue.
MODIFY l_t_range FROM l_s_range INDEX l_idx.
As you can see the key is passing the "BT" information for capturing range.
Hope it helps..
thanks
Kumar -
Customer exit variable for date range for the last day
Hi,
If user enters date ranges in variable
suppose user enters 9/1/2010 to 9/15/2010 and we have to calculate currency conversion based on last day i..e 9/15/2010 . 08
2)User input is date range 08/01/2010 to 08/30/2010
I need from the customer exit 08/30/2010 (on last day) to calculate currency conversion.
Can anyone help me with ABAP code to achieve this customer exit?And please tell me how to proceed step by step
Sridharcreate a variable to enter date range (ZDATE1)
create a key date variable(ZDATE2) with processing type customer exit, should not be ready for input.
In the exit ZXRSRU01 write below code.
DATA: l_s_range TYPE rsr_s_rangesid,
loc_var_range LIKE rrrangeexit.
WHEN 'ZDATE2'.
IF i_step = 2.
read table i_t_var_range INTO loc_var_range
with key vnam = 'ZDATE1'.
CLEAR l_s_range.
l_s_range-low = loc_var_range-high.
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
ENDIF. -
ABAP ROUTINE AT INFOPACKAGE FOR DATE RANGE
hi all,
I want to Schedule my infopackge with selection options
0DATE infoobject with First date of current month( 01.02.2008) to last date of current month ( 29.02.2008).
this i have to get automatically bcoz i have to use this in process chain.
so I want to write a routine for this at the infopackage level with ABAP Routine -6 option.
So please suggest me how to write the code for this case.
thanks,
kiran manyam.Hi Kiran,
Please paste the following code there and also check for syntax error.
data first_date type d.
data last_date type d.
first_date = sy_datum.
first_dat+6(2) = '01'.
CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
Exporting
DAY_IN = first_date
Importing
LAST_DAY_OF_MONTH = last_date.
read table l_t_range with key
fieldname = 'DATE'.
if sy-subrc = 0.
l_idx = sy-tabix.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
l_t_range-low = first_date.
l_t_range-high = last_date.
modify l_t_range index l_idx.
else.
move 'DATE' to l_t_range-fieldname.
l_t_range-sign = 'I'.
l_t_range-option = 'BT'.
l_t_range-low = first_date.
l_t_range-high = last_date.
append l_t_range.
endloop.
endif.
p_subrc = 0.
Maybe you are looking for
-
We have implemented data level security by applying filters on groups in Obiee Administration tool. Here we have set filter on division(which is a column in Customer table). This is done so that user can see data for division for which he has access.
-
Hi ! I'm a little confused. I moved a house to nerest city , when I checked the availability of infinity and as shown by entering the zip code is available, I ordered a technician to connect my new home to the Internet. I have an appointment on 16 m
-
Checking the size of the infocube
Hi, How can we check the size of the infocube with large volume of data? From the SAP standard practice what is the optimal size that an infocube can consist of data with out an impact on the query performance?
-
Compiling .as file to .swc
I'd like to compile a .as file to .swc so I can reference it directly, but I'm sure how to go about it in Flex. I'm using the new Flash Builder 4 Beta, but have a working copy of Flex Builder 3 as well so either is fine. Thanks, David
-
Need help in e mailing pictures
I need a password to send my pictures by e mail. Can you send (or re send) me one?