Hi All,
I have some doubt about creating a formula at query level if we want to go for If..Else like below
IF WA_SALESREP-INCOTERMS1 EQ 'DDP'.
WA_SALESREP-NETSALES = WA_SALESREP-GROSSSALES - ( WA_SALESREP-FREIGHTDDP - WA_SALESREP-FREIGHTDISCOUNT ).
ELSE.
WA_SALESREP-NETSALES = WA_SALESREP-GROSSSALES.
ENDIF.
I know how to do for the below statement
WA_SALESREP-NETSALES = WA_SALESREP-GROSSSALES - ( WA_SALESREP-FREIGHTDDP - WA_SALESREP-FREIGHTDISCOUNT ).
But I want to know how to write if it is with IF Else statement in formula.
Is there any where else can we write such type of statement? How?
Thanks,
Seshu
Hi Seshu,
Use this, It should work in Bex analyser formula.
(WA_SALESREP-INCOTERMS1 = 'DDP' *
WA_SALESREP-NETSALES = WA_SALESREP-GROSSSALES - ( WA_SALESREP-FREIGHTDDP - WA_SALESREP-FREIGHTDISCOUNT ).
+ WA_SALESREP-NETSALES = WA_SALESREP-GROSSSALES
Use * for 'THEN', + for 'ELSE'
Regards
Devesh
Hi Sesha,
IF WA_SALESREP-INCOTERMS1 EQ 'DDP'.
WA_SALESREP-NETSALES = WA_SALESREP-GROSSSALES - ( WA_SALESREP-FREIGHTDDP - WA_SALESREP-FREIGHTDISCOUNT ).
ELSE.
WA_SALESREP-NETSALES = WA_SALESREP-GROSSSALES.
ENDIF.
I know how to do for the below statement
WA_SALESREP-NETSALES = WA_SALESREP-GROSSSALES - ( WA_SALESREP-FREIGHTDDP -WA_SALESREP-FREIGHTDISCOUNT ).
Create a CKF
If
(A = B * C ) = C
Else
D
Endif.
Hi Sesha,
I am assuming WA_SALESREP-INCOTERMS1 is available in query drill-down in output.
Step-1: Create a dummy CKF (DDP_CKF1) and in formula pane keep '1' .
Step-2: Create a RKF (DDP_RKF1) on above created CKF with restriction of WA_SALESREP-INCOTERMS1 = DDP .
Step-3: Now keep this RKF in keyfigure pane and hide it.
Step-4: Now create formula like below
(DDP_RKF1 = 1 * (WA_SALESREP-GROSSSALES - ( WA_SALESREP-FREIGHTDDP - WA_SALESREP-FREIGHTDISCOUNT )) + WA_SALESREP-GROSSSALES
Hope this will give you direction to achieve your requirement.
Note: DDP_RKF1 is RKF which we created in formula we just need to keep calculation "WA_SALESREP-NETSALES" is not required because this
Add a comment