Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Report Writer - Using Formula in a set

john_lee7
Participant
0 Kudos

Hi I am trying to learn Report Writer (GR31) and one of the things I want to do is put a formula in a set, but I am having hard time getting it to work.

I want to put a formula like this...

if account is 5000000 then put do one thing else put 1

IF '&ZACCT1' = 500000 THEN '001' * 'A' ELSE 1

but I am not getting any value back.

Anyone have any idea what I am doing wrong.

Thanks in advance for any help/suggestions.

John

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi John Lee,

The logic that you would want , can be implemented through a column set. That is, as per your logic written in the set, your column values differ.

First in your set, keep your account number in the first set line. ie. 5000000.

Then you enter the following formula in the second line of a set defined for a report column:

IF u2018001u2019 > 5000000 THEN u2018001u2019 ELSE 0

If the value in the first column (set line 001) is greater than 5000000, then this value displays in the second column; if the value in the first column is less than 1000, the value 0 displays in the second column.

Revert if you need any additional help.

Regards,

Subin John

8 REPLIES 8

Former Member
0 Kudos

Hi John Lee,

The logic that you would want , can be implemented through a column set. That is, as per your logic written in the set, your column values differ.

First in your set, keep your account number in the first set line. ie. 5000000.

Then you enter the following formula in the second line of a set defined for a report column:

IF u2018001u2019 > 5000000 THEN u2018001u2019 ELSE 0

If the value in the first column (set line 001) is greater than 5000000, then this value displays in the second column; if the value in the first column is less than 1000, the value 0 displays in the second column.

Revert if you need any additional help.

Regards,

Subin John

0 Kudos

Hi,

Please refer the links below.

It might be helpful.

[Link1|http://help.sap.com/saphelp_40b/helpdata/fr/5b/d22c6243c611d182b30000e829fbfe/content.htm]

[Link2|http://help.sap.com/saphelp_47x200/HELPDATA/EN/5b/d22db643c611d182b30000e829fbfe/frameset.htm]

Thanks,

Harini

0 Kudos

Thanks for suggestion.

Your suggestion isn't really what I was think, but I do have a question for you.

How would you populate account no in key figure field of set?

What value/variable do you use in the formula to populate account no?

Thanks again.

John

0 Kudos

Hi John Lee,

I did not get exactly what you require.

Following may help you or otherwise please explain to me exactly what do you require. I will try to help you.

1. There are 4 ways by which you can create sets.

a) Basic b) Single c) Multi d) Key figure set.

I am assuming that you are using a Key figure set. Because, in all other sets , you cannot enter a Key figure.

2. Key figure sets are created for columns in Report Writer reports.

Hence in your report writer report , first create a row set which will bring your account numbers. (Either basic, single or Multi)

Then create a Key figure set in which you put a variable which will have your logic using IF else as I had explained earliar.

Regards,

Subin John

0 Kudos

Thanks.

I did all you mentioned, but what I want to know is how to set formula in Key Figure Set column.

Let say, I want to create formula in column 2 where if account no is 500000 then column 1 * 10

if account no is 60000 then column 1 * 20

else column1.

How would you set the formula?

I can do 'THEN' statement, but I cannot make IF statement working 'IF ... = 500000

Have you done this?

John

0 Kudos

Hey Subin John,

Do you have suggestion to my question above?

How do I create If statement to say If account number = 5000 then do calc #1 else if account no = 60000 do calc #2 Else do calc #3 in formula.

thanks.

John

Edited by: John Lee on Nov 13, 2009 3:06 PM

0 Kudos

Hi John,

Try creating a "Formula Variable" (T Code GS11) and use a user defined exits (''#U001') (you must create one) in the formula area.

Regards,

Subin John

0 Kudos

Thanks for your answer... but I am not sure how I need to do this...

If you have time, can you explain little more detail as to how I need to accomplish this.

thanks again.

john