Reporting monthly values as daily
I have infocube data like the following:
fiscper.............qty
009/2007.........60
And I need to produce a report like this:
date................qty
09/01/07...........2
09/02/07...........2
09/03/07...........2
etc. thru end of month (total qty being divided by number of days in month)
Being a former abaper, I'm thinking I could manipulate the infocube data into a ztable, and then extract the ztable data into another infocube. Is there a more standard bw-type approach I should consider?
Thanks!
Den
Hi,
You can go for Customer Exit, writing simple ABAP code here.I have given the sample code also.Its better to go with Variable exit.
Customer or Variable exit is done in CMOD transaction. There are 2 kinds of Exit project available for BEX one at the Data target level EXIT_SAPMRSRU_001 and one at the query level EXIT_SAPLRRS0_001.
check the folloiwng thread for Sample code:
Re: Customer exit
check the 3rd option: User exit for Varibales relevant to u.
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6378ef94-0501-0010-19a5-972687ddc9ef
http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/frameset.htm
Similar Messages
-
MDX for Start of Month Values at Daily level
Hey Guys,
I am dealing with a requirement as below, the solution i have is either not addressing the complete problem or is extremely slow and in many cases just not feasible. Need a little help on the same.
Problem: Need a query with cross join of 4 dimension (10 levels) and a date dimension, i need to determine a measures's first
available value across time periods such as Start of month, start of year Etc..
I have
dimA - Level A1
dimB - Leve B1,B2,B3
dimC - Level C1
dimD - LevelD1, D2,D3,D4,D5
Date Dimension - Date, Month, Year as levels.
Measure - M1 To M5
Query:
SELECT
NON EMPTY
[Measures].[M1]
,[Measures].[M2]
,[Measures].[M3]
,[Measures].[M4]
,[Measures].[M5]
,[Measures].[M1SOM]
} ON COLUMNS
,NON EMPTY
[DimA].[A1].[A1].ALLMEMBERS*
[DIMB].[B1].[B1].ALLMEMBERS*
[DIMB].[B2].[B2].ALLMEMBERS*
[DIMB].[B3].[B3].ALLMEMBERS*
[DIMB].[B4].[B4].ALLMEMBERS*
[DIMB].[B5].[B5].ALLMEMBERS*
[DIMC].[C1].[C1].ALLMEMBERS*
[DIMD].[D1].[D1].ALLMEMBERS*
[DIMD].[D2].[D2].ALLMEMBERS*
[DIMD].[D3].[D3].ALLMEMBERS*
[Date].[Date].[Date].ALLMEMBERS*
[Date].[Month].[Month].ALLMEMBERS*
} ON ROWS
FROM
[Cube]
***The above query has all those cross joins as this query would power an SSRS report dataset.
Need to create a new calculated measure or a real (persisted measure) that displays the Start of month & Start of year Values. Below are the options i have currently. Lets assume, Measure M1 is the one for which i need the SOM and SOY values.
Create a persisted measure (M1SOM) based off the measure M1 and provide an aggregation function of "FirstNonEmpty" : This works perfectly when we run a query at Month level i.e. in the above query have [Date].[Month].[Month].Allmembers instead
of [Date].[Date].[Date].Allmembers. It displays the first available non empty value of the month. However, this means the rest of the measures are aggregated at month level. If i want to display the daily values of the other measures along with SOM values
for this measure it wont work, cause the scope now changes to a single date and i just get the daily value in the M1SOM measure as well.
Create a calculated measure (M1SOM) as below, along with the query above and the same thing happens. Cant display the SOM values at a daily date level.
WITH
MEMBER [Measures].[M1SOM] AS
[Date].[Date].FirstChild
,[Measures].[M1]
3. Create a calculated member as below, This works! however, the query
absolutely kills my machine and takes forever to execute, if i run it with more than 3 levels in the cross join.
WITH MEMBER M1SOM AS Head(NonEmpty({[Date].[Date].Parent.Children}*[Measures].[M1SOM])).Item(0)
Is there a better way to achieve the SOM and SOY calculations at a daily level?
Thanks
SrikanthHi Srikanth,
Basically you want to get the cell values on different granularity for date dimension in the same result set. For performance consideration, we suggest to use MDX to get the 2 types of value separatedly and merge with T-SQL.
Below is an example on how to get data from MDX within T-SQL for your reference.
SET
@mdx
=
'{some
dynamic MDX}'
SET @sql
=
'SELECT a.* FROM
OpenQuery(LinkedAnalysisServer, '''
+
@mdx
+
AS a'
BEGIN TRY
INSERT INTO #result
EXEC sp_executesql @sql
END TRY
BEGIN CATCH
IF ERROR_NUMBER <>
'The error number you are seeing'
BEGIN
RAISERROR('Something happened that was not an empty result set')
END
END CATCH
SELECT * FROM
#result
Regards -
YTD and monthly value in reports
Hello experts,
some of our reports show value in terms of YTD value...and the corresponding characteristics are Accounts....
My user wanted to know if possible to see some accounts showing YTD value and some accounts Monthly value....
Is it possible?Both Monthly value and YTD value are available in cube....
Thanks.
Regards,
S Hhi,
u can also include both monthly value column as well as YTD in report.just that u need to have filter for those account .
a way is that u can include fiscal year period var in selection screen then make restriction on this basis.
and for YTD will show value from start of year till date
ex- if u enter march 2010 to aug 2010.then YTD will show jan 2010 to aug 2010 data.
So try this
thanks
nilesh -
Last Month value for the keyfigure in Report
HI ALL,
how do we get keyfigure value for the last month in the report.
for ex: for amount keyfigure should come for the last month rest of the key figures should come for the current month values.
SBU | AMOUNT (LAST MONTH VALUE) | QTY(CURRENT MONTH) | NETPROFIT(CURRENT MONTH)
The above shown is ex as i required in same manner. Even i restricted with calmonth offset value -1 in keyfigure but it is not working. please help me to get solution .
Thanks
Pinky ReddyHi Pinky,
It is not advisable to use offset to get the previous month value.This is not effective in the case when your current month is Jan & u have to get the previous year's dec month value.It is always better to opt for Exits
Do use the code mentioned below.
Note:- ZCUSMFIS3 - Variable in the selection screen for entering current month
'ZPREVPER - Variable with which the amount key figure has to be resticted.
WHEN 'ZPREVPER'.
IF I_STEP = 2. "after the popup
LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
WHERE VNAM = 'ZCUSMFIS3'.
V_PERIOD = LOC_VAR_RANGE-LOW+4(3).
V_FYEAR = LOC_VAR_RANGE-LOW+0(4).
V_FVARIANT = 'B1'.
V_FISCPERYEAR = LOC_VAR_RANGE-LOW.
IF V_PERIOD = '001'.
V_PERIOD = '012'.
V_FYEAR = V_FYEAR - 1.
CONCATENATE V_FYEAR V_PERIOD INTO V_FISCPERYEAR.
ELSE.
V_FISCPERYEAR = V_FISCPERYEAR - 1.
LOC_VAR_RANGE-LOW = V_FISCPERYEAR.
ENDIF.
CLEAR L_S_RANGE.
L_S_RANGE-LOW = LOC_VAR_RANGE-LOW. "YYYYMMDD - DD will indicate the no of days
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
ENDLOOP.
ENDIF.
Hope this provides the solution for your requirement.
Regards,
Saswati. -
How to display Month values in SSRS report
Hi All,
I have a requirement to display month values in SSRS Chart. x-axis should display all month names from January till current month. How can I set this properties and show it in a line graph
Thanks & Regards,
Regards RCPHi,
The above link is not meeting my requirement. I need January till July to be displayed in x-axis
labels of graph. How this can be achieved ??
Regards RCP
You can create a calendar table on the fly and use it for your dataset to be used in the graph. Use logic as below
http://visakhm.blogspot.in/2010/02/generating-calendar-table.html
For getting January till current month use query as
DECLARE @Start datetime,@End datetime
SELECT @Start = DATEADD(yy,DATEDIFF(yy,0,GETDATE()),0),
@End = GETDATE()
SELECT *
FROM dbo.CalendarTable(@Start,@End,0,1) f
As a long time persistent solution best option would be to create a calendar table in the database.
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
How should get last month value from report?
Hi experts,
How should last month value. For example
jan feb march
100 -- ---
Here i want to get jan month value in march coloumn.Hi ,
It is only show last month value. but my requirement is if last month is empty it should bring Before Last month.
For Example
Jan Feb Mar
1000
i need if the Feb value is empty should come jan month value. -
Why customer exit variable to grab the current month value doesn't work?
In CMOD, input the following code to grab the current month value from the system date:
Grab the month value with System Date
WHEN 'CURMONTH'.
CLEAR l_s_range.
l_s_range-low = SY-DATUM+4(2).
l_s_range-sign = 'I'.
l_s_range-opt = 'EQ'.
APPEND l_s_range TO e_t_range.
In Query Designer, create a formula variable CURMONTH processed by customer exit and the dimension under the Currency/Unit tab is "Number". Put the formular variable in the column as a KF. When running the query, the column with the formular variable shows values of "2,0000000" other than just "2" I want for the current month. If the dimension under the Currency/Unit tab is "date", the column with the formular variable shows values of "00/00/0000". Any idea? How to grab the correct current month value which is 2 from the system date.
Thanks!Oh ok , try the below options, As such I dont see any errors in our code .
Not sure if you have ABAPER's in your team, just check with them once on the FM we are trying to see .
Next , do you hvae 0CALDAY available in your report ? If so try to restrict that field with variable "0DAT" and write the same code you have written for your formula variable , but instead change the variable name to "0DAT" and try if this gets the month . let me know if I'm not clear . -
SCCM 2012 R2 - Software metering Reports Parameters Value not appear to choice
Hello Every Body
I hope to get answer as soon as possible
I have SCCM 2012 R2 & SQL Server 2012 SP1, my problem is ( all software metering Reports Parameters Values Not appear so I cannot select
Note:-
( All parameters Available Value set to Get Values From a Query)Has it been over 45 days since you created the active SWM rules? Do all (most) other SWM reports
work?
all other reporting in SWM which doesn't ask for month and year working
only the problem in year & Month Parameters Values
note:-
these reports doesn't need a 45 days to work, alwasy when i install SCCM reports working only from the second day of installation -
Getting the Month value and Name from the Ranges of the Date given input.
Hi Techies,
I am developing Monthly wise report in FICO. My Inputs are Company Code, Fiscal Year and Date Range. From the Date Range I have to get the month and Generate the Report.
For Ex:
BUKRS : 1000
GJAHR : 2009
FKDAT : 01.04.2008 to 01.04.2009
From the Above Date range how can I get the individual month names or periods. As per my Knowledge I can get the month value when the date is parameter but here the date is ranges. Is any code available for this ?
Thanks in Advance
Regards,
Muralikrishna Peravali.
Edited by: muralipsharma on Aug 31, 2010 10:30 AM
Edited by: muralipsharma on Aug 31, 2010 12:57 PMDATA: lv_dat TYPE dats,
lv_day TYPE c LENGTH 2,
lv_month TYPE c LENGTH 2,
lv_year TYPE c LENGTH 4.
DATA: lv_poper TYPE t009b-poper.
DATA: lt_poper TYPE TABLE OF t009b-poper.
SELECT-OPTIONS: so_dat FOR sy-datum.
break fis-kemmer.
lv_dat = so_dat-low.
DO.
CLEAR: lv_poper.
CALL FUNCTION 'FI_PERIOD_DETERMINE'
EXPORTING
i_budat = lv_dat
IMPORTING
e_poper = lv_poper
EXCEPTIONS
fiscal_year = 1
period = 2
period_version = 3
posting_period = 4
special_period = 5
version = 6
posting_date = 7
OTHERS = 8.
APPEND lv_poper TO lt_poper.
lv_day = lv_dat+6(2).
lv_month = lv_dat+4(2).
lv_year = lv_dat(4).
lv_month = lv_month + 1.
IF lv_month LE 9.
CONCATENATE '0' lv_month INTO lv_month.
ENDIF.
CONCATENATE lv_year lv_month lv_day INTO lv_dat.
IF lv_dat GT so_dat-high.
EXIT.
ENDIF.
ENDDO.
after that you have a list of all the FI periods in internal table LT_POPER.
get the idea? -
How to accessing current row report column value in Lov Query?
Hi,
which access methods (eg. bind variables, substitutions, ...) for getting the current row report column value can be used in the "Lov Query" property of a report column?
As what I know of and what I have read on the forum there are no bind variables for the report columns. For the "Link Text" property it seems that the column values exist as substitution strings (#COLUMN_NAME#). But they don't work in the Lov Query. => And would be good because of a hard parse each time the Lov query is executed.
The following post (Re: Simulating a correlated sub query in lov
is showing a solution to use package variables for temporary storage of the referenced value, but the only problem with that solution is that if a new record is added with the "Add rows to tabular form" process the package variable still contains the value from the last queried row! Is there a way (variable, APEX package, ...) to determine if the lov query is executed for a new record so that the package can return null?
I know that I could write the package in a way that the value is immediately cleared when lov_pkg.keyval is called (one time read), but then I would have to create several variables if I'm accessing the value multiple times in the query or in another query => I think an one time read solution would be very obscurely.
Thanks for your help
Patrick
http://inside-apex.blogspot.comHi Patrick,
I agree that it's a waste to continually use Ajax to go back to the server to get the contents of a dynamic select list.
There are no bind variables for any row item - but what you do have, as per my previous post, is the value of the data entered by the user in the first row. You can pass this into your application process (using get.add("VARIABLENAME", value)), which can use it to retrieve the correct LOV in your Ajax code - this will give you a "bind variable" that your process can use.
What you could do, however, is generate hidden select lists on your page - one for each possible LOV list and replace the contents of the new row's select list with the contents of the appropriate hidden select list. This is easy to do with javascript (using innerHTML functions). Obviously, though, the usefulness of this depends on the number and size of the select lists.
Even if you don't generate them to start with, you can keep a copy of any select lists returned by Ajax in the DOM for use on new rows. So, if you have retrieved a select list, you will have a copy of it in DOM which you can then copy into the new row. If you don't have the list in DOM, use Ajax to get it, store a copy of it and copy it into the new row.
Which method you use will depend on the number/size of select lists needed. If they are few in number and/or size, I would suggest generating hidden lists. If they are large, use Ajax to get them once, store them and then retrieve them from the DOM when needed.
There is another thread here where Arie recommends going to the server every time to make sure you get the most up-to-date data for the lists. If you want to follow this advice, for this reason, use get.add("VARIABLENAME", value) to pass the value to your process. If this is not an issue, you can use one of the other methods I outlined above.
Regards
Andy -
Crystal Report Viewer 11.5 Java SDK - How to set sub report parameter value
Good day!
I have a report with 3 sub-reports in the detail section. Main report has two parameters and each sub-report has one parameter in turn. We have our own JSP to receive parameter values from the user. I am using the following code to do the parameter value setting later into the report. Parameter value setting works for main report, but not for the sub-report.
I get an Error, for the first sub-report, from the viewer saying:
The parameter 'parametername' does not allow null values
On this article: [article link|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap%28bd1lbizjptawmq==%29/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313337333233323331%7D.do]
It says to set the report name of the parameter field to the name of the sub report. On this aspect, assuming this tip/solution works, I would like to read the names of the sub-reports and their parameter names. I do not want to hard-code them into our application.
Here is my current code:
sdk.occa.report.data.Fields parameterFields = new Fields();
I have a HashMap of <parameterName, parameterValue>
Iterate through the map
report.data.ParameterField aParameterField = new ParameterField();
aParameterField.setReportName(""); //main report
report.data.Values theValues = new Values();
ParameterFieldDiscreteValue aParameterFieldDiscreteValue = new ParameterFieldDiscreteValue();
aParameterFieldDiscreteValue.setValue (aValue);
theValues.add(aParameterFieldDiscreteValue);
aParameterField.setName(parameterName)
aParameterField.setCurrentValues(theValues);
parameterFields.add(aParameterField);
viewer.setParameterFields(parameterFields);
Please look at the line:
aParameterField.setReportName(""); //main report
Here's where I would like to say
if (parameter is subreport's parameter) then setReportName(subreport name);
ThxIt was little difficult to navigate down the objects to find the sub reports and their parameters. I am attaching the code:
May be there are other ways to do the same.
public String getReportNameForParameter (String parameterName, ReportClientDocument reportClientDoc)
String result = "";
boolean found = false;
try {
SubreportController src = reportClientDoc.getSubreportController();
DataDefController ddc = reportClientDoc.getDataDefController();
IDataDefinition idd = ddc.getDataDefinition();
Fields fs = idd.getParameterFields();
Iterator fiter = fs.iterator();
while (fiter.hasNext()) {
IField ifld = (IField) fiter.next();
if (parameterName.equals(ifld.getName())) {
found = true;
//System.out.println ("\t Field Name/Description/HeadingText: " + ifld.getName() + "/" + ifld.getDescription() + "/" + ifld.getHeadingText());
if (!found) {
IStrings reportNames = src.getSubreportNames();
//System.out.println (" Sub Reports If Any ...");
if (reportNames != null) {
Iterator iter = reportNames.iterator();
while (iter.hasNext()) {
String repName = (String) iter.next();
//System.out.println ("\t Sub Report Name " + repName);
ISubreportClientDocument srcd = src.getSubreport(repName);
ddc = srcd.getDataDefController();
idd = ddc.getDataDefinition();
fs = idd.getParameterFields();
fiter = fs.iterator();
while (fiter.hasNext()) {
IField ifld = (IField) fiter.next();
if (parameterName.equals(ifld.getName())) {
result = repName;
break;
//System.out.println ("\t\t Field Name/Description/HeadingText: " + ifld.getName() + "/" + ifld.getDescription() + "/" + ifld.getHeadingText());
//System.out.println ("********************************************************** ");
catch (Exception exc) {
System.out.println ("Error/Exception while trying to find the report name for parameter [" + parameterName + "]");
System.out.println ("*******************************************************************************************");
exc.printStackTrace();
return result; -
How to get the current month value for a customer exit variable?
How to get the current month value for a customer exit variable?
And also if we have an InfoObject with date value (including date, month, year), then how to derive the month value from this date type of Char.?
Thanks!Hi Kevin,
Check here........
Re: Customer Exist for "From Current Date To Month End"
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/25d98cf6-0d01-0010-0e9b-edcd4597335a
Cal month
Regards,
Vijay. -
Column link - call java script & assign current report column value to item
Hi,
How to call java script and assing current report column value to item?
I have a button column in the report to 'delete' the selected row.
I want to first show dialog box with message 'Are you sure?'. If yes, process to delete
will be executed, else no action.
In order to fire JS, I used Column Link ->Target=URL.
Problem: The alert is showing but I don't know how to pass selected row's primary
key value to process (to delete selected row).
I have a item which can be used to store selected primary key value but don't know how to assign the value
when button pressed.
Thanks in advance
DipOk. The issue has been resolved by following way.
PAGE PROCESS: delete_request
begin
delete xyz
where id = :P8_id;
commit;
end;BUTTON URL:
javascript: DelRec(null,'CREATE', 'f?p=&APP_ID.:8:&SESSION.:delete_request:NO::P8_id:#id#');Java Script:
<script language="JavaScript1.1" type="text/javascript">
function DelRec(msg, req, url){
var confDel = msg;
if(confDel ==null){
confDel= confirm("Are you sure?");
}else{
confDel= confirm(msg);}
if (confDel== true){
redirect(url); }
</script> -
Dynamically set report field value
In my old classic VB project, I was able to set a report field value using the following simple line of code.
someReport.SomeField.SetText u201Cabcu201D
This was nice and simple, now with crystal reports .Net I do the following:
((TextObject)someReport.SectionX.ReportObjects["SomeField"]).Text = u201Cabcu201D;
Itu2019s simple enough but seems too elaborated compared to the good old VB6.
Not that is a big deal but is there a simpler way (Classic VB6 style) to set a field on a report without me having to create my own utility method to u201Csimplifyu201D things?
Thanks.Perhaps using a formula?
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class Form1
Inherits System.Windows.Forms.Form
Dim Report As New CrystalReport1()
Dim FormulaFields As FormulaFieldDefinitions
Dim FormulaField As FormulaFieldDefinition
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
FormulaFields = Report.DataDefinition.FormulaFields
FormulaField = FormulaFields.Item(0)
FormulaField.Text = "[formula text]"
CrystalReportViewer1.ReportSource = Report
End Sub
Other than that, InProc RAS, but if the solution you have is complicated, you ain't seen nothing yet
- Ludek -
How to Bring the Quarter Period and Previous Month Value for given Input
Hi to all,
I want bring Quarter Period and Previous Month value for the given Input. Plz help me on this
Example :
Input : 06.2008
Output:
Input Prev.Month Quarter 1 Quarter 2 Quarter 3
06.2008 05.2008 03.2008 12.2007 09.2008
12.2008 11.2008 09.2008 06.2008 03.2008
Is there any Standad Exit for this or we have to write coding ?
Regards,
SaranHi,
You can solve this by using Replacement path.There you have a option offsets.Here give the current period.Based on that give the number which previouse month you suppose to want.
I think this 'll help you
assign points if this helps
Regards
JT Goud
Maybe you are looking for
-
IPad2 unusable after upgrade to ios7 because of keyboard lag
I have a 5-10 second lag after typing any character on my iPad after upgrading to ios7. I've reset it. I've restored it. I've turned off iCloud for data and documents. None of this has solved the problem. Any other ideas? It's impossible to use for a
-
OIM encryption/decryption error
I am building a new environment by importing resources, lookup definitions, etc from an existing environment via deployment manager. Both the environments are same in s/w and h/w config: OIM: 9.1.0.2 BP18 Weblogic: 10.3.2 Windows Server 2008 R2 64 bi
-
How to find paragraphs by using paragraph style name?
How to get the Paragraph style UIDRef from paragraph style name. To find the paragraphs using Paragraph style i want UIDRef of paragraph style.Can some one help me..,
-
DYNPRO_SEND_IN_BACKGROUND in RFC
Hi, I am getting error "DYNPRO_SEND_IN_BACKGROUND" when i am trying to process RFC and My RFC has a submit statement to another program which has i has a "BDC SESSION" for VL02N. I am invoking my RFC from Mercator. FUNCTION ysd_rfc
-
Long Running SQL and ORDS Spawns Multiple Database Sessions
Hi all. We have a strange situation when accessing a long running SQL Report (a single APEX Page). The SQL takes about 15 mins to run but when I monitor what database sessions are spawned by the APEX Listener, I see multiple sessions all executing th