Monthly and Yearly info on the same Pivot Table
Hi everyone,
I have a couple of questions.
1) I want to show the same results by month and by year on the same pivot table. Is there any way this can be done?
2) I would also like to show data on graphs by month. To do this i have added my date field to the table (hidden) and used the function MONTHNAME(expr). This works fine except that any transactions in April 2007 get grouped with any transactions in April 2008, and the same with the rest of the months. Is there any MONTHYEAR function or the like, that differentiates between months from different years?
Any help would be great!
Thanks
1) I believe you need 2 pivot tables
2) Can you give me more details on which object and which date you are using? I think it should be possible to get the required output.
Similar Messages
-
Reporting Question - Detail and Summary info in the same report
Hello All,
I have a situation where I have to report the detail and summary information from one cube (or multiple cubes) in a single report. Following is the example cube with smaple data and the required report
Cube - Char - 0CUSTOMER
0MATERIAL
0MATL_GRP
0CURRENCY
Key Fig - 0AMOUNT
Data
0CUSTOMER 0MATERIAL 0MATL_GRP 0AMOUNT 0CURRENCY
CUS1 MAT1 GRP1 1000 USD
CUS1 MAT2 GRP1 2000 USD
CUS1 MAT3 GRP2 3000 USD
CUS1 MAT4 GRP2 4000 USD
CUS2 MAT2 GRP1 2222 USD
If I run a report to See Which Customers have bought Material MAT1, I want to produce a report like
Material Cust Matl_Gr Amt(Matl) Amt(Cust/Mtgr) Amt(Cust)
MAT1 CUS1 GRP1 1000 USD 3000 USD 10000 USD
MAT1 CUS2 GRP1 2222 USD 2222 USD 2222 USD
Any Ideas to create such a report is welcome. I am open to use multiple cubes, Multicubes, summarized data joins etc.
Thanks in advance for the help.
Amit GuptaAmit,
You can acheive this using single cube.
All you need to do is to define 2 restricted keyfigures the following way.
1. Amount (Cust/Material Group)
In the Restricted KF (either global or local), pull in the Material to the right side, right click on it and select "Constant Selection". Save it.
2. Amount (Customer)
Pull in both Material and Material Group and do the same step as above for both. Save it.
Now run the query and tests it. Let us know if i worked.
Gova -
Getting Blank Rows and Good Rows in the same bound table
Hi, a little brief here I am a developer at Oracle and am trying to use ADF and Oracle BC's on my webpages.
I am using Oracle TopLink and ADF to display the contents of several tables. The issue I encounter is that TopLink for some reason (I hypothesize memory constraints) does not return the actual contents of the rows but instead nulls to the front end for my ADF Read-Only Table on the page. The number of rows is correct but only the first 11 rows are displayed and after that the rows are completely blank, I cannot navigate to the third set of rows (the second set of rows I can navigate to because there is one good row there) and when I select one of the blank rows and try to perform an action it gives null for the contents of the actual row and throws an exception. How can I resolve this issue?
I have tested that I can see the full contents of the table correctly on another page with less content, but when I put the table on the page that has multiple iterators and also BC's on it only the first 11 rows are visible. Is there an easy solution to this issue, why does it occur, and why is there no error thrown when the null rows are given to the page? Does anyone know of a solution to this issue?Resolved the issue, the problem was that I had a refresh that was on ALWAYS on the component, I change the refresh to a RENDER MODEL refresh and now can see the whole table.
-
Include structure and extra fields in the same Internal Table
Hi developers,
im trying to declare an internal table with include structure and extra fields,
something like this:
data: BEGIN OF it_loans occurs 0,
include structure zthrca006,
status(10),
pernr like pa0001-pernr,
sname like pa0001-pernr,
tipomov(20),
monto like zthrca006-monto,
data: END of it_loans.
zthrca006 is huge so i dont want to type everithing.What is the issue?
data: BEGIN OF it_loans occurs 0.
include structure zthrca006.
data : status(10),
data : pernr like pa0001-pernr.
data : sname like pa0001-pernr.
data : tipomov(20).
data : monto like zthrca006-monto,.
data: END of it_loans.
Regards,
Ravi
Note - Please mark all the helpful answers -
Find the difference between two dates for the specific month and year
Hi,
I have two dates, start date is 30/12/2012 and end date is 04/01/2013. Using datediff I found the difference of days between two dates. But I find the no of days in January 2013. ie output is 4 instead of 6. I input month and year to find the no of days
for that date. In this case I input Jan 2013. How can I sql this ?I don't understand how most of the answers provided here not analytically solving the problem with many cases possible.
First let me understand you:
You have 2 dates range and you want to calculate day range for specific month and year between the original date range.
declare @for_month int = 1 --January
declare @for_year int = 2013
declare @StartDate date = '2012-12-20'
declare @EndDate date = '2013-01-04'
SELECT
CASE
WHEN (DATEPART(MONTH, @StartDate) = @for_month and DATEPART(MONTH, @EndDate) = @for_month) and ((DATEPART(YEAR, @StartDate) = @for_year or DATEPART(YEAR, @EndDate) = @for_year)) THEN
DATEDIFF(DAY, @StartDate,@EndDate)
WHEN (@StartDate < cast(CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as date)) and (@EndDate between (cast(CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as date)) and (cast(DATEADD(d, -1, DATEADD(m, DATEDIFF(m, 0, cast( CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as date)) + 1, 0)) as date))) THEN
DATEDIFF(DAY, DATEADD(MONTH, DATEDIFF(MONTH, -1, @EndDate)-1, 0),@EndDate)
WHEN (@EndDate > cast(DATEADD(d, -1, DATEADD(m, DATEDIFF(m, 0, cast( CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as date)) + 1, 0)) as date)) and (@StartDate between (cast(CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as date)) and (cast(DATEADD(d, -1, DATEADD(m, DATEDIFF(m, 0, cast( CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as date)) + 1, 0)) as date))) THEN
DATEDIFF(DAY, @StartDate,DATEADD(d, -1, DATEADD(m, DATEDIFF(m, 0, @StartDate) + 1, 0))) + 1
WHEN ((DATEDIFF(DAY, @StartDate, cast(DATEADD(d, -1, DATEADD(m, DATEDIFF(m, 0, cast( CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as date)) + 1, 0)) as date)) >= 0) and (DATEDIFF(DAY, cast(CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as date), @EndDate) >= 0)) THEN
DATEDIFF(DAY, cast( CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as datetime), DATEADD(d, -1, DATEADD(m, DATEDIFF(m, 0, cast( CONVERT(varchar(4), @for_year) + '-' + CONVERT(varchar(2), @for_month) + '-01' as datetime)) + 1, 0))) + 1
ELSE
0
END as [DD]
I don't know how you calculate day range between 01/01/2013 and 04/01/2013
is 4, it is actually is 3 but if that is the case, you can add 1 from the condition. -
Query to get holidays including saturday and sunday by giving month and year as input
query to get holidays including saturday and sunday by giving month and year as input.
Hi,
Create a table for holidays. You could INSERT one row for each holiday in each year, but it might be more useful if you just create 1 row for every day, with a column that tells whether that day is a holday, part of a weekend, or a work day.
See
http://forums.oracle.com/forums/message.jspa?messageID=3351081
for a user-defined function that tests if a given DATE is holiday.
You could use such a function when populating the table I mentioned earlier. -
Hide days from WebElements component WECalendar (show only month and year)
Dear expert,
I'm using WebElements to replace standard InfoView parameter screen for my Crystal Reports. My question is:
1. Is it possible to customize WebElements component: WECalendar so that we only see Month and Year, but not the Days (in other words to hide the days from the calendar).
If not possible then is there any other WebElements component that i can use for this purpose?
Because i only need to pass value of month and year selected by user when jumping to other report (using OpenDocument).
2. When i looked at the code, i'm afraid the only way is by editing the HTML part that is marked with:
// *** do not modify the code below
Since there's no available variables for hiding the days in the section that can be modified:
// *** the code below can be modified to change the formatting to the desired look and feel
Below is some of the code of the WECalendar component:
Function (stringvar ElementName, datevar ElementDefault, stringvar MonthDisplays, stringvar DayDisplays)
// *** the code below can be modified to change the formatting to the desired look and feel
// calendars use the stringvars below if nothing is entered into the WECalendar function for these parameters
if DayDisplays="" then DayDisplays:= 'Su|Mo|Tu|We|Th|Fr|Sa'; // note that there must be two characters for each day...or use " " as in 'S |M |T |W |T |F |S '
if MonthDisplays="" then MonthDisplays:= 'January|February|March|April|May|June|July|August|September|October|November|December';
// the font below is for the month & year display in the calendar and can be modified
stringvar headerfont:= WEFont('Verdana', 11, 'Navy', '', true, false,"","");
// the font colour and size below can be modified...this is for the arrows that change the month or year of the calendar
stringvar arrowfont:= WEFont('Arial', 10, 'Gray', '', false, false,"","");
// these fonts for the calendar days must be a fixed width font such as Lucida Console or the calendar spacing will break
stringvar datefont:= WEFont('Lucida Console', 8, 'Black', '', false, false,"","");
stringvar daystringfont:= WEFont('Lucida Console', 8, 'Black', '', false, false,"underline","");
stringvar weekendfont:= WEFont('Lucida Console', 8, 'Gray', '', false, false,"","");
stringvar inputfont:= WEFont('Lucida Console', 8, 'Navy', 'Center', false, false,"","");
// *** do not modify the code below
Thank you very much.
Kind regards,
aswin
Edited by: Aswin Setyawan Margono on Feb 2, 2011 5:16 PMhi Aswin,
you can always modify any of the webelements controls or create your own if you're feeling adventurous. the "do not modify" is just a warning that the code below is not as customizable as the code above which is made to be easily changed.
my recommendation for an easy win in your case though is to use the weSelectDuo control having years in the first of the select menus and the months in the second select menu.
cheers,
jamie -
Hi all Thanks in Advance
I need help in Pivoting Data
SELECT ID,MONTH,COUNT FROM TABLE_PIVOT ORDER BY ID,MONTH
ID MONTH COUNT
10 10/01/2009 60
10 11/01/2009 80
10 12/01/2009 78
10 01/01/2010 81
10 02/01/2010 73
10 03/01/2010 84
10 04/01/2010 100
10 05/01/2010 107
10 06/01/2010 90
10 07/01/2010 0
10 08/01/2010 0
10 09/01/2010 73
20 10/01/2010 71
20 11/01/2010 76
20 12/01/2010 79
20 01/01/2011 79
20 02/01/2011 81
20 03/01/2011 88
20 04/01/2011 97
20 05/01/2011 87
20 06/01/2011 97I tried to pivot with below query
SELECT ID,
SUM(DECODE(to_char(month,'MM'),'01',count,0)) " Jan",
SUM(DECODE(to_char(month,'MMYY'),'02',count,0)) Feb,
SUM(DECODE(to_char(month,'MM'),'03',count,0)) Mar,
SUM(DECODE(to_char(month,'MM'),'04',count,0)) Apr,
SUM(DECODE(to_char(month,'MM'),'05',count,0)) May,
SUM(DECODE(to_char(month,'MM'),'06',count,0)) June,
SUM(DECODE(to_char(month,'MM'),'07',count,0)) July,
SUM(DECODE(to_char(month,'MM'),'08',count,0)) August,
SUM(DECODE(to_char(month,'MM'),'09',count,0)) September,
SUM(DECODE(to_char(month,'MM'),'10',count,0)) October,
SUM(DECODE(to_char(month,'MM'),'11',count,0)) November,
SUM(DECODE(to_char(MONTH,'MM'),'12',count,0)) December
FROM Table_PIVOT
GROUP BY ID
ORDER BY ID
ID Jan FEB MAR APR MAY JUNE JULY AUGUST SEPTEMBER OCTOBER NOVEMBER DECEMBER
10 81 0 84 100 107 90 0 0 73 60 80 78
20 79 0 88 97 87 97 0 0 0 71 76 79I want output to display the column names with Month and Year like below
ID Oct-2009 Nov-2009 Dec-2009 Jan-2010 Feb-2010 ................... OCT-2010 NOV-2010 DEC-2010 JAN-2011 FEB-2011 ......
10 60 80 78 81 73 ...................
20 71 76 79 79 81
CREATE TABLE "TABLE_PIVOT"
( "ID" NUMBER,
"MONTH" DATE,
"COUNT" NUMBER
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('10/01/2009','MM/DD/YYYY'),60);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('11/01/2009','MM/DD/YYYY'),80);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('12/01/2009','MM/DD/YYYY'),78);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('01/01/2010','MM/DD/YYYY'),81);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('02/01/2010','MM/DD/YYYY'),73);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('03/01/2010','MM/DD/YYYY'),84);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('04/01/2010','MM/DD/YYYY'),100);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('05/01/2010','MM/DD/YYYY'),107);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('06/01/2010','MM/DD/YYYY'),90);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('07/01/2010','MM/DD/YYYY'),0);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('08/01/2010','MM/DD/YYYY'),0);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (10,to_timestamp('09/01/2010','MM/DD/YYYY'),73);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('10/01/2010','MM/DD/YYYY'),71);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('11/01/2010','MM/DD/YYYY'),76);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('12/01/2010','MM/DD/YYYY'),79);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('01/01/2011','MM/DD/YYYY'),79);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('02/01/2011','MM/DD/YYYY'),81);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('03/01/2011','MM/DD/YYYY'),88);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('04/01/2011','MM/DD/YYYY'),97);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('05/01/2011','MM/DD/YYYY'),87);
Insert into TABLE_PIVOT (ID,MONTH,COUNT) values (20,to_timestamp('06/01/2011','MM/DD/YYYY'),97);
COMMIT;Hi,
user1849 wrote:
Any Sample code is appreciated
I didn't see any solution for following one in your linklI think Centinul was specifically referring to:
Help for a query to add columns
but other links from
SQL and PL/SQL FAQ
may help you more.
>
Re: How to pipeline a function with a dynamic number of columns?
Posted: May 9, 2006 2:58 PM in response to: Billy Verreynne Reply
Interesting stuff! It's going to take me awhile to digest it.
For what it's worth, I was trying to build a pivoting function that would take a MYTABLE table like this:
YEAR CITY X Y
2000 BAL 95 96
2000 BOS 101 101
2001 BAL 92 94
2001 BOS 101 101
2002 BAL 98 98
2002 BOS 98 99
2003 BAL 95 96
2003 BOS 105 104
and allow me to do something like:
CREATE VIEW MYPIVOT
AS
SELECT *
FROM TABLE (PIVOT(MYTABLE, [with other params]))
and get the following view MYPIVOT on the table:
YEAR BOS_X BOS_Y BAL_X BAL_Y
2000 101 101 95 96
2001 101 101 92 94
2002 98 99 98 98
2003 105 104 95 96
Where the number of distinct CITY values will vary over time. I am able to build the query I need dynamically, but since the CITY data values in the original table change, the columns are not necessarily static from invocation to invocation. Therefore I didn't want to just create a view using the dynamic SQL once, because it may need to be created next time I need to access the view. I wanted to be able to access the pivoted data on demand.A pipelined function is your best bet for that.
I couldn't do was be able to execute the query and treat it as a pipelined function, hence my original question.Sorry, I don't understand.
I'll dig into the code above to see if it does what I wanted, but if someone has a better suggestion on how to approach this, I'd be interested in hearing it.A completely different approach is String Aggregation , where you would get output like this:
YEAR TXT
BOS_X BOS_Y BAL_X BAL_Y
2000 101 101 95 96
2001 101 101 92 94
2002 98 99 98 98
2003 105 104 95 96Note that this output contains 6 rows and 2 columns. On the first row, year is NULL and txt=' BOS_X BOS_Y BAL_X BAL_Y'. You can do this is pure, static SQL, without knowing the number of cities in advance. -
I have two Macs and I am using the same Apple ID on both. All of my info, history etc is showing up on both. How do I turn this off?
You likely have iCloud turned on in at least Safari. If you don't want Safari to sync between these devices turn one of them off. System Preferences - iCloud - Safari (uncheck the box)
-
I want to accumulate rain for the day, month and year; What formula can I use?
I want to accumulate rain for the day, month and year; What formula or expression can I use.
I am using a Rain Wise product that converts pulses to an analog value. The Rain Wise device can be
set to measure up to 1", 5", or 10". I will be setting the unit to 10 inches in increments of 0.01 inches.
What I would like to do is everytime the signal increments I would like to count it as 0.01 then after reaching
a period of time whether it be a day or a month reset back to zero.
Need some advise on this problem.
Solved!
Go to Solution.Hello Ryan,
Lookout gets a Modbus over Ethernet signal which originates as a 4-20mA input to a Moxa Ethernet I/O Module (E1240) in the field. In Lookout I created a ModbusEthernet Driver and a tag which scales 0 - 65534 RAW to 0-10 Eng. [0 - 10 is inches of rain] Also, another piece of information is that after the rain gauge maxes out at 10 inches it will zero out and start over.
I though the accumulator was time based and took a sample over a specific time period, for instance, one sample every 30 seconds then accumulate. If this is so then if I have 5 inches of rain and then it stopped raining, then 30 seconds latter it would sample, it would see 5 inches and add that to be 10 inches when actually it had only rained 5 inches.
I really need some help with this process,
David Lopez
City of Corpus Christi -
Can we modify the pnp selection screen and get only month and year?
Dear Freinds,
I have requirement where i have to modify the PNP selection screen. So with the help of report category and coding in AT SELECTION-SCREEN OUTPUT , i have modified all the fields relating to dates . i.e i have removed all the radio buttons (i.e Today, Current month,current year etc) and finally
i have landed with only Period ( PNPBEGDA & PNPENDDA range) . But i dont want the PNPBEGDA & PNPENDDA range , but i want only is the month and year ( i.e just like the PNPPABRP & PNPPABRJ)
on my selection screen along with the pernr .
i have used the below code to close all the fields except pnpbegda and pnpendda.
AT Selection-Screen output.
loop at screen.
IF screen-group4 = '098' .
screen-input = '0'.
screen-invisible = '1'.
ENDIF.
IF screen-group4 = '092' .
screen-input = '0'.
screen-invisible = '1'.
ENDIF.
IF screen-group4 = '094' .
screen-input = '0'.
screen-invisible = '1'.
ENDIF.
IF screen-group4 = '100' .
screen-input = '0'.
screen-invisible = '1'.
ENDIF.
IF screen-group4 = '104' .
screen-input = '0'.
screen-invisible = '1'.
ENDIF.
MODIFY SCREEN.
endloop.
i.e on my selection screen i want only month & year combination and pernr -
when iam using the logical database PNP . Could any one please let me know how can i get only mon & year only on my selection screen .
If it is possible please let me know .
Thanks & regards
divya.Hi ,
The requirement is that the user doesnt want to enter the date range i.e for ex: 01012008 to 31012008.
As per the requirement the user will enter only the month and year only . so i on the selection screen
i want only the month and year only . Is there any means i can modify the date period which is there by
default (PNPbegda and PNPendda) on PNP selection screen. Instead of we givign to the user the
PNPBEGDA and PNPPENDA i want is only month and year .
AS already the code has already been written and now they have asked that they want only the month and year on the selection screen.
Please suggest me in this regard.If iam hiding all the buttons relating the dates fields, and now if iam adding the parameters for the month and year it is coming below below the fields pernr , personnel ara and subara , company code , payroll area, employee group of the standard fields of PNP selection screen , there by any body could please suggest me how to change.
regards
divya. -
When my delegates are filling in a event form i have put together, a large number of them forget to change either the month or year on the date field. Is there a way to have a date field that has drop down boxes for day, month and year so they have to choose rather than a date been already on the screen??
ThanksHi Christopher,
The WEEKDAY function allows specifying either Sunday or Monday as the first day of the week:
WEEKDAY
The WEEKDAY function returns a number that is the day of the week for a given date. WEEKDAY(date, first-day)
 date: The date the function should use. date is a date/time value. The time portion is ignored by this function.
 first-day: An optional value that specifies how days are numbered.
Sunday is 1 (1 or omitted): Sunday is the first day (day 1) of the week and Saturday is day 7.
Monday is 1 (2): Monday is the first day (day 1) of the week and Sunday is day 7. Monday is 0 (3): Monday is the first day (day 0) of the week and Sunday is day 6.
But I think you are referring to the first day of the 'workweek', for which I do not see a means of defining a custom value.
Since you want to 'insert categories', though, you could easily define your own, using WEEKDAY(date) or WEEKDAY(date,1), plus an IF statement to return the category label appropriate to the day. Here's one for a Sunday to Thursday work week. Dates are in column A, the formula is in whichever column you want as the Category column. For the example, I've placed it in column B.
B2, and filled down: =IF(WEEKDAY(A)<6,"Work","Off")
The top table shows the weekday numbers returned for each day of the week for each of the three permitted values for the optional second argument. The bottom table shows the results from the formula above, used to define a category label for each date:
A10 was left blank intentionally, to determine if the lack of data resulted in an error. The Warning message, flagged by the blue 'warning' triangle, is "The formula uses a number in place of a date." The 'date' assigned to this numerical value of zero was a Friday, but I'm not certain when. Probably best to avoid extra rows with no date shown.
Regards,
Barry -
Function module for getting month and year of the previous month (say -6)
Hi,
Is there a function module that will get you the month and year of say, a month before, and as far as 11 months ago.
For example, say today is 6/2007. I want 7 months ago.
How do i get this value?
What function module or method is available?
Points will be rewarded and responses will be appreciated.
Thank You,
JohnHi
lv_period gives the month and year which is two months earlier now as we have specified lv_months as -2.
DATA: LV_PERIOD LIKE S001-SPMON,
LV_MONTHS(2) TYPE C VALUE '2-',
LV_DATUM LIKE SY-DATUM,
LV_NEWDT LIKE SY-DATUM,
P_SPMON LIKE S001-SPMON VALUE '200601'.
CONCATENATE P_SPMON '01' INTO LV_DATUM.
LV_PERIOD = P_SPMON+0(6).
CALL FUNCTION 'MONTH_PLUS_DETERMINE'
EXPORTING
MONTHS = LV_MONTHS
OLDDATE = LV_DATUM
IMPORTING
NEWDATE = LV_NEWDT
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC = 0.
LV_PERIOD = LV_NEWDT+0(6).
ENDIF.
WRITE :/ LV_PERIOD.
OR
Use the following FM for getting the year and the month based on date
CACS_DATE_GET_YEAR_MONTH
or
Call Function 'CCM_GO_BACK_MONTHS '.
Funny module: 03/31/2002 - 1 month = 02/31/2002
OR
RE_ADD_MONTH_TO_DATE ( Add / substract month to/from date )
Need ur reward points.
Best regards,
Ravi -
Calculating previous month and year of the previous month
Hi frenz,
Can anybody know FM to calculate the previous month and year of the previous month.
are there any standard FMs existed to achieve this?
br,
anil.hi,
lv_period gives the month and year which is two months earlier now as we have specified lv_months as -2.
DATA: LV_PERIOD LIKE S001-SPMON,
LV_MONTHS(2) TYPE C VALUE '2-',
LV_DATUM LIKE SY-DATUM,
LV_NEWDT LIKE SY-DATUM,
P_SPMON LIKE S001-SPMON VALUE '200601'.
CONCATENATE P_SPMON '01' INTO LV_DATUM.
LV_PERIOD = P_SPMON+0(6).
CALL FUNCTION 'MONTH_PLUS_DETERMINE'
EXPORTING
MONTHS = LV_MONTHS
OLDDATE = LV_DATUM
IMPORTING
NEWDATE = LV_NEWDT
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC = 0.
LV_PERIOD = LV_NEWDT+0(6).
ENDIF.
WRITE :/ LV_PERIOD.
Regards,
Sailaja. -
DRQ: Isolate the Daily, Monthly and Yearly CheckBoxes in Selection Criteria
Module: Financials => Financial Reports => Accounting => General Ledger
Request to Isolate the Daily, Monthly and Yearly Check Boxes in the General Ledger - Selection Criteria screen, instead of an option in the report window.
Problem: If there is BP/General Ledger having long transaction list, then once user un-check any of the check boxes system takes long time to remove/hide those rows which contains Totals. Which is effecting the performance of the report also. Also those checkboxes appeared with check marked by default.
If user has an option in the selection criteria screen, then they can choose which Total they want before previewing the report and mark accordingly.
Thanks & Regards
Anjan BhowmickBeing reached to 10 open question, I am forced to close this thread
Maybe you are looking for
-
I want to be able to connect an iPod to an interactive whiteboard. I was told by a presentor to buy a special cable, which I did, but now what? Do I need a certain app? I want to use the board to display apps to teachers to show them how to use th
-
I updated my iPhone yesterday (simply to get rid of the reminder that was bugging me). The last time I updated the phone everything went fine, my settings, ringtones, messages photos etc all backed up perfectly. This time around all my photos are g
-
How to upload a file in servlet ?
hi i am new to this concept .............. i need upload a file in mysql database ......... i created a form ... <html> <form method="post" action="http://localhost:8080/examples/servlet/UploadFile" enctype="multipart/form-data"> File <input type="fi
-
Read XML file into databased using stored procedure
I need to read an xml file into my database using a stored procedure. I looked at a couple of tutorials, but I am kind of lost and am looking for some guidance. I will eventually need to only pull a handfull of the data in based on the USER ID. Any h
-
Home Location Nokia Drive +
Hello I have recently purchased Nokia Lumia 925. How can i setup Home Location in Nokia Drive +. Thanks Pavan