Using a formula variable to return a date
Hi everyone
Please can you help.
I have created a two formula variables, one to return the first day of the period entered and one to return the last day of the period. I return these to the query through a calculated key figure.
The code I have written to fill the date is working but obviously returns the date as a number. I have tried to use the function calculate as date however the result is just an 'X'. I then tried concatenating the result I want to return to the query but then I get a RAISE_EXCEPTION short dump.
Has anyone else tried to do this before?
Regards
Gail
Hi Gopal
I am using customer exits to fill the variable using the standard FM's FIRST_DAY_IN_PERIOD_GET and LAST_DAY_IN_PERIOD_GET. I do get the correct dates however because I am returning the value to a key figure it is displaying the value as 20,080,201. What I then tried to do was use the concatenate command to give me the date in the format that I require which is 01.02.2008 and I then got the short dump.
You have mentioned using a customer exit variable based on the date. That's exactly what I want to do however what do I return the value to in the query?
Regards
Gail
Similar Messages
-
How to use standard Search Input Help (return 2 data code and desc) ?
Hi,
Please advise how to use standard Input Help provided by SAP and return 2 data (code and description) ? because the standard Input Help only return the code only ?
Thank You and Best Regards
Fernand>
Saket Abhyankar wrote:
> Hi,
>
> I think you need to go for 'Search Help Exit' or OVS.
>
> Regards,
>
> Saket.
That is not true that this is the only way. The standard Data Dictory based search help can return more than one value as long as there are multiple exporting values defined in the search help, the search help is attached to a Data Dictionary Structure, and this same data dictionary structure is used as the source of the context node. You can read more about this in the online help:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/9f724642314aabe10000000a42189b/frameset.htm
The Note section under Integration:
If an input help structure is stored in a field in the ABAP Dictionary, and if you want to use the field mapping of search help parameters stored in the ABAP Dictionary as the field name for the structure for your Web Dynpro input help, then map your context nodes to this structure. This ensures that all components of the structure are available dynamically at runtime as attributes of the node.
If the context node is not mapped to the structure, the data element's input help can be used if there is one. -
Is it possible to use charecterestic used in formula variable
Got a boolean logic in a formula of the structure in BEx, i could create a formula variable for date , it works .However, i have to bring payment method into the logic ,( e.g.. if the payment method is 'C'-weekly then late payment logic is different then if it is not weekly) , Any idea how to achieve this in BEx.
You could create a key figure that always displays a fixed value example 1.
You then restrict this individual key figure to payment method C.
The key figure is now only 1 for payment method C.
In your calculation you now say: if key figure = 1 then ... else ...
If statements are not directly possible, you can only do if statemements indirectly by a similar formula:
(key figure = 1) * value
if key figure is one -> result of (key figure = 1) is 1
1 multiplied by value = value
if key figure is not one -> result of (key figure = 1) is 0
0 multiplied by value = 0
You now have an indirect if clause.
Please assign points if this solved your problem,
Best Regards,
Filip -
Hi Experts,
In my requirement, we should not do any changes in the BW system. I need to create a Bex query on the existing Info-set, KPI need to be calculated from the date objects.
e.g
Delivery date - Order date - which has been done with the formula variable in the bex, I'm getting exact value. the problem is if I'm not dragging the Delivery date or order date in the Bex ROW, its not populating value. I'm expecting consolidated value for a month.
It has an impact in the BOBJ system. since i'm not getting consolidated value, the number of data which is coming in BOBJ system is very huge. Hence doing calculating in the bobj will affect performance.
Regards
VijaykumarHi,
i think your calculating the value form Delivery date - Order date.
if you drag the Delivery date - Order date object to rows it will give values.
Thanks,
Phani. -
Using an ssis variable object as a data source in a foreach loop container
hi we run 2012 std. I have an ssis var of type object that is hydrated from a dynamic query in an execute sql task. I can count on one thing in this object and that is that ID will always be the first "col" on each "row".
Otherwise, resultset can contain a variety of things based on params passed to this sub pkg.
I'd like to introduce a for each loop on this object and tap into index 0, ie the id column.
The first question is "will I be able to parse this object's id in a for each component?".
In the for each loop container properties, I c an item enumerator, ado enumerator, ado.net schema rowset and variable enumerator as enumerator choices. Which do I want if the answer to the 1st question is yes?hoping 2 avoid a data flow. I wonder if what u r saying is that I cannot use an felc to do this. Or if u r showing one of many alternatives.
Sorry, bad title. I just changed that.
I just tried foreach from variable enumerator and aborted with a message that said my variable "coll" doesn't have an enumerator. Going 2 try some of the other choices.
I just tried ado enumerator and from what I can c it isn't actually iterating thru my resultset even once.
I just tried a foreach item enumerator giving "column 0" a data type that matches my ID but from what I can tell the component isn't iterating thru my collection.
ado.net schema rowset doesn't look inviting at all in that it looks like it wants to go back to the db. Not what I had in mind having already gotten this resultset into memory.
according to this article u r supposed to be able to do this using ado enumerator
social.technet.microsoft.com slash wiki slash articles slash sis-looping-over-object-variables-with-as-ado-enumeration-in-foreach-loop-container.aspx -
Aggregrating Results of Formula Variable
Hello All,
I have created a key figure using a formula variable to subtract 2 dates in BEx 3.5 front end. The formula works great as long as I have the 2 dates in my drilldown...if I don't, I get an x as the result. I want to show the average of this formula on a monthly basis without showing the details of the dates.
Any Ideas??
Thanks!!
Tina.Hi Brock,
Its possible, but I haven't tried as requirements didn't imply.
More simpler idea is why don't you use a flat file loading through the IP to Info providers?
Or even more better option is why don't you adapt to Virtual Info providers?
For your suggested custom table using custom transaction, we can surely make it. Its possible in SE93. Try this transaction code. It must definitely help.
Thanks,
Arun Bala G
Edited by: Arun Bala G on Jan 11, 2010 2:16 PM -
Formula variable using date char - unable to use conditions
Hello Experts,
I am sure I am making a silly mistake here - but after spending lot of time I am unable to rectify this - please help if you can:
I basically want the report to show only latest employee actions for a selected period (usually month).
1. I am using formula variable that is based on 0CALDAY and defined as number.
2. A calculated keyfigure uses this formula variable. Both calculated keyfigure and CALDAY char are included in the report / navigation.
3. There is a condition defined using calculated keyfigure. No matter what logic I use, I just cannot use calculated keyfigure to filter records on the report. My original idea was to use Top N - 1 with char combination as 'Employee' to get me the latest employee records for each employee.
Can anyone help spot where I am going wrong?
Thanks.I haven't looked at that, but as a first guess idea- why not use the picker to get a date, then save it as a number of seconds from a given date?
See:
dateWithTimeIntervalSince1970:
Creates and returns an NSDate object set to the given number of seconds from the first instant of 1 January 1970, GMT.
+ (id)dateWithTimeIntervalSince1970:(NSTimeInterval)seconds
Or you could store it as a string, but I think the number would be easier. -
Formula variable for date in report
Hi All,
I have to display the last date value of a particular date in the report.
For a better understanding,
I have Customer, Equipment, Service date, Amount
In the report, I have to display
Customer, Equipment, Last Service date, Last Service Amount.
I have created a formula variable (Formula variable for Service date) for Service date with Replacement path.
Replace Variable with Infoobject, Replace with Key, Dimension dates.
And in Key figures, I have created a formula (Last Service date) with Last value in the Aggregation using the "Formula variable for Service date".
The Last Service date is displayed as 'X' in the report since the Service date is not in the row. I cannot have the service date in the row either (not even by hiding the display).
Kindly tell me how to rectify this problem.
Thanks and Regards
Adhira Anand.The X is appearing because, with the drill downs you have added, you have more than 1 date value to choose from when you attempt to aggregate.
Have you tried using APD instead of exception aggregation?
Have you built the exception aggregation calculated key figure globally or just locally (i.e. as a structure element)? It must be built globally to work properly. -
Is it possible to run Go URL SQL and return raw data using Java?
Hi All,
I just got GO URL SQL working in HTML, when i type the following URL on to the address bar.
https://odsau.oraclecorp.com/analytics/saw.dll?Go&SQL=select+"MFG Serial Number"."Job Name","MFG Serial Number".Item+from+"Supply Chain Management"
It prints out a table with all the data that query from the database in a HTML page. However, I want to be able to manipulate these data in a JAVA script.
Is there a similar function i can use in Java script and return raw data so i can store them into a variable for data manipulation?
Or is there a work around that someone has already done ?
Thanks
John LauYou can excute SQL statemetns throught JDBC, but that doesn't have a facility to read those statements from a file. You'd have to write code to read the file and create and execute statements through JDBC. That should be pretty straightforward though.
It's conceivable that there's a third party library out there that does it, if you know what to look for.
If you're not familiar with JDBC, check out http://java.sun.com/developer/onlineTraining/Database/JDBC20Intro/ -
Formula variable using Replacement path not working
Dear All,
I am using a query to calculate YTD values in the report. I am using a formula variable to calculate the number of months. Formula is
Month To - Month From+1
When I am giving the range from 001 to 006 for period in th evariable screen,
I am gettung Month To as 6 and Month From as 6 with total no . of months as 1.
I think Month From is not being caculated properly. I created another formul variable using Replacement path, for characteristic Posting period, replace with a Key and dimension ID as number with out any offset.
Still not working.
Any suggestions.
Thanks and Regards,
Srini
Edited by: Srinivas on Apr 24, 2008 11:13 AMHello,
I have seen this document already. It is slightly different from what I am trying to do here than what the post shows. How ever, I did everything right, atleast seems to be and don´t know why I am not getting the From value from the posting period selected. To value variable is coming right.
Any more sugegstions.?
Thanks and Regards,
Srini -
Using Formula variable in a key figure formula
Hi Expert,
Can anyone tell me how to use a formula variable to pass the fiscal year variable value (with offset values define in different columns) to the be used in the formula (if statements)?
Currently, I create a formula variable using replacement path from the fiscal year reference object and key but it's not pull the correct value. I'm not sure what's the difference between the different objects i.e. key, external char key value, attribute value etc.
Please give me some lights.
Thanks!Hi Janice,
From Standard SAP Help
http://help.sap.com/saphelp_nw70/helpdata/EN/43/565cd22fc95f6ce10000000a1553f6/content.htm
Don't want to sound rude, but please search the Forum and SAP Hel before posting a thread, it helps everyone.
Thanks
CK -
Date Difference between to date formula variable
Hi Expert,
I have create two formula variable one for Document Date and another one for Goods reciept date
and through formula variable I am subtracting these two formula variable and getting the no. of days between
document date and GR date.
This Shows me the correct value for one document date because i am filtering my query according to document
date,
while i am giving the date range for document date is shows me incorrect result. bucause document date formula
variable contains only one date.
Eg. i am giving the document date range like 01.02.2010 - 28.02.2010.
In document date formula variable it contains only 01.02..2010 and GR date formula variable it contain correct
value, thats why the date difference is incorrect because those PO which has PO date like 12.02.2010 for that Doc
formula variable bring the same date like 01.02.2010.
Please tell me the solution
Thanks and Regards
Lalit KumarHi Expert,
Actually i have created two formula variable on for PO date and another for GR date
and i've restrict the query through PO date.
while i am taking the single PO date in Selection parameter it showing me correct difference
eg: Selection Parameter for PO: 01.01.2010
But while i am taking the date interval for PO date
eg: 01.01.2010-30.01.2010
PO No: XXXXX123 , Doc date: 01.01.2010 GR date: 7.01.2010 then date difference is : 6
PO No: XXXXX432, Doc date: 03.01.2010 GR date: 8.01.2010 then date difference is : 7 but it is 5
Thanks and Regards
Lalit Kumar -
How to create formula variable on system date.
i want to calculate inventory age as on today. i have create formula variable on inventory creation date. i want to create <b>formula variable on system date.</b>
simply create a formula variable and set the processing to "by user exit"
in the user exit assign sy-datum to the variable -
Use Formula variable in planning function
Hello,
I would like to use a formula variable in a planning function.
The problem is that when I execute this function all keyfigures values are set to 0 so the FOX is not executed.
The idea is to have something like
= VARV(FORMULAVARIABLE).
How could this be achieved using FOX ?
Or how using an exit function could I call this FORMULAVARIABLE which is not used in the query ?
Thanks,
MatthieuHello Matthieu,
Please search the forum before posting:
http://forums.sdn.sap.com/click.jspa?searchID=70350665&messageID=9814615
Regards,
Marc
SAP Techology RIG
PS: You closed the thread so I have to add some details here. The FOX runtime is hardcoded to 0RSPLS_FORMULA. Therefore, 0RSPLS_FORMULA cannot be copied to a custom planning function type as you suggest.
Edited by: Marc Bernard on Feb 23, 2011 3:36 PM -
Formula variable not displayed in proper format
Hai,
I used a keyfigure formula variable, that gets current date, in a query (In columns, key figure structure to calculate no. of days). The no. of days are calculated peoperly and everything is just perfect.
But after executing the query, when I display text element=> variables, the system is displaying the variable as 20,060,803 as opposed to date format like 8/3/2006.
Question: Is it how the date formula variable is displayed or there is a system error?
I remember seeing it in date format.
Can somebody comment on this or suggest a solution.
I couldn't find notes on this too!In the restricted key figure formula definition, use the Data function "Process Value as Date DATE" and enclose your restricted key figure calculation inside the date parenthesis.
I have another related problem. I am trying to use dates to calculate 30 days before a (date formula variable), 60 days after, etc. Some of the dates are calculating correctly, but some are just returning an X. All appear to be extracting with the same format.
Anyone have a similar problem?
Maybe you are looking for
-
Most of my music is not in iTunes! How do I get it back?
10June2013 I uploaded many music CDs years ago. I kept servaal ipods full of music. I noticed recently that almost all my music is missing from the Itunes music library. I update Itunes Match several times a week, I hope to God that my music in in
-
Can no longer see font display in Illustrator CS2
I am still in CS2. It used to be that I could see a little "thumbnail" preview of the fonts when I would have a text selection and would be scrolling through my font list in order to decide what font I would use. Now all I can see is the name of the
-
Shoud the fire vault and fire wall be turned on iam a new imac user
should the fire vault and fire wall be turned on. iam new to apple this is my first i mac
-
6500s missing Module Information
Running LMS 3.2 on a Windows 2003 box. I've noticed in trying to run a report on various module types that the 6500s are missing descriptive module information. For example, the below is a copy of the Module information section on the Detailed Device
-
21 September, 2014, from India. MD513AE/A iPad Wi-Fi-16GB White - Model A 1458 I have purchase this from Dubai, UAE, some 2 years back. I am NOT able to switch it on; when connected to power supply, the battery icon comes in but no signs of charging