Please explain how to use binary search in this loop.

Hi,
I want to use the binary search in below Read please give me solution....
LOOP AT it_vbfa_temp ASSIGNING <fs_vbfa_temp>.
      CLEAR is_ekbz1.
      READ TABLE it_ekbz1 INTO is_ekbz1 WITH KEY xblnr = <fs_vbfa_temp>-deliv flag = space.
      IF  sy-subrc = 0.
        w_tabix = sy-tabix.
        is_ekbz1-tknum = <fs_vbfa_temp>-shipno.
        is_ekbz1-flag  = 'X'.
        MODIFY it_ekbz1 FROM is_ekbz1 INDEX w_tabix TRANSPORTING tknum flag.
ENDLOOP.

Hi,
Thanks for the inputs given.. Please find the solution for the same ....
   CLEAR is_ekbz1.
    is_ekbz1-flag = 'X'.
    MODIFY it_ekbz1 FROM is_ekbz1 TRANSPORTING flag WHERE flag IS INITIAL.
    SORT it_ekbz1 BY ebeln xblnr lifnr flag.
  LOOP AT it_vbfa_temp ASSIGNING <fs_vbfa_temp>.
      CLEAR is_ekbz1.
      READ TABLE it_ekbz1 INTO is_ekbz1 WITH KEY xblnr = <fs_vbfa_temp>-deliv flag = 'X' BINARY SEARCH.
      IF  sy-subrc = 0.
        w_tabix = sy-tabix.
        is_ekbz1-tknum = <fs_vbfa_temp>-shipno.
        is_ekbz1-flag  = space.
        MODIFY it_ekbz1 FROM is_ekbz1 INDEX w_tabix TRANSPORTING tknum flag.
  ENDLOOP.
Regards,
Srinivas
Edited by: Srininas on Apr 6, 2010 12:16 PM
Edited by: Srininas on Apr 6, 2010 12:17 PM

Similar Messages

  • Please Explain how to use extensions..

    We are using Agile D2R PIP, we do have some cutomizations. to enable the Extensions, we need change the following extensions to True.
    <Property name="ABCSEXTENSION.PREPROCESSABM">false</Property>
    <Property name="ABCSEXTENSION.POSTPROCESSABM">false</Property>
    <Property name="ABCSEXTENSION.PREPROCESSEBM">false</Property>
    <Property name="ABCSEXTENSION.POSTPROCESSEBM">false</Property>
    My question is to extend the Provider ABCS service, i will prefer set true for PREPROCESSEBM and POSTPROCESSABM.
    But In Environment A we have the properties like below
    <Property name="ABCSEXTENSION.PREPROCESSABM">false</Property>
    <Property name="ABCSEXTENSION.POSTPROCESSABM">true</Property>
    <Property name="ABCSEXTENSION.PREPROCESSEBM">true</Property>
    <Property name="ABCSEXTENSION.POSTPROCESSEBM">false</Property>
    In Environment B the properties are like below,
    <Property name="ABCSEXTENSION.PREPROCESSABM">true</Property>
    <Property name="ABCSEXTENSION.POSTPROCESSABM">true</Property>
    <Property name="ABCSEXTENSION.PREPROCESSEBM">true</Property>
    <Property name="ABCSEXTENSION.POSTPROCESSEBM">false</Property>
    But the functionality on both Environments is same. Can you please explain me how really extension processes works in the two cases..?
    Thanks
    SK

    Please refer to:
    http://docs.oracle.com/cd/E20713_01/doc.11112/e17364.pdf
    13.1.2. Introduction to Enabling Provider ABCS for Extension
    http://docs.oracle.com/cd/E23549_01/doc.1111/e17363/chapter06.htm#BABEAIFG
    6.5 Process Extensions
    As 'ABCSEXTENSION.PREPROCESSABM' is different, compare input/output payload of ABCS extension service in both environment for the difference.
    Also check PreprocessABMSequence in ABCS and what's done inside your ABCS extension service.
    What's the Prov ABCS service you r referring to?
    Regards,
    Faiz

  • Iphone 6 3 UK please explain how to use internet while not using wifi

    when i bought my iphone 6 i placed my sim in to my phone from my previous blackberry. i have credit but no plan as im on pay as you go. despite not having a plan i still have internet when i turn mobile data on when im outside my house. it doesnt work well so can anyone explain how this works if there taking money from my credit and the best plan for me internet wise thanks

    How do I ask a question on the forums?
    SQL and PL/SQL FAQ
    interesting code.
    so what exactly is your problem?

  • Please  explain how to use JarURLClassLoader?

    If you can please give an example.
    I want to know how to load classes from jar files and invoke them.

    You don't NEED to... that class is used internally by the JVM so don't care about it in your applikation. To test what I'm now saying do like this:
    Copy this class, compile it and put it into a jar-file. My jarfile was in the dir D:\javaforum\testmain\test.jar
    package lime.test.frames;
    import java.awt.BorderLayout;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    public class TestFrame extends JFrame {
         private static final long serialVersionUID = 1L;
         private JPanel jContentPane = null;
         private JLabel jLabel = null;
          * This is the default constructor
         public TestFrame() {
              super();
              initialize();
          * This method initializes this
          * @return void
         private void initialize() {
              this.setSize(300, 200);
              this.setContentPane(getJContentPane());
              this.setTitle("JFrame");
          * This method initializes jContentPane
          * @return javax.swing.JPanel
         private JPanel getJContentPane() {
              if (jContentPane == null) {
                   jLabel = new JLabel();
                   jLabel.setText("Called!");
                   jContentPane = new JPanel();
                   jContentPane.setLayout(new BorderLayout());
                   jContentPane.add(jLabel, BorderLayout.CENTER);
              return jContentPane;
         public static void main(String[] args) {
              TestFrame t = new TestFrame();
              t.setVisible(true);
    }Copy this class and put it wherever you want to, as long as it is not in the same catalog as the previous class or the jar-file created.
    package lime.javaforum;
    import lime.test.frames.*;
    public class InvokeTest {
          * @param args
         public static void main(String[] args) {
              TestFrame.main(args);
    }Compile it and start the InvokeTest with:
    [java -cp <path to jar> lime.javaforum.InvokeTest[/i]
    and see what will happen...

  • ICal on iPad: please explain how to use the duplicate calendars

    I am traveling with my iPad and cannot get on my computer. I want to add calendar events that will sync to MMe. I have checked off the calendars for @me.com. Sometimes the iPad duplicate switches on. I assume that i have this so i can see if i need to what is really on the iPad ND what is really on mobile me in case i don't have wi fi access. However Apple does not explain to us why so that we could understand our own systems. We are left to guess and stab in the dark. I want to add items that will go over to mobile me and to my phone. Do i add them in to the calendar that is on the ipad and then it will automatically sync the events?
    I just edited some items that had previously been synced to mobile me. Those items are showing up synced to my phone so i know they went to mobile me. However i added some new items that went into the calendar on my iPad and those are not syncing (I wonder why apple has this odd system set up?)
    So is there something i don't know about entering events in my iPad? Why would there be a dublicTe calendar kept that does not sync to the rest?
    Please help! I can't go to my computer to reset hints for now i just have to know how to input events correctly into iPad so they will sync to mobile me and my phone. I have previously fine through resetting hints with mobile me support so it all should be set up correctly.
    Thanks

    Edited version (it won't let me edit)
    I am traveling with my iPad and cannot get on my computer. I want to add calendar events that will sync to MMe. I have checked off the calendars for @me.com. Sometimes the iPad duplicate switches on. I assume that i have this so i can see if i need to what is really on the iPad and what is really on mobile me in case i don't have wi fi access. However Apple does not explain to us why so that we could understand our own systems. We are left to guess and stab in the dark. I want to add items that will go over to mobile me and to my iPhone. Do i add them in to the calendar that is on the ipad and then it will automatically sync the events?
    I just edited some items that had previously been synced to mobile me. Those items are showing up synced to my iphone now so i know they went to mobile me. However i added some new items that went into the calendar "on my iPad" and those are not syncing (I wonder why apple has this odd system set up?)
    So is there something i don't know about entering events in my iPad? Why would there be a duplicate calendar kept on the iPad that does not sync to the rest?
    Please help! I can't go to my computer to reset anything for now i just have to know how to input events correctly into iPad so they will sync to mobile me and my phone. I have previously been through resetting everything with mobile me support so it all should be set up correctly.
    Also I have the new iCal that was called beta ND it syncs through CalDav or whatever that is separate from the contacts and bookmarks.
    Thanks
    iPad wifi + 3G   Other OS   Why not give a choice for iPad in that list?  

  • Explain How to use Structure mapping button

    Hi All
    Iam Developing an application "Implementing and Using Exceptions in Guided Procedures"
    Can you please explain How to use Structure mapping button,
    Plz give me steps in details
    Thanks
    Srinivas

    Hi
    Create a project using 0020 as method.
    Max

  • I am having email problems with the new Lion.  stmp, imap, etc. I have looked up google info and It is confusing when it comes to TS, SSL also, please explain how to set it up so my email goes out and comes in securely.  Help

    I am having email problems with the new Mountain Lion.  stmp, imap, etc. I have looked up google info and It is confusing when it comes to TS, SSL also, please explain how to set it up so my email goes out and comes in securely.  Help
    Incoming Mail (IMAP) Server - requires SSL:
    imap.gmail.com
    Use SSL: Yes
    Port: 993
    Outgoing Mail (SMTP) Server - requires TLS:
    smtp.gmail.com (use authentication)
    Use Authentication: Yes
    Use STARTTLS: Yes (some clients call this SSL)
    Port: 465 or 587
    Account Name:
    your full email address (including @gmail.com) Google Apps users, please enter username@your_domain.com
    Email Address:
    your full Gmail email address ([email protected]) Google Apps users, please enter username@your_domain.com
    Password:
    your Gmail password
    The Quick Answer
    Follow the instructions below to set up IMAP1 access in most email clients.
    Google Apps users, please follow the default instructions unless otherwise noted, replacing 'your_domain.com' with your actual domain2 name.
    this is all greek to me. WHAT IS STARTTLS? On the first page of Apple set up there is a TLS certificate and it is marked NONE- should I change it to the long APPLE CERT option?  The next page under ADVANCED: THERE IS A BOX SSL MARKED.  Then IMAP Path Prefix - I put stmp.gmail.com.. is that right?  Port 993 can  use this one? as 456 doesn't work and 587 said it wasn't safe.  Under AUTHENTICATION I used PASSWORD.  Should I have used external client cert TLS?
    Please help me set this up securely. Thanks

    Apple - Support - Mail Setup Assistant

  • In Pages 09 we can do Mail Merge and Import Styles from a document. Can someone please explain how we can do this with the new version of Pages 5.1. Even Apple solutions are only valid for Pages Version 09. What a DOWN GRADE!

    In Pages 09 we can do Mail Merge and Import Styles from a document. Can someone please explain how we can do this with the new version of Pages 5.1. Even Apple solutions are only valid for Pages Version 09. What a DOWN GRADE! Thank god Pages 09 is still there.

    …and the other 98 missing features.
    Just use Pages '09, which should be in your Applications/iWork folder.
    Rate/review Pages 5 in the App Store.
    Peter

  • How to use standard Search Input Help (return 2 data code and desc) ?

    Hi,
    Please advise how to use standard Input Help provided by SAP and return 2 data (code and description) ? because the standard Input Help only return the code only ?
    Thank You and Best Regards
    Fernand

    >
    Saket  Abhyankar wrote:
    > Hi,
    >
    > I think you need to go for 'Search Help Exit' or OVS.
    >
    > Regards,
    >
    > Saket.
    That is not true that this is the only way.  The standard Data Dictory based search help can return more than one value as long as there are multiple exporting values defined in the search help, the search help is attached to a Data Dictionary Structure, and this same data dictionary structure is used as the source of the context node. You can read more about this in the online help:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/9f724642314aabe10000000a42189b/frameset.htm
    The Note section under Integration:
    If an input help structure is stored in a field in the ABAP Dictionary, and if you want to use the field mapping of search help parameters stored in the ABAP Dictionary as the field name for the structure for your Web Dynpro input help, then map your context nodes to this structure. This ensures that all components of the structure are available dynamically at runtime as attributes of the node.
    If the context node is not mapped to the structure, the data element's input help can be used if there is one.

  • READ using Binary Search

    Hi,
    Is it necessary to use all the sorted keys in READ using BINARY SEARCH .
    For EX: Sort it_tab BY key1 key2
    While Reading i will use only key1 with BINARY SEARCH,Please tell me whether READ statement works?
    Thanks,
    Rathish

    Hello Ratish,
    There isnt any hard and fast rule that you will have to use all the fields on which you sort. The key fields which you may want to use in the READ statement depends on the logic with which you are reading the internal table. As Rob pointed out its better to use all the fields which could make a record unique in the READ statement else it would keep reading only the first occurence of the record.
    Vikranth

  • A little urgent when to use binary search.

    Hi evryone,
    Plz let me know under what kind of conditions can we use binary search addition cause if I use it for every read statement the database acees in se30 goes higher than normal.
    If i randomly select only a few big read table statements the database acees in se30 goes is slightly lesser.
    But I some how dont know where to use binary search and where not to with read statements.
    Expecting an early reply.
    Rgds,
    Anu

    hi,
    If you read entries from standard tables using a key other than the default key, you can use a binary search instead of the normal linear search. To do this, include the addition BINARY SEARCH in the corresponding READ statements.
    READ TABLE <itab> WITH KEY <k1> = <f1>... <kn> = <fn> <result>
                                                           BINARY SEARCH.
    The standard table must be sorted in ascending order by the specified search key. The BINARY SEARCH addition means that you can access an entry in a standard table by its key as quickly as you would be able to in a sorted table.
    REPORT demo_int_tables_read_index_bin.
    DATA: BEGIN OF line,
            col1 TYPE i,
            col2 TYPE i,
          END OF line.
    DATA itab LIKE STANDARD TABLE OF line.
    DO 4 TIMES.
      line-col1 = sy-index.
      line-col2 = sy-index ** 2.
      APPEND line TO itab.
    ENDDO.
    SORT itab BY col2.
    READ TABLE itab WITH KEY col2 = 16 INTO line BINARY SEARCH.
    WRITE: 'SY-SUBRC =', sy-subrc.
    The output is:
    SY-SUBRC =    0
    The program fills a standard table with a list of square numbers and sorts them into ascending order by field COL2. The READ statement uses a binary search to look for and find the line in the table where COL2 has the
    reward if useful.
    Thanks,
    Madhukar

  • When to use binary search ... little urgent.

    Hi evryone,
    Plz let me know under what kind of conditions can we use binary search addition cause if I use it for every read statement the database acees in se30 goes higher than normal.
    If i randomly select only a few big read table statements the database acees in se30 goes is slightly lesser.
    But I some how dont know where to use binary search and where not to with read statements.
    Expecting an early reply.
    Rgds,
    Anu

    Hi,
    If  you read entries from standard tables using a key other than the default key, you can use a binary search instead of the normal linear search. To do this, include the addition BINARY SEARCH in the corresponding READ statements.
    READ TABLE <itab> WITH KEY <k1> = <f1>... <kn> = <fn> BINARY SEARCH.
    The standard table must be sorted in ascending order by the specified search key. The BINARY SEARCH addition means that you can access an entry in a standard table by its key as quickly as you would be able to in a sorted table.
    BINARY SEARCH approaches the middle entry in the table, decides if it matches, or lexically greater than or equal to the key being searched. It accordingly skips either the top or bottom part of the internal table and searches the other half. It repeats this process till it finds the row.
    Using BINARY SEARCH with READ is the most efficient way to read standard internal tables which are sorted by the key used to search them
    BINARY SEARCH addition when reading a sorted table is not required, as it happens by default. It makes a good difference in performance if you are reading a large standard internal table without sorting and reading by BINARY SEARCH.
    Regards,
    Padmam.

  • Can't we use Binary SEARCH  for TYPE SORTED TABLE?(Performance Improvement)

    Hi Expert!
                       I have declare a sorted type table with NON -UNIQUE, and want to use Binary search in read statement. But while  using bunary search in read statement I'm facing an error. The ERROR is
    "Table LI_MARC is a SORTED TABLE or INDEX TABLE. The BINARY SEARCH
    addition is only allowed for these tables if the key specified is an
    initial part of the table key."
    Please find detail
    TYES: tt_marc  TYPE SORTED TABLE OF marc   WITH NON-UNIQUE KEY matnr,werks.
    DATA: li_marc type tt_marc.
    READ TABLE li_marc INTO marc WITH KEY matnr = i_mbew-matnr     
                                                                          werks = i_mbew-bwkey BINARY SEARCH . 
    To my understanding , there is no need to mention Bianry Search  for sorted table TYPE. Please  let me know can  i use ?

    Hello,
    there is no need to mention Bianry Search for sorted table TYPE.
    Yes, this is because for SORTED TABLEs binary search algorithm is used by default for READ TABLE. Although you can use BINARY SEARCH addition but it's use is redundant.
    As for your case you've defined the KEY fields incorrectly There shouldn't be any "comma(s)" between the fields.
    TYPES: tt_marc TYPE SORTED TABLE OF marc WITH NON-UNIQUE KEY matnr werks.
    When you define it with commas
    TYPES: tt_marc TYPE SORTED TABLE OF marc WITH NON-UNIQUE KEY matnr, werks.
    the result is something like this:
    TYPES: tt_marc TYPE SORTED TABLE OF marc WITH NON-UNIQUE KEY matnr.
    TYPES: werks.
    Hence you were getting the syntax error!
    BR,
    Suhas
    PS: As for MARC you can use UNIQUE KEY addition because MATNR & WERKS are the key fields in the table.

  • Can somebody please explain how to format and then reinstall Mac lion10.7 without cd

    can somebody please explain how to format and then reinstall Mac lion10.7 without cd

    You will need either an Ethernet or Wifi Connection to the Internet - USB Mobile device is not supported.
    If you already have Lion installed you can boot to Recovery with Command R and use the Disk Utility to erase the Macintosh HD and then reinstall the OS from the Mac OS X Utilities.
    You will need the Apple Id used for purchase if the Mac did not ship with Lion installed originally.
    If you want to repartition the HDD you can use the Recovery Disk Assistant to make a recovery USB drive
    http://support.apple.com/kb/DL1433
    http://support.apple.com/kb/HT4848
    As Always - Back up the Mac before erasing unless you are confident there is absolutely nothing on the mac that you might possibly need later.
    If the machine is a 2011 build or later you might be able to boot to Internet Recovery with Command Option R

  • Could someone explain how to use of the object Thermometer?

    Hi to all,
    please, could someone write a real example explaining how to use the thermometer in order to indicate the progress of a process like to submit a document?
    I need to do it exactly to indicate this process in Adobe Reader.
    Thanks.
    Dan

    Sorry but I surely have explained my problem badly. I understand how to use the object thermometer perfectly.
    I need to use this object in order to determine the progress of the document's transference when I submit a PDF form from Adobe Reader.
    I'm having problems when I try to do this, and I would like to know if there exists some way to do it.
    b I have tried the following:
    var t = app.thermometer;
    t.duration = 1000;
    // How can I know this value?
    t.begin();
    t.text = "Please wait";
    // Is this a madness?
    while( event.target.submitForm( { cURL: [...], cSubmitAs: [...] } ) )
       t.value++;
    t.end();
    Thank you for your time
    Dan

Maybe you are looking for

  • Is  there any another BI tools ( other than  Mltiprovider / Infoset )  for

    For connecting two different information .. of two cubes  with a single matching columb , Multiprovoider / Infoset Is there is any another tool  ? Thanks Regards Sanjeev Kumar

  • Could anyone please tell me how to tuning my program?

    I have already executed the program with SE30. I think that the program has some problem SQL in form "GET_BACK_ORDER       (Fetch VBAP, Net % = <b>26.2</b>)" and "GET_PENDING_ORDER (Fetch AUFK,  Net % = <b>25.7</b>)" but I can not find the data that

  • Table Header Reference as variable

    Good Day, I have a simple table that is a summary of multiple tables.  The data comes in with a function SheetName::Table 1:: ColunnReference RowReference I would like to adjust the ColumnReference with a variable from a Pop-Up Menu box.  Is this pos

  • Stacked canvas appearing over content canvas by default

    Hi Guys, I have a Main content canvas and a stacked canvas. Both are having common single window attached to them window type is Document. When I launch this form then main content canvas is displayed but with stacked canvas on top of it. Control is

  • Saving a file on Android?

    Hi Everyone, I'm having trouble saving a file on Android devices. I'm using the Air for Android packager and a Droid 2 if that matters. I have a base XML file that I want to open, manipulate and save. The base file is one of the 'included files' that