Get table partition name dynamically for given date range
Dear All,
Could you please tell me how to get the partition name dynamicaly for given date range ?
Thank you.
SQL> select table_name,
partition_name,
to_date (
trim (
'''' from regexp_substr (
extractvalue (
dbms_xmlgen.
getxmltype (
'select high_value from all_tab_partitions where table_name='''
|| table_name
|| ''' and table_owner = '''
|| table_owner
|| ''' and partition_name = '''
|| partition_name
|| ''''),
'//text()'),
'syyyy-mm-dd hh24:mi:ss')
high_value_in_date_format
from all_tab_partitions
where table_name = 'SALES' and table_owner = 'SH'
TABLE_NAME PARTITION_NAME HIGH_VALUE_IN_DATE_FORMAT
SALES SALES_1995 01-JAN-96
SALES SALES_1996 01-JAN-97
SALES SALES_H1_1997 01-JUL-97
SALES SALES_H2_1997 01-JAN-98
SALES SALES_Q1_1998 01-APR-98
SALES SALES_Q2_1998 01-JUL-98
SALES SALES_Q3_1998 01-OKT-98
SALES SALES_Q4_1998 01-JAN-99
SALES SALES_Q1_1999 01-APR-99
SALES SALES_Q2_1999 01-JUL-99
SALES SALES_Q3_1999 01-OKT-99
SALES SALES_Q4_1999 01-JAN-00
SALES SALES_Q1_2000 01-APR-00
SALES SALES_Q2_2000 01-JUL-00
SALES SALES_Q3_2000 01-OKT-00
SALES SALES_Q4_2000 01-JAN-01
SALES SALES_Q1_2001 01-APR-01
SALES SALES_Q2_2001 01-JUL-01
SALES SALES_Q3_2001 01-OKT-01
SALES SALES_Q4_2001 01-JAN-02
SALES SALES_Q1_2002 01-APR-02
SALES SALES_Q2_2002 01-JUL-02
SALES SALES_Q3_2002 01-OKT-02
SALES SALES_Q4_2002 01-JAN-03
SALES SALES_Q1_2003 01-APR-03
SALES SALES_Q2_2003 01-JUL-03
SALES SALES_Q3_2003 01-OKT-03
SALES SALES_Q4_2003 01-JAN-04
28 rows selected.
Similar Messages
-
SD pricing extract for given date range
Hi,
Is any one knows any FM where you can able to extract pricing for given date range.
FM Pricing works for one date. I don't want to loop at this
FM for the given date rage. It takes very long time.
Thanks for any suggestion.
Kind Regards
NirHi,
Is any one knows any FM where you can able to extract pricing for given date range.
FM Pricing works for one date. I don't want to loop at this
FM for the given date rage. It takes very long time.
Thanks for any suggestion.
Kind Regards
Nir -
Price change report for a given date range in inforecords
hi,
Can any body suggest how we can get price changes in inforecords for given date range. is there any standard sap tcode or fuction module.Hi,
If you are referring to the changes in the condition record (for eg. for PR00), then you may go through the foll path:
Execute VK13 for any condition type - once inside the detail screen, from the menu path, choose Environment -> Changes -> change report. This will take you to a new selection screen where you can define the period you want to see the change record as well as the condition type for which you want to track the changes. Beware, this is a complex report for SAP and it will take definitely longer time to complete. So, it is better to specify short time periods and specific condition types and execute this in background.
Hope, this helps!
S. Siva -
How to calculate a week & Month in given date range (not for sele-options)
Hi ,
I have defined 2 date parameters in sel-screen (Plz remember that date variable are not a SELECT-OPTIONS). Now i want ot display week nos & monts in output.
Ex: date1: 20080101 & date2: 20080229. then
weeks : 1, 2, 3,---9.
months: jan-08, feb-08.
Plz help me with block of code or any FM.
Regards,Hi Srikanth,
The FM HR_99S_INTERVAL_BETWEEN_DATES is doesn't existing, but there is a fm HR_MX_INTERVAL_BETWEEN_DATES but it returns no of Years & Days.
But i found some FM which r returns no of months for given date range. but my requirement is, want to display the month no bw 1 to 12. (ex: dat1=15-03-2008 & dat2= 01-06-2008 then in month fields 03,04,05 & 06. ).
Plz help me on this.
-Regards. -
Workday calculation for specified date range
Hi All,
How to count number of workdays available for given date range. And I tried below statement which is
not working.
SUM(CASE [Calendar].[Calendar Date]
WHEN [Calendar].[Calendar Date].[Year] = '2005' AND [Calendar].[Calendar Date].[Month]
= 1
THEN [Calendar].[Calendar Date].CURRENTMEMBER.CHILDREN
END
, [Measures].[Work Day Flag])Hi bpbhhaskar,
According to your description, you want to count the weekdays in MDX. Right?
In this scenario, we can just aggregation days from Monday to Friday. The key should be 2 to 6. Please use the expression below:
with
MEMBER [Measures].[DayCount] AS
Count
Descendants
[Date].[Calender].CurrentMember
,[Date].[Calender].[Date]
* {[Date].[Day Of Week].&[2]:[Date].[Day Of Week].&[6]}
Best Regards,
Simon Hou
TechNet Community Support -
Name of users of a particular Tcode for a given date range
Hi experts,
I am making an alv where inputs will be
1> T_code(as parameter)
2> Date Range(as Select options)
I have to display the following fields:::
1> User name
2> Frequency of use the Tcode for the given Date range.
Please give me the tables where I can get the relation of those fields.
N.B. I know the transaction AL08 and SM04.But it won't solve my purpose.
Thanx in advance,
Sourav>
SOURAV PAUL wrote:
> Hi experts,
> I am making an alv where inputs will be
> 1> T_code(as parameter)
> 2> Date Range(as Select options)
by creating the report As per your this requirement you need not to create any Bulk on your SAP.Just use STAD/STAT transaction they are availabe for this purpose.
and more you may track by security log audit by SM20 get these details.
i'm worried about tables which sre storing these details. -
Any FM to get count of each week day for the given date range
Hi guys,
Any FM to get count of each week day for the given date range?
eg: If i give 14/07/2008 to 14/08/2008
I need to find how many Mondays, tuesdays...sundays in this given date range.
If not single FM is available, any logic that gives above result is also appreciated.
Thanks,
Vinod.hi Vinod,
this is not a full solution, I just give you a basic idea:
DATA : lv_start TYPE sy-datum VALUE '20080714',
lv_end TYPE sy-datum VALUE '20080814'.
WHILE lv_start LE lv_end.
CALL FUNCTION 'FTR_DAY_GET_TEXT'
EXPORTING
pi_date = lv_start.
* IMPORTING
* PE_DAY_TEXT1 =
* PE_DAY_TEXT2 =
* PE_DAY =
* you have to summarize the output here somehow...
lv_start = lv_start + 1.
ENDWHILE.
hope this helps
ec -
How to get XLR to show BPs with no transaction data for a given date range
Hi -
I am building an XLR report that does a comparison of net sales data across two periods for a given sales employee's BPs.
The report has the row expansion:
FACT BPA(*) SLP(SlpName = "ASalesPersonNameHere") ARDT(Code = "ARCreditMemo", "Invoice") Group by BPA.CardName
and column expansions:
FIG(SO_TaxDate = @StartDate:@EndDate)
and
FIG(SO_TaxDate = @StartDate2:@EndDate2)
where @StartDate, @EndDate, @StartDate2, @EndDate2 are parameters that define the two ranges of dates.
The column formulas are, from left to right:
=ixDimGet("BPA", "CardName")
=ixGet("SO_DocTotal") <-- filtered by column expansion for first date range
=ixGet("SO_DocTotal") <-- filtered by column expansion for second date range
The report works fine except for one problem, I would like it to include BPs for which no transaction occurred in either date range as well.
Any help is greatly appreciated!
Thanks,
Lang RileyReally appreciate your feedback! Those are good suggestions. I should have mentioned that I had already tried both those suggestions.
Removing FACT on BPA in this case ends up returning all the BPs and not respecting the SLP(SlpName = "aName") part of the query.
Using **, i.e., * or #NULL, makes no change in the resulting data in this case. I had thought that ** would be the solution, but it didn't change the outcome. I still have BPs for which when their sales employee is used as the filter and they have no transactions for either date range, and yet they still do not appear.
I should further mention that the IXL query, as it now stands, does return BPs for which one of the periods has no data, just not both, and I have verified that applicable BPs with no transaction data for both periods do exist in my data set. It seems that perhaps the IXL query needs to be restructured? Please keep the suggestions coming including how this query might be restructured if necessary. -
Getting the column names dynamically
hi gurus,
i have list item populated with many table names from a schema.
i have grid in oracle forms 10g and i want to fill the grid with the data that should come at least four/more columns.
i want to fire the list change trigger when each time any one table name is selected/changed.
how can i get the column names dynamically
please give me the step by step process
for filling the grid..hi ,
by getting column names dynamically i am creating a record group
using this below query
SELECT COLUMN_NAME, DATA_TYPE FROM USER_TAB_COLUMNS WHERE TABLE_NAME = <table_name>
but when timestamp datatype is there then it is showing error cannot create group groupname
but the record group is running successful on varchar2,number,date dayatypes
if any alternative is there i mean to say without using record group then tell me or where is the problem -
Stock report with value and qauntity for given date not month wise
Hi gems,
can any body give me the standard report for Stock value and qauntity for given date not month wise at storage location levelHi
check the report S_P00_07000139 with the option inventory and raw material report- detail and selection date (from, to date same). List will give opening & closing balances with goods movment and their values.
Thanks -
How to pull records only for particular date range in Flex frm SAP wd table
Hi,
Can anyone help me with databing for datefield.
I am using two datefields in Flex for Start Date and End Date. When I click the Execute button, it should pull only the records for that date range from SAP wd table and display in my Flex datagrid.
Thanks,
Sri
Edited by: rmsridevi on May 17, 2011 4:38 PMHi,
Your query has mistakes as well. I corrected them.
Check this two different ways were in first you can define the period (month) you want and in second you have the option to select from the drop drown list :
SELECT T0.DocNum, T0.DocDate, T0.CardName,T0.DocTotal,T1.whsCode
FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
WHERE t0.docdate >= '2011.01.01' and t0.docdate <='2011.01.31'
OR
SELECT T0.DocNum,T0.DocDate,T0.CardName,T0.DocTotal,T1.whsCode
FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
WHERE t0.docdate >= [%1] and t0.docdate <= [%2]
Kind Regards,
Jitin
SAP Business One Forum Team -
Last Purchase price Warehouse wise for given date
Hai all....
I Want query report for Last purchase price for all items, warehouse wise for given date, i tried following query
SELECT
T10.ItemCode,
(Select i1.Itemname from oitm i1 where i1.itemcode = T10.[ItemCode]) as 'ItemName',
T10.[Whscode],
(SELECT T1.[DocDate] FROM OPDN T1 where T1.[DocEntry] = max(T10.[DocEntry])) as 'Doc_Date',
(SELECT T1.[DocNum] FROM OPDN T1 where T1.[DocEntry] = max(T10.[DocEntry])) as 'GRPO_NO',
(SELECT case avg(T2.[Rate]) when 0 then avg(T2.[price]) else (avg(T2.[price]) * isnull(avg(T2.[Rate]),1)) end FROM PDN1 T2 where T2.[DocEntry] = max(T10.[DocEntry])
and T2.Itemcode = T10.[ItemCode]) as 'Unit_Price',
(SELECT isnull(avg(T3.[Rate]),0) FROM PDN1 T3 where T3.[DocEntry] = max(T10.[DocEntry])
and T3.Itemcode = T10.[ItemCode]) as 'CurrencyRate',
(Select isnull(max(OP1.Docnum),0) from OPCH op1 where op1.Docentry in
(SELECT T12.[trgetEntry] FROM PDN1 T12 where T12.[DocEntry] = max(T10.[DocEntry]))) as 'Invoice_No'
FROM PDN1 T10
INNER JOIN OPDN T11 ON T10.DocEntry = T11.DocEntry and T11.[DocType] = 'I'
where T11.Docdate <= '[%0]' and t10.targettype <> 21
GROUP BY
T10.[ItemCode],T10.[Whscode]
this query working good but problem in this query is ,when the user put back dated entry means this report will show wrong value,bcz i write this query based on MAX of docentry please help me to solve this issue
Edited by: Prasanna s on Mar 27, 2009 5:49 AM
Edited by: Prasanna s on Mar 27, 2009 8:00 AMHai ...
please help me in this query,my question is not clear or?? -
Devloped an ALV report for daily cash receipts for selected date range
hi,
how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report.Hi,
You can develop simple reports using Report Painter.
You may be also interested in:
Check report SAPMF05A for credit memo
See the following Std reports on Payment Advices execute the Tcodes:
S_ALR_87009888
S_ALR_87009889
S_ALR_87009890
S_ALR_87009891
S_ALR_87009892
S_ALR_87009893
S_ALR_87009978
S_ALR_87009979
S_ALR_87009980
S_ALR_87009981
S_ALR_87009982
S_ALR_87009983
S_ALR_87010056
S_ALR_87010057
S_ALR_87010058
S_ALR_87010059
S_ALR_87010060
S_ALR_87010061
S_ALR_87010066
S_ALR_87010067
S_ALR_87012106
S_ALR_87012107
S_ALR_87012108
S_ALR_87012109
S_ALR_87012110
S_ALR_87012111
S_ALR_87012116
S_ALR_87012117
S_ALR_87012200
S_ALR_87012201
S_ALR_87012202
S_ALR_870122
S_ALR_87012204
S_ALR_87012205
S_ALR_87012350
S_ALR_87012351
S_ALR_87012352
S_ALR_87012353
S_ALR_87012354
S_ALR_87012355
sample ALV report:
tables:
marav. "Table MARA and table MAKT
Data to be displayed in ALV
Using the following syntax, REUSE_ALV_FIELDCATALOG_MERGE can auto-
matically determine the fieldstructure from this source program
Data:
begin of imat occurs 100,
matnr like marav-matnr, "Material number
maktx like marav-maktx, "Material short text
matkl like marav-matkl, "Material group (so you can test to make
" intermediate sums)
ntgew like marav-ntgew, "Net weight, numeric field (so you can test to
"make sums)
gewei like marav-gewei, "weight unit (just to be complete)
end of imat.
Other data needed
field to store report name
data i_repid like sy-repid.
field to check table length
data i_lines like sy-tabix.
Data for ALV display
TYPE-POOLS: SLIS.
data int_fcat type SLIS_T_FIELDCAT_ALV.
select-options:
s_matnr for marav-matnr matchcode object MAT1.
start-of-selection.
read data into table imat
select * from marav
into corresponding fields of table imat
where
matnr in s_matnr.
end-of-selection.
Now, we start with ALV
To use ALV, we need a DDIC-structure or a thing called Fieldcatalogue.
The fieldcatalouge can be generated by FUNCTION
'REUSE_ALV_FIELDCATALOG_MERGE' from an internal table from any
report source, including this report.
The only problem one might have is that the report and table names
need to be in capital letters. (I had it )
Store report name
i_repid = sy-repid.
Create Fieldcatalogue from internal table
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = sy-repid
I_INTERNAL_TABNAME = 'IMAT' "capital letters!
I_INCLNAME = sy-repid
CHANGING
CT_FIELDCAT = int_fcat
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = i_repid
I_STRUCTURE_NAME = 'marav'
I_DEFAULT = 'X'
I_SAVE = 'A'
TABLES
T_OUTTAB = imat.
IF SY-SUBRC <> 0.
WRITE: 'SY-SUBRC: ', SY-SUBRC .
ENDIF.
Hope this will help.
Regards,
Naveen. -
Devolped an ALV report for daily cash receipts for selected date range
hi,
how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report.hi,
how to devlop an ALV report for daily cash receipts for selected date range.for this report what are the tables and fields we have to use.what is the selectionscreen&what is logic.give me sample report. -
Hi,
My end user requires me to develop a report that will accept the following parameters:
Customer Code : ABC
From Period : 01-Jan-2005
To Period : 31-Dec-2010
Output must be as follows :
Customer Jan-05 Feb-05 Mar-05 Apr-05 May-05 ......................................Dec-10 Total Order
Code
ABC 10 15 5 20 10 ...................................... 15 X value
I have told my end user that it is not possible to create an Oracle report that will give data for any period range that the user specifies. First the number of columns for the date range must be fixed like say at a time only data for 12 months will be displayed in the report. Then they can run the report for any year and the parameter has to be
Customer Code : ABC
Year :2005
The output will be :
Customer Jan-05 Feb-05 Mar-05 Apr-05 May-05 ......................................Dec-05 Total Order
Code
ABC 10 15 5 20 10 ...................................... 15 X value
Am I right or wrong ? Please advise. This is very urgent.I don't see why this should not be possible.
Remember that you can have repeating frames in every direction (ie. right and down) and can combine these.
What I would do is look for (or create) a type of calender-table where I could select the date values from (ie. JAN 05) qualified by the from- and to-Parameters (aka query1),
then have a second, dependent query which uses the date from the calender (aka query2).
Then stack a down repeating frame for query2 into the right repeating frame for query1 and you should be almost there... Use the date from query1 as heading...
Cheers,
Jens Rettig
Maybe you are looking for
-
Multiple Apple ID's - How to merge?
I currently have 2 Apple ID's that i want to merge together so they both fall under 1 account and not 2, how do i merge these together?
-
HP6520 Scanner and Copier Broke after installing windows 8.1
After installing windows 8.1, my copier and scanner stopped working. I have an HPPhotosmart 6520. There is no "Microsoft Fix it" for Windows 8.1. Could you help me with this problem? Thank you.
-
Situation : My users are connected with RDP on a Windows Server 2012 R2 Datacenter Remote Desktop Service and when they log on, their share printers are installed. When some users open a pdf file, they can't print it. When they try to print a file, n
-
Can I put the HP recovery (D:) partition in an extended partition?
I recently had to replace my HDD and HP sent a recovery disk set with my OEM replacement HDD which I used to returm my laptop to "factory original" condition. My problem is that it created 4 primary partitions on the HDD, and now I'm looking for a wa
-
How to insert the current datetime?
Hello everyone, I'm beginner in this world, sorry for my simple question. I wanna insert the current date and time on the database after my application has started the stored procedure. I have to insert the following format for datetime column: 03/19