Internal Table with 22 Million Records
Hello,
I am faced with the problem of working with an internal table which has 22 million records and it keeps growing. The following code has been written in an APD. I have tried every possible way to optimize the coding using Sorted/Hashed Tables but it ends in a dump as a result of insufficient memory.
Any tips on how I can optimize my coding? I have attached the Short-Dump.
Thanks,
SD
DATA: ls_source TYPE y_source_fields,
ls_target TYPE y_target_fields.
DATA: it_source_tmp TYPE yt_source_fields,
et_target_tmp TYPE yt_target_fields.
TYPES: BEGIN OF IT_TAB1,
BPARTNER TYPE /BI0/OIBPARTNER,
DATEBIRTH TYPE /BI0/OIDATEBIRTH,
ALTER TYPE /GKV/BW01_ALTER,
ALTERSGRUPPE TYPE /GKV/BW01_ALTERGR,
END OF IT_TAB1.
DATA: IT_XX_TAB1 TYPE SORTED TABLE OF IT_TAB1
WITH NON-UNIQUE KEY BPARTNER,
WA_XX_TAB1 TYPE IT_TAB1.
it_source_tmp[] = it_source[].
SORT it_source_tmp BY /B99/S_BWPKKD ASCENDING.
DELETE ADJACENT DUPLICATES FROM it_source_tmp
COMPARING /B99/S_BWPKKD.
SELECT BPARTNER
DATEBIRTH
FROM /B99/ABW00GO0600
INTO TABLE IT_XX_TAB1
FOR ALL ENTRIES IN it_source_tmp
WHERE BPARTNER = it_source_tmp-/B99/S_BWPKKD.
LOOP AT it_source INTO ls_source.
READ TABLE IT_XX_TAB1
INTO WA_XX_TAB1
WITH TABLE KEY BPARTNER = ls_source-/B99/S_BWPKKD.
IF sy-subrc = 0.
ls_target-DATEBIRTH = WA_XX_TAB1-DATEBIRTH.
ENDIF.
MOVE-CORRESPONDING ls_source TO ls_target.
APPEND ls_target TO et_target.
CLEAR ls_target.
ENDLOOP.
Hi SD,
Please put the select querry in below condition marked in bold.
IF it_source_tmp[] IS NOT INTIAL.
SELECT BPARTNER
DATEBIRTH
FROM /B99/ABW00GO0600
INTO TABLE IT_XX_TAB1
FOR ALL ENTRIES IN it_source_tmp
WHERE BPARTNER = it_source_tmp-/B99/S_BWPKKD.
ENDIF.
This will solve your performance issue. Here when internal table it_source_tmp have no records, that time it was fetchin all the records from the database.Now after this conditio it will not select anyrecords if the table contains no records.
Regards,
Pravin
Similar Messages
-
Deleting records from a table with 12 million records
We need to delete some records on this table.
SQL> desc CDR_CLMS_ADMN.MDL_CLM_PMT_ENT_bak;
Name Null? Type
CLM_PMT_CHCK_NUM NOT NULL NUMBER(9)
CLM_PMT_CHCK_ACCT NOT NULL VARCHAR2(5)
CLM_PMT_PAYEE_POSTAL_EXT_CD VARCHAR2(4)
CLM_PMT_CHCK_AMT NUMBER(9,2)
CLM_PMT_CHCK_DT DATE
CLM_PMT_PAYEE_NAME VARCHAR2(30)
CLM_PMT_PAYEE_ADDR_LINE_1 VARCHAR2(30)
CLM_PMT_PAYEE_ADDR_LINE_2 VARCHAR2(30)
CLM_PMT_PAYEE_CITY VARCHAR2(19)
CLM_PMT_PAYEE_STATE_CD CHAR(2)
CLM_PMT_PAYEE_POSTAL_CD VARCHAR2(5)
CLM_PMT_SUM_CHCK_IND CHAR(1)
CLM_PMT_PAYEE_TYPE_CD CHAR(1)
CLM_PMT_CHCK_STTS_CD CHAR(2)
SYSTEM_INSERT_DT DATE
SYSTEM_UPDATE_DT
I only need to delete the records based on this condition
select * from CDR_CLMS_ADMN.MDL_CLM_PMT_ENT_bak
where CLM_PMT_CHCK_ACCT='00107' AND CLM_PMT_CHCK_NUM>=002196611 AND CLM_PMT_CHCK_NUM<=002197018;
Thsi table has 12 million records.
Please advise
Regards,
Narayanuser7202581 wrote:
We need to delete some records on this table.
SQL> desc CDR_CLMS_ADMN.MDL_CLM_PMT_ENT_bak;
Name Null? Type
CLM_PMT_CHCK_NUM NOT NULL NUMBER(9)
CLM_PMT_CHCK_ACCT NOT NULL VARCHAR2(5)
CLM_PMT_PAYEE_POSTAL_EXT_CD VARCHAR2(4)
CLM_PMT_CHCK_AMT NUMBER(9,2)
CLM_PMT_CHCK_DT DATE
CLM_PMT_PAYEE_NAME VARCHAR2(30)
CLM_PMT_PAYEE_ADDR_LINE_1 VARCHAR2(30)
CLM_PMT_PAYEE_ADDR_LINE_2 VARCHAR2(30)
CLM_PMT_PAYEE_CITY VARCHAR2(19)
CLM_PMT_PAYEE_STATE_CD CHAR(2)
CLM_PMT_PAYEE_POSTAL_CD VARCHAR2(5)
CLM_PMT_SUM_CHCK_IND CHAR(1)
CLM_PMT_PAYEE_TYPE_CD CHAR(1)
CLM_PMT_CHCK_STTS_CD CHAR(2)
SYSTEM_INSERT_DT DATE
SYSTEM_UPDATE_DT
I only need to delete the records based on this condition
select * from CDR_CLMS_ADMN.MDL_CLM_PMT_ENT_bak
where CLM_PMT_CHCK_ACCT='00107' AND CLM_PMT_CHCK_NUM>=002196611 AND CLM_PMT_CHCK_NUM<=002197018;
Thsi table has 12 million records.
Please advise
Regards,
NarayanDELETE from CDR_CLMS_ADMN.MDL_CLM_PMT_ENT_bak
where CLM_PMT_CHCK_ACCT='00107' AND CLM_PMT_CHCK_NUM>=002196611 AND CLM_PMT_CHCK_NUM<=002197018; -
Table with 200 millions records.
Dear all,
I have to create table which will accept 200 millions record. I have to do monthly report from these data.
The performance make me very very concern, does anyone has any suggestion?
Thanks in advance.Hi,
I have a situation like yours.
Each month, you need to create a new partition, for the next year, this is anothers partition.
For example, you have a table
SQL> CREATE TABLE sales99_cpart(
2> sale_id NUMBER NOT NULL,
3> sale_date DATE,
4> prod_id NUMBER,
5> qty NUMBER)
6> PARTITION BY RANGE(sale_date)
7> SUBPARTITION BY HASH(prod_id) SUBPARTITIONS 4
8> STORE IN (data01,data02,data03,data04)
9> (PARTITION cp1 VALUES LESS THAN('01-APR-1999'),
10> PARTITION cp2 VALUES LESS THAN('01-JUL-1999'),
11> PARTITION cp3 VALUES LESS THAN('01-OCT-1999'),
12> PARTITION cp4 VALUES LESS THAN('01-JAN-2000'))
13> /
For the next year, add new partition and subpartition.
Subpartitions are like table, after what you can use parallel query. It is very interristing for good performance.
You can partition table by range on date, and subpartition by hash on id callcenter.
Next year, if you want history, you can drop only one subpartition.
The cost : Oracle partitionning is an option of Oracle entreprise edition, this is not default option.
Nicolas. -
Delete 50 Million records from a table with 60 Million records
Hi,
I'm using oracle9.2.0.7 on win2k3 32bit.
I need to delete 50M rows from a table that contains 60M records. This db was just passed on to me. I tried to use the delete statement but it takes too long. After reading the articles and forums, the best way to delete that many records from a table is to create a temp table, transfer the data needed to the temp table, drop the big table then rename temp table to big table. But the key here is in creating an exact replica of the big table.I have gotten the create table, indexes and constraints script in the export file from my production DB. But in the forums I read, I noticed that I haven't gotten the create grant script, is there a view I could use to get this? Can dbms.metadata get this?
When I need to create an exact replica of my big table, I only need:
create table, indexes, constraints, and grants script right? Did I miss anything?
I just want to make sure that I haven't left anything out. Kindly help.
Thanks and Best RegardsCan dbms.metadata get this?
Yes, dbms_metadata can get the grants.
YAS@10GR2 > select dbms_metadata.GET_DEPENDENT_DDL('OBJECT_GRANT','TEST') from dual;
DBMS_METADATA.GET_DEPENDENT_DDL('OBJECT_GRANT','TEST')
GRANT SELECT ON "YAS"."TEST" TO "SYS"
When I need to create an exact replica of my big table, I only need:
create table, indexes, constraints, and grants script right? Did I miss anything?
There are triggers, foreign keys referencing this table (which will not permit you to drop the table if you do not take care of them), snapshot logs on the table, snapshots based on the table, etc... -
Importing a Partitioned Table with 10 Million Records.
I've been trying to import from a dump file using:
imp system/######@******** fromuser=fusr touser=tusr file=/f1/f2/expfl.dbf log=/o1/implg.log grants=N &
import done in US7ASCII character set and UTF8 NCHAR character set
import server uses UTF8 character set (possible charset conversion)
This contains a Table 'Tab_Mil_Rec', with almost 10 millions of records and has 10 partitions.
Done in 9i, on Solaris9.
Problem is the process abruptly ends at 'Tab_Mil_Rec'. This table is created but nothing is imported. I checked the log file, but it has logged events before this table, but nothing (not evens errors or termination message) after that. No errors are thrown even at os level, I don't know exactly because this was done as backgruond job.
Can anybody guess went wrong and whats the next step?Hi,
Can you tried import partition by partition of this table ?
Cheers -
Like % in a query running on an Oracle Apps table with 8 million records
I am running the below query. As per the explain plan it is using the index on organization_id and inventory_item_id.
select segment1 from mtl_system_items where organization_id = 100 and inventory_item_id like '123456%'
It takes about 15 min to run this query which is a long time as this query returns values to the frontend created in asp. The webpage would time out by the time this query completes running. do you have any suggestions on how to run this query faster?It is an oracle apps table. below is the structure -
Name Null? Type
INVENTORY_ITEM_ID NOT NULL NUMBER
ORGANIZATION_ID NOT NULL NUMBER
LAST_UPDATE_DATE NOT NULL DATE
LAST_UPDATED_BY NOT NULL NUMBER
CREATION_DATE NOT NULL DATE
CREATED_BY NOT NULL NUMBER
LAST_UPDATE_LOGIN NUMBER
SUMMARY_FLAG NOT NULL VARCHAR2(1)
ENABLED_FLAG NOT NULL VARCHAR2(1)
START_DATE_ACTIVE DATE
END_DATE_ACTIVE DATE
DESCRIPTION VARCHAR2(240)
BUYER_ID NUMBER(9)
ACCOUNTING_RULE_ID NUMBER
INVOICING_RULE_ID NUMBER
SEGMENT1 VARCHAR2(40)
SEGMENT2 VARCHAR2(40)
SEGMENT3 VARCHAR2(40)
SEGMENT4 VARCHAR2(40)
SEGMENT5 VARCHAR2(40)
SEGMENT6 VARCHAR2(40)
SEGMENT7 VARCHAR2(40)
SEGMENT8 VARCHAR2(40)
SEGMENT9 VARCHAR2(40)
SEGMENT10 VARCHAR2(40)
SEGMENT11 VARCHAR2(40)
SEGMENT12 VARCHAR2(40)
SEGMENT13 VARCHAR2(40)
SEGMENT14 VARCHAR2(40)
SEGMENT15 VARCHAR2(40)
SEGMENT16 VARCHAR2(40)
SEGMENT17 VARCHAR2(40)
SEGMENT18 VARCHAR2(40)
SEGMENT19 VARCHAR2(40)
SEGMENT20 VARCHAR2(40)
ATTRIBUTE_CATEGORY VARCHAR2(30)
ATTRIBUTE1 VARCHAR2(150)
ATTRIBUTE2 VARCHAR2(150)
ATTRIBUTE3 VARCHAR2(150)
ATTRIBUTE4 VARCHAR2(150)
ATTRIBUTE5 VARCHAR2(150)
ATTRIBUTE6 VARCHAR2(150)
ATTRIBUTE7 VARCHAR2(150)
ATTRIBUTE8 VARCHAR2(150)
ATTRIBUTE9 VARCHAR2(150)
ATTRIBUTE10 VARCHAR2(150)
ATTRIBUTE11 VARCHAR2(150)
ATTRIBUTE12 VARCHAR2(150)
ATTRIBUTE13 VARCHAR2(150)
ATTRIBUTE14 VARCHAR2(150)
ATTRIBUTE15 VARCHAR2(150)
PURCHASING_ITEM_FLAG NOT NULL VARCHAR2(1)
SHIPPABLE_ITEM_FLAG NOT NULL VARCHAR2(1)
CUSTOMER_ORDER_FLAG NOT NULL VARCHAR2(1)
INTERNAL_ORDER_FLAG NOT NULL VARCHAR2(1)
SERVICE_ITEM_FLAG NOT NULL VARCHAR2(1)
INVENTORY_ITEM_FLAG NOT NULL VARCHAR2(1)
ENG_ITEM_FLAG NOT NULL VARCHAR2(1)
INVENTORY_ASSET_FLAG NOT NULL VARCHAR2(1)
PURCHASING_ENABLED_FLAG NOT NULL VARCHAR2(1)
CUSTOMER_ORDER_ENABLED_FLAG NOT NULL VARCHAR2(1)
INTERNAL_ORDER_ENABLED_FLAG NOT NULL VARCHAR2(1)
SO_TRANSACTIONS_FLAG NOT NULL VARCHAR2(1)
MTL_TRANSACTIONS_ENABLED_FLAG NOT NULL VARCHAR2(1)
STOCK_ENABLED_FLAG NOT NULL VARCHAR2(1)
BOM_ENABLED_FLAG NOT NULL VARCHAR2(1)
BUILD_IN_WIP_FLAG NOT NULL VARCHAR2(1)
REVISION_QTY_CONTROL_CODE NUMBER
ITEM_CATALOG_GROUP_ID NUMBER
CATALOG_STATUS_FLAG VARCHAR2(1)
RETURNABLE_FLAG VARCHAR2(1)
DEFAULT_SHIPPING_ORG NUMBER
COLLATERAL_FLAG VARCHAR2(1)
TAXABLE_FLAG VARCHAR2(1)
QTY_RCV_EXCEPTION_CODE VARCHAR2(25)
ALLOW_ITEM_DESC_UPDATE_FLAG VARCHAR2(1)
INSPECTION_REQUIRED_FLAG VARCHAR2(1)
RECEIPT_REQUIRED_FLAG VARCHAR2(1)
MARKET_PRICE NUMBER
HAZARD_CLASS_ID NUMBER
RFQ_REQUIRED_FLAG VARCHAR2(1)
QTY_RCV_TOLERANCE NUMBER
LIST_PRICE_PER_UNIT NUMBER
UN_NUMBER_ID NUMBER
PRICE_TOLERANCE_PERCENT NUMBER
ASSET_CATEGORY_ID NUMBER
ROUNDING_FACTOR NUMBER
UNIT_OF_ISSUE VARCHAR2(25)
ENFORCE_SHIP_TO_LOCATION_CODE VARCHAR2(25)
ALLOW_SUBSTITUTE_RECEIPTS_FLAG VARCHAR2(1)
ALLOW_UNORDERED_RECEIPTS_FLAG VARCHAR2(1)
ALLOW_EXPRESS_DELIVERY_FLAG VARCHAR2(1)
DAYS_EARLY_RECEIPT_ALLOWED NUMBER
DAYS_LATE_RECEIPT_ALLOWED NUMBER
RECEIPT_DAYS_EXCEPTION_CODE VARCHAR2(25)
RECEIVING_ROUTING_ID NUMBER
INVOICE_CLOSE_TOLERANCE NUMBER
RECEIVE_CLOSE_TOLERANCE NUMBER
AUTO_LOT_ALPHA_PREFIX VARCHAR2(30)
START_AUTO_LOT_NUMBER VARCHAR2(30)
LOT_CONTROL_CODE NUMBER
SHELF_LIFE_CODE NUMBER
SHELF_LIFE_DAYS NUMBER
SERIAL_NUMBER_CONTROL_CODE NUMBER
START_AUTO_SERIAL_NUMBER VARCHAR2(30)
AUTO_SERIAL_ALPHA_PREFIX VARCHAR2(30)
SOURCE_TYPE NUMBER
SOURCE_ORGANIZATION_ID NUMBER
SOURCE_SUBINVENTORY VARCHAR2(10)
EXPENSE_ACCOUNT NUMBER
ENCUMBRANCE_ACCOUNT NUMBER
RESTRICT_SUBINVENTORIES_CODE NUMBER
UNIT_WEIGHT NUMBER
WEIGHT_UOM_CODE VARCHAR2(3)
VOLUME_UOM_CODE VARCHAR2(3)
UNIT_VOLUME NUMBER
RESTRICT_LOCATORS_CODE NUMBER
LOCATION_CONTROL_CODE NUMBER
SHRINKAGE_RATE NUMBER
ACCEPTABLE_EARLY_DAYS NUMBER
PLANNING_TIME_FENCE_CODE NUMBER
DEMAND_TIME_FENCE_CODE NUMBER
LEAD_TIME_LOT_SIZE NUMBER
STD_LOT_SIZE NUMBER
CUM_MANUFACTURING_LEAD_TIME NUMBER
OVERRUN_PERCENTAGE NUMBER
MRP_CALCULATE_ATP_FLAG VARCHAR2(1)
ACCEPTABLE_RATE_INCREASE NUMBER
ACCEPTABLE_RATE_DECREASE NUMBER
CUMULATIVE_TOTAL_LEAD_TIME NUMBER
PLANNING_TIME_FENCE_DAYS NUMBER
DEMAND_TIME_FENCE_DAYS NUMBER
END_ASSEMBLY_PEGGING_FLAG VARCHAR2(1)
REPETITIVE_PLANNING_FLAG VARCHAR2(1)
PLANNING_EXCEPTION_SET VARCHAR2(10)
BOM_ITEM_TYPE NOT NULL NUMBER
PICK_COMPONENTS_FLAG NOT NULL VARCHAR2(1)
REPLENISH_TO_ORDER_FLAG NOT NULL VARCHAR2(1)
BASE_ITEM_ID NUMBER
ATP_COMPONENTS_FLAG NOT NULL VARCHAR2(1)
ATP_FLAG NOT NULL VARCHAR2(1)
FIXED_LEAD_TIME NUMBER
VARIABLE_LEAD_TIME NUMBER
WIP_SUPPLY_LOCATOR_ID NUMBER
WIP_SUPPLY_TYPE NUMBER
WIP_SUPPLY_SUBINVENTORY VARCHAR2(10)
PRIMARY_UOM_CODE VARCHAR2(3)
PRIMARY_UNIT_OF_MEASURE VARCHAR2(25)
ALLOWED_UNITS_LOOKUP_CODE NUMBER
COST_OF_SALES_ACCOUNT NUMBER
SALES_ACCOUNT NUMBER
DEFAULT_INCLUDE_IN_ROLLUP_FLAG VARCHAR2(1)
INVENTORY_ITEM_STATUS_CODE VARCHAR2(10)
INVENTORY_PLANNING_CODE NUMBER
PLANNER_CODE VARCHAR2(10)
PLANNING_MAKE_BUY_CODE NUMBER
FIXED_LOT_MULTIPLIER NUMBER
ROUNDING_CONTROL_TYPE NUMBER
CARRYING_COST NUMBER
POSTPROCESSING_LEAD_TIME NUMBER
PREPROCESSING_LEAD_TIME NUMBER
FULL_LEAD_TIME NUMBER
ORDER_COST NUMBER
MRP_SAFETY_STOCK_PERCENT NUMBER
MRP_SAFETY_STOCK_CODE NUMBER
MIN_MINMAX_QUANTITY NUMBER
MAX_MINMAX_QUANTITY NUMBER
MINIMUM_ORDER_QUANTITY NUMBER
FIXED_ORDER_QUANTITY NUMBER
FIXED_DAYS_SUPPLY NUMBER
MAXIMUM_ORDER_QUANTITY NUMBER
ATP_RULE_ID NUMBER
PICKING_RULE_ID NUMBER
RESERVABLE_TYPE NUMBER
POSITIVE_MEASUREMENT_ERROR NUMBER
NEGATIVE_MEASUREMENT_ERROR NUMBER
ENGINEERING_ECN_CODE VARCHAR2(50)
ENGINEERING_ITEM_ID NUMBER
ENGINEERING_DATE DATE
SERVICE_STARTING_DELAY NUMBER
VENDOR_WARRANTY_FLAG NOT NULL VARCHAR2(1)
SERVICEABLE_COMPONENT_FLAG VARCHAR2(1)
SERVICEABLE_PRODUCT_FLAG NOT NULL VARCHAR2(1)
BASE_WARRANTY_SERVICE_ID NUMBER
PAYMENT_TERMS_ID NUMBER
PREVENTIVE_MAINTENANCE_FLAG VARCHAR2(1)
PRIMARY_SPECIALIST_ID NUMBER
SECONDARY_SPECIALIST_ID NUMBER
SERVICEABLE_ITEM_CLASS_ID NUMBER
TIME_BILLABLE_FLAG VARCHAR2(1)
MATERIAL_BILLABLE_FLAG VARCHAR2(30)
EXPENSE_BILLABLE_FLAG VARCHAR2(1)
PRORATE_SERVICE_FLAG VARCHAR2(1)
COVERAGE_SCHEDULE_ID NUMBER
SERVICE_DURATION_PERIOD_CODE VARCHAR2(10)
SERVICE_DURATION NUMBER
WARRANTY_VENDOR_ID NUMBER
MAX_WARRANTY_AMOUNT NUMBER
RESPONSE_TIME_PERIOD_CODE VARCHAR2(30)
RESPONSE_TIME_VALUE NUMBER
NEW_REVISION_CODE VARCHAR2(30)
INVOICEABLE_ITEM_FLAG NOT NULL VARCHAR2(1)
TAX_CODE VARCHAR2(50)
INVOICE_ENABLED_FLAG NOT NULL VARCHAR2(1)
MUST_USE_APPROVED_VENDOR_FLAG NOT NULL VARCHAR2(1)
REQUEST_ID NUMBER
PROGRAM_APPLICATION_ID NUMBER
PROGRAM_ID NUMBER
PROGRAM_UPDATE_DATE DATE
OUTSIDE_OPERATION_FLAG NOT NULL VARCHAR2(1)
OUTSIDE_OPERATION_UOM_TYPE VARCHAR2(25)
SAFETY_STOCK_BUCKET_DAYS NUMBER
AUTO_REDUCE_MPS NUMBER(22)
COSTING_ENABLED_FLAG NOT NULL VARCHAR2(1)
AUTO_CREATED_CONFIG_FLAG NOT NULL VARCHAR2(1)
CYCLE_COUNT_ENABLED_FLAG NOT NULL VARCHAR2(1)
ITEM_TYPE VARCHAR2(30)
MODEL_CONFIG_CLAUSE_NAME VARCHAR2(10)
SHIP_MODEL_COMPLETE_FLAG VARCHAR2(1)
MRP_PLANNING_CODE NUMBER
RETURN_INSPECTION_REQUIREMENT NUMBER
ATO_FORECAST_CONTROL NUMBER
RELEASE_TIME_FENCE_CODE NUMBER
RELEASE_TIME_FENCE_DAYS NUMBER
CONTAINER_ITEM_FLAG VARCHAR2(1)
VEHICLE_ITEM_FLAG VARCHAR2(1)
MAXIMUM_LOAD_WEIGHT NUMBER
MINIMUM_FILL_PERCENT NUMBER
CONTAINER_TYPE_CODE VARCHAR2(30)
INTERNAL_VOLUME NUMBER
WH_UPDATE_DATE DATE
PRODUCT_FAMILY_ITEM_ID NUMBER
GLOBAL_ATTRIBUTE_CATEGORY VARCHAR2(150)
GLOBAL_ATTRIBUTE1 VARCHAR2(150)
GLOBAL_ATTRIBUTE2 VARCHAR2(150)
GLOBAL_ATTRIBUTE3 VARCHAR2(150)
GLOBAL_ATTRIBUTE4 VARCHAR2(150)
GLOBAL_ATTRIBUTE5 VARCHAR2(150)
GLOBAL_ATTRIBUTE6 VARCHAR2(150)
GLOBAL_ATTRIBUTE7 VARCHAR2(150)
GLOBAL_ATTRIBUTE8 VARCHAR2(150)
GLOBAL_ATTRIBUTE9 VARCHAR2(150)
GLOBAL_ATTRIBUTE10 VARCHAR2(150)
PURCHASING_TAX_CODE VARCHAR2(50)
The query is as below
select segment1 from mtl_system_items where organization_id = 100 and inventory_item_id like '123456%'
The explain plan is as below -
Plan
SELECT STATEMENT RULE
2 TABLE ACCESS BY INDEX ROWID INV.MTL_SYSTEM_ITEMS
1 INDEX RANGE SCAN NON-UNIQUE INV.MTL_SYSTEM_ITEMS_N1
The INV.MTL_SYSTEM_ITEMS_N1 index is created on
ORGANIZATION_ID and SEGMENT1 -
Nested Internal tables with cl_gui_alv_grid - not displaying records
Hi,
I wrote a program using nested internal tables with cl_gui_alv_grid class
At runtime, when I select dropdown on one of the cells (RESWK - driver to the nested table), it does not bring the related record and display it
Does cl_gu_alv_grid support nested internal tables?
Or which class to use
Appreciate reply at the latest
Thanks
Rajeev
Edited by: Thomas Zloch on Feb 7, 2011 4:11 PM - priority reducedHi Rajeev,
Maybe checking out this documnetation will answer your question:
[ALV Grid Control (BC-SRV-ALV)|http://help.sap.com/saphelp_erp2004/helpdata/EN/bf/3bd1369f2d280ee10000009b38f889/frameset.htm]
To my knowledge ALV does not support deep structures.
Kind regards,
Robert -
Reg - Reading internal table with multiple record in a single field
Dear Guru's,
i want to read a internal table with field having mutilple entries like
read table READ TABLE LT_T2 INTO LT_T2_WA WITH KEY HKONT IN ( '0001152430', '0001152930', '0001152410' ).
But it says comma without preceding colon (after READ?).
please guide me.....
thanks & Regards,
Balaji.Sya this is inside the loop.
plz check....
loop at lt_t2 into lt_t2_wa.
READ TABLE LT_T2 INTO LT_T2_WA WITH KEY HKONT IN ( '0001152430', '0001152930', '0001152410' ).
endloop.
thanks & Regards,
Balaji.S -
Internal table more than 1million record
Hi
I have one internal table. I want to fetch more than 1million records in internal table. But it gives error like storage error. Is there anyother way possible to fetch such high records from databse. Also I Came to know from my friend that it is easy to use Internal table for upto 10000 records.use the OPEN CURSOR, FETCH and CLOSE_CURSOR statements and make sure you
specify the package size.
Here is an example code.
PACKAGE_SIZE = 2000.
OPEN CURSOR WITH HOLD CURS FOR
SELECT *
FROM MARA
WHERE MATNR <> SPACE.
DO.
FETCH NEXT CURSOR CURS
INTO TABLE I_MARA PACKAGE SIZE PACKAGE_SIZE.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
ENDDO.
CLOSE CURSOR CURS.
refer ...
Inserting Millions of records-Please Help!
copy from 1 table to anaother
Rgds,
Jothi.
Mark useful answers. -
How to fill internal table with no data in debugging mode
Hi all,
I modified one existing program.Now I want to test it.I am not given test data.So in the middle of my debugging, I found that one internal table with no data.My problem is how to fill that internal table with few records in that debugging mode just as we change contents in debugging mode.If I want to proceed further means that internal table must have some records.
Please I dont know how to create test data so I am trying to create values temporarily in debugging mode only.
Thanks,
BalajiHi,
In the debugging do the following..
Click the Table button..
Double click on the internal table name..
Then in the bottom of the screen you will get the buttons like CHANGE, INSERT, APPEND, DELETE..
Use the APPEND button to insert records to the internal table..
Thanks,
Naren -
Internal table with Dynamic and Non dynamic fileds
Hi Experts,
How to get the internal table with Dynamic and Non-Dynamic Fields.
Could u please help me.
Thanks,
VarunHi,
Execute the below sample code or analyze it there is appropriate description provided.
*& Report ZTEST_PRM_DYN_ALV
REPORT ZTEST_PRM_DYN_ALV.
type-pools: slis.
field-symbols: <dyn_table> type standard table,
<dyn_wa>.
data: alv_fldcat type slis_t_fieldcat_alv,
it_fldcat type lvc_t_fcat.
selection-screen begin of block b1 with frame title text-001.
parameters: p_flds(5) type c.
selection-screen end of block b1.
start-of-selection.
*build the dynamic internal table
perform build_dyn_itab.
*write 5 records to the alv grid
do 5 times.
perform build_report.
enddo.
*call the alv grid.
perform call_alv.
*Build_dyn_itab
form build_dyn_itab.
data: new_table type ref to data,
new_line type ref to data,
wa_it_fldcat type lvc_s_fcat.
*Create fields .
clear wa_it_fldcat.
wa_it_fldcat-fieldname = 'name1'.
wa_it_fldcat-datatype = 'mara-matnr'.
wa_it_fldcat-intlen = 5.
append wa_it_fldcat to it_fldcat .
*clear wa_it_fldcat.
wa_it_fldcat-fieldname = sy-index.
wa_it_fldcat-datatype = 'CHAR'.
wa_it_fldcat-intlen = 5.
append wa_it_fldcat to it_fldcat .
do p_flds times.
clear wa_it_fldcat.
wa_it_fldcat-fieldname = sy-index.
wa_it_fldcat-datatype = 'CHAR'.
wa_it_fldcat-intlen = 6.
append wa_it_fldcat to it_fldcat .
enddo.
*Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = it_fldcat
importing
ep_table = new_table.
assign new_table->* to <dyn_table>.
*Create dynamic work area and assign to FS
create data new_line like line of <dyn_table>.
assign new_line->* to <dyn_wa>.
endform.
*Form build_report
form build_report.
data: fieldname(20) type c.
data: fieldvalue(5) type c.
data: index(3) type c.
field-symbols: <fs1>.
do p_flds times.
index = sy-index.
*Set up fieldvalue
concatenate 'FLD' index into
fieldvalue.
condense fieldvalue no-gaps.
assign component index of structure <dyn_wa> to <fs1>.
<fs1> = fieldvalue.
enddo.
*Append to the dynamic internal table
append <dyn_wa> to <dyn_table>.
endform.
*CALL_ALV
form call_alv.
data: wa_cat like line of alv_fldcat.
*clear wa_cat.
wa_cat-fieldname = 'matnr'.
wa_cat-seltext_s = sy-index.
wa_cat-outputlen = '10'.
append wa_cat to alv_fldcat.
do p_flds times.
clear wa_cat.
wa_cat-fieldname = sy-index.
wa_cat-seltext_s = sy-index.
wa_cat-outputlen = '6'.
append wa_cat to alv_fldcat.
enddo.
*Call ABAP List Viewer (ALV)
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
it_fieldcat = alv_fldcat
tables
t_outtab = <dyn_table>.
endform.
Hope this will help, reward if found usefull.
Cheers,
Ram. -
Diff Between Internal Table with Occurs 0 & Field Groups
Hi,
Is there really any difference between just using an internal table with an OCCURS 0 statement-- which would write the entire table to paging space-- and using field-groups? How is Field-Groups is more effective than Internal tables with occurs 0 when it comes to performance?
Could anybody please give some information regarding above question?
Thanks,
Mohan.hi,
occurs 0 means it wont create any extra memory. based on the records only the memory is allocated to internal tables at run time. but when an internal table is created it can hold data of type to which it is declared.
i.e data: itab like mara occurs 0 with header line.
can take data only from mara table
we can also do in another way as using types keyword we can declare a standard structure and create a internal table of that type. its also not that useful as we have to change the structure depending on changes for storing data.
for this purpose field symbols are used. field symbols can hold any data means that they can point to tables, fields, any standard or user-defined types. field symbols actually points to respective types by which we can directly access to that types using field symbols.
filed symbols works more faster than internal tables.
if helpful reward some points.
with regards,
Suresh.A -
Differences between Internal table with Occurs 0 and Field-Groups?
Is there really any difference between just using an internal table with an OCCURS 0 statement-- which would write the entire table to paging space-- and using field-groups? How is Field-Groups is more effective than Internal tables with occurs 0 when it comes to performance?
Could anybody please give some information regarding above question?
Thanks,
Surya.hi,
occurs 0 means it wont create any extra memory. based on the records only the memory is allocated to internal tables at run time. but when an internal table is created it can hold data of type to which it is declared.
i.e data: itab like mara occurs 0 with header line.
can take data only from mara table
we can also do in another way as using types keyword we can declare a standard structure and create a internal table of that type. its also not that useful as we have to change the structure depending on changes for storing data.
for this purpose field symbols are used. field symbols can hold any data means that they can point to tables, fields, any standard or user-defined types. field symbols actually points to respective types by which we can directly access to that types using field symbols.
filed symbols works more faster than internal tables.
if helpful reward some points.
with regards,
Suresh.A -
Internal table with out header line
Hi friends,
Can u send me code for internal table with out header line : how to declare ,how to populate data and how to access the data
Regards,
vijayHi Vijay
There are several ways to declare an internal table without header line:
A) You can define a type table
TYPES: BEGIN OF TY_ITAB OCCURS 0,
INCLUDE STRUCTURE ZTABLE.
TYPES: END OF TY_ITAB.
and then your intrnal table:
DATA: ITAB TYPE TY_ITAB.
B) DATA: ITAB TYPE/LIKE STANDARD TABLE OF ZTABLE.
C) DATA: ITAB TYPE/LIKE ZTABLE OCCURS 0.
All these ways create a STANDARD TABLE
You can create other types of internal table, for example SORTED TABLE or HASHED TABLE.
These kinds of table can allow to improve the performance because they use different rules to read the data.
When it wants to manage a table without header line, it need a work area, it has to have the same structure of table.
DATA: WA LIKE ZTABLE.
DATA: T_ZTABLE LIKE STANDARD TABLE OF ZTABLE.
A) To insert the record:
If you use INTO TABLE option you don't need workarea
SELECT * FROM ZTABLE INTO TABLE T_ZTABLE
WHERE FIELD1 = 'Z001'
AND FIELD2 = '2006'.
but if you want to append a single record:
SELECT * FROM ZTABLE INTO wa WHERE FIELD1 = 'Z001'
AND FIELD2 = '2006'.
APPEND WA TO T_ZTABLE.
ENDSELECT.
Now you need workarea.
B) To read data: you need always a workarea:
LOOP AT T_ZTABLE INTO WA WHERE ....
WRITE: / WA-FIELD1, WA-FIELD2, WA-FIELD3.
ENDLOOP.
or
READ T_ZTABLE INTO WA WITH KEY FIELD3 = '0000000001'.
IF SY-SUBRC = 0.
WRITE: / WA-FIELD1, WA-FIELD2, WA-FIELD3.
ENDIF.
Anyway if you want to know only if a record exists, you can use the TRANSPORTING NO FIELDS option, in this case it doesn't need a workarea.
READ T_ZTABLE WITH KEY FIELD3 = '0000000001'
TRANSPORTING NO FIELDS.
IF SY-SUBRC = 0.
WRITE 'OK'.
ENDIF.
C) To update the data: it always needs a workarea
LOOP AT T_ZTABLE INTO WA WHERE FIELD3 = '0000000001'.
WA-FIELD3 = '0000000002'.
MODIF T_ZTABLE FROM WA.
ENDLOOP.
or
READ T_ZTABLE INTO WA WITH KEY FIELD3 = '0000000001'.
IF SY-SUBRC = 0.
WA-FIELD3 = '0000000002'.
MODIF T_ZTABLE FROM WA INDEX SY-TABIX
ENDIF.
AT the end you can use the internal table to update database:
MODIFY/UPDATE/INSERT ZTABLE FROM T_ZTABLE.
See Help online for key words DATA, you can find out more details.
Max
Message was edited by: max bianchi -
Creating Dynamic Internal table with a dynamic name
Hi,
I want to create dynamic internal tables with dynamic names.
For example:
Suppose I have a table with three fields.
1. Structure name
2.Fields
3.file
And the structure of the internal table is as follows:
TYPES:BEGIN OF table_type,
struct TYPE char70,
fields TYPE tt_type OCCURS 0,
File TYPE ttab_type OCCURS 0,
END OF table_type.
Suppose I have one record inside my internal table with struct as "STRUCTURE", fields have an internal table content of set of fields and File has some set of records.
Now I want to create dynamic internal table whose name will be "STRUCTURE" , the fields of the dynamic internal table structure[] will be as in fields, and the records will be as in File.
Like this if i have 100 records in my internal table then I have to create 100 dynamic internal table dynamically.
Can anyone suggest how to do this?
Edited by: Jjammy on Jul 22, 2009 7:52 AMHi,
Check the sample program and develop your program accordingly.
<font color=blue><pre>
REPORT ztest_notepad.
*& Declarations
*Type-pools
TYPE-POOLS:
slis.
*Types
TYPES:
ty_fcat TYPE lvc_s_fcat,
ty_fcatalog TYPE slis_fieldcat_alv.
*Work areas
DATA:
wa_fcat TYPE ty_fcat,
wa_fcatalog TYPE ty_fcatalog.
*Internal tables
DATA:
it_fcat TYPE STANDARD TABLE OF ty_fcat,
it_fcatalog TYPE STANDARD TABLE OF ty_fcatalog.
*Type reference
DATA:
it_dyn_tab TYPE REF TO data,
wa_newline TYPE REF TO data.
*Filed symbols
FIELD-SYMBOLS:
<gt_table> TYPE STANDARD TABLE,
<fs_dyntable>,
<fs_fldval> TYPE ANY,
<l_field> TYPE ANY.
*Variables
DATA:
l_fieldname TYPE lvc_s_fcat-fieldname,
l_tabname TYPE lvc_s_fcat-tabname,
l_fieldtext TYPE lvc_s_fcat-seltext,
l_index TYPE char2.
"Selection-screen
PARAMETERS:
p_colms TYPE i.
*& start-of-selection.
START-OF-SELECTION.
PERFORM build_fieldcat.
PERFORM create_dynamic_table.
DO 20 TIMES.
DO p_colms TIMES.
l_index = sy-index.
CONCATENATE 'FIELD' l_index INTO l_fieldname.
ASSIGN COMPONENT l_fieldname OF STRUCTURE <fs_dyntable> TO <l_field>.
<l_field> = sy-index.
ENDDO.
INSERT <fs_dyntable> INTO TABLE <gt_table>.
ENDDO.
LOOP AT it_fcat INTO wa_fcat.
PERFORM fieldcatalog1 USING: wa_fcat-fieldname
wa_fcat-tabname
wa_fcat-seltext.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = 'ZTEST_NOTEPAD'
it_fieldcat = it_fcatalog
TABLES
t_outtab = <gt_table>.
*& Form BUILD_FIELDCAT
FORM build_fieldcat .
CLEAR: l_fieldname,
l_tabname,
l_fieldtext,
l_index.
DO p_colms TIMES.
CLEAR l_index.
l_index = sy-index.
CONCATENATE 'FIELD' l_index INTO l_fieldname.
CONCATENATE 'Field' l_index INTO l_fieldtext.
l_tabname = '<GT_TABLE>'.
PERFORM fieldcatalog USING: l_fieldname
l_tabname
l_fieldtext.
ENDDO.
ENDFORM. " BUILD_FIELDCAT
*& Form CREATE_DYNAMIC_TABLE
FORM create_dynamic_table .
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = it_fcat
IMPORTING
ep_table = it_dyn_tab.
ASSIGN it_dyn_tab->* TO <gt_table>.
Create dynamic work area and assign to FS
CREATE DATA wa_newline LIKE LINE OF <gt_table>.
ASSIGN wa_newline->* TO <fs_dyntable>.
ENDFORM. " CREATE_DYNAMIC_TABLE
*& Form FIELDCATALOG
FORM fieldcatalog USING field table f_txt.
wa_fcat-fieldname = field.
wa_fcat-tabname = table.
wa_fcat-seltext = f_txt.
APPEND wa_fcat TO it_fcat.
CLEAR wa_fcat.
ENDFORM. " FIELDCATALOG
*& Form FIELDCATALOG1
FORM fieldcatalog1 USING field table f_txt.
wa_fcatalog-fieldname = field.
wa_fcatalog-tabname = table.
wa_fcatalog-seltext_m = f_txt.
APPEND wa_fcatalog TO it_fcatalog.
CLEAR wa_fcatalog.
ENDFORM. " FIELDCATALOG1 </pre>
</font>
Thanks
Venkat.O
Maybe you are looking for
-
Acrobat 9 Pro - previous output settings in a batch process keep interfering with new one
I created a batch process for pdf/a conversion. For the output setting, I unchecked the "overwrite" box and added a suffix to the file name. When I deleted one and recreated a different one, it is still appending that old suffix to the file name and
-
Google Calendar is now fully supported by Safari 2.0.3 under Mac OS X 10.4
This change has been posted to the Google Help Center: Which browsers does Google Calendar support? Currently, Google Calendar fully supports the following browsers: - Microsoft Internet Explorer (IE) version 6.0 (for Windows) - Mozilla Firefox versi
-
Patitioning My Harddrive after Windows
I partitioned my hard drive through BootCamp to install Windows OS. But I put it on the wrong partition. So once I installed Windows on my MAC OS hard drive, I just reinstalled MAC OS on the 30gb partition. I now have a 30 gb partition and a 40gb of
-
Zone is in state 'shutting_down', but zoneadmd does not appear to be availa
Hello, I have a global zone with two local zones. One of the local zones has an issue where it got stuck in the "ready" state when its SAN device was not available. This zone continues to hold onto it's SAN device (which has an I/O error), and I am u
-
Lock Purchase Order fields after goods receipt
Hello everyone, I need to be able to set a couple of fields in ME22N as display only after goods receipt has been done for the PO. Is there any config that I can do to get this done? Any idea or suggestion? Thank you very much for your help! Kell