Where to write IF THEN ELASE statements in BEX Query Designer

Hi All,
I need to write a formula in query designer...
saying that to display the all Quantities in KGs.. Now articles are in Grams and KGs...
So here i need to perform calculation like... if article is in KGs divide by 1, else if article is in Grams divide by 1000.
where can i write this logic to perform calculation ...
Thanks in advance..
ravi.p

hi chetan,
No its not work.. why because i  need to convert the unit of measure in Masterdata Attribute values... that means ) ' 0grooss_wt'.  this is  attribute as a keyfigure of ' 0material' .. this ' 0gross_wt' values has to convert in KGs. at Present ' 0gross_wt' values are in KG and Grams...
I can change these values in update rules by writting  Routine.. But I need to convert it in KGS at BEX Query Designer Level..
I need calculate like this
quantity sold * Gross Weight. 
here Gross Weight is the formula variable which replacing the values of gross weight...
i tried by creating conversion types in RSUOM t-code. but it works on keyfigures of infocube.. not on attribute values of master data...
is there any solution to solve this Problem...

Similar Messages

  • IF THEN ELSE STATEMENT IN BeX Query designer

    Hi,
    I want to write a query as follows:
    IF <Value a> is available THEN <Value a> ELSE <Value b>
    I have written it as follows:
    (X>0)X+(X<=0)Y
    The problem with this equation is,  in case X = 0(number Zero) then Y is not getting displayed. But In case X =NULL (or no values) then Y displayed. This is leading to inconsistency in final result. Please help in rectifying the formula incase it is incorrect or is it because of some program bug in BeX?
    Regards
    Madhav

    This works for me...dont understand y its not working with u!!
    it is simple:
    (X<>0)X+(X==0)Y
    If X is 0, then  0X + 1Y = Y
    else
    1X + 0Y = X.
    What result you are getting in both cases?
    as you thing,X value is may not be 0 in your case. It may be 0.00004...something like that...Set Decimal Places to 5 or 6 to X.
    Message was edited by:
            Muralidhar C

  • IF...ELSE.. STATEMENT in BEx Query Designer

    Hi,
    Why there is no IF, ELSE function in BEx Query Designer?
    Assuming I need to write the following logic, how can it be accomplished?
    IF (A=0 OR B=0)
        THEN 0
    ELSE IF ( B/A <0)
        THEN '       *'
    ELSE
        B/A * 100
    i.e.
    if A or B is equal to 0, then display the value of 0
    else if B is negative (as A is either 0 or positive), then display the following text: '         *'
    otherwise, display the value of  B/A * 100
    Thanks!

    Hi,
    You can achieve this by creating a new formula.
    You have to use the boolean operations and mathematical functions. But we cannot display *. u have to display some value for that.
    Khaja

  • IF and ABS condition statement in BEX query designer

    Hi,
    I would like to ask the best way for me to produce an acceptable result from Excel IF and ABS Condition statement.
    The condition statement that I have on my Excel file is
    =IF((A2-B2)>0,ABS(A2-B2),0)
    I'm trying multiple times to reproduce this in BEX Query designer, unfortunately I'm getting a bad result or unacceptable formula.
    Anyone who could help me with my issue?
    Thanks,
    Arnold

    Hi Arnold,
    Thank you,
    Nanda

  • Creating Restrictions in BEx query designer for (1-a), where a is variable.

    Dear All,
    >>  Suppose for the variable in the BEx query designer, I've created restriction for 0FISCPER to the variable 0P_PER (as 0P_PER-1) by right clicking 0P_PER3, from that a dialog box appears.  In that I've selected 0P_PER3 and then clicked on offset variable and when I set the offset variable, it works for (0P_PER-1.etc, 0P_PER+1,etc..)
    But if I want to have (1-0P_PER), then plz tell me how to define this restriction?
    Plz explain me the steps to perform (1-0P_PER) restriction in BEx query designer in BW1.
    I'm using SAP BI 7.2 gui.
    Expecting your reply soon,
    with Regards,
    Jerald

    My requirement is that I want to have " 1-fiscal year"., But this I could not define using offset variables, since using offset we can define "fiscal year +1" or "fiscal year -1". 
    So there would be some other way to define "1-fiscalyear".  So Please help me to define "1-fiscalyear"  by giving me the steps.
    Thank you,
    with Regards,
    Jerald

  • How to write a condition in BEX Query Designer

    Hi
    How can i write a condition in Query Designer
    Scenario
    An employee can purchase any no of policies in a day or month.each policy will have start date and expiry date.
    My requirment
    Count all the policies(valid) by employee on a ranges basis exception reporting
    (0-10;10-20;20-30;30-40) and then able to drill down by policy start date and expiry date.
    As per the requirment is to show policies which are not yet expired (active) i need to write a condition that will count only policies whose Expiry date is > Current calender day
    As Policy Expiry Date is a char i am converting it to KF using fourmala variable so that i can write a condition on it using current cal day formula variable sap exit
    But i char assigment of a condition i find 4 option
    How can i achieve this
    Thanks

    Hi Aurun,
    Thanks for the help,Really appreciated
    As this is my first enhancement using ABAP & CMOD
    What type of key (either Access or developer ) do i require to perform the following  enhancement......so that i can raise request with basis team
    I shall be great ful if u can asnwer below question
    First, you need to create a variable for expiry date with processing type as customer exit, and then give the necessary info.
    In details tab, unchk ready for input as we wont be taking the value from the prompt.
    Now go to CMOD transaction.
    Open the correcsponding project which has the exit code
    (How can i identify the project which has exit code)
    and go to ZXRSRU001 module inside taht.
    Go to the module where u write the exit.
    (How to locate the required module)
    Then, under i step 1, write the code:
    IF I_STEP = 1.
    CASE V_NAME  (What is 'V_NAME',Is it my variable technical name)
    WHEN 'X' " X is the variable u created for the exit
    l_s_range-low = SY-DATUM.
    l_s_range-opt = 'I'.
    l_s_range-sign = 'GT'.
    APPEND l_s_range TO e_t_range.
    END CASE.

  • IF ELSE Statement in BEx Query based on the results

    Hi experts,
    I want to realize the following IF/ELSE statement in a BEx Query in respect to the result values
    If the result of KF1 equals 0, than set the KF2 to 0, Else (KF1 NE 0) show the value of KF2
    Background: I want to report the order backlog. In the example above we have an incoming order value of 23.700,80 EUR in periode 12.2013 and an turnover of 22.370,80 EUR in periode 01.2014. The order backlog in ST (KF1) is 1 ST (12.2013) - 1 ST (01.2014) = 0 ST. The order backlog in EUR (KF2) is 23.700,80 EUR (12.2013) - 22.370,80 EUR (01.2014) = 1.330 EUR. The Order and Invoice is finished, but we have an positive order backlog in EUR (reason: less turnover as incoming order).
    For this case I want to realize the IF/Else statement to check if the oder backlog in ST = 0, if yes, than set the order backlog in EUR also to 0.
    Any best practices?
    Many thanks and best regards,
    Michael

    Hi Suman,
    thanks aigain for your reply!
    I have tried your proposal before you have posted it.
    In my special case the following if/else statement works successfully:
    CKF = calculated key figure
    Formula1 = (CKF1 == 0) * 0 + (CKF1 <> 0) * CKF2
    In my case the CKF2 is the result value from "Incoming Order value" - "Turnover"
    So I had to define a separate Formula (1:1 equals to CKF2) and then I was able to set "*CKF2" in the statement.
    The statement CKF2 = (CKF1 == 0) * 0 + CKF2 is not possible (because it´s not possible to calculate from CKF2 itself).
    Now it works
    Best regards,
    Michael

  • If Then Else Statement in SAP R/3 BW

    Hi,
    Does anyone know how to create an If Then Else statement in BEX?
    Thanks,
    Mounika.

    Hi mounika,
    do this way
    If 'material number' > 0.
    rslt = 'enter into table'.
    else.
    rslt = 15.
    endif.
    A True condition always evaluates to 1, a False condition evaluates to 0.
    for more quieries in bw ..pls go through  the link
    http://sap.ittoolbox.com/groups/technical-functional/sap-bw
    pls reward if helps,
    regards.

  • How to Generate a MDX statement using a BEX query

    Hello,
    Is there any possiblity in BW to generate a MDX statement using a BEx query?
    Thanks,
    Ravi

    BW does not generate any MDX statement for Bex query.I have tried ample number of times to acheive this but failed.
    Like an Infocube the Query is also an object where in you can write MDX queries on BEx Queries.
    As it is I never found BW rendering MDX queries.But with MDX queries you can get something but how far it helps I don't know.
    RSCRM_BAPI is obsolete and it is recommended to use RSCRM_REPORT somewhere I have read ,but when I went to that transaction I never found that "MDX" button at all.
    It was converted to "OLAP Check" which gave me some warning on the key figures and that's it.
    Somehow I feel BW is not comfortable with MDX.
    Regs
    Gopi

  • Usage of exists in if-then-else statements

    please correct the mistakes in this procedure regarding exists in the use of if then else statement .as i am new to oracle i am unable to do it.
    errors are statement ignored
    exists should be inside the statement;
    CREATE or replace FUNCTION CHECK_FG_Id
    p_LegacyDocumentId VARCHAR2,
    p_LegacyFGroupId VARCHAR2,
    p_TransmissionId INTEGER
    RETURN INTEGER as
    BEGIN
    IF EXISTS
    (Select FG.ControlNo from functionalgroup FG,document D
    WHERE FG.DocumentId=D.Id AND D.TransmissionId=p_TransmissionId
    AND FG.ControlNo=p_LegacyFGroupId AND D.ControlNo=p_LegacyDocumentId ) THEN
    Return 1;
    ELSE
    Return 0;
    END IF;
    end;

    Lots of different ways...One way is as follows:
    CREATE OR REPLACE FUNCTION check_fg_id (
    p_legacydocumentid VARCHAR2,
    p_legacyfgroupid VARCHAR2,
    p_transmissionid INTEGER) RETURN INTEGER AS
    vDoesItExist NUMBER;
    BEGIN
    SELECT COUNT (1)
    INTO vdoesitexist
    FROM functionalgroup fg,
    document d
    WHERE fg.documentid = d.ID
    AND d.transmissionid = p_transmissionid
    AND fg.controlno = p_legacyfgroupid
    AND d.controlno = p_legacydocumentid;
    IF vDoesItExist > 0 THEN
    RETURN 1;
    ELSE
    RETURN 0;
    END IF; /** vDoesItExist > 0 **/
    END check_fg_id;

  • Where to write Database access logic

    I am new to Webdynpro. Could anyone please let me know where to write the code to access database. Is it right to write it in iview or component controller.

    Hi Sudhir
    Webdynpro works on MVC architecture .So there can be three approaches
    1) Create Java Bean Model
    Importing Complex JavaBean model into WebDynpro by creating relationships for the model classes
    WebDynpro: Importing Java Classes as model
    2)Can call create the database in the  Controller and view
    3) you can use a java file and copy the same in the wdproject>src->package--> java file and then access the java methods.
    Thanx
    Pankaj

  • Write Source to Destination statement

    Hi,
      We are making the code unicode compatible,
    we re facing a problem in the
    <b>Write <Source> to <Destination> statement</b>
    as shown below
    WRITE SATZ-SOFE_ERSF TO SATZ-SOFE_ERSF CURRENCY P0008-WAERS
    the unicode error is, the destination field must be of type Charracter.
    If we use a temporary variable of type char, then we must convert this character variable back to the type P and assign it to the actual variable.
    How do we achieve this.
    Thanks,
    Chetana

    if you dont want to use char type u dont need to use WRITE syntax.
    you can use MOVE syntax to move data from type has any decimal to type any decimal.
    WRITE is generally using when datas wanted to display formatted.
    ibrahim

  • Java If/Then/Else Statement

    Hello,
    Just wondering if it is possible to call one java file from within another.
    I'm thining wiht an if.then/else statement similar to
    If x==true
    then run file1.java
    else run file2.java
    any examples of this, or if it is even possible would be appreciated.

    This is something like what I would do.
    public class FileRunner {
        public static void main(String [] args) {
            if ( args[0].equals("file1") {
                File1 file1 = new File1();
                file1.init() //method you define in File1 that runs everything that would've been in the File1's main method
            } else if (args[0].equals("file2") {
                File2 file2 = new File2();
                file2.init() //method you define in file2 that runs everything that would've been in the File2's main method
            } else {
                System.err.println("Invalid argument");
                System.exit(1);
    java.exe FileRunner.class file1
    java.exe FileRunner.class file2The other method is to start a new jvm from within java, but that gives you less control than this imo.

  • How to total 2 colums with an -If then else- statement each

    Hello,
    I have 2 colums A en B who generate data based on an “If then else” statement.
    Colum A
    <?xdofx:if (OMZET_YTD_VJ )!='' then ((OMZET_YTD_VJ) * (BM_YTD - BM_YTD_VJ)) div 100 else 0 end if?>
    Colum B
    <?xdofx:if (BM_YTD)!='' then ((BM_YTD) * (OMZET_YTD - OMZET_YTD_VJ)) div 100 else 0 end if?>
    Colum C needs to be the sum of both. Who can help me?
    Thanks a lot.

    Can you send me the RTF template and xml file to [email protected]? I can take a look and try to help.
    Thanks,
    Bipuser

  • Inserting a 'null' value in an IF THEN ELSE statement

    Greetings,
    I'm using Business Object webi XiR3
    I'd like to return a 'null' value in certain cases for an IF THEN ELSE statement.  Depending on if I format the field as a text or a number, I can return blanks ("") and zeros (0).  However, what I really need to do is leave the field / column formatted as a number and return a 'null' value.  You can see the variable below ... this will return a blank but the column is text.
    Suggestions?
    thanks.
    variable:
    =If([Comp Rate Mid] = 0 And( ([Market Rate 50th].085) - [Annual Total Targeted Comp] >=0) ; ([Market Rate 50th]0.85) - [Annual Total Targeted Comp]; If([Comp Rate Mid] <> 0 And( ([Comp Rate Mid] 0.85) - [Annual Total Targeted Comp] >=0) ; ([Comp Rate Mid]0.85) - [Annual Total Targeted Comp];""))

    I don't think this is possible using a formula, as formulas deal with content, and images can be placed in cells only as 'image fill', which is Format, rather than Content.
    Might be possible using an AppleScript, but I'm not the person to advise you on that.
    Regards,
    Barry

Maybe you are looking for

  • Missing fields in the Cube.

    SDN Community, We have a 3 layered data warehousing model. The first is the write - optimized DSO and then the standard DSO and then the Infocubes. There are light/very light tranformations in between the layers. There was data already in the write-

  • An Open Letter To MSI - A very dis-satisfied *former* customer

    I sent this letter to as many MSI email  addresses as i could find: Sirs: I’m done with MSI. I’ve bought two MSI K8N Neo Platinum boards and two K8N Neo 4 Platinum SLI boards. My original K8N ran great without problems for nearly a year, then one nig

  • Compare with unedited image doesnt work

    hi i started my first project in lightroom, and i use to change the look of my images in the development section every day again (a bit here, a bit there). when i press before/after, LR5 only shows the version i did yesterday and the one from now, to

  • Error with video playback

    Hi, I have a problem with the video playback on the ATV. In every movie I played on the ATV there is one or two errors during the playback. It looks not like a missing frame, its difficult to say, for a second, the picture on my TV is flickering. Whe

  • Next component to get focus?

    Hey Guys, If i had a panel with buttons and other components and if the focus is on one of the buttons, is it possible to have java return what the next component to get the focus is? I know there's a getNextFocusableComponent, but i'd rather use som