cancel
Showing results for 
Search instead for 
Did you mean: 

Using a Variable in a Report Painter Formula

Former Member
0 Kudos
710

Hi all,

I am creating a PCA report using Report Painter ( GRR1, i.e. not a drill-down report Form). I need to create a formula in a column, that divides the year-to-date $ amount by the current Period Number, to give an average $ per period.

I'm trying to use the Period variable 'ZPRT' in my formula ( e.g. X001 / 'ZPRT' ), but I get the following error: Incorrect formula component = 'ZPRT'

I thought maybe that the value in 'ZPRT' is not a number so it can't be used in such a formula, so I tried using it a different way, as an experiment, just to see if it can be used at all, in any formula. For example, I tried IF 'ZPRT' = "6" THEN 100 ELSE 0. I still get exactly the same error message.

SAP Help in the formula box says the following:

Formula syntax in the Report Writer

    A formula consists of operands, operators, numbers, and parentheses.


    o   The following operands are possible:

        -   Row numbers (for example, Y001 for row 001)

        -   Column numbers (for example, X001 for column 001)

        -   Cells (for example, Z001 for a specific total in a report)

        -   Value variables (for example, '1PERIK' for the value variable
            1PERIK)

So, it looks like I should be able to use my variable in the format 'ZPRT'. I also tried &ZPRT and '&ZPRT', but I still get the same error. So, here are my questions:

1. Can I use a Variable in a column formula and, if so, what is the syntax?

2. Is there another way to achieve the result I need - i.e. $amt / No. of Periods?

We are on ECC6

Many thanks.

View Entire Topic
Former Member
0 Kudos

Sorry, I believe I have found the answer

AnnaConsultant
Explorer
0 Kudos
It would be great if you or someone else can give me the solution. I have the same problem but dont know how to fix it. Thanks in advance!
MasterMaster16
Explorer
Just Creat a colum 'total' and another colum 'hide period' using a option of 'Set' or a 'variable' to determine the period acording to select screen of the report. Also you have to creat a colum '$ per period' for this using 'Formula' em divid 'total' / 'hide period' . After that hide the coluns: 'total' and 'hide period' therefore in your report just will appears the principal column