Create fragmented table data
Hi guys,
I would like to create a table and populate it with lot of data to make some tests, but I also would like to have a high fragmented table to simulate this.
is there any script that create this environment?
thanks
Hi ,
Please try this ,Not tested.
1-Create table without any index.
2-insert data.
3-create index
4-update some data
5-drop Index.
6-create index
7-insert another data
check now select * from dba_segments where extents > 10;
Regards
faheem latif
Similar Messages
-
Procedure for creating transparent table, data element and domain
Hi,
Can anybody let me know the procedure for creating transparent table, data element and domain.
Thanks,
MahathiHi
Database table and its components
A database table is the central data structure of the ABAP/4 data dictionary.
The structure of the objects of application development are mapped in tables on the underlying relational database.
The attributes of these objects correspond to fields of the table.
A table consists of columns (fields) and rows (entries). It has a name and different attributes, such as delivery class and maintenance authorization.
A field has a unique name and attributes; for example it can be a key field.
A table has one or more key fields, called the primary key.
The values of these key fields uniquely identify a table entry.
You must specify a reference table for fields containing a currency (data type CURR) or quantity (data type QUAN). It must contain a field (reference field) with the format for currency keys (data type CUKY) or the format for units (data type UNIT). The field is only assigned to the reference field at program runtime.
The basic objects for defining data in the ABAP Dictionary are tables, data elements and domains. The domain is used for the technical definition of a table field (for example field type and length) and the data element is used for the semantic definition (for example short description).
A domain describes the value range of a field. It is defined by its data type and length. The value range can be limited by specifying fixed values.
A data element describes the meaning of a domain in a certain business context. It contains primarily the field help (F1 documentation) and the field labels in the screen.
A field is not an independent object. It is table-dependent and can only be maintained within a table.
You can enter the data type and number of places directly for a field. No data element is required in this case. Instead the data type and number of places is defined by specifying a direct type.
The data type attributes of a data element can also be defined by specifying a built-in type, where the data type and number of places is entered directly.
<b>Two Level Domain Example</b>
A domain defines a field technically and therefore it may
be used at different business levels.
A data element describes the meaning of a domain in a certain business context.
A domain, however, is used for the technical definition of a table field (for example field type and length).
Therefore, although a take-off airport (data element S_FROMAIRP) would have a different business meaning from an airport where a plane lands (data element S_TOAIRP), they could still have the same domain(here S_AIRPID) because technically we could assign the same number of characters whether the airport is a take-off or a landing airport.
<b>Definitions of Table in Database</b>
In SAP R/3 tables are defined as
A) Transparent tables: All of the fields of a dictionary table correspond to a field in the real database table.
B) Pooled tables: Different tables which are not linked to each other with a common key are combined into a TABLE POOL. Several logical tables thus exist as a single real database table.
C) Cluster tables: Several tables linked by a common key may sometimes be combined by the data dictionary and made to exist on the database schema as a single table.
SAP is evolving R/3 tables in transparent tables.
<b>Elaboration on each of the definitions</b>
A transparent table is automatically created on the database when it is activated in the ABAP Dictionary. At this time the database-independent description of the table in the ABAP Dictionary is translated into the language of the database system used.
The database table has the same name as the table in the ABAP Dictionary. The fields also have the same name in both the database and the ABAP Dictionary. The data types in the ABAP Dictionary are converted to the corresponding data types of the database system.
The order of the fields in the ABAP Dictionary can differ from the order of the fields on the database. This permits you to insert new fields without having to convert the table. When a new field is added, the adjustment is made by changing the database catalog (ALTER TABLE). The new field is added to the database table, whatever the position of the new field in the ABAP Dictionary.
Tables can also reside on the database as Pooled tables or cluster tables
Pooled Tables: Different tables which are not linked to each other with a common key can be combined into a Table Pool. The tables contained within this pool are called Pooled Tables. A table pool is stored in the database a simple table. The table's data sets contain, in separate fields, the actual key for the data set to be stored, the name of the pooled table and the contents of the data set to be stored.
Using this schema, several logical tables are combined into a single real database table. Although the data structure of each set is lost during the write to the table pool, it is restored during the read by the ABAP/4 Data Dictionary. The ABAP/4 Data Dictionary utilizes its meta-data to accomplish this.
Since information must be prepared (defined) within the ABAP/4 Data Dictionary when it is read or written to (or accessed), this process itself defines these as not transparent tables
Cluster Tables: Occasionally, several tables may be linked by a common key. The ABAP/4 Data Dictionary can also combine these tables into a single table. Each data set of the real table within the database contains a key and in a single data field, several data sets of the subsequent table for this key.
As mentioned above, these table types require special data handling, therefore they are not transparent tables.
<b>Technical Settings in Dictionary</b>
The data class logically defines the physical area of the database (for ORACLE the table space) in which your table should be created. If you choose the data class correctly, the table will automatically be created in the appropriate area on the database when it is activated in the ABAP Dictionary.
The most important data classes are master data, transaction data, organizational data and system data.
Master data is data that is rarely modified. An example of master data is the data of an address file, for example the name, address and telephone number.
Transaction data is data that is frequently modified. An example is the material stock of a warehouse, which can change after each purchase order.
Organizational data is data that is defined during customizing when the system is installed and that is rarely modified thereafter. The country keys are an example.
System data is data that the R/3 System itself needs. The program sources are an example.
Further data classes, called customer data classes (USER, USER1), are provided for customers. These should be used for customer developments. Special storage areas must be allocated in the database.
The size category describes the expected storage requirements for the table on the database.
An initial extent is reserved when a table is created on the database. The size of the initial extent is identical for all size categories. If the table needs more space for data at a later time, extents are added. These additional extents have a fixed size that is determined by the size category specified in the ABAP Dictionary.
You can choose a size category from 0 to 4. A fixed extent size, which depends on the database system used, is assigned to each category.
Correctly assigning a size category therefore ensures that you do not create a large number of small extents. It also prevents storage space from being wasted when creating extents that are too large.
Modifications to the entries of a table can be recorded and stored using logging.
To activate logging, the corresponding field must be selected in the technical settings. Logging, however, only will take place if the R/3 System was started with a profile containing parameter 'rec/client'. Only selecting the flag in the ABAP Dictionary is not sufficient to trigger logging.
Parameter 'rec/client' can have the following settings:
rec/client = ALL All clients should be logged.
rec/client = 000[...] Only the specified clients should be logged.
rec/client = OFF Logging is not enabled on this system.
The data modifications are logged independently of the update. The logs can be displayed with the Transaction Table History (SCU3).
Logging creates a 'bottleneck' in the system:
Additional write access for each modification to tables being logged.
This can result in lock situations although the users are accessing different application tables!
<b>Create transparent table</b>
Go to transaction SE11. Enter name of table you want to create (beginning with Y or Z) and click on create pushbutton
Enter the delivery class and the table maintenance criteria
The delivery class controls the transport of table data when installing or upgrading, in a client copy and when transporting between customer systems .
The display/maintenance indicator specifies whether it is possible to display/maintain a table/view using the maintenance tools Data Browser (transaction SE16) and table view maintenance (transactions SM30 and SM31).
Enter the name of the table field and the data element. The
System automatically populates the technical details for
existing data elements.
So far as possible it is advisable to use existing data elements which befit the business requirements.
However, we may create data elements if need be. The same is shown in the next slide.
To create a data element simply double click on it.
Alternately create a data element by simply choosing the
data type radio button on SE11 initial screen.
<b>Create data element</b>
The system prompts you to create a new data element.
Choose the Yes pushbutton.
Under the data type tab enter the domain name which
determines the technical characteristics of the field.
Further characteristics tab: Allows you to specify a search help assigned to the data element.
It also allows you to specify a parameter id which helps you populate a field from SAP memory.
Field label: Can be assigned as prefixed text to a screen field referring to the ABAP Dictionary. The text is displayed on the screen in the logon language of the user (if the text was translated into this language).
<b>Create domain</b>
If the domain does not exist in the data dictionary the
system prompts you to create one.
Give the technical characteristics under the definition
tab. Value range allows you value restriction at domain
level.
Value range tab:
As explained in the section Consistency through input checks one can restrict the possible values for a field at domain level itself by either entering fixed values or by specifying a value table under the tab Value range.
<b>Currency/Quantity fields in a table</b>
A currency or a quantity field must be assigned a reference field from a reference table containing applicable qty unit or currency unit.
Field of the reference table, containing the applicable quantity unit or currency
A field containing currency amounts (data type CURR) must be assigned a reference field including the currency key (data type CUKY).
A field containing quantity specifications (data type QUAN) must be assigned a reference field including the associated quantity unit (data type UNIT).
<b>Create transparent table continue</b>
Maintain the technical settings of the table by clicking on the tab -
How to create 2 tables data in smartforms
Hi
I am new to smartform. I have minimum knowledge in smartform.
here I have 2 tables. I want to display 2 tables data. How to create a smartform using these two tables? I know create a smart form using one table.
Please tell me
ThanksOk you are passing fields from two different tables i believe
1)For that jus give internal tables name as i said in your form interface->tables
2)And in global data please mention your both tables work area
3)Now in main window create table and ther in data give any 1 of the internal table name into WA
4)Create loop for that right click->flowlogic->loop here mention your second table and its respective WA.
5)Under this loop create table line->row->cells.
6)Now mention your fields in respective cells as per your req
This fields can be from any of your two internal tables.
Swetha -
ABAP Code for Backup the entire table data in the application server
Hello Friends,
I have to create the table data Backup and Store the entire table data in the application server and also be able to restore the data back if needed.
this should be dynamic program for any table based on the table name given on the application server.. I have developed a program for this but its having problems with the Quantity, amount. Its not writing it correctly at the application level.
ANy Suggestions on this.
Below is the program for this.
Thanks,
Ster.
* Report YWMM_TABLE_DUMP *
REPORT ywmm_table_dump .
TABLES :
dd03l.
* Type spool declaration
TYPE-POOLS:
abap, slis.
DATA: i_table_data1 TYPE REF TO data.
DATA : it_dd03l LIKE dd03l OCCURS 0 WITH HEADER LINE.
*DATA : gt_fieldcat TYPE lvc_s_fcat.
DATA : i_fcat TYPE STANDARD TABLE OF lvc_s_fcat,
l_dr_line TYPE REF TO data,
l_v_as4vers TYPE as4vers.
FIELD-SYMBOLS: <f_table_data1> TYPE STANDARD TABLE,
<f_wa_table_data1> TYPE ANY.
SELECTION-SCREEN: BEGIN OF BLOCK bl1 WITH FRAME TITLE text-001.
PARAMETERS: rb_copy RADIOBUTTON GROUP map DEFAULT 'X',
rb_rest RADIOBUTTON GROUP map.
SELECTION-SCREEN: END OF BLOCK bl1.
SELECTION-SCREEN: BEGIN OF BLOCK bl2 WITH FRAME TITLE text-002.
PARAMETERS: p_table TYPE tabname OBLIGATORY,
p_plfld TYPE dd03l-fieldname.
SELECTION-SCREEN SKIP 1.
PARAMETERS: p_bkfile TYPE localfile OBLIGATORY.
SELECTION-SCREEN: END OF BLOCK bl2.
PERFORM get_data.
IF rb_copy = 'X'.
PERFORM backup.
ELSEIF rb_rest = 'X'.
PERFORM database_update.
ENDIF.
*& Form get_data
FORM get_data.
CLEAR i_fcat.
REFRESH i_fcat.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = p_table " Table Name
CHANGING
ct_fieldcat = i_fcat
EXCEPTIONS
OTHERS = 1.
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = i_fcat
IMPORTING
ep_table = i_table_data1.
IF sy-subrc = 0.
ASSIGN i_table_data1->* TO <f_table_data1>.
ELSE.
WRITE: 'Error creating internal table'.
ENDIF.
IF rb_copy = 'X'.
SELECT * FROM (p_table) INTO CORRESPONDING FIELDS OF
TABLE <f_table_data1> UP TO 20 ROWS.
ELSEIF rb_rest = 'X'.
CREATE DATA l_dr_line LIKE LINE OF <f_table_data1>.
ASSIGN l_dr_line->* TO <f_wa_table_data1>.
*Get Data from Application Server
* Opening the dataset P_BKFILE given in the selection screen
TRANSLATE p_bkfile TO LOWER CASE.
OPEN DATASET p_bkfile FOR INPUT IN TEXT MODE." ENCODING DEFAULT.
IF sy-subrc NE 0.
* MESSAGE:
ELSE.
DO.
* Reading the file from application server
READ DATASET p_bkfile INTO <f_wa_table_data1>.
IF sy-subrc = 0.
APPEND <f_wa_table_data1> TO <f_table_data1>.
ELSE.
EXIT.
ENDIF.
ENDDO.
* Closing the dataset
CLOSE DATASET p_bkfile.
ENDIF.
ENDIF.
ENDFORM. " get_data
*& Form backup
* text
* --> p1 text
* <-- p2 text
FORM backup.
TRANSLATE p_bkfile TO LOWER CASE.
OPEN DATASET p_bkfile FOR OUTPUT IN TEXT MODE.
IF sy-subrc NE 0.
WRITE: text-017.
STOP.
ELSE.
LOOP AT <f_table_data1> ASSIGNING <f_wa_table_data1>.
TRANSFER <f_wa_table_data1> TO p_bkfile.
ENDLOOP.
ENDIF.
CLOSE DATASET p_bkfile.
ENDFORM. " backup
*& Form database_update
FORM database_update.
DATA : i_mara_u TYPE STANDARD TABLE OF mara WITH HEADER LINE,
i_ekpo_u TYPE STANDARD TABLE OF ekpo WITH HEADER LINE,
i_eban_u TYPE STANDARD TABLE OF eban WITH HEADER LINE,
i_resb_u TYPE STANDARD TABLE OF resb WITH HEADER LINE,
i_plpo_u TYPE STANDARD TABLE OF plpo WITH HEADER LINE,
i_stpo_u TYPE STANDARD TABLE OF stpo WITH HEADER LINE,
i_vbap_u TYPE STANDARD TABLE OF vbap WITH HEADER LINE,
i_vbrp_u TYPE STANDARD TABLE OF vbrp WITH HEADER LINE,
i_lips_u TYPE STANDARD TABLE OF lips WITH HEADER LINE,
i_afvc_u TYPE STANDARD TABLE OF afvc WITH HEADER LINE,
i_asmd_u TYPE STANDARD TABLE OF asmd WITH HEADER LINE,
* i_cooi_u TYPE STANDARD TABLE OF cooi WITH HEADER LINE,
i_qmel_u TYPE STANDARD TABLE OF qmel WITH HEADER LINE,
i_cooi_u TYPE STANDARD TABLE OF cooi WITH HEADER LINE,
i_esll_u TYPE STANDARD TABLE OF esll WITH HEADER LINE,
i_t165_u TYPE STANDARD TABLE OF t165 WITH HEADER LINE,
i_t165e_u TYPE STANDARD TABLE OF t165e WITH HEADER LINE,
i_twpko_u TYPE STANDARD TABLE OF twpko WITH HEADER LINE,
i_tpext_u TYPE STANDARD TABLE OF tpext WITH HEADER LINE,
i_ce4mxpa_u TYPE STANDARD TABLE OF ce4mxpa WITH HEADER LINE,
i_ce4mxpa_acct_u TYPE STANDARD TABLE OF ce4mxpa_acct WITH
HEADER LINE,
i_zaim_u TYPE STANDARD TABLE OF zaim WITH HEADER LINE,
i_s012_d TYPE STANDARD TABLE OF s012 WITH HEADER LINE,
i_s012_i TYPE STANDARD TABLE OF s012 WITH HEADER LINE,
i_dummy TYPE STANDARD TABLE OF mara.
CASE p_table.
WHEN 'MARA'.
* Non-Key
PERFORM move_to_table USING <f_table_data1>
CHANGING i_mara_u[]
i_mara_u.
PERFORM update_table USING i_mara_u[].
ENDCASE.
ENDFORM. " database_update
*& Form move_to_mara
FORM move_to_table USING p_tab_from TYPE STANDARD TABLE
CHANGING p_tab_to TYPE STANDARD TABLE
p_w_table.
DATA: l_wa_fcat TYPE lvc_s_fcat.
FIELD-SYMBOLS: <f_field_from> TYPE ANY,
<f_field_to> TYPE ANY.
LOOP AT p_tab_from ASSIGNING <f_wa_table_data1>.
LOOP AT i_fcat INTO l_wa_fcat.
ASSIGN COMPONENT l_wa_fcat-fieldname
OF STRUCTURE <f_wa_table_data1> TO <f_field_from>.
ASSIGN COMPONENT l_wa_fcat-fieldname
OF STRUCTURE p_w_table TO <f_field_to>.
<f_field_to> = <f_field_from>.
ENDLOOP.
APPEND p_w_table TO p_tab_to.
ENDLOOP.
ENDFORM. " move_to_mara
*& Form update_table
FORM update_table USING p_table_update TYPE STANDARD TABLE.
SELECT SINGLE *
FROM dd03l
WHERE fieldname = p_plfld
AND tabname = p_table
AND keyflag <> 'X'
AND as4local = 'A'
AND as4vers = l_v_as4vers
AND ( comptype = 'E' OR comptype = space ).
IF sy-subrc = 0.
* Do update
IF NOT p_table_update IS INITIAL.
UPDATE (p_table) FROM TABLE p_table_update.
IF sy-subrc = 0.
COMMIT WORK.
ELSE.
ROLLBACK WORK.
WRITE: text-003.
STOP.
ENDIF.
ENDIF.
ELSE.
*delete and insert.
IF NOT p_table_update IS INITIAL.
* DELETE (p_table).
IF sy-subrc = 0.
INSERT (p_table) FROM TABLE p_table_update.
IF sy-subrc = 0.
COMMIT WORK.
ELSE.
ROLLBACK WORK.
WRITE: text-018.
STOP.
ENDIF.
ELSE.
ROLLBACK WORK.
WRITE: text-018.
STOP.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. " update_table
Edited by: Julius Bussche on Jul 18, 2008 1:43 PM
Please use a meaningfull subject title!ARS,
I am struggling a bit to get this.
there is a syntax error,
Field "FIELDS_INT-TYPE" is unknown. It is neither in one of thespecified tables nor defined by a "DATA" statement.
Again you have asked to move to a diffrent table. What is that table and how to build it.
LOOP AT <f_table_data1> ASSIGNING <f_wa_table_data1>.
LOOP AT i_fcat INTO l_fcat.
IF l_fcat-inttype EQ 'P'.
ASSIGN COMPONENT l_fcat-fieldname
OF STRUCTURE <f_wa_table_data1> TO <f_field>
TYPE fields_int-type
DECIMALS fields_int-decimals.
ELSE.
ASSIGN COMPONENT l_fcat-fieldname
OF STRUCTURE <f_wa_table_data1> TO <f_field>
TYPE fields_int-type.
ENDIF.
" Move <f_field> to a new table and use this table for download
ENDLOOP.
TRANSFER <f_wa_table_data1> TO p_bkfile.
ENDLOOP.
Ster -
Table Data Source Search Result gives ClassCastException
I set up a table data source and queried it using the following URL:
http://machine_name:port/ultrasearch/query/search.jsp?usearch.p_mode=Advanced
and specified my table data source. The result URLs
came up with the right primary key id. However when I
click the URL, I get:
java.lang.ClassCastException: com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].sql.OrclCallableStatement
at oracle.ultrasearch.query.DisplayUtil.displayTableUrl(DisplayUtil.java:131)
at display.jspService(_display.java:1568) [SRC:/display.jsp:81]
at com.orionserver[Oracle9iAS (9.0.2.0.0) Containers for J2EE].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:302)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:59)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:283)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:523)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].server.http.AJPRequestHandler.run(AJPRequestHandler.java:151)
at com.evermind[Oracle9iAS (9.0.2.0.0) Containers for J2EE].util.ThreadPoolThread.run(ThreadPoolThread.java:64)
I have specified NUMBER as the data type for my primary key column and it is of type NUMBER in my table DDL. Is that OK or could this be causing the problem?
DineshDinesh,
Can you provide the following information for creating the table data source:
- Is the table data source based on a table or a view?
- Is the table/view in the local or remote database?
- If the table is in the local database, is the table in the instance owner schema or another schema?
- Do you login to Ultra Search Admin Tool as the instance owner or other users?
- Does the instance owner schema have privileges to read the contents in the table/view? -
Create XML file from table data
Dear All,
with dataservice 4.0, I want to create an XML file from a table data.
Table have a single column but more record, for example:
0001000488;100;EUR;
0001000489;200;EUR;
0001000450;300;EUR;
My desired XML output:
<Data>
0001000488;100;GBP;
0001000489;200;EUR;
0001000450;300;EUR;
</Data>
I try with a sample query but the sistem write only the last record in XML file:
<Data>
0001000450;300;EUR;
</Data>
Can everyone help me?
Thank in advance.
SimoneHello
That is a very simple (also odd) XML document structure, and as such doesn't require use of the XML target. It can be easily acheived by writing a normal file with a header and footer, which is acheived using a row_generation and a query to generate the hard coded open and close tags.
Michael -
How to Create Inline Table to Display Detail Data in a Master Table in 11g?
Hi,
I have a requirement to create inline table inside master table to show data.
I found this 10g article for this http://download.oracle.com/docs/cd/B31017_01/web.1013/b28967/web_masterdetail006.htm#BABCDCGE
I couldn't find such option in 11g. Am i missing something? Please let me know where i can find more details.
Required Output:
[+] DepartmentId DepartmentName
[-] DepartmentId DepartmentName
EmployeeId FirstName LastName
EmployeeId FirstName LastName
EmployeeId FirstName LastName
[+] DepartmentId DepartmentName
Also, I tried creating the Page as below (Departments -Employees Relation). i.e I have tried using the ADF treeModel in the bindings and then created a table/inline table manually to populate. The data is available in the iterators (i found using sops in back bean), but the inline table is not showing any data. I tried enabling PPR on detail based on master. But no luck.
<af:table rows="#{bindings.Departments1.rangeSize}"
emptyText="#{bindings.findAllStaff1.viewable ? \'No rows yet.\' :
\'Access Denied.\'}"
var="row" value="#{bindings.Departments1.treeModel}">
<af:column headerText="#{bindings.Departments1.labels.DepartmentId}"
sortable="false" sortProperty="DepartmentId">
<af:outputText value="#{row.DepartmentId}"/>
</af:column>
<af:column headerText="#{bindings.Departments1.labels.DepartmentName}"
sortable="false" sortProperty="DepartmentName">
<af:outputText value="#{row.DepartmentName}"/>
</af:column>
<f:facet name="detailStamp">
<af:table rows="#{bindings.Departments1.rangeSize}"
emptyText="No rows yet." var="detailRow"
value="#{row.children}">
<af:column headerText="#{row.children[0].labels.EmployeeId}"
sortable="false" sortProperty="EmployeeId">
<af:outputText value="#{detailRow.EmployeeId}"/>
</af:column>
<af:column headerText="#{row.children[0].labels.FirstName}"
sortable="false" sortProperty="FirstName">
<af:outputText value="#{detailRow.FirstName}"/>
</af:column>
<af:column headerText="#{row.children[0].labels.LastName}"
sortable="false" sortProperty="LastName">
<af:outputText value="#{detailRow.LastName}"/>
</af:column>
</af:table>
</f:facet>
</af:table>
Thanks in Advance,
HarikiranHi,
After reading the above links end-to-end twice, I'm finally able to establish the relationship in UI. I've used iterator for my specific purpose, although it can be done using a table/forEach.
1) Create VOs for Dept and Emp, i.e. DeptVO and EmpVO.
2) Then a View Link on deptID, i.e DeptEmpVL
3) Drag and drop the Dept as AdfTreeTable, b'coz it will create the treeBinding and also add the emp accessor by selecting it in the binding window. (refer to above doc links from BaiG)
4) In my Page UI, i've created a new table and an iterator in the detailStamp.
Dept Table ->
o Value = #{bindings.Departments1.treeModel}
o Var = dept
o varStaus = deptVarStatus
Add these:
Column1-> OutputText -> #{dept.DepartmentId}
Column2-> OutputText -> #{dept.DepartmentName}
Insert into TableFacets -> detailStamp -> iterator
Iterator ->
o Value = #{dept.children}
o Var = emp
o varStatus = empVarStatus
Add these:
OutputText -> #{emp.EmployeeId}
OutputText -> #{emp.EmployeeName}
OutputText -> #{emp.Salary}
This iterator/forEach comes in handy for having n Number of regions inside a layout.
Thanks,
Harikiran -
How to Create a Table in Oracle with XML data type.
Dear ALL,
What are the requirements for creating a table with xml datatype in Oracle: The steps would help very much to know the scripting of the table and how to query and either insert/update and remove data from that table.
Any help, direction, advise would be highly appreciated.
Thanks.Reffer to this Note.243554.1.
In a nut shell you will need to run catqm.sql -
How to create a table with data in it?
I need to have a temp table in a PL/SQL procedure for processing which can hold data values from two other tables and a sequence number.
Ex:
Existing tables:
table1 (col1 varchar2(100), col2 date, col3 number20) - Has more 1Lakh rows
table2 (col1 varchar2(100), col2 date) - Has more 900 rows
New table
temp_table (col1 PRY KEY(seq1.number), col2 varchar2(100), col3 date)
Currently i have created the temp_table and inserting all the data from both table1 & table2 (which is poor). Please suggest me a way to have the temp_table created with data(atleast from table1 which has more than 1Lakh rows). Please see i need a sequence number as well.
Thanks in advance.Vel wrote:
I am creating XML file using DBMS_XMLGEN package. This XML file will contain data from two different database tables. So I am creating temporary table in the PL/SQL procedure to have the data from these different tables in a single temporary table.
Please find the below Dynamic SQL statements that i'm using for create the temp table and inserting the data into it.
Before insert the V_NAME filed, i will be appending a VARCHAR field to the original data.
EXECUTE IMMEDIATE 'CREATE TABLE TEMP_TABLE (UNIQUE_KEY NUMBER , FILE_NAME VARCHAR2(1000), LAST_DATE DATE)';
EXECUTE IMMEDIATE 'INSERT INTO TEMP_TABLE values (SEQUENCE.nextval,:1,:2)' USING V_NAME,vLastDate;What exactly i need is to eliminate the INSERT portion of it,Since i have to insert more 90,000 rows into it. Is there way to have the temp table created with data in it along with the sequence value as well.
I'm using Oracle 10.2.0.4 version.
Edited by: 903948 on Dec 22, 2011 10:58 PMWhat you need to do to eliminate the INSERT statement is to -- as already suggested by others - eliminate the temporary table. You don't need it. It is just necessary overhead. Please explain why you (apparently) believe that the suggestion of a view will not meet your requirements. -
Creating MS- Access data base from the Internal tables data of an ABAP Prog
Hi,
I have a requirement where I have to create Access tables from the Internal tables of ABAP program.
The tables are like Project systems Header data, WBS elements data, Netwrok data, Activity data, Milestone data and Project revunes. I will have the internal tables for these. I want to transfer these tables data into MS-Access tables onto Users desktop.
Please adivce me how to do this.
Thanks,
PrabhakarHI,
I am trying to create a DB table in the access but I am not successful. The following is the format of the table needs to be created from the ABAP program.
I have created a table with the following format in MS-Access with the name tblHeader. Is it neccessary to create a DB table ( MS-Access) in advance or by using the FM STRUCTURE_EXPORT_ TO_MSACCESS we need to create a structure in MS-Access?
False tblHeader
Field Name Type Length
ProjectDef Text 255
ProjectDes Text 255
Created Text 50
Change Text 50
RespPerson Text 255
Profile Text 255
Plant Text 255
ObjNo Text 255
OverheadKey Text 255
I have created a Z table ZTAB1 with the same format from the SAP fields.
MS-Access Table name : tblHeader
ABAP program Internal table : t_tblheader
Z table Name : ZTAB1.
First I am trying to create a structure in MS-Access with the following FM.
CALL FUNCTION 'STRUCTURE_EXPORT_ TO_MSACCESS'
EXPORTING
dbname = 'D:\test\db2'
LANGU = SY-LANGU
dest = 'PS_ACCESS_1'
TABLES
tabname = ttblheader
EXCEPTIONS
system_failure = 1
comm_failure = 2
OTHERS = 3
Table ttblheader type is DFIES and I am filling the table with only one record and one field i.e TABNAME and the value is ZTAB1.
The source code of the FM is using another FM
CALL FUNCTION 'MSACCESS_STRUCT_ EXPORT_RFC' DESTINATION DEST
Here I am getting the Error message Object required. I can't able to create a table structure in MS-Access.
Next I am going to Use the FM
'TABLE_EXPORT_ TO_MSACCESS'
and it will create the records in the MS-access table.
CALL FUNCTION 'TABLE_EXPORT_ TO_MSACCESS'
EXPORTING
dbname = 'D:\test\db2'
langu = sy-langu
dest = 'PS_ACCESS_2'
tabname = 'ZTAB1'
reftable = 'tblheader'
FLG_NO_DOWNLOAD = ' '
FLG_APPEND = ' '
FLG_POPUP = ' '
TABLES
dtab = t_tblheader
here t_tblheader is the internal table.
Reftable = tblheader is the table which i have created in advance. ( not by using the First FM)
In this FM i am getting a error message : Unable to connect to Database D:\test\db2.
Please help me how to create the MS-Access database. -
Create flat file from oracle table data
d_adp_num char(10)
d_schd_date char(8)
d_sched_code char(25)
d_pay_code char(50)
d_mil_start char(4)
d_mil_end char(4)
d_duration char(5)
d_site_code char(4)
d_dept_id char(6)
select payroll_id,
schedule_date,
reason_code ,(sched_code)
reason_code, (pay_code)
start_time,
end_time,
total_hours,
site_code,
department_id
from dept_staff
where schedule_date between (sysdate+1) and (sysdate+90)
loading some data instead for the date range.
sched_code - 'Unavailable' if reason_code = 'OD' and 'LA'
pay_code - 'BD Berevevement' if reason_code = 'BD'
'UP Unexcused PTO' if reason_code = 'UP'
'RG' if reason_code = 'SH'
'PTO' if reason_code = 'VA'
these are a few.....
start_time and end_time - convert into military time
based on start_ampm and end_ampm
Based on this, I need help to create a flat file. Attaching sample of flat file and data from dept_staff
If site_code is there then no need to get department_id( see sample flat file)
sample data for flat file
ZZW002324006072012 PTO
0800160008.00
ZZW002428106072012 RG
1015174507.50HM34
ZZW002391606072012 RG
1100193008.50
ZZW002430406072012 RG
1100193008.50 130000
dept_staff table data
PAYROLL_ID SCHEDULE_DATE REASON_CODE REASON_CODE_1 START_TIME START_AMPM END_TIME END_AMPM TOTAL_HOURS SITE_CODE DEPARTMENT_ID
ZZW0024468 6/8/2012 SH SH 730 A 400 P 850 12
ZZW0000199 6/8/2012 SH SH 730 A 400 P 850 14
ZZW0023551 6/8/2012 SH SH 1145 A 930 P 975 GH08 95
ZZW0024460 6/8/2012 SH SH 515 A 330 P 1025 GH08 95
ZZW0023787 6/8/2012 SH SH 630 A 300 P 850 24
ZZW0024595 6/8/2012 TR TR 730 A 400 P 850 90
ZZW0023516 6/8/2012 OD OD 800 A 400 P 800 95
ZZW0023784 6/8/2012 OD OD 800 A 400 P 800 5
ZZW0024445 6/8/2012 SH SH 1145 A 930 P 975 GH08 5
ZZW0024525 6/8/2012 OD OD 800 A 400 P 800 23
ZZW0024592 6/8/2012 TR TR 730 A 400 P 850 5
ZZW0024509 6/8/2012 SH SH 830 A 330 P 700 MK21 95
ZZW0023916 6/14/2012 SH SH 1100 A 730 P 850 27user_anumoses wrote:
Any examples, please provide? Thankshttp://www.lmgtfy.com/?q=oracle+utl_file+example
Handle: user_anumoses
Status Level: Newbie
Registered: Jun 9, 2009
Total Posts: 155
Total Questions: 60 (55 unresolved)
why so MANY unanswered questions? -
Creating a zipped file from table data
I am currently extracting data from a table and creating a flat file which is read later to create a compressed (zip) file.
Is there a way that I can create a zipped file in one step (i.e. directly from the table data)? I am trying to reduce the number of file i/o hits in my appication.
Thanks,
MineshIs there a way that I can create a zipped file in one step (i.e. directly from the table data)?Yes. Instead of doing something like:
FileOutputStream fout = new FileOutputStream("flatfile");
// write using foutdo this:
ZipOutputStream zout = new ZipOutputStream("flatfile.zip");
zout.putNextEntry(new ZipEntry("flatfile"));
// write using zout -
Create Menu items from table data?
Wondering if anyone knows of a way(if even possible) to create menu items on logon from table data where the menu data is stored?
You'd have to make the menu code generic as well - probably the bet bet would be to have each menu item calling a common procedure but passing in the menu item selected - you'll then have to cross reference that with the current function of that menu item and do the right thing.
-
Oracle table data to create xml file.
HI all,
i want to create a xml file from table data.
i want to data in below format.
Tag
- <root>
- <ReportValues>
<Value name="Client" value=" Correspondence.manco" />
<Value name="Communication" value="correspondence.deliverby" />
<Value name="Correspondence_Type" value=" correspondence.corrname" />
<Value name="FROM" value="This email address will be based on the email address for the servicing segment the entity is linked to" />
<Value name="REPLYTO" value=" This email address will be based on the email address for the servicing segment the entity is linked to " />
<Value name="MessageId" value=" correspondence.seqno " />
<Value name="RECIPIENT" value=" correspondence.deliveryaddress " />
<Value name="Frommasquerade" value="correspondence.Manco" />
<Value name="Replytomasquerade" value="correspondence.Manco" />
is there any inbuilt function in oracle to do this functionality?
any help appriciated.select xmlelement(name "ReportValues",
xmlagg(xmlelement(name "Value",
xmlattributes(name as "name",value as "value"))))
from tab -
Uploading data from excel file to a dynamically created internal table
Hi,
I have a requirement where i have to upload data from an excel file into a database table. I would be able to determine the structure of the table only at runtime based on the user input.. so i have created an internal table dynamically.
Could you please tell me if its possible to upload data from an excel file to the dynamically created internal table using any function modules?
I thought of doing this by declaring a generic internal table of one field and then uploading the *.csv file into it and then splitting it based on "," and then assigning it to the field symbol referencing the internal table.. but my file length exceeds 132 characters and i'm only able to get data of lenght 132 char's in my internal table ( generic one).
Could anyone please show me a way around this.
Thanks in advance,
HarshaSure, check this out.
report zrich_0002.
type-pools: slis.
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
data: it_fldcat type lvc_t_fcat,
wa_it_fldcat type lvc_s_fcat.
type-pools : abap.
data: new_table type ref to data,
new_line type ref to data.
data: iflat type table of string.
data: xflat type string.
data: irec type table of string with header line.
data: tabix type sy-tabix.
data: file type string.
selection-screen begin of block b1 with frame title text .
parameters: p_file type rlgrap-filename default 'c:Test.csv'.
parameters: p_flds type i.
selection-screen end of block b1.
start-of-selection.
* Add X number of fields to the dynamic itab cataelog
do p_flds times.
clear wa_it_fldcat.
wa_it_fldcat-fieldname = sy-index.
wa_it_fldcat-datatype = 'C'.
wa_it_fldcat-inttype = 'C'.
wa_it_fldcat-intlen = 10.
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>.
file = p_file.
call method cl_gui_frontend_services=>gui_upload
exporting
filename = file
changing
data_tab = iflat
exceptions
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
others = 17.
loop at iflat into xflat.
clear irec. refresh irec.
split xflat at ',' into table irec.
loop at irec.
tabix = sy-tabix.
assign component tabix of structure <dyn_wa> to <dyn_field>.
<dyn_field> = irec.
endloop.
append <dyn_wa> to <dyn_table>.
endloop.
* Write out data from table.
loop at <dyn_table> into <dyn_wa>.
do.
assign component sy-index of structure <dyn_wa> to <dyn_field>.
if sy-subrc <> 0.
exit.
endif.
if sy-index = 1.
write:/ <dyn_field>.
else.
write: <dyn_field>.
endif.
enddo.
endloop.
Regards,
Rich Heilman
Maybe you are looking for
-
How Do I Move Contacts from One Machine to Another?
I am a brand new user. I bought an I-Phone. I used my son's computer and sinked up with his machine. I like the the phone and bought an apple computer. When I synced up, every thing was gone. Back to the son's machine and it wall all back. I wan
-
How to populate text in smartforms
Hi friends in a smart form i am populating text from vf03 in smartform to internal table the problem is when i looping the internal table the text are coming as truncated in smartform how to resolve this
-
Converting 2007 MS Word doc into Adobe Acrobat 9 Pro
When using the Print function in MS Word and selecting Adobe PDF, the MS Word version is converted into PDF format. Most pictures/images residing in MS Word usually appears in PDF version, however, one particular picture/image is not appearing. Usi
-
How can i create the variant name against table KNa1.
-
Performance issues in million records table
I Have a scenario wherein have some 20 tables each with a million and more records. [ Historical ] On an average I do add 1500 - 2500 records a day... i.e would add a million records every year on an average Am looking for archival solutions for thes