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: 

Formula calulation in SQ01 in Queries areas

Former Member
0 Kudos
740

Hi Gurus

There is a field VBGEL which is Ref No , I want to modify in SQ01.

The name of VBGEL in short fields is REF .I have created a display field ACTUAL_PR

which stores the qty * st_price.

I wrote a formula in SQ01 by going to Edit- changes

Short name = ACTUAL_PR

Under

Calculation Formula

INV_QTY * ACT (which will calculate qty x st price and display the result in ACTUAL_PR ).

Now my requirement is I want to write a formula For actual price .

I want the Actual price to display as zero where VBGEL starts with 6* (credit) AND 7* (debit) in my report.

So when I run the report the report , Actual price = INV_QTY * ACT should shows ' 0 ' value and rest ref starts from 8* ,9* etc., should shows the value as it is.

How can I write a formula so that ACTUAL_PR should be 0 where VBGEL starts with (REF) = 6* AND 7*

REF = VBGEL

if REF = 6* ANA 7*

ACTUAL_PR = 0

ELSE

ACTUAL_PR = INV_QTY * ACT

ENDIF.

how can write the condition in SQ01 under queries this formula.

Thanks for your help in advanced

regards

Piros

3 REPLIES 3

Former Member
0 Kudos
110

Hello,

In SQ02, you can define an additional field (ACTUAL_PR) using Extras->Create. Then select the additional field and click 'Code' icon. Add your code snippet in the white space. Save and activate the Info Set.

Hope this helps.

Thanks,

Venu

Former Member
0 Kudos
110

Condition should be:

IF ref cp '6*' or ref cp '7*'.
    actual_pr = 0.
ELSE
    actual_pr = inv_qty * act.
ENDIF. 

Former Member
0 Kudos
110

hi,

how to split time in SQ01 newly defined Local field?

regards

Muhammad Shoaib