Select the data from table which inbteween as well as one field if satisfy

Tab1.   entries are below
MANDT   SLRNO   BUKRS   ORDNR       FANLKL     TANLKL
111                                 Ger          2           00110000       00110030
111            000013         Ger          1            00110000       00130000
111           000054          Ger          1             00110000     00130000
111           000055          Ger           2             00110000     00110030
111            000072         Ger          1             00110000      00130000
111             000073        Ger          1             00110000     00130000
111             000074       Ger           2             00110000     00110030
111             000075       Ger          2              00110000     00110030
111           000126         Ger          2             00160000      00160000
lv-assetclass = u201800110020u2019 this is and company code is the only values which I have.
  which is inbetween 00110000    and    00110030
So my below select statement should always give me sy-subrc = 0.
select single FANLKL TANLKL
              from Tab1
              into (lv_var1, lv_var2)
             where   BUKRS = Lv_companycode  
               and   ( FANLKL GE  lv-assetclass and TANLKL LE  lv-assetclass ).
          if  sy-subrc <> 0.
            Codes are there.
          Endif.
But it is giving sy-subrc = 4.So it satisfies the if statement and what ever the code part is there in ifu2026endif that is executed.
My requirement is if lv-assetclass is 00110000 or 00110030 or inbetween these two values 00110020 for all the sy-subrc = 0.Even 00120000 should also give me sy-subrc 0 as 6th line is having entry 00110000     00130000  and 00120000 is coming under this.it should give me Sy-subrc = 0 when I put  lv-assetclass as 00110000 also.
Can any one help me out in his select statement.
Regards,
Partha

Hi,
Change your Select Query as:
select single FANLKL TANLKL
from Tab1
into (lv_var1, lv_var2)
where BUKRS = Lv_companycode
and ( FANLKL LE lv-assetclass and TANLKL GE lv-assetclass ).

Similar Messages

  • How to select the data from a Maintainance View into an internal table

    Hi All,
    Can anybody tell me how to select the data from a Maintainance View into an internal table.
    Thanks,
    srinivas.

    HI,
    You can not retrieve data from A mentenance view.
    For detail check this link,
    http://help.sap.com/saphelp_nw2004s/helpdata/en/cf/21ed2d446011d189700000e8322d00/content.htm
    Regards,
    Anirban

  • To Select the data from two table one is transp table and onther is cluster

    Hi All,
    I want to select the data from two tables
    Here i am giving with an example.
    Fileds: kunnr belnr from bseg.  table bseg
    fields: adrnr from kna1     table: kna1.
    Know i want to put these into one internal table based on kunnr and belnr.
    Thanks in advance.
    Ramesh

    Hi,
       U cant use joins on cluster table and BSEG is a cluster table so use FOR  ALL ENTRIES for taht
    refer this code
    *&      Form  sub_read_bsak
          text
    -->  p1        text
    <--  p2        text
    FORM sub_read_bsak.
    *--Select data from BSAK Table
      SELECT lifnr
             augdt
             augbl
             gjahr
             belnr
             xblnr
             blart
             dmbtr
             mwskz
             mwsts
             sgtxt
             FROM bsak
             INTO CORRESPONDING FIELDS OF TABLE it_bsak
             WHERE belnr IN s_belnr
             AND   augdt IN s_augdt.
      IF sy-subrc EQ 0.
    *--Sort table by accounting document and vendor number
        SORT it_bsak BY belnr lifnr.
      ENDIF.
    ENDFORM.                    " sub_read_bsak
    *&      Form  sub_read_bseg
          text
    -->  p1        text
    <--  p2        text
    FORM sub_read_bseg.
      IF NOT it_bsak[] IS INITIAL.
    *--Select data from BSEG table
        SELECT belnr
               gjahr
               shkzg
               kostl
               hkont
               ebeln
               ebelp
               FROM bseg
               INTO CORRESPONDING FIELDS OF TABLE it_bseg
               FOR ALL ENTRIES IN it_bsak
               WHERE belnr EQ it_bsak-belnr
               AND   gjahr EQ it_bsak-gjahr
               AND   shkzg EQ 'S'.
        IF sy-subrc EQ 0.
    *--Sort table by accounting document
          SORT it_bseg BY belnr.
        ENDIF.
      ENDIF.
    ENDFORM.                    " sub_read_bseg

  • How to make users to select the date from calendar control my making the date field read only in date time control in external list in sharepoint 2010

    How to make users to select the date from calendar control only, by my making the date text field read only (don't want to let users type the date) in date time control in external list in sharepoint 2010. I am looking for a solution which can
    be done through sharepoint desginer / out of the box.
    thanks.

    Congratulate you got the solution by yourself. I am new to a
    WinForms calendar component, I feel so helpless on many problems even I'd read many tutorials. This question on the
    calendar date selection did me a great favor. Cheers.

  • Restoring the data from table after deletion

    Hi,
    If  I delete the data from the database (using delete command) , is there anyway to restore that data. I know it looks bit weird but I'm checking whether there is any technique in abap by which we can restore the data.
    Your help would be appreciated.
    Thanks,
    Kranthi.

    Hi Kranthi,
               When you delete lines of a database table using the DELETE command, the process is only complete after a database commit. Before the commit, any database change can be reset using a database rollback.To be able to perform a database rollback, a database system must generate a copy of each database object before making a change. These copies are kept in a rollback log until the end of an LUW. An overflow of the rollback log always results in the termination of the transaction which caused it. For example, attempting to remind a large number of defaulting customers in the same transaction could trigger such an error. You can only solve this problem by dividing the set of database updates into several smaller units ( LUWs) for the database system. You use this statement if you cannot be certain that all the database changes have been executed correctly.
    For your information :
    An LUW begins each time you start a transaction,when the database changes of the previous LUW have been confirmed (database commit) or when the database changes of the previous LUW have been cancelled (database rollback)
    An LUW ends when the database changes have been confirmed (database commit) or when the database changes have been canceled (database rollback). Within an LUW, database changes are not made until after a database commit. Prior to this, any database change can be canceled by a database rollback.
    Cheers
    Nishanth

  • Selecting the data from database and sending to users  using javamail

    how to select the records from database table in oracle and send automatically to users using javamail. I am able to send the txt msg. but dont know how to send the selected table data to users automatically.
    can anyone suggest how to write the steps with database connection to send msgs containing data to different users
    Thank You

    using JDBC..you want to
    1. create the connect
    2. open the connection
    3. query the table for the data
    4. loop through the resultset to retrieve rows of data
    5. do something with the data
    6. email the result
    once you have the data, it is up to you to determine the format to send to the user using JavaMail. It is easiest to send plain text
    here's a site that give code example (for all steps above relating to JDBC):
    http://javaalmanac.com/egs/java.sql/pkg.html

  • How to select the data from DB and write into File?

    Hi Experts,
    Can any one please help me,
    I want to write the data from a table "T1" from Data Base to one file in windows.
    This functionality i need to achive in SSIS package through script component and Execute SQL task if it's passible.
    If any other way is there please help me.

    through script component and Execute SQL task if it's passible
    The easier way is to use a "Data Flow" Task with a "OleDB Data Source" pointing the the SQL Server table / query and a "Flat File Destination" to export to a file.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • How to export the data from table to excel sheet

    hi experts i have some problem am trying to export the data fro table to Excel sheet  in the view controller i have created one button wit public void onActionCLEAR(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionCLEAR(ServerEvent)
       //wdContext.nodeBapi_Salesorder_Getlist_Input().
       //wdContext.nodeBapi_Salesorder_Getlist_Input().invalidate();
        //@@end
      //@@begin javadoc:onActionExporToExcel(ServerEvent)
      /** Declared validating event handler. */
      //@@end
      public void onActionExporToExcel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionExporToExcel(ServerEvent)
         try{
         FileOutputStream fos=new FileOutputStream("Test.xls");
          PrintStream ps=new PrintStream(fos);
          ps.println("<html><body><table border=1>");
          int size=wdContext.nodeBapi_Salesorder_Getlist_Input().size();
           Iterator attributes=wdContext.getNodeInfo().iterateAttributes();
           ps.println("<tr>");
           while(attributes.hasNext()){
            ps.println("<th>");
            DataAttributeInfo attrName=(DataAttributeInfo)attributes.next();
            ps.println(attrName.getName());
            ps.println("</th>");
           ps.println("</tr>");
          for(int i=0; i<wdContext.nodeBapi_Salesorder_Getlist_Input().size();i++)
            attributes=wdContext.getNodeInfo().iterateAttributes();
            ps.println("<tr>");
            IWDNodeElement ele=wdContext.getElementAt(i);
            while(attributes.hasNext()){
              ps.println("<td>");
              DataAttributeInfo attrName=(DataAttributeInfo)attributes.next();
              ps.println(""+ele.getAttributeAsText(attrName.getName()));
              ps.println("</td>");
            ps.println("</tr>");
           ps.println("</table></body></html>");
           ps.flush();
           ps.close();
           fos.close();
          catch(Exception e){
           wdComponentAPI.getMessageManager().reportException(e.getMessage(), false);
          finally{
         //return("Test.xls")  ;
        //@@end
      }h action and i have return the code
    its running sucessfully but am not able to perform the action plz help me

    Hi,
    You shouldn't use DataAttributeInfo as it is an internal object, if I'm correct.
    Use IWDAttributeInfo instead of DataAttributeInfo and it should work
    (See also API doc of IWDNodeInfo.iterateAttributes() at http://help.sap.com/javadocs/nwce/ce711sp02/wdr/com.sap.wdr/com/sap/tc/webdynpro/progmodel/api/IWDNodeInfo.html#iterateAttributes())
    Cheers,
    Robin

  • Problem in Selecting the data from EKPO and KONV tables

    Hi Experts,
    Presently I am working on Report with Comparision-Sheet Between the vendor's Quotations. I have to display the Discount, Freight, Packing and Forwarding, Vat in Item level data based on the conditions made in PO.
    As per my Knowledge, Condition Types are stored in KONV Table. But there is no relation between KONV and EKPO tables.  So, I am unable to print the data for Discount, Freight, Packing and Forwarding, Vat... How can I get the values from EKPO and KONV tables?
    Thanks in Advance.
    Thanks n Regards,
    Muralikrishna.

    Don't recall if this is correct, but you may need the condition number from the header (EKKO) combined with EKPO-EBELP or other field as you key to access KONV (KNUMH and KPOSN).  My site doesn't run PP, so can't verify if the data is actually stored that, so just a possibility.

  • RFC fetching data from table which is not commited

    Hi Experts,
                   I have a query regarding commit work.Below is the RFC that i have written
    FUNCTION ZBAPI_CREATE.
    *"*"Local Interface:
    *"  TABLES
    *"      IT_ZABAP_RFC STRUCTURE  ZBAPI_RFC_STR OPTIONAL
    *"      RETURN STRUCTURE  BAPIRET2 OPTIONAL
    CALL FUNCTION 'ZBO_BAPI_CREATE'
    TABLES
       IT_ZABAP_RFC       = IT_ZABAP_RFC
       RETURN             = return
    Break-point.
    DATA lt TYPE TABLE OF ZBAPI_RFC_STR_MAIN.
    CALL FUNCTION 'ZBAPI_SEARCH_RANGE'
    * EXPORTING
    *   IS_STR        =
    TABLES
       ET_TAB        = lt
    *   RETURN        =
    ENDFUNCTION.
    here in first RFC call i am creating a record in ZTABLE , and then at break-point
    i check the ZTABLE where it does not create any record because data is not commited into ZTABLE upto this point, but just after it i have written code for fetching data from ZTABLE but i am able to get this new record in lt.
    Can anybody please explain that from where this serach RFC is providing data because inside serach i am simply selecting data from ZTABLE.
    Regards,
    Abhishek Bajpai
    Edited by: ABHISHEK BAJPAI on Jan 28, 2009 1:12 PM

    Hi Thomas,
                     Thanks for reply , i checked in ZTABLE ,before search RFC call data is not there but if i commit explicitly only then it is showing data in ZTABLE. Actually my requirement is different -
    I have two RFCs 1. Create 2. Search , Now  from web dynpro user will call first Create RFCs but at this point it should not insert record in ZTABLE and just after it user will call another search RFC and in this search he should be able to get these newly created records.
    I want to have the functionality which a user gets when working with normal database front end like SQLPLus for Oracle. In these scenarios we see that whenever user does any insert or update the data sits in the table but still it is not committed. So there he fires Select query he sees the inserted data. But if he logs off from SQL PLUS and then logs in again, and fires Select query he does not see the data as it was not committed. I want a similiar functionalty in which if user inserts the data through Create RFC and fires the Select query through Search RFC then he can see the newly Created data also even though this data is not committed.
    Although if i call create RFC in update task it will not update ZTABLE but in this situation , if user will call search RFC he will not be able to get newly created records.
    So my requirement is that i should be able to get those records which are not commited in ZTABLE .If you have still any doubt regarding my question then please let me know.
    Regards,
    Abhishek

  • Database Adapter: Selecting all data from table

    Hi All
    I am new to SOA Suite and I am using Soa Suite version 10.1.3.1 and Jdev version 10.1.3.3. It is required to select data from one database using the database adapter and insert it in a table in another database. I implemented the flow using DBadapters select operation the problem is everytime I am running the instance it transfers only one row though no condition has been specified on the select. Could anyone please help me out and let me know how to transfer a complete table from one database to another using DBadapters and in a single instance.
    Thanks

    Well Stupid me, got the answer, I think m just at the begining of the learning curve.

  • Unable to get the data from table controller

    Dear All,
    I am facing the following problem in BSP tableview,
    I am having tableview on page as below
    <htmlb:tableView id              = "reportsTable2"
                           headerVisible   = "true"
                           headerText      = "Pending PANs:"
                           footerVisible   = "true"
                           design          = "standard"
                           visibleRowCount = "20"
                           width           = "100%"
                           fillUpEmptyRows = "false"
                           columnWrapping  = "false"
                           columnWidth     = "200"
                           sort            = "server"
                           keyColumn       = "panid"
                           onRowSelection  = "alternate()"
                           selectionMode   = "SingleSelect"
                           iterator        = "<%= tv_itr %>"
                           table           = "<%=IT_DATE_RANGE_PAN %>" >
          </htmlb:tableView>
    I want  collect the table view data in DO_REQUEST method, when i press the sort option on any column in table.
    i used the code in DO_request,
    if lv_button_id NE '0'.
          tv ?= cl_htmlb_manager=>get_data(
                 request =   runtime->server->request
                 name    =  'tableview'
                 id      =  'reportsTable2' ).
          tv_data = tv->data .
    but , I found no table content  in tv_table.
    even i tried with export, import .. normally we will dod in ABAP.   not wotking.
    export IT_DATE_RANGE_PAN2 from IT_DATE_RANGE_PAN to memory id memid1.
    import IT_DATE_RANGE_PAN2 to IT_DATE_RANGE_PAN from memory id memid1.
    Can any body help me to solve the above issue.
    Regards,
    Kishan

    Hi,
    Refer your earlier forum...
    how to collet data from tableview in MVC
    Thnx
    suriya

  • Can a Rejection in an Approval Step roll back the data from  table

    Hi All
    We are using the BPC 7.5 MS  Version SP 4 for Quantity & Sales Planning.
    The main drive dimenion is the Material Dimenion whiich is having almost 65000 member id's and increasing.
    I have a situation where the a High Level Planner Input some quantity and it allocated down at  Material Level.
    When the Surbodinate Planner under the High Level Planner looking at the allocated value, he has the option to change the quantity.
    But after he make the changes to quantity and send the data to the data base, the High Level Planner can accept the Change or Reject the change.
    If the High Level Planner Reject the change, make by  the Subordinate Planner, the Data will Roll Back to its original value, meaning the Data Submitted by Subordinate Planner will be deleted from the table and the earlier Value from the High Level Planner will show.
    Is this kind of facility available in BPC 7.5 MS Version of Rolling Back the Data already comiited to the data base.
    Looking forward to hear from you all on the same.
    Regards
    Krish

    One idea will be that you have to insert the users like dimension into BPC. This will be probably the way how you have to design your application.
    In this way probably you will be able to simulate this behaviour.
    Any way I will come back to your request.
    Why the roll back it wil help?
    May be the reject is just for planning of one material why do we have to roll back everything planned for other materials?
    Other idea for implementation is related to what means the approval and reject. Are we speaking about work status or are we speaking about another type of approval.
    It is not a simple discussion. We have to speak about detailed reguirements and function by that it can be easy achieved this behavour requested.
    Regards
    Sorin Radulescu

  • Pls let me know how to fetch the data from tables bdcp or bdcps

    Hi guru's!!!!
    I want to post the changed master data to the legacy.
    I am npt using IDOC. I want to go ahead by using the change doc. I want to know how we can filer the change doc. data for my equirement. & also how to send the data
    transaction wise. I am using the FMs "change_pointers_read.
    it is very urgent..
    Thanks in advance!!!!!

    Hi,
    1. You will have to activate the change pointers for the master data you are looking for.
    2. You can do the configuration so that whenever master data is changed, a IDOC is triggered for that master data.
    3. You can configure the IDOC's to be transmitted to your legacy system in the form of files or to your middleware system.
    <b>You don't have to read the CHANGE POINTERS yourself.</b>
    Regards,
    Ravi
    Note : Please mark all the helpful answers
    Message was edited by: Ravikumar Allampallam

  • Can not insert/update data from table which is created from view

    Hi all
    I'm using Oracle database 11g
    I've created table from view as the following command:
    Create table table_new as select * from View_Old
    I can insert/update data into table_new by command line.
    But I can not Insert/update data of table_new by SI Oject Browser tool or Oracle SQL Developer tool .(read only)
    Anybody tell me, what's happend? cause?
    Thankyou
    thiensu
    Edited by: user8248216 on May 5, 2011 8:54 PM
    Edited by: user8248216 on May 5, 2011 8:55 PM

    I can insert/update data into table_new by command line.
    But I can not Insert/update data of table_new by SI Oject Browser tool or Oracle SQL Developer tool .(read only)so what is wrong with the GUI tools & why posting to DATABASE forum when that works OK?

Maybe you are looking for

  • Questions on the very basics of setup

    I'm helping a "friend" setup his MacBook Pro (a likely story, I know). he has an AirPort Extreme and wants to connect to the internet using his DSL box. All the cables are correctly connected, I believe. Went through the procedure of using the AirPor

  • External web service provided by third party application

    Hi all, Hope to clarify some doubts on usage of Enterprise Service Repository. I understand that ESR is the storage of service interfaces that may be provided or consume by different systems in the landscape. If a business process is required to cons

  • How do i update a new iPad air with everything on my old iPad gen1?

    Just got a new ipad air to replace my ipad gen1.  How do I get all my apps, pics, video, etc...from the old ipad to the new one?  Does Cloud simply replicate everything?

  • Rollback segment error

    Hello experts, My problem is as follows: I need to perform a large transaction on one of my tables in my database. I have to delete a large number of records using a command as follows: Delete from mytable where ordernumber like '2000%'; Each time i

  • Issue with Transfer order after inbound delivery

    HI SAP Experts ,   we have an issue where User inputed the Inbound delivery and then assigned with Handling Unit and then he has Created the Transfer order and which he has confirmed later he has Unassigned Handling Unit , know how can he  Proceed fu