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: 

SQ01: add more than 3 conditions to calculation of local field?

Former Member
0 Kudos

Hi,

I'm creating a query report in transaction SQ01, and I have a couple of local fields to include. One of these fields is to be a text field that groups employees according to their age.

There are 5 groups in total: <25y, 25-34y, 35-44y, 45-54y and 55-64y.

Some other local fields have even more possible results.

However, in the complex calculation screen, it seems I can only define 3 conditions + 1 otherwise.

The + and - buttons only increase the amount of input lines for a certain selected condition or formula, but I don't know how to add additional conditions, if this is actually possible. Although when I look at the generated code, there's no reason why it shouldn't be...

Does anyone know the solution to this? And if it's not possible, what would be a possible workaround? I can't really add the field to the infoset, because it's value is calculated from the date entered in the selection-screen. Unless I can use LDB fields in an infoset somehow?

Thanks!!

1 ACCEPTED SOLUTION

Former Member

how about doing this calculation in infoset itself (SQ02)? i have done few complex calculation in SQ02 by using local variables/fields. in fact to me...SQ01 is just to design your output i.e., representation of data that you have already prepared in SQ02.

7 REPLIES 7

Former Member

how about doing this calculation in infoset itself (SQ02)? i have done few complex calculation in SQ02 by using local variables/fields. in fact to me...SQ01 is just to design your output i.e., representation of data that you have already prepared in SQ02.

0 Kudos

Well, no, you can also add local fields to the query that are derived from queried data.

For me, it makes little sense to add such a field to the infoset.

I finally found it, by the way. In the popup of the complex calculations, when you set the cursor on 'Condition' or 'Formula' (the text itself, not the textbox next to it!) and then click the '+', a new condition is added.

You really have to know this, the SAP documentation never mentions this functionality of the +/- buttons!! I lost 2 days on this, but I'm very happy that I can continue now

0 Kudos

great!

Anna_Strokova
Explorer

I know this is a 10 year old question, but in case somebody - like me - is looking for an answer:

In order to add additional condition in the query local field it is important to place the cursor not on the line, but on the word "Condition". Cheers. Anna

hi ANNA

This is very strange, your advice is absolutely correct

thank you very much.

TNX

0 Kudos

Glad it helps. 🙂 Spent an hour yesterday trying to get it working.

0 Kudos

Thank you. I recommend also posting both a question and an answer, with more details, screenshots to bring even more clarification; you may even copy/paste the text of the author if it's relevant to you -- I guess there's no copyright infringement 😄

NB: it's what I'm starting to do within the forum (provided that there's no good question/answer yet) --idea promoted by Stack Overflow.