Could I have CASE or IF statement in FMS queries?

Is it possible to have case statements in FMS queries:
For example:
SELECT T0.[U_DepoistfeeON] case
      when T0.[U_DepoistfeeON] is NOT BLANK  then $[$38.111.160]='Deposit Fee'
      when T0.[U_DepoistfeeON] is BLANK  then  then $[$38.111.160]=BLANK
end FROM OITM T0
What is wrong with above query please? Thank you very much.
I do not mind even if above query is doable with an IF statement in it.

Hi Rahul, this is what I want -
I have a user defined field attached to item master OITM. The field is called : U_DepoistfeeON
The above field contains additional depositFee taxes for selling beer bottles.
I have also created a new tax as part of Freight handling. While on Sales Order screen, the Freight (unhide first through forms field) drop down can have the new tax type selected automatically "Deposit Fee".
Thus, if the line item is of beer type that has U_DepositfeeON, then Freight field should automaticlally pick the type "Deposit Fee".
If U_DepositfeeON is zero then I would like the Freight field on Sales Order screen ($38.111.160) set to blank.
I tried to achieve this through following using case statement.
select T0.U_DepoistfeeON
from oitm t0
case
when T0.U_DepoistfeeON 0
then $http://$38.111.160='Deposit Fee'
when T0.U_DepoistfeeON = 0
then $http://$38.111.160=''
else
$http://$38.111.160=''
end;
Of course it doesn't work. Note: I know I typed in DepoistfeeON, the error is not due to that.
Thanks.

Similar Messages

  • Case when null statement

    Afternoon Folks,
    The line highlighted in Bold is where I have the issue. I want it to pick up NULL or Blanks in the method type has well as types E,G,T. I've tried NULL is the statement, "", and '' put none of these work. What am I doing wrong? I'm using 11g by the way
    select specialty,
    member_id,
    sp_id,
    service_date,
    sum(case when method_type = 'C' then (payment_total) end) "CONSULTATION",
    sum(case when method_type = 'M' then (payment_total) end) "MOT",
    sum(case when method_type = 'D' then (payment_total) end) "TESTS",
    sum(case when method_type in ('E','G','T') then (payment_total) end) "OTHER",
    sum(payment_total) "TOTAL"
    from a3_fact_sms_service_inv
    where specialty in ('Chiropody','Podiatry')
    and service_date between date '2011-01-01' and date '2011-12-31'
    group by specialty,
    member_id,
    sp_id,
    service_date
    order by specialty,
    member_id,
    sp_id,
    service_date

    957099 wrote:
    Afternoon Folks,
    The line highlighted in Bold is where I have the issue. I want it to pick up NULL or Blanks in the method type has well as types E,G,T. I've tried NULL is the statement, "", and '' put none of these work. What am I doing wrong? I'm using 11g by the way
    select specialty,
    member_id,
    sp_id,
    service_date,
    sum(case when method_type = 'C' then (payment_total) end) "CONSULTATION",
    sum(case when method_type = 'M' then (payment_total) end) "MOT",
    sum(case when method_type = 'D' then (payment_total) end) "TESTS",
    sum(case when method_type in ('E','G','T') then (payment_total) end) "OTHER",
    sum(payment_total) "TOTAL"
    from a3_fact_sms_service_inv
    where specialty in ('Chiropody','Podiatry')
    and service_date between date '2011-01-01' and date '2011-12-31'
    group by specialty,
    member_id,
    sp_id,
    service_date
    order by specialty,
    member_id,
    sp_id,
    service_dateWell, effectively the in is like saying method_type = 'E' or method_type = 'G' or method_type = 'T'
    and so trying null as well in the in-list would be ...or method_type = null which won't work
    as null isn't equal (nor not equal) to null.
    so you could try
    sum(case when method_type in ('E','G','T') or method_type is null then (payment_total) end) "OTHER",or use nvl
    sum(case when nvl(method_type,'X') in ('E','G','T','X') then (payment_total) end) "OTHER",where 'X' is a value you definitely don't (and won't) use as a real value in method_type.
    (Not tested as you didn't provide create table statements or inserts of test data).

  • Error: The report source could not be retrieved from the state object.

    I have been trying to create a report in a JSF page. The relevant parts are below:
    Inside the JSP page, this is the code:
                  <jsp:useBean id="MyBean" class="com.nm.facade.rto.POJOViewerBean" scope="session" />
                    <jsp:setProperty name="MyBean" property="reportLocation" value="Report1.rpt" />
                   <v:reportPageViewer reportSource="#{MyBean.reportSource}"
                                           displayToolbarPrintButton="true"
                                           printMode="ActiveX"
                                           zoomPercentage="100"
                                           displayToolbarExportButton="true"
                                           displayToolbarRefreshButton="true"
                                           viewerName="My Viewer"
                   ></v:reportPageViewer>
    In the backing bean, this is the relevant code:
        public Object getReportSource() throws ReportSDKException
            if (propertiesChanged || reportSource == null)
                propertiesChanged = false;
                if (reportLocation == null)
                    throw new RuntimeException("The reportLocation property must be set before a report source is retrieved");
                ReportClientDocument rcd = new ReportClientDocument();
                rcd.setReportAppServer(ReportClientDocument.inprocConnectionString);
                rcd.open(reportLocation, 0);
                DatabaseController dbc = rcd.getDatabaseController();
                //Create the POJO collection and populate it with data
                ReportData[] data =
                  new ReportData("B.B.", "King", 6, new Date(25, 9, 16)),
                    new ReportData("Muddy", "Waters", 7, new Date(15, 4, 4)),
                    new ReportData("John Lee", "Hooker", 8, new Date(16, 8, 16)),
                    new ReportData("Otis", "Rush", 9, new Date(34, 4, 29)),
                    new ReportData("Buddy", "Guy", 10, new Date(36, 7, 30))
                //Create the result set from the collection of POJOs
                POJOResultSetFactory factory = new POJOResultSetFactory(ReportData.class);
                factory.setVerbose(true);
                POJOResultSet results = factory.createResultSet(data);
                ResultSetMetaData metaData = results.getMetaData();
                //Set the resultset as the report datasource
                      //Get the table name from the 'Set Datasource Location' dialog in the Crystal Reports designer
                String reportTable = "getReportDataDataSource";
                dbc.setDataSource(results, reportTable, reportTable);       
                IReportSource reportSource = rcd.getReportSource();
                if (reportSource == null)
                    throw new RuntimeException("Unable to get a report source.");
            return reportSource;
    In the CRConfig.xml, this is what is there:
    <?xml version="1.0" encoding="utf-8"?>
    <CrystalReportEngine-configuration>
        <reportlocation>../reports</reportlocation>
        <timeout>0</timeout>
        <ExternalFunctionLibraryClassNames>
             <classname></classname>
        </ExternalFunctionLibraryClassNames>
    </CrystalReportEngine-configuration>
    The report template 'Report1.rpt' is packaged under WEB-INF/reports in the war file.
    When I try to generate the report by accessing the JSF page, I am getting an error: "The report source could not be retrieved from the state object. "
    I am not sure what is wrong. Can someone help me in resolving this issue?
    Edited by: renshai on Jul 9, 2009 3:21 AM

    My formatting gets lost and the message looks unintelligible. After some experimentation, I found that if the message exceeds some length, the formatting is removed. Since I couldn't find any way to delete this post, I made another post with the same subject. Please ignore this post and help me to find a solution for the problem posted in the other thread with the same subject. Thanks in advance.

  • Case in Select Statement - Ramya

    Hi All,
    Could any body help me out ,how to use the CASE in select Statement
    Thanks in Advance

    here is an example:
    SQL> select * from emp;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7566 JONES      MANAGER         7839 02-APR-81       2975       1000         20
          7902 FORD       ANALYST         7566 03-DEC-81       3000                    20
          7839 KING       PRESIDENT            17-NOV-81       5000                    10
          7698 BLAKE      MANAGER         7839 01-MAY-81       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-81       2450                    10
          7369 SMITH      CLERK           7902 17-DEC-80        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-81       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-81       1250        500         30
          7654 MARTIN     SALESMAN        7698 28-SEP-81       1250       1400         30
          7788 SCOTT      ANALYST         7566 09-DEC-82       3000                    20
          7844 TURNER     SALESMAN        7698 08-SEP-81       1500          0         30
          7876 ADAMS      CLERK           7788 12-JAN-83       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-81        950                    30
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
    14 rows selected.
    SQL> select empno,
      2         ename,
      3         job,
      4         case when job = 'PRESIDENT' then 1
      5              when job = 'MANAGER' then 2
      6              when job = 'SUPERVISOR' then 3
      7              else 4
      8         end rank
      9    from emp;
         EMPNO ENAME      JOB             RANK
          7566 JONES      MANAGER            2
          7902 FORD       ANALYST            4
          7839 KING       PRESIDENT          1
          7698 BLAKE      MANAGER            2
          7782 CLARK      MANAGER            2
          7369 SMITH      CLERK              4
          7499 ALLEN      SALESMAN           4
          7521 WARD       SALESMAN           4
          7654 MARTIN     SALESMAN           4
          7788 SCOTT      ANALYST            4
          7844 TURNER     SALESMAN           4
          7876 ADAMS      CLERK              4
          7900 JAMES      CLERK              4
          7934 MILLER     CLERK              4
    14 rows selected.
    SQL>

  • My iphone 6 is only getting 1x service in my office.  Could this have something to do with the VOLTE?

    My iphone 6 is only getting 1x service in my office.  Could this have something to do with the VOLTE?

        wc_e,
    Let's look further into this! No, that shouldn't be the case. Does service improve outside your office? Are you a new customer? If not, did your previous phone experience the same issue? Try resetting network settings in Settings>General>Reset test and share. Thank you.
    TominqueBo_VZW
    Follow us on Twitter @VZWSupport

  • Use event to jump to a case in a state machine

    How would I use an event to force a jump to a certain case in a state machine? For example, in the attached VI, I have a state machine that will simply blink a green LED indicator on and off for five seconds. I have a case in which the LED turns red for five seconds and a button which I would like to use to jump to this case. In other words, if the state machine is currently halfway (2.5 seconds) through my "Green_Light_ON" case when the button is pressed, I would like the state machine to immediately jump out of the "Green_Light_ON" case and into the "Red_Light_ON" case. This is not my ACTUAL VI, but it's a simplified example that will work for finding my solution. Thank you very much in advance for your help! 
    Attachments:
    DemoStateMachine.zip ‏18 KB

    Sounds like the classic "Producer-Consumer (Events)" design pattern.  File>>New...>>VI from template.  There is a good shipping example as well as the comments on the template vi
    Jeff

  • Does Best Buy have a: Defined Mission Statement? Defined Vision? Long Term/Short term objectives?

    Does best buy have, in terms of as a company: A Defined Mission Statement? A Defined Vision? A long Term and/or Short Term Objective? This is for a senior level college report. I could not find anything on your official website. Please ignore the category. It was chosen at random. Thank you

    Hi Tomas,
    Best Buy doesn't have an official mission statement per se, but you can learn about our Customer Promise by visiting our Community Relations site:
    http://www.bby.com/about-best-buy/
    This site also has information on our giving partnerships, national and community grant programs, and links to both our quarterly and annual earnings reports.
    I hope this helps!
    Aaron|Social Media Specialist | Best Buy® Corporate
     Private Message

  • I have defined a finite state machine: pb with button : they need to be click twice

    I have defined a finite state machine and also defined a call to a C dll enabling to kill processus  since in my state machine I have to sequence several exe and being able to interupt them (This is the goal of mu manageProc dll)
    for the moment I make my integration test with the notepad.exe process
    the create and kill seems to work
    but I have problem wth my finite state machine I need to click twice on the differnts button for a given state to be really effective
    I have also used glabal variable and an event controller ( without that I was unable to get ffedback oo buuton click
    So my question are
    Is my problem due to the use of a shift register
    Please tell me if you need other file to understand my problem
    Regards
    Thibaut
    Attachments:
    Spectro State MAchine .vi ‏77 KB

    Thibaut,
    You should put the event structure into its own parallel while loop rather than sharing the loop with the state machine. Typically the terminals of the controls will be placed inside the event case where they are read. At least inside the loop.
    Run your VI with execution highlighting on (the light bulb on the diagram toolbar). This will show you how dataflow works.
    You probably do not need most of your global variables. Appropriate use of shift registers and wires would eliminate them.
    Lynn

  • I can see less than 5 percent of my music from the iTunes 12 on my Macbook Air.  What could I have changed to lose almost everything?

    Here are the stats:  From my Mac Mini where I keep physical copies of everything: 43 genres, 706 artists, 1477 albums, 17719 songs.  On my Macbook (same new version of iTunes) 9 genres, 52 artists, 59 albums and 611 songs.  What could I have done to make my iCloud content invisible and inaccessible?  I paid up and the setup looks normal.
    The system is completely up-to-date running all of the latest available versions and patches for IOS X 10.10.2
    Help would be appreciated.
    Thanks,
    Joe

    See this older post from another forum member Zevoneer covering the different methods and software available to assist you with the task of copying content from your iPod back to your PC and into iTunes.
    https://discussions.apple.com/thread/2452022?start=0&tstart=0
    As you will have discovered, the music sync is only one way, from iTunes to the iPod, minus iTunes purchases.  On top of that, an iPod is designed to sync with only one iTunes library at a time.
    B-rock

  • When i login to yahoo, my first click results in the spinning wheel. Could i have a virus Or why does it only happen when i login to yahoo?

    When i login to yahoo, my first click results in the spinning wheel. Could i have a virus? Or why does it only happen when i login to yahoo?

    Firefox allows to select part of a word. You can select a word with a double click and use Shift + left click to set the end of the selection, so you need to click at the end of the last word instead of in it.

  • Could I have purchased an i7 13" MBP non-retina in-store?

    Hey everyone!
    Back in October, I purchased the 13" non-retina display MBP at my nearest Apple Store. I really wanted to get the higher-end i7 version (as it was listed on the website) but, I wasn't asked if I wanted to configure it to higher specs when I was in-store. At the time, I was only given the option between the retina and non-retina model so I went with the non-retina because it was cheaper but, I found out it only had an i5 processor. Now, I'm kinda stuck with the lowest-end mid-2012 MBP.
    So, is configuring a MacBook Pro an online-only thing or could I have configured it in-store?

    Hi d,
    From everything I've ever read, seen, heard and experienced, you have to do a build-to-order Mac online, so don't beat yourself up.

  • Left joins : Case or if statement

    Hi
    I want to know if one can build in a case or if statement into a left join. I want to multiply a value with -1 if the condition is met.

    I think it is not possible in SELECT statement...but you can do the below to resolve it.
    add a field for FKART in your internal table.
    TYPES: BEGIN OF tab ,
           kunag LIKE vbrk-kunag,
           fkdat like vbrk-fkdat,
           matnr LIKE vbrp-matnr,
           werks LIKE vbrp-werks,
           fkart like vbrk-fkart,
           volum LIKE vbrp-volum,
           END OF tab.
    DATA: wa_outtab TYPE table of tab WITH HEADER LINE.
    SELECT akunag  afkdat
           bmatnr bwerks a~fkart
           SUM( b~volum )
       INTO  table wa_outtab
    FROM vbrk AS a
    INNER JOIN vbrp AS b
          ON  avbeln  = bvbeln
    WHERE
    avbeln = bvbeln                                                                               
    AND ( afkart LIKE 'F2' OR afkart LIKE 'RE' )
    GROUP BY  akunag afkdat bmatnr bwerks a~fkart.
    sort wa_outtab.
    Loop at wa_outtab.
      if wa_outtab-fkart = 'RE'.
        lpos = lpos +  wa_outtab-volum.
      else.
        lneg = lneg +  wa_outtab-volum.
      endif.
      at end of werks.
         lvaule = lpos - lneg.
        lpos = lneg = 0.
      endat.
    endloop.

  • Firstly, I can't open iPhoto on my macbook as of a few days and could it have anything to do with a problem I have updating my iPhone's software as I've downloaded extra iCloud storage but I still can't get the iPhone to recognise the space for software

    Firstly, I can't open iPhoto on my macbook as of a few days and could it have anything to do with a problem I have updating my iPhone's software as I've downloaded extra iCloud storage but I still can't get the iPhone to recognise the space for software

    No. With the amount of information you've provided it's impossible to offer a potential solution.  We can't see your computer so we need to know the details of your problem and setup, i.e.:
    what version of iPhoto are you using?
    what system version are you running?
    what do you see when iPhoto opens?
    what fixes have you tried?
    where is your library located?
    did you apply any updates or upgrades just prior to the problem occurring?
    are you running a "managed" or "referenced" library?
    what type of Mac?
    how much free space on your boot drive?
    For the iPhone issue ask in the iPhone forum.
    OT

  • I have doubt in Read statement

    Hi All.
    I have doubt in Read statement .i need to convert following select statement  as read statement .how can i change help me.
    IF p_field1 IS  INITIAL
         AND p_field2 IS INITIAL
         AND p_field3 IS INITIAL
         AND p_field4 IS INITIAL
         AND p_field5 IS INITIAL.
        SELECT *
              FROM zdbt
               INTO TABLE itab
               WHERE field5 = p_field5
               ORDER BY PRIMARY KEY.
        IF sy-subrc <> 0.
          MESSAGE s035.
        ENDIF.
      ENDIF.
    regards,
    Jay.

    hi
    The READ statement is as below:
    When u have a table already with values and to improve the performance u need to use this.
    Reading Lines of Tables
    To read a single line of any table, use the statement:
    READ TABLE <itab> <key> <result>.
    For the statement to be valid for any kind of table, you must specify the entry using the key and
    not the index. You specify the key in the <key> part of the statement. The <result> part can
    specify a further processing option for the line that is retrieved.
    If the system finds an entry, it sets SY-SUBRC to zero, if not, it takes the value 4, as long as it is
    not influenced by one of the possible additions. If the internal table is an index table, SY-TABIX
    is set to the index of the line retrieved. If the table has a non-unique key and there are duplicate
    entries, the first entry is read.
    Thanks
    Shiva

  • Case in Update statement

    hi,
    How to use the case or decode statement in Update statement.

    Welcome to Oracle Technology network!
    This forum is for SQL*Developer issues - things realed directly to Oracle's SQL*Developer product. Your quesiton about CASE statements in UPDATES is a general SQL question. You will get a better answer if you close this thread and open it again in the SQL and PL/SQL forum which is for SQL questions

Maybe you are looking for

  • Why is my "recent items" list not updating properly?

    When I go under the Apple menu to "Recent Items," I find that sometimes it does not actually show the most recent documents I have been working on.  I just closed a Microsoft Word document that I've been editing and saving for the past two hours, and

  • #1  i'm having trouble installing acrobat 9 pro in a macbook pro.  #2 how to convert to searchable d

    #1  i'm having trouble installing acrobat 9 pro in a macbook pro.  #2 how to convert to a scan to a searchable and cut/paste doc.?

  • How to set UOO(bea_unitoforder) property within BPEL Adapter property

    Hi, In oracle documentation JMS message payload field values can be used as correlation properties. Correlation property aliases are used to define from which payload field the correlation property value is taken. I need to set the correlation proper

  • Problem in the stock report

    Hi all, We have stock report.There is one problem in the report.We are using "2LIS_03_BF" and " 2LIS_03_UM " as data source and " 0AFMM_C02" as info source. When i run the report with material as row its giving me the correct result.But when i pass p

  • Com.ms.xml.dso.XMLDSO.class

    Dear All, I tried to load an XML doc using: <applet code="com.ms.xml.dso.XMLDSO.class" id="myXML" height=0 width=0 mayscript="true"><param name="URL" value="emp.xml"> </applet> But the status shows com.ms.xml.dso.XMLDSO.class not inited and then Load