Formula Variables in Report Painter- Syntac error in formula
Dear Experts,
I'm creating the report where I need to calculate annualized P&L. The formula is as follows : (P&L account/Period(variable ))*12
I need to capture the From_period, which is entered by the user on the selection screen when running the report and use it as a variable in the formula above. Example: If User insert From Period 3, then the formula should be *P&L accoun / 3 * 12*
I have tried so many different way but nothing seems to work. one of the ways i tried was:
In the general selection Im using set variable 6P-S-PERIOVB.CCSS for period which consists of variable V_PERIO and B_PERIO.
So Im trying to create a folowing formula:
IF 1 >= u2018PER_FRu2019 AND 1 <= u2018PER_TOu2019 THEN 1 ELSE 16
IF 2 >= u2018PER_FRu2019 AND 2 <= u2018PER_TOu2019 THEN 1 ELSE 16
Unfortunately I keep getting Syntac error in formula. Please help me I'm really desperate to solve this issue after 5 days of unlucky research.
Thank you in advance
Regards
Ernesta
so, I would use parameters.....
P_fr_MO(2) TYPE N DEFAULT '01',
p_fr_yr(4) type n default '2011'.
Then, to set my range, i would do something like....
data: lv_to_mon(2) type n,
lv_to_yr(4) type n.
if p_fr_mo eq '01'.
lv_to_yr = p_fr_yr. "12th month, same year...
else.
lv_to_yr = p_fr_yr + 1. "any other month puts us into next year.
endif.
case p_fr_mo.
when '01'.
lv_to_mon = 12. "always for 12 month period...
when others.
lv_to_mon = p_fo_no - 1. '''example 10/2010 to 09/2011.
endcase.
then concatenate the from and to variables into what format is needed to read the data...
on the other hand, if the user gives us from and to, we have a different problem....one then has to calculate what part of a year they have and create a factor for multiplying any data values....
for instance if user says Jan (01) to (03) March, then I know that to month - from month + 1 is the number of months I have....
then 12 / that number is the factor to multiply the results by....
example...
data : factor(5) type p decimals 2
months(3) type n.
if p_to < p_from. "adjust if I cross a year boundary....Oct to Jan becomes 13 - 10 + 1 or 4 months.
p_to = p_to + 12.
endif.
months = p_to - p_from + 1.
factor = 12 / months. " factor 12 /4 months = 3 times the values obtained = 1 year.
something like this....hope this is helpful to you.
Edited by: DaveL on Oct 18, 2011 6:24 PM
Similar Messages
-
Formula Variables for Report Painter- Syntac error in formula, Please Help!
Dear Experts,
I'm creating the report where I need to calculate annualized P&L. The formula is as follows : (P&L account/Period(variable ))12*
I need to capture the From_period, which is entered by the user on the selection screen when running the report and use it as a variable in the formula above. Example: If User insert From Period 3, then the formula should be *P&L accoun / 3 * 12*
I have tried so many different way but nothing seems to work. one of the ways i tried was:
In the general selection Im using set variable 6P-S-PERIOVB.CCSS for period which consists of variable V_PERIO and B_PERIO.
So Im trying to create a folowing formula:
IF 1 >= u2018PER_FRu2019 AND 1 <= u2018PER_TOu2019 THEN 1 ELSE 16
IF 2 >= u2018PER_FRu2019 AND 2 <= u2018PER_TOu2019 THEN 1 ELSE 16
Unfortunately I keep getting Syntac error in formula. Please help me I'm really desperate to solve this issue after 5 days of unlucky research.
Thank you in advance
Regards
ErnestaThank you all for your help. The issue was that the variable was assigned to the different table as the library. After I changed it, it worked fine.
Regards
Ernesta -
How to use Value Variable in Report Painter Column defined as Formula
Hi Gurus,
In report painter, how can I add one field (exchange rate) in selection screen, so that user can provide the exchange rate to be used, then execute the report, the exchange rate will used to multiple local currency amount.
The reason for this is we want use provided exchange rate to convert the amount from once currency to the other currency.
Alternatively I am studying the functionality of "Value Variable" and found that I can perform the task from this. I have created the value variable but when I am using the variable in Report Painter columns as "&ZVALVAR", system is giving me error. I read the help and it states that use the variable with "&" and do it as it is mentioned.
Can anybody suggest what I need to do to make it workable.
ThanksI did try using the presentation variable, but that does not work too. I am setting session variable in the dashboard prompt (select 'request variable'). When I use presentation variable, it hard codes the value of the variable name.
sql is
select date from work_order where facility = @{p_facility}
the physical log sql is
select date from work_order where facility = 'p_facility' -
Formula Variables for Report Painter
Dear Experts,
I have a Report Painter Report which displays month wise report in columns and now i want the report to be displayed based on the period mentioned in selection screen.
Can someone please advice how do I do the same with use of Formula Variables.
Regards,
RahulGo to the selection screen and press F1 and go to technical details to name the name of the screen field. example: 8A-VON (period from) and 8A-BIS (period to).
In your report designer, you enter the those variable for the "period" characteristic and tick the variable ON/OFF checkbox. -
Formula variable in Report painter
Hi
Normally when ever you create a formula varibale for year or period system will
check the period and year from current system year and period(S001 and S002)
I am looking for a solution where i can create variable which is independent of
current year and period.
Lets Say if i give 2006 and period 7(of 2006)system has to give results
in the predefined columns like 2006 of period 7 and 2005 of period 7 and 2004 of period 7 and 2003 of period 7(I have 4 columns)
Can any one tell me how to create this using the formual variable,which will allow
me to select in the input screen any period and year and display the results as per my own requirement.
Thanks
LilyHi Ramachandra
Sorry for late reply
As per your reply,i am not still clear,can i put in more clear my question again
Selection screen
Year-2006
Period-6
I have 5 columns ,can you specify me the formula for 5 columns in your reply.
Column1- (it has to display 2nd quarter of 2006)
Column2-(it has to display 1nd quarter of 2006)
Column3-(it has to display 4nd quarter of 2005)
Column4-(it has to display 3nd quarter of 2005)
Column5-(it has to display 2nd quarter of 2005)
Pls specify me FYEAR and Period from and period to which formula variable i need
to use,how many variables i need to create for this purpose.
Keep in view that selction screen i can give 2006,or 2005 or 2007,but system has to display 5 quarters back data in in 5 columns.
This is urgent,can you pls help.
Thanks
Lily -
Formula line in Report painter
Hello,
Can I use 'IF' phrase in Formula column in Report painter ? If so what's the right Syntax .
Thank you,
Ran.Hi Ran,
Glad to hear from you too!
Did you put '.' in the formula at the end of the message? You shouldn't in this kind of statement, so the expression should be:
IF X005 > 0 THEN X004 + X003 + X005 ELSE X004 + X003
Regards,
Eli
P.S. I tried it, just in case, and it works. -
Hi,
I have a customized variable in report painter which pulls data from standard table, profit centre (GLPCT). The data is included dummy profit centre.
How can block or should not allow dummy profit centre data to flow to the report?
Please advice.Hi,
Easier option is to create a profit center group excluding the dummy profit center and assign it in the report painter instead of the variable.
Other option is at the time of executing the report, exclude the dummy profit center with out making any changes in the report.
Regards
Sudhakar Reddy -
GR224 Report Painter: Internal error when converting a report
Hi
Using FAGL_RMIGR transaction I've trasferred report 8A3-0010 in a
custom library ZXX. The migration happened without error messages. I've
tryed then to run report FL3-0010 by GRR3 transaction but error message
GR224 appears
Report Painter: Internal error when converting a report
Message no. GR224
Diagnosis
During the internal compilation of a Report Painter report to a
Report Writer report, sets are generated. This caused an error in the
subprogramm GENERATE_ROW_MULTI. The return code was 7.
System Response
The report could not be generated and/or saved.
Procedure
Please call the SAP Hotline and send them this longtext as well as
detailed information describing the circumstances in which this
error
occured.
Please could you help me?
Thanks in advance
Giovanna ScamardellaHI,
SAPNET notes search with GR 224 brings some old (but maybe helpful) notes: 37611, 193392,137231, pls. check.
Best regards, Christian -
How to create characterstic formula variable in reporting
how to create characterstic formula variable in reporting
tell me any one in steps
thanksHI
Query Designer -- Select your Char -- Create Char Variable -- Processing type should be Replacment path =In the Replace Variable with drop down box, choose Attribute Value. In the Attribute drop down, select Characteristic Reference
http://help.sap.com/saphelp_nw70/helpdata/EN/03/6ba03cc24efd1de10000000a114084/frameset.htm
Hope it helps -
Report painter- problem in creating formula variable- ps
Hi Experts,
i have copied report 6P3 - 6PP1-001 Act/Com/Total/Plan from library in report painter.
our requirement is we want two user fields from cj20n in this report. they are prps-usr04
and prps-usr05.
i have added these in header as special text variable as they were ALREADY available at header under
MASTER DATA FOR PROJECTS / WBS ELEMENT IN REPORT-WRITER.
now my requirement is to add new columns. for that i required these two fields in formula.
but as they are not present in formula component i am not able to get it.
what should i do to enter these fields in component list in formula?
PLEASE GUIDE ME?
AMOLActRunningBal is a running total calculated in crystal or database field? If it is a database field then you can try this
if {command.CR-Amount} <>0 then
{command.CR-Amount}
else
previuous()+previous({command.Dr-Amount})
If it is a running total you cannot apply previous function on it.
Regards,
Raghavendra -
Creating variables in Report Painter
Hi ...
I would like to know ... how do I create variable ? I know it is via T CODE GS11, but when run tht, in the next screen it pops up for variable ? What variable do I need to enter ? is this predelivered Eg : CE-PK, or can we create one ? Please advise
Also, I would like to I have a requirement for a report whereby the format is like this .....
SALES CURR MONTH (06/2006) LAST YEAR
- Sales IT
- Sales 1
- Sales 2
COGS
- cogs 1
- cogs 2
- cogs 3
COS
- cos 1
- cos 2
- cos 3
GROSS PROFIT
Whereby, SALES = sales it + sales 1 + sales 2, COGS = cogs 1+cogs 2 + cogs 3, COS = cos 1+ cos 2+ cos 3. also GROSS PROFIT = SALES + COGS + COS
The abpve report is inclusive of Cost Centre and Profit Centre, how acn I utilize the libraray in Report Pianter to create such report, is this possible in Report Painter whereby including Cost center and Profit Centre in one single report
Pls assist me
NathanWhen you create your variable first enter the variable name. Second enter the reporting "table" to use. Third enter the "field'. Press enter. Next enter a default value for your field. Save you variable. It is now ready to use in your report painter.
Using the PCA reporting tables gives you the profit center but not the cost center. You can only use one reporting table per report. you will need a cctr report for that.
First create your own libray from GLPCT. Next create your report using your new library. The report painter can do the calculations that you have shown.
You create a formula in the row or column to calculate your sub totals.
pls assign points if helpful as a way to say thanks. -
New variable in Report Painter - GRR2
Hi,
Can i create a variable with a value of table PROJ, the value is in Z field of table PROJ?
I need to create a formula in report painter to take the field value PROJ table and multiply by the actual costs.
Many thanks.
Regards.Hi,
Easier option is to create a profit center group excluding the dummy profit center and assign it in the report painter instead of the variable.
Other option is at the time of executing the report, exclude the dummy profit center with out making any changes in the report.
Regards
Sudhakar Reddy -
FI-SL How to define formula components ID(report painter)
Hi Experts
please teach me how to define formula components ID.(it is related to report painter)
I cannot see by GS13(variable)
Regards.I sloved by myself. it automatically made when I add the row or culumn.
but after delete the row or culumn. it may have a problem.... I do not know.
thanks. -
Adding variable in Report painter
Hi Gurus,
I am creating a new report using Report painter. Though, it is working fine, I want to bring one of the field for selection. How to add variable ? I created a variable but I am trying to insert this variable in the report painter... I am unable to find any way.
Awaiting your help.
thanks in advance.Hi,
Go to Global Parameters Definitaion in report painter, variable will be used only along with the field, just in global paramerters enter your desired field and click in next column, system will show you a pop up select your variable for that field...
now its just done run the report and test it!
If you still not make it refer to standard report of such kind, you will surely get it....
Regards,
Sayujya -
When executing a Cost Centre Z developed Report painter report, The values appearing blank on the face of the report but when drilling down to line item level i can see the value exists. This is not a access/security/authorization error as no crosses on the face of the report.
Please advice
M Khanbut the total lines are not adding to zero. in a another report painter report one of the lines value is not equal to line item total! it is quite a strange behaviour that i have never come accross! any clues?
Maybe you are looking for
-
To create a PAL DVD in DVD Studio Pro...
I simply took my NTSC Uncompressed Quicktime File, put it into Compressor, and when I converted the file to MPEG 2 I changed the Video Format to PAL in the Inspector Settings. I didn't make any changes to the AC3 settings... When the m2v and AC3 file
-
In my JSP page i am using Callable Statements for storing the data. The stored procedure returns a value after inserting the data. I want to know, how to access the output parameter passed by the stored procudure in the JSP page
-
Escaping special characters in RAW/BLOB
Hi! I have a BLOB column that needs to be exported into a CSV Textfile. Sounds a bit scary but works fine when you escape the critical bytes. I need to do the following replacement: 5C -> 5C 5C ( = \ ) 22 -> 5C 22 ( = " ) 00 -> 5C 30 ( = ?? ) 0A -> 5
-
Hi everyone, nice forum New to it. Allright, to the subject. I recently bought a zen v plus 8gb. I noticed that sometimes while listening to music on it, it sometimes just stops playing. Like its paused. But on screen it still says its playing (the p
-
Concurrent sessions on a Mac running Leopard
Hi Is it possible to have two people working on a same machine one log in locally and the other remotely? Like you will do in a windows server. Regards