Sitemap

Amicuk Programming Answers

How about use partial key to loop at a hashed table?

2015-10-11   Views:0

Advertisement

Such as I want to loop a Internal table of BSID according to BKPF. data itab_bsid type hashed table of BSID with unique key bukrs belnr gjahr buzid. Loop at itab_bsid where bukrs = wa_bkpf-bukrs                           and    belnr  = wa_bkpf-belnr

Such as I want to loop a Internal table of BSID according to BKPF.
data itab_bsid type hashed table of BSID with unique key bukrs belnr gjahr buzid.
Loop at itab_bsid where bukrs = wa_bkpf-bukrs
                          and    belnr  = wa_bkpf-belnr
                          and    gjahr  = wa_bkpf-gjahr.
endloop.
I know if you use all key to access this hashed table ,it is certainly quick, and my question is when i use partial key of this internal hashed table to loop it, how about its performance.
Another question is in this case(BSID have many many record) , Sorted table and Hashed table , Which is better in performance.

The replay answer
Advertisement
You can't cast b/w data reference which l_tax is and object reference which l_o_tax_code is.
osref is a generic object type and you store a reference to some object in it, right? So the question is: what kind of object you store there? Please note - this must be an object reference , not data reference .
i.e
"here goes some class
class zcl_spfli definition.
endclass.
class zcl_spfli implementation.
endclass.
"here is an OBJECT REFERENCE for it, (so I refer to a class) i.e persistent object to table SPFLI
data oref_spfli type ref to zcl_spfli.
"but here I have a DATA REFERENCE (so I refer to some data object) i.e DDIC structure SPFLI
data dref_spfli type ref to spfli.
So my OSREF can hold only oref_spfli but it not intended for dref_spfli . That's why you get this syntax error. Once you have stored reference to zcl_spfli in osref then you will be able to dereference it and access this object's attributes.
data: osref type osref.
create object osref_spfli.
osref = osref_spfli.
"now osref holds reference to object, you can deference it
oref_spfli ?= osref.
osref_spfli->some_attribute = ....
OSREFTAB is just a table whose line is of type OSREF (so can hold multiple object references - one in each line).
Regards
Marcin

Go to See the other 11 answers

How about use partial key to loop at a hashed table?

Category:DefaultRelease time:2015-10-11Views:130

Such as I want to loop a Internal table of BSID according to BKPF. data itab_bsid type hashed table of BSID with unique key bukrs belnr gjahr buzid. Loop at itab_bsid where bukrs = wa_bkpf-bukrs                           and    belnr  = wa_bkpf-belnr[More]

Questions in partial key matches of Btree

Category:DefaultRelease time:-0001-11-30Views:130

Hi, For Btree access method, partial key matches and range searches can be done through cursor with DB_SET_RANGE flag specified. It will return "the smallest record in the database greater than or equal to the supplied key". Seems it only suppor[More]

Windows 7 not genuine, Have partial key code

Category:DefaultRelease time:-0001-11-30Views:130

I keep geting this message that WIndows & is not genuine.  I know it is, however I recently had my hard drive replaced. I have a partial key code and my Computer name is HP Pavilliaon P6000 Series, Model #P6823B The Partial key code is: 73CQT-WFM7J-3[More]

Partial Key Selects

Category:DefaultRelease time:-0001-11-30Views:130

Hi everyone I am aware that when writing a select statement it is preferable to have all the PK fields in the where clause and failing that to have as many of the leftmost key fields as possible.  However, I have a situation where I am only intereste[More]

Performace Which is better ?  : Bapi inside a loop OR Select from Tables

Category:DefaultRelease time:2015-10-11Views:130

Hi Gurus, I have a report which displays purchase info records. If I am selecting from tables i need to use EINA, EINE, EORD and some other tables. There is a BAPI which gets all purchase info records specific to a vendor , material , purchasing orga[More]

Modify key in Hashed table

Category:DefaultRelease time:2015-10-11Views:130

Hi All, I have hashehed internal table like this. data :  it_zawcumsetz like hashed table of zawcumsetz with unique key KTONR_OPUS ZZ_AWC WAERS_OPUS. I am geeting entries in table. LOOP AT it_zawcumsetz into wa_zawcumsetz.      IF  wa_zawcumsetz-zz_a[More]

While loop in a Hash Map

Category:DefaultRelease time:-0001-11-30Views:130

My while loop doesnt seem to work in a hash map, it works fine when I loop an array list. It compiles but it doesnt seem to find any employees, should I use another loop? {code public Employee find(String id) Employee foundEmployee = null; int index[More]

Sy-tabix in relation to LOOP AT and READ TABLE

Category:DefaultRelease time:2015-10-11Views:130

Hi All, As per SAP documentation, 1) While looping through an internal table (LOOP AT), sy-tabix contains the index number of current row(for standard and sorted tables) 2)When successfully reading from an internal table(READ TABLE), sy-tabix is set[More]

Which system variable is reset at the exit of a loop of an internal table

Category:DefaultRelease time:2015-10-11Views:130

which system variable is reset at the exit of a loop of an internal table a)sy-loop b)sy-index c)sy-dbcnt d)sy-tabixYou might want to revist your threads from Friday, and award points and mark as "Answered" or "Solved". Regards, Rich H[More]

HELP! FOR LOOP TO SCROLL THROUGH TABLE AND CREATE DATABASE LINK

Category:DefaultRelease time:2015-10-11Views:130

Hi, Here's the scenario, not much of a PL programmer, just basic SQL so really need some help people! I have 2 tables. 1 contains list of DB's and the other contains rules to follow. I need to create a loop that goes through the table containing the[More]

Transportation lane KEY not getting generated in the table

Category:DefaultRelease time:2015-10-11Views:130

Transportation lane KEY not getting generated in the table Hi folks, The issue is like this : We have a weekly workorders upload program from legacy systems to SAP-APO. The legacy planners send a .CSV file containing material-wise workroders. A custo[More]

Hot
Hi all, We have an existing Customer Balances report wherein we are able to veiw the Debit/Credit amount Of all the open items based on the input date given by the user but unable to view the items which have been cleared later for the items opened o [More]
When trying to PDF a webpage into a PDF, it does not work, I go through all the steps as normal, and It does nothing. I can repeat my action, where instead of "printing" to adobe, it saves the file, which it doesn't save it at all. I can't even [More]
Hello alles! When executing a program (a report) using SAP WebGUI or the portal (Manager's Desktop/Launchpad etc.), exporting the result list to a spreadsheet doesn't seem to work. No error message, browser doesn't really hang, but nothing happens. N [More]
I have a T500, but just got my daughter a T510. She is now away from home at school and having trouble with the media card reader. Seems it is very different from the one in the T500. Is there any place I can get instructions on how to use this reade [More]
When attempting to update firmware, I get: unexpected error: None of the checked updates could be installed So, I go to the downloads section of the apple website and manually download and install it. However, when I run for updates, the same files s [More]
Dear Expert, We have different Terms of Payment  as per the Customer, Ex. we have terms of payment i, e. for particular customer and its working or calculate as per the our sap system but for Customer calculate days of terms of payment as the when he [More]
My synchronization button, in the Files Tab, has all of a sudden been grayed out and I am unable to synchronize the local files to the files on the remote server for any of my websites. When I view both the remote files and local files I get the foll [More]
how can i sort cookies by add date, is there any method at all?Hi Ted Have a look at Cocoa Cookies. Requires minimum OS X Tiger. Not the most ideal cookie manager, but certainly a step up from Safari.Read other 3 answers [More]
please help me solving this peculiar problem with jspinner . I got a jspinner , a text box and a button of my frame.i have written code to valdiate the value entered in text field. If an invalid value is entered an error dialog is show. and focus is [More]
Hi, My dbs is installed on AIX 433 I have 4 dbs in oracle 8.1.6. I can start all the 4 dbs. I can connect to them without the network. But when I connect to them with the network I got the ORA-01034. But, there's always one db which I can connect to [More]