How can I use Hash Table when processing the data from cdpos and cdhdr

Hello Guru,
I've a question,
I need to reduce the access time to both cdhdr and cdpos.
Because may be I'll get a huge number of entries.
It looks like that by processing cdhdr and cdpos data will take many secondes,
it depends on how many data you need to find.
Hints : Putting instructions inside a form will slow down the program?
Also, I just want use Hash table and I need to put a loop-instruction going on the hash-table in form.
I know that it's no possible but I can declare an index inside my customized hash table.
For example :
DO
READ TABLE FOR specific_hash_table WITH KEY TABLE oindex = d_oindex.
Process data
d_oindex += 1.
UNTIL d_oindex = c_max_lines + 1.
Doing this would actually not necessary improve the performance.
Because It looks like I'm having a standard table, may be there's a hash function, but it could be a bad function.
Also I need to use for example COUNT (*) to know how many lines I get with the select.
FORM find_cdpos_data_with_loop
  TABLES
    i_otf_objcs TYPE STANDARD TABLE
  USING
    i_cdhdr_data TYPE HASHED TABLE
    i_objcl TYPE j_objnr
*    i_obj_lst TYPE any
    i_option TYPE c
  CHANGING
    i_global TYPE STANDARD TABLE.
  " Hint: cdpos is a cluster-table
  CONSTANTS : objectid TYPE string VALUE 'objectid = i_obj_lst-objectid',
              changenr TYPE string VALUE 'changenr = i_obj_lst-changenr',
              tabname TYPE string VALUE 'tabname = i_otf_objcs-tablename',
              tabnameo1 TYPE string VALUE 'tabname NE ''''',
              tabnameo2 TYPE string VALUE 'tabname NE ''DRAD''',
              fname TYPE string VALUE 'fname = i_otf_objcs-fieldname'.
  DATA : BEGIN OF i_object_list OCCURS 0,
            objectclas LIKE cdpos-objectclas,
            objectid LIKE cdpos-objectid,
            changenr LIKE cdpos-changenr,
         END OF i_object_list.
  DATA : i_cdpos LIKE TABLE OF i_object_list WITH HEADER LINE,
         i_obj_lst LIKE LINE OF i_cdpos.
  DATA : tabnamev2 TYPE string.
  IF i_option EQ 'X'.
    MOVE tabnameo2 TO tabnamev2.
  ELSE.
    MOVE tabnameo1 TO tabnamev2.
  ENDIF.
*LOOP AT i_cdhdr_data TO i_obj_lst.
  SELECT objectclas objectid changenr
    INTO TABLE i_cdpos
    FROM cdpos
    FOR ALL ENTRIES IN i_otf_objcs
    WHERE objectclas = i_objcl AND
          (objectid) AND
          (changenr) AND
          (tabname) AND
          (tabnamev2) AND
          (fname).
  LOOP AT i_cdpos.
    APPEND i_cdpos-objectid TO i_global.
  ENDLOOP.
*ENDLOOP.
ENDFORM.                    "find_cdpos_data

Hey Mart,
This is what I met, unfortunately I get the same performance with for all entries.
But with a lot of more code.
FORM find_cdpos_data
  TABLES
    i_otf_objcs TYPE STANDARD TABLE
  USING
    i_objcl TYPE j_objnr
    i_obj_lst TYPE any
    i_option TYPE c
  CHANGING
    i_global TYPE STANDARD TABLE.
  " Hint: cdpos is a cluster-table
  CONSTANTS : objectid TYPE string VALUE 'objectid = i_obj_lst-objectid',
              changenr TYPE string VALUE 'changenr = i_obj_lst-changenr',
              tabname TYPE string VALUE 'tabname = i_otf_objcs-tablename',
              tabnameo1 TYPE string VALUE 'tabname NE ''''',
              tabnameo2 TYPE string VALUE 'tabname NE ''DRAD''',
              fname TYPE string VALUE 'fname = i_otf_objcs-fieldname'.
*  DATA : BEGIN OF i_object_list OCCURS 0,
*            objectclas LIKE cdpos-objectclas,
*            objectid LIKE cdpos-objectid,
*            changenr LIKE cdpos-changenr,
*         END OF i_object_list.
** complete modified code [begin]
  DATA : BEGIN OF i_object_list OCCURS 0,
            objectclas LIKE cdpos-objectclas,
            objectid LIKE cdpos-objectid,
            changenr LIKE cdpos-changenr,
            tabname LIKE cdpos-tabname,
            fname LIKE cdpos-fname,
         END OF i_object_list.
** complete modified code [end]
  DATA : i_cdpos LIKE TABLE OF i_object_list WITH HEADER LINE.
  DATA : tabnamev2 TYPE string.
** complete modified code [begin]
FIELD-SYMBOLS : <otf> TYPE ANY,
                <otf_field_tabname>,
                <otf_field_fname>.
** complete modified code [end]
  IF i_option EQ 'X'.
    MOVE tabnameo2 TO tabnamev2.
  ELSE.
    MOVE tabnameo1 TO tabnamev2.
  ENDIF.
**  SELECT objectclas objectid changenr
**    INTO TABLE i_cdpos
*  SELECT objectid
*      APPENDING CORRESPONDING FIELDS OF TABLE i_global
*      FROM cdpos
*      FOR ALL ENTRIES IN i_otf_objcs
*      WHERE objectclas = i_objcl AND
*            (objectid) AND
*            (changenr) AND
*            (tabname) AND
*            (tabnamev2) AND
*            (fname).
** complete modified code [begin]
  SELECT objectid tabname fname
      INTO CORRESPONDING FIELDS OF TABLE i_cdpos
      FROM cdpos
      WHERE objectclas = i_objcl AND
            (objectid) AND
            (changenr) AND
            (tabnamev2).
ASSIGN LOCAL COPY OF i_otf_objcs TO <otf>.
  LOOP AT i_cdpos.
  LOOP AT i_otf_objcs INTO <otf>.
   ASSIGN COMPONENT 'TABLENAME' OF STRUCTURE <otf> TO <otf_field_tabname>.
   ASSIGN COMPONENT 'FIELDNAME' OF STRUCTURE <otf> TO <otf_field_fname>.
    IF ( <otf_field_tabname>  EQ i_cdpos-tabname ) AND ( <otf_field_fname> EQ i_cdpos-fname ).
      APPEND i_cdpos-objectid TO i_global.
      RETURN.
    ENDIF.
  ENDLOOP.
  ENDLOOP.
** complete modified code [end]
**  LOOP AT i_cdpos.
**    APPEND i_cdpos-objectid TO i_global.
**  ENDLOOP.
ENDFORM.                    "find_cdpos_data

Similar Messages

  • How can I use "write to spreadsheet" during the data is taking but not the end of all the loops

    Hi,
    I have to run an experiment on Labview 6 or 5. I don't have Labview 7 on that computer for some reason. My experiment is talking about 1000 hours, and I have a probelm on storing the data. Right now I am using "Write to spread sheet" and I set the "append" to false. And the data is installed at the end of the experiment, that means after 1000 hours. In the mean time if somthing oges wrong like power cut or what, I will lose all the data. So what I want to do is to save the data evertime when the data is took. I tired to set the "append" to true, but it does not let me to choose the "file path"--- when I choose this and select write on new or excisting file, it said" you may not be able to save on a exciting file" and it does not let me create a new file either. If anyone have the lidea like how can I use the "wrtie to spreadsheet" function and at the same time can install the data everytime inside the look, please let me know. Thanks alot.
    KL

    KL,
    It sounds like you want to periodically save your data so it is in smaller files. (great idea) For this operation you will not want to append the data...if something happens to your system while the file is open it could become corrupt and ruin all the data. You need to write the new block of data to a new file every time. Now...this depends on how big your data is...if you only have like 500k of data to write in a block you should probably write several blocks before starting a new file. I don't know enough about how much data you are acquiring. In either case...the write to spreadsheet file.vi will need a different name each time it is called and you will not want to append. Append = false.
    -Brett

  • How can i update my new iphone with the data from my old iphone?

    I recently bought an iphone 3GS after my iphone 4 was stolen but when i try to sync the new phone it says the software is out of date. (when i was telling the guy at the apple store about my phone being stolen he said when you get a new phone just sync it to retrieve all the information stored on there. Is there any way i can retrieve the stuff from my old phone? I would like my messages, notes and apps from my old phone on my new one.

    Just to make sure - You're saying you had backed up your iPhone 4. When you plug in the 3GS, and try to "restore" the data from the iPhone 4 backup onto the 3GS, you get that error? Check to see if the iOS version is up-to-date, and hopefully it isn't. It might also be because your iPhone 4 wasn't, and is causing some sort of problem.
    Good luck!

  • HT3354 how can i use one table for reference to another

    how can i use a table for a referance to another eg when i type a word in a cell, i will like it to match the word with another table then return the information in the cell i am using

    you can use vlookup() (or any of the lookup family of functions) to locate an item based on a key value:
    Here is an example of something you can do with two tables:
    The table on the right is title "Data" and stores a list of names with age and favorite color.
    The table on the left uses the value in the first column to lookup up information in the table Data
    in the table on the left:
    B2=IFERROR(A2&" is " & VLOOKUP(A2, Data :: A:D, 2, 0)&" years old and likes the color "& VLOOKUP(A2, Data :: A:D, 3, 0), "NOT FOUND")
    I know this look complicated.  so I'll break it up into smalled pieces:
    first the "&" is called the concatenate operator and joins two strings.  like this:
    a string is a set of characters between double quotes.
    so "string 1" & "string 2" becomes "string 1string2"  or "Sam " & "Jones" becomes "Sam Jones"
    you can use cell references instead of strings directly in which case the concatenation is performed on the contents of the cells.
    so if cell A1 contains "Hi " and the cell A2 contains "There"  then A1 & A2 will result in "Hi There"
    so you could add the formula
    A3=A1 & A2
    this is short hand for select cell A3 then type everything including the A3 so that A3 contains "=A1 & A2" (omit the double quote)
    OK.  So the formula I provided concatenates several items together:
    it concatenates A2, then the string " is " then a formula, then the string " years old and likes the color " then a formula
    the two formulas (highlighted in blue) perform a lookup of the value in cell A2 in columns A thru D of the table named "Data".  If if finds the value in cell A2 in the first column of the lookup range in the table Data (column A) then it returns the value from the same row but in the second or third column.
    all that is in a function calld iserror() to trap the condition where the calue you enter in A2 does not exist in the table Data:
    You will find the Numbers users guide and function reference helpful.  You can download then from Apple here:
    http://support.apple.com/manuals/#productivitysoftware

  • How can I use Guest network when my internal server provides the DNS?

    How can I use guest network when my internal server provides the DNS? The help article TS4505 tells me to enter an external DNS server, but I believe I can not configure my network that way...

    Apple assumes that you will be connecting the Time Capsule to a simple modem....and.....that the Time Capsule is configured as a router to provide DHCP and NAT services for the network.
    The Guest Network cannot be enabled correctly unless the Time Capsule is in charge of DHCP and NAT services on the network.
    Another way of saying the same thing is that the Guest Network will not operate correctly if the  Time Capsule is configured in Bridge Mode or DHCP Only.

  • How can I use AirPort Express when traveling?

    How can I use AirPort Express when traveling?

    How can I use AirPort Express when traveling?
    Connect the AirPort Express to the Ethernet port in your room.....to be able to create your own private wireless network in your room for multiple devices.
    You will still have to pay the hotel Internet charge for one device, if the hotel charges for Internet access.
    If the hotel only provides wireless service, then a single AirPort Express will not help you.
    However, if you have two AirPort Express devices, then you can use one to "join" the hotel wireless network, then connect the second Express to the first using an Ethernet cable and create your own wireless network for multiple devices in your room.

  • How can I use apple gift card in the Philippines . It says it's only applicable in US storefront

    How can I use my gift card in the Philippines  when it says for US Storefront only

    You cannot use that card. iTunes gift cards are only valid in the country of original purchase.

  • How can i use offline & online database in the same time?

    how can i use offline & online database in the same time?
    my database in another server when the connection true it connect
    but if not does not work
    i wanna make offline database if the server not connected it connect offline then the server is on it alter all data from the offline to the server.

    User, please tell us your Jdev version!
    There is no such functionality build into the framework. The offline data base is only for designing the db, not to have a backup db.
    If you can't connect to the db the application will not work.
    Timo

  • How can I use FK description in a BC4J data query component?

    Hi all,
    I am facing the following problem.
    Although I use renderers in the DataEdit component for displaying the descriptions of the FKs this is not useful for the BC4J data query components.
    How can I get the same functionality as in the dataEdit components?
    Thanks in advance,
    Aggelos

    Anfortunately,
    This is not the same when I have a DataQuery component.
    The question now becomes as following:
    How can I use FK description in a BC4J data query component?
    Thanks in advance
    Aggelos

  • How can i use my apple ID with the itune store over my windows laptop

    how can i use my apple ID with the itune store over my windows laptop

    If you don't have iTunes installed on your laptop then you can download and install it from here : http://www.apple.com/itunes/download/
    You can then log into your account on it via the Store > Sign In menu option (on iTunes 11 on a PC you can get the menus to show via control-B) :
    And you can then select the Store on the left-hand sidebar (you can enable the sidebar via control-S), and then browse items in the store and buy them by clickin on their price.

  • Hi, we have two iphones with two accounts.  The apple tv automatically syncs with one account to play music from the iphone to apple tv.  How can I use my iphone to do the same?

    Hi, we have two iphones with two accounts.  The apple tv automatically syncs with one account to play music from the iphone to apple tv.  How can I use my iphone to do the same?

    Our experience is a little different, we have different iTunes accounts for different family members, each family member has their own iTunes library on their own mac, each mac uses my Apple ID for homesharing and we are able to play purchased content from each library on the Apple TV.

  • TS4148 I have an apple 4 given to me by my cousin from japan but the phone is lock by japan sotfbank, how can i use this phone here in the Philippines network provider? thanks

    I have an apple 4 given to me by my cousin from japan but the phone is lock by japan sotfbank, how can i use this phone here in the Philippines network provider? thanks

    Only the carrier an iPhone was sold as carrier locked with can officially unlock the iPhone. It is my understanding that Softbank in Japan does not unlock iPhones.

  • [HELP],875P LSR ,HOW Can I USE 3 Optical Drives in the MoBO?

    I have 1 SATA HDD Drive (Seagate 160G) installed and Have 3  Optical Drives ,Pioneer DVD and Liton CDRW in IDE2 , Plextor CDRW in IDE3 ,but MOBO can't recgnize the PLextor CDRW,WHY???
    NEED HELP!!!!!HOW can I USE these 3  Optical Drives the same time?THANK's LOT!

    Thanks Everybody!
    I changed another IDE Cable and set IDE mode in BIOS : Native , SATA only ,Keep PATA, both channels
    then,
    Everything is OK!
    How silly I am ! I used a bad 80 pin IDE CABLE!

  • How can I use SQL to check if the receipt is accounted?

    Dear all:
    How can I use SQL to check if the AR receipt is accounted ? Because there is so many receipts to check, I cannot open it to see the detail one by one.
    My environment is :11.5.9
    database : Oracle 9.2.0.8

    Duplicate post.
    How can I use SQL to check if the receipt is accounted?
    Re: How can I use SQL to check if the receipt is accounted?

  • How can i unlock my iPhone 4s i bought off from eBay and is Verizon im current oversea i want to use a local sim card

    how can i unlock my iPhone 4s i bought off from eBay and is Verizon im current oversea i want to use a local sim card

    First you'd have to establish service with Verizon. Once a paying customer in good standing, you can then request the GSM portion be unlocked. Obviously, you can't do any of that stuff while you're out of the US. They will not unlock the CDMA side.

Maybe you are looking for

  • Computer wont recognize iphone

    i unplugged my iphone4s on accident while it was doing a backup restore in itunes when i plugged it back in a notification popped up saying the device in the usb port is unrecognised because the device has malfunctioned.... how do i fix this

  • How do I open photoshop from my other computer?

    how do I open photo shop from my other computer?

  • AIA error handling solutions

    Hi All, Could anyone please help me out understanding, what are solutions available from the AIA error handling perspective?? Thannks, Santosh

  • Format Mask Property

    I have a field “cat_no. varchar2 (9)” now I want the values should be save in this field such as 11-23-765, 23-45-876 etc. I use Format mask property of this field as FM99"-"99"-"999, but It can not save with dash (-) such as 11-23-344, it save as 11

  • IOS 6 Notification sound not working!!

    Hi everyone, when I updated my iphone 4s to the latest version of OS meaning  IOS6, I noticed that the sound in notification is not working. Only displaying the notification. Anyone anyone else have this problem and if so how to solve it please ?