Generic table data editor?
This is probably a newbie question, but I've created some tables and am trying to get some data into them.
Isn't there some kind of a generic data in table editor for this? Something that can browse, add and edit rows for any table?
I tried creating an application for this, but the date columns (which I specified cannot be null) seem to be messing things up since I can't specify date values?
Brent Allsop
Hi,
create a trigger which inserts SYSDATE into the table, something like this:
CREATE OR REPLACE TRIGGER "BI_KV"
before insert on "KV"
for each row
begin
:new.createdon := sysdate;
end;
Regards
Alex
Similar Messages
-
Does 10g have a built-in, direct equivalent to the Table Data Editor function that was present in 9i?
Right, that's the tool I'm using - the EM Console - or at least I'm pretty sure. Let me confirm what I'm doing. I load the page using http://mycomputername:5500/em. I'm logging in as the SYSDBA. Up at the top of the page, it shows the words "Oracle Enterprise Manager 10g", below that the words "Database Control", over on the right a tab that says "Database". Various categories in the main body of the page, such as General, Host CPU, Active Sessions, SQL Response Time, Diagnostic Summary, etc...
Is this the EM Console? Am I in the right place?
So, I'm on that page, and I've gone through everything a zillion times, and if the Table Data Editor is available on this tool, then I'm just blind, because I can't find it. I can click 'Administration', then 'Tables' (under Schema/Database Objects) and display all of the table names (I'm using the SCOTT schema). I select the EMP table, because I see that it has 14 rows, so I know there's some data there.
If I click on either the table name link or the VIEW button, I see the table definition, no data. If I click EDIT, I can change the table structure, no data. If I select 'View Data' from the 'Actions' drop-down box, I can see, but not edit, the data in the table.
Where, oh where, is the link or menu selection that gets me to the 10g equivalent of the Table Data Editor, if it exists? -
How to get the name of a Data Element of a generic Table!
Hi guys!
In my function i have the following import paramenter
i_outtab type standard table
now i import a table and i want to get the dataelement of the fields.
is there a way to do this??Hello Thomas
Perhaps the following sample report may be useful for you.
*& Report ZUS_SDN_RTTI_STRUCT_COMPONENTS
*& <a class="jive_macro jive_macro_thread" href="" __jive_macro_name="thread" modifiedtitle="true" __default_attr="1145711"></a>
*& Thread: How to get the name of a Data Element of a generic Table!
REPORT zus_sdn_rtti_struct_components.
TYPE-POOLS: abap.
TYPES: BEGIN OF ty_s_outtab.
TYPES: bukrs TYPE bukrs.
TYPES: kunnr TYPE kunnr.
TYPES: END OF ty_s_outtab.
DATA: gdo_data TYPE REF TO data.
DATA: gs_outtab TYPE ty_s_outtab.
DATA: go_typedescr TYPE REF TO cl_abap_typedescr,
go_structdescr TYPE REF TO cl_abap_structdescr,
go_datadescr type ref to cl_abap_datadescr.
DATA: gs_comp TYPE abap_compdescr,
gd_dtel type string,
gt_dfies type ddfields.
FIELD-SYMBOLS:
<gs_struct> TYPE ANY.
START-OF-SELECTION.
BREAK-POINT.
GET REFERENCE OF gs_outtab INTO gdo_data.
ASSIGN gdo_data->* TO <gs_struct>.
go_typedescr = cl_abap_typedescr=>describe_by_data( <gs_struct> ).
go_structdescr ?= go_typedescr.
BREAK-POINT.
LOOP AT go_structdescr->components INTO gs_comp.
go_datadescr = GO_STRUCTDESCR->GET_COMPONENT_TYPE( gs_comp-name ).
gd_dtel = go_datadescr->get_relative_name( ).
write: / syst-tabix, 'Data element =', gd_dtel.
ENDLOOP.
END-OF-SELECTION.
Regards
Uwe -
I want to create generic master data attribute datasource on ANLA table .
hI,
I want to create generic master data attribute datasource on ANLA table .
and have to activate delta load.
Is it possible for delta upload on this table?
if it is possible then on which field i can create genric delta?1.I want to fetch quantity ,inventory no , serial no.......
I have to enhance that datasource.....
2.else i can create master data for asset number using ANLA
I have opted 2nd option -
Export table data in a flat file without using FL
Hi,
I am looking for options where I can export table data into a flat file without using FL(File Layout) i.e., by using App Engine only.
Please share your experience if you did anything as this
ThanksA simple way to export any record (table/view) to an csv fiel, is to create a rowset and loop through all record fields, like below example code
Local Rowset &RS;
Local Record &Rec;
Local File &MYFILE;
Local string &FileName, &strRecName, &Line, &Seperator, &Value;
Local number &numRow, &numField;
&FileName = "c:\temp\test.csv";
&strRecName = "PSOPRDEFN";
&Seperator = ";";
&RS = CreateRowset(@("Record." | &strRecName));
&RS.Fill();
&MYFILE = GetFile(&FileName, "W", %FilePath_Absolute);
If &MYFILE.IsOpen Then
For &numRow = 1 To &RS.ActiveRowCount
&Rec = &RS(&numRow).GetRecord(@("RECORD." | &strRecName));
For &numField = 1 To &Rec.FieldCount
&Value = String(&Rec.GetField(&numField).Value);
If &numField = 1 Then
&Line = &Value;
Else
&Line = &Line | &Seperator | &Value;
End-If;
End-For;
&MYFILE.WriteLine(&Line);
End-For;
End-If;
&MYFILE.Close(); You can of course create an application class for generic calling this piece of code.
Hope it helps.
Note:
Do not come complaining to me on performance issues ;) -
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.
-
Problem with table cell editors - Dropdown by Index, getting lead selection
Hi experts,
I have a table editor with 5 columns
1st column is a Drop Down byIndex.
My contex looks like this
AS_DATA(Parent Node cardinality 1.1, selection 0-1)
HEADER (NODE)
DETAILS(NODE cardinality 0..n, selection 0-1)
ACTIVITY_TYPES (NODE cardinality 0..n selection 0-1 ) "node for drop down
description - attribute
unit
quantity
i have bound details node to table data source.
i have a tool bar button 'Add Line item' which will add a new line item to the table.
(i am adding a blank line to the table that is bound to table )
Its working fine. but when ever i add more than one row, the selection made in the previous rows drop down is lost.
its initializing. where could be the problem.
My code
data LO_ND_INV_TYPE type ref to IF_WD_CONTEXT_NODE.
data LO_EL_INV_TYPE type ref to IF_WD_CONTEXT_ELEMENT.
data LS_INV_TYPE type WD_THIS->ELEMENT_INV_TYPE.
data LV_INV_TYPE type WD_THIS->ELEMENT_INV_TYPE-INV_TYPE.
data LO_ND_DETAILS type ref to IF_WD_CONTEXT_NODE.
data LT_DETAILS type WD_THIS->ELEMENTS_DETAILS.
data LS_DETAILS like line of LT_DETAILS.
data: WD_NODE type ref to IF_WD_CONTEXT_NODE,
LR_ELEMENT type ref to IF_WD_CONTEXT_ELEMENT.
data LO_ND_INV_PATTERN type ref to IF_WD_CONTEXT_NODE.
data LO_EL_INV_PATTERN type ref to IF_WD_CONTEXT_ELEMENT.
data LS_INV_PATTERN type WD_THIS->ELEMENT_INV_PATTERN.
data LV_INV_PAT type WD_THIS->ELEMENT_INV_PATTERN-INV_TYPE.
data LO_ND_ACTIVITY_TYPES type ref to IF_WD_CONTEXT_NODE.
data LT_ACTIVITY_TYPES type WD_THIS->ELEMENTS_ACTIVITY_TYPES.
data LW_ACTIVITY_TYPES type WD_THIS->ELEMENT_ACTIVITY_TYPES.
data LO_EL_ACTIVITY_TYPES type ref to IF_WD_CONTEXT_ELEMENT.
* navigate from <CONTEXT> to <DETAILS> via lead selection
LO_ND_DETAILS = WD_CONTEXT->PATH_GET_NODE( PATH = `AS_DATA.DETAILS` ).
LO_ND_DETAILS->GET_STATIC_ATTRIBUTES_TABLE(
importing TABLE = LT_DETAILS ).
* Append an empty row to lt_details
append LS_DETAILS to LT_DETAILS.
LO_ND_DETAILS->BIND_TABLE(
NEW_ITEMS = LT_DETAILS ).
* Get values for dropdown
call method WD_ASSIST->GET_ACTIVITY_TYPE
exporting
I_INV_CAT_ID = LV_INV_PAT
importing
ET_ACTIVITY_TYPE = LT_ACTIVITY_TYPES.
LW_ACTIVITY_TYPES-ID = 'Select a Activity type'.
LW_ACTIVITY_TYPES-TEXT = 'Select a Activity type'.
insert LW_ACTIVITY_TYPES into LT_ACTIVITY_TYPES index 1.
loop at LT_DETAILS into LS_DETAILS.
LV_TABIX = SY-TABIX.
LR_ELEMENT = LO_ND_DETAILS->GET_ELEMENT( LV_TABIX ).
WD_NODE = LR_ELEMENT->GET_CHILD_NODE( 'ACTIVITY_TYPES' ).
*lv_index = wd_node->get_lead_selection_index( ). " it is dumping at this statement when i try to get lead selection
WD_NODE->BIND_TABLE( NEW_ITEMS = LT_ACTIVITY_TYPES ). " data for dropdown
endloop.
any clue on what am i missing will be appreciated.
I am getting dump when i try to get the lead selection
AjayYou only have only one option in the DDI to display in the example. when you have multiple values
i assume that by adding an empty row like this will lose the SELECTION MADE in DDI. (Correct me If i am wrong)
somehow i believe that we need to bind the DD values using SET LEAD SELECTION INDEX METHOD FOR THE DDI when they are already selected and trying to BIND.
*LO_ND_DETAILS->GET_STATIC_ATTRIBUTES_TABLE(*
*importing TABLE = LT_DETAILS ).*
** Append an empty row to lt_details*
*append LS_DETAILS to LT_DETAILS.*
*LO_ND_DETAILS->BIND_TABLE(*
*NEW_ITEMS = LT_DETAILS ).*
even though the above code will have the selected value, the SELECTIONS MADE will be initialize.
you need to bind it explicitly.
you have to create an element and bind the DDI values for adding an row as SARAVANAN said.
or i guess you can continue with you code but need to use SET LEAD to display the correct SELECTIONS MADE
loop at LT_DETAILS into LS_DETAILS.
LV_TABIX = SY-TABIX.
LR_ELEMENT = LO_ND_DETAILS->GET_ELEMENT( LV_TABIX ).
WD_NODE = LR_ELEMENT->GET_CHILD_NODE( 'ACTIVITY_TYPES' ).
WD_NODE->BIND_TABLE( NEW_ITEMS = LT_ACTIVITY_TYPES ). " data for dropdown
*" try to set the desired value in the DDI when you have multiple values using SET LEAD*
endloop. -
Method GET_STATIC_ATTRIBUTES with generic table-structure
Hi ,
I am trying to select some rows of a web dynpro alv .
LS_ALL-TABNAME = VAR_NAME_OF_TABLE.
CREATE DATA LS_ALL-OBJECT TYPE TABLE OF (VAR_NAME_OF_TABLE). "<<<<<
INSERT LS_ALL INTO TABLE LT_ALL.
LOOP AT LT_ALL INTO LS_ALL.
ASSIGN LS_ALL-OBJECT->* TO <FS_TABLE>. "<<<<<
ENDLOOP.
LT_ELEMENTS = WD_THIS->DYN_NODE->GET_SELECTED_ELEMENTS( INCLUDING_LEAD_SELECTION = ABAP_TRUE ).
LOOP AT LT_ELEMENTS INTO LR_ELEMENT.
LR_ELEMENT->GET_STATIC_ATTRIBUTES( IMPORTING STATIC_ATTRIBUTES = <FS_TABLE> ).
"coding...
ENDLOOP.
My problem: It's a generic web dynpro alv (with a dynamic context node) and i only have the tablename (and so it's structure) of the alv at runtime in a variable.
I want to select some rows of this alv and get the data of the selected rows, so I try to work with field-symbols, but because of the move-corresponding in the coding of the method IF_WD_CONTEXT_ELEMENT~GET_STATIC_ATTRIBUTES...:
method IF_WD_CONTEXT_ELEMENT~GET_STATIC_ATTRIBUTES .
field-symbols:
<values> type data.
assign me->static_attributes->* to <values>.
move-corresponding <values> to static_attributes.
endmethod.
...i get the short-dump:
German:
Falscher Typ eines Operanden bei der Anweisung MOVE-CORRESPONDING.
English:
Wrong type of operands during the assignment MOVE-CORRESPONDING.
So how can i get the structure of my generic table and do a move-corresponding with the method above?
Many thanks in advance!
Regards,
Ludwig
Edited by: Ludwig Heinz on Mar 13, 2008 9:45 AMOk - but how can i make a declaration of dref_tab?
my coding:
TYPES: BEGIN OF TS_ALL,
TABNAME TYPE DD02L-TABNAME,
OBJECT TYPE REF TO DATA,
END OF TS_ALL.
"dref_tab TYPE HASHED TABLE OF TS_ALL
" WITH UNIQUE KEY TABNAME,
FIELD-SYMBOLS:
<FS_LINE> TYPE ANY,
<FS_STRUCT> TYPE ANY,
"<FS_TABLE> TYPE ANY TABLE.
CREATE DATA LS_ALL-OBJECT TYPE (LF_TABLENAME).
INSERT LS_ALL INTO TABLE LT_ALL.
"CREATE DATA dref_tab TYPE TABLE OF (LF_TABLENAME).
"ASSIGN dref_tab->* TO <FS_TABLE>.
LOOP AT LT_ALL INTO LS_ALL.
ASSIGN LS_ALL-OBJECT->* TO <FS_STRUCT>.
ENDLOOP.
LT_ELEMENTS = WD_THIS->DYN_NODE->GET_SELECTED_ELEMENTS( INCLUDING_LEAD_SELECTION = ABAP_TRUE ).
LOOP AT LT_ELEMENTS INTO LR_ELEMENT.
LR_ELEMENT->GET_STATIC_ATTRIBUTES( IMPORTING STATIC_ATTRIBUTES = <FS_STRUCT> ).
" append <FS_STRUCT> to <FS_TABLE>.
ENDLOOP.
syntax-error:
"dref_tab" is not a datareference-variable.
So how is the right declarion of "dref_tab" ?
Many thanks - i've you can solve this - i think i can finish it
Regards,
Ludwig -
Small issue with custom table cell editor and unwanted table row selection
I'm using a custom table cell editor to display a JTree. Thing i notice is that when i select a value in the tree pop-up, the pop-up closes (as it should) but then every table row, from the editing row to the row behind the pop-up when i selected the value becomes highlighted. I'm thinking this is a focus issue, but it thought i took care of that. To clairfy, look at this: Before . Notice how the "Straightening" tree item is roughly above the "Stock Thickness" table row? When i select Straightening, this is what happens to my table: After .
My TreeComboBox component:
public class TreeComboBox extends JPanel implements MouseListener {
private JTextField itemField;
private TreeModel treeModel;
private ArrayList<ActionListener> actionListeners = new ArrayList<ActionListener>();
private Object selectedItem;
* Creates a new <code>TreeComboBox</code> instance.
* @param treeModel the tree model to be used in the drop-down selector.
public TreeComboBox(TreeModel treeModel) {
this(treeModel, null);
* Creates a new <code>TreeComboBox</code> instance.
* @param treeModel the tree model to be used in the drop-down selector.
* @param selectedItem tree will expand and highlight this item.
public TreeComboBox(TreeModel treeModel, Object selectedItem) {
this.treeModel = treeModel;
this.selectedItem = selectedItem;
initComponents();
* Returns the current drop-down tree model.
* @return the current <code>TreeModel</code> instance.
public TreeModel getTreeModel() {
return treeModel;
* Sets the tree model.
* @param treeModel a <code>TreeModel</code> instance.
public void setTreeModel(TreeModel treeModel) {
this.treeModel = treeModel;
* Returns the selected item from the drop-down selector.
* @return the selected tree object.
public Object getSelectedItem() {
return selectedItem;
* Sets the selected item in the drop-down selector.
* @param selectedItem tree will expand and highlight this item.
public void setSelectedItem(Object selectedItem) {
this.selectedItem = selectedItem;
String text = selectedItem != null ? selectedItem.toString() : "";
itemField.setText(text);
setToolTipText(text);
* Overridden to enable/disable all child components.
* @param enabled flat to enable or disable this component.
public void setEnabled(boolean enabled) {
itemField.setEnabled(enabled);
super.setEnabled(enabled);
public void addActionListener(ActionListener listener) {
actionListeners.add(listener);
public void removeActionListener(ActionListener listener) {
actionListeners.remove(listener);
// MouseListener implementation
public void mouseClicked(MouseEvent e) {
public void mouseEntered(MouseEvent e) {
public void mouseExited(MouseEvent e) {
public void mousePressed(MouseEvent e) {
public void mouseReleased(MouseEvent e) {
showPopup();
private void initComponents() {
setLayout(new GridBagLayout());
itemField = new JTextField();
itemField.setEditable(false);
itemField.setText(selectedItem != null ? selectedItem.toString() : "");
itemField.addMouseListener(this);
add(itemField, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0,
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
private void showPopup() {
final TreePopup popup = new TreePopup();
final TreeComboBox tcb = this;
final int x = itemField.getX();
final int y = itemField.getY() + itemField.getHeight();
int width = itemField.getWidth() + popupButton.getWidth();
Dimension prefSize = popup.getPreferredSize();
prefSize.width = width;
popup.setPreferredSize(prefSize);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
popup.show(tcb, x, y);
popup.requestFocusInWindow();
private void fireActionPerformed() {
ActionEvent e = new ActionEvent(this, ActionEvent.ACTION_PERFORMED, "TreeComboBoxSelection");
for (ActionListener listener : actionListeners) {
listener.actionPerformed(e);
private class TreePopup extends JPopupMenu {
private JTree tree;
private JScrollPane scrollPane;
public TreePopup() {
initComponents();
initData();
private void initData() {
if (treeModel != null) {
tree.setModel(treeModel);
private void initComponents() {
setFocusable(true);
setFocusCycleRoot(true);
tree = new JTree();
tree.setRootVisible(false);
tree.setShowsRootHandles(true);
tree.setFocusable(true);
tree.setFocusCycleRoot(true);
tree.addTreeSelectionListener(new TreeSelectionListener() {
public void valueChanged(TreeSelectionEvent e) {
tree_valueChanged(e);
scrollPane = new JScrollPane(tree);
add(scrollPane);
private void tree_valueChanged(TreeSelectionEvent e) {
DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent();
setSelectedItem(node.getUserObject());
fireActionPerformed();
this.setVisible(false);
}My TreeComboBoxTableCellEditor:
public class TreeComboBoxTableCellEditor extends AbstractCellEditor implements TableCellEditor, ActionListener {
protected TreeComboBox treeComboBox;
protected ArrayList<CellEditorListener> cellEditorListeners = new ArrayList<CellEditorListener>();
public TreeComboBoxTableCellEditor(TreeComboBox treeComboBox) {
this.treeComboBox = treeComboBox;
treeComboBox.addActionListener(this);
public Object getCellEditorValue() {
return treeComboBox.getSelectedItem();
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
treeComboBox.setSelectedItem(value);
return treeComboBox;
public void actionPerformed(ActionEvent e) {
stopCellEditing();
}Any thoughts?
Edited by: MiseryMachine on Apr 3, 2008 1:21 PM
Edited by: MiseryMachine on Apr 3, 2008 1:27 PMAs I said, you have to have empty context elements before additional rows will be open for input.
For instance if you want to start with 5 rows available for input do the following to your internal table that you will bind:
data itab type standard table of sflight.
do 5 times.
append initial line to itab.
enddo.
context_node->bind_table( itab ).
The other option if you need n number of rows is to add a button to the table toolbar for adding more rows. When this button is pressed, you add a new context element to the node - thereby creating a new empty row in the table. -
How Internal table data send to sap mail as a attachment?
Hi,
Can any one please let me know , how we will send internal table data to sap mail.
In my internal table my data output length is more than 255 characters.
Thanks in advance.Hi
Try out the below code:
DATA: ld_mtitle LIKE sodocchgi1-obj_descr,
ld_format TYPE so_obj_tp ,
ld_attdescription TYPE so_obj_nam ,
ld_attfilename TYPE so_obj_des .
* ld_receiver LIKE sy-subrc.
DATA: it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
it_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
it_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
w_cnt TYPE i,
w_sent_all(1) TYPE c, "#EC NEEDED
w_doc_data LIKE sodocchgi1.
REFRESH it_receivers . CLEAR it_receivers .
IF v_trip_send = 'X'.
it_receivers-receiver = it_trip_dload-approver_email .
ELSE .
it_receivers-receiver = it_adv_dload-approver_email .
ENDIF.
it_receivers-rec_type = c_u .
APPEND it_receivers. CLEAR it_receivers.
* it_receivers-receiver = ' <Email ID> ' "Email address.
IF v_trip_send = 'X' .
it_receivers-receiver = it_trip_dload-requester_email .
ELSE .
it_receivers-receiver = it_adv_dload-requester_email .
ENDIF .
it_receivers-rec_type = c_u .
it_receivers-copy = 'X' .
APPEND it_receivers. CLEAR it_receivers.
ld_mtitle = p_mtitle.
ld_format = p_format.
ld_attdescription = p_attdescription.
ld_attfilename = p_filename.
* Fill the document data.
w_doc_data-doc_size = 1.
* Populate the subject/generic message attributes
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = c_saprpt.
w_doc_data-obj_descr = ld_mtitle .
w_doc_data-sensitivty = 'F'.
* Fill the document data and get size of attachment
CLEAR w_doc_data.
READ TABLE it_attach INDEX w_cnt.
w_doc_data-doc_size =
( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
w_doc_data-obj_langu = sy-langu.
w_doc_data-obj_name = c_saprpt.
w_doc_data-obj_descr = ld_mtitle.
w_doc_data-sensitivty = c_f.
CLEAR it_attachment.
REFRESH it_attachment.
it_attachment[] = it_attach[].
* Describe the body of the message
CLEAR it_packing_list.
REFRESH it_packing_list.
it_packing_list-transf_bin = space.
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
DESCRIBE TABLE it_message LINES it_packing_list-body_num.
it_packing_list-doc_type = c_raw.
APPEND it_packing_list.
* Create attachment notification
it_packing_list-transf_bin = c_x.
it_packing_list-head_start = 1.
it_packing_list-head_num = 1.
it_packing_list-body_start = 1.
DESCRIBE TABLE it_attachment LINES it_packing_list-body_num.
it_packing_list-doc_type = ld_format.
it_packing_list-obj_descr = ld_attdescription.
it_packing_list-obj_name = ld_attfilename.
it_packing_list-doc_size = it_packing_list-body_num * 255.
APPEND it_packing_list.
CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
EXPORTING
document_data = w_doc_data
put_in_outbox = c_x
commit_work = c_x
IMPORTING
sent_to_all = w_sent_all
TABLES
packing_list = it_packing_list
contents_bin = it_attachment
contents_txt = it_message
receivers = it_receivers.
&*********<removed_by_moderator_together_with_6_unmentionables>************&
Edited by: Julius Bussche on Jun 23, 2008 11:04 PM -
R/3 table data for BI reporting ?
In R/3 i have a table and I want to take the complete table data into SAP BI system for reporting .
In how many ways can I take the data to sap BI system.
In how many ways I can make use of that table for reporting in BI
please suggest me some .Hi,
You have to create a generic datasource based on this table (if no Bi content is supported)
You can direct assign this (1)table for generic datasource is it a transparent table.
or u can create a (2) view based on this table then use that view for the datasource
or u can create an (3) Infoset query on this table
or u can create a (4)function module to extract its data..
Its more simple to create a generic datasource based on 1 option
Then u have to create a data target(info cube/DSO) for this generic datasource and create report on this data target.
you can search the forum for generic datasource creation.
Hope this helps and ask if further question are there
Sonal.....
Edited by: Sonal Patel on Aug 14, 2008 12:52 PM -
Package with table data type as out parameter.
Hi there, I managed to compile the package without error but when I am trying to test this package and
I am keep facing this error message.
Am I using correctly for the table data type as out parameter. I have no idea what is wrong with the package to fix.
Pls. help and advise me. Thanks.
Error starting at line 1 in command:
DECLARE
p_stmodel VARCHAR2(40):=null;
p_item_number VARCHAR(40):='9BX158-300';
p_item_id NUMBER:=0;
l_attribute_out test_common_api.l_item_attr_tab:=test_common_api.l_item_attr_tab();
BEGIN
test_common_api.test_attribute(p_stmodel,p_item_number,p_item_id,l_attribute_out);
END;
Error report:
ORA-06550: line 8, column 18:
PLS-00302: component 'TEST_ATTRIBUTE' must be declared
ORA-06550: line 8, column 2:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
---------Package.
CREATE OR REPLACE PACKAGE test_common_api
AS
TYPE item_attr_rec IS RECORD (CONFIGURATION VARCHAR2(20),
PRODUCTTYPE VARCHAR2(30),
INTERNALPRODUCTNAME VARCHAR2(20),
NUMBEROFHEADS VARCHAR2(2),
NUMBEROFDISCS VARCHAR2(2),
GENERATION VARCHAR2(10),
FACTORYAPPLICATION VARCHAR2(150),
PRODUCTFAMILY VARCHAR2(60),
FORMFACTOR VARCHAR2(10),
FORMATTEDCAPACITY NUMBER,
FORMATTEDCAPACITY_UOM VARCHAR2(20),
INTERFACE VARCHAR2(30),
SPINDLESPEEDRPM NUMBER,
PRODUCTCACHE VARCHAR2(10),
WARRANTYMONTHS VARCHAR2(2),
PHYSICAL_SECTOR_SIZE NUMBER,
MODELHEIGHT VARCHAR2(10),
ENCRYPTION_TYPE VARCHAR2(40));
TYPE l_item_attr_tab IS TABLE OF item_attr_rec;
END test_common_api;
show errors
create or replace package body test_common_api
AS
PROCEDURE test_attribute (p_stmodel IN VARCHAR2,
p_item_number IN VARCHAR2,
p_item_id IN NUMBER,
l_item_attr_list OUT l_item_attr_tab)
IS
l_stmodel st.stmodelnumber%TYPE;
l_market_segment VARCHAR2(10) ;
l_sub_market_segment VARCHAR2(10) ;
l_app_segment VARCHAR2(10);
l_market_name VARCHAR2(40) ;
l_ccitem seaeng_ccitemnumber.ccitemnumber%TYPE;
l_query_item VARCHAR2(1000);
l_query_model VARCHAR2(1000);
l_where VARCHAR2(1000);
l_bind_var1 VARCHAR2(40);
l_bind_var2 VARCHAR2(40);
l_sql NUMBER:=0;
l_config VARCHAR2(40):=null;
BEGIN
IF p_stmodel is not null THEN
l_where :='WHERE sc.ccmodel = sp.productmodelnumber AND sp.stmodelnumber = st.stmodelnumber
AND sc.pricingdescriptor=''MODEL''
AND sc.ccdashnumber =''000''
AND sp.detailedproductname=''GENERIC''
AND st.stmodelnumber= :1';
IF p_item_number is null AND p_item_id is null THEN
l_config :='null';
ELSE
l_config :='sc.configuration';
END IF;
l_bind_var1 :=p_stmodel;
l_sql :=1;
ELSE
IF p_item_id is null and p_item_number is not null THEN
l_where := 'WHERE sc.ccmodel = sp.productmodelnumber AND sp.stmodelnumber = st.stmodelnumber and sc.ccitemnumber = :1';
l_bind_var1 :=p_item_number;
l_sql:=2;
ELSIF p_item_id is NOT null and p_item_number is null THEN
l_where := 'WHERE sc.ccmodel= sp.productmodelnumber AND sp.stmodelnumber = st.stmodelnumber and sc.ccitemnumber in ( select msi.segment1
from mtl_system_items msi
where msi.inventory_item_id = :1)';
l_bind_var1 := p_item_id;
l_sql:=2;
ELSIF p_item_id is not null and p_item_number is not null THEN
l_where :='WHERE sc.ccmodel = sp.productmodelnumber AND sp.stmodelnumber = st.stmodelnumber and sc.ccitemnumber in (select msi.segment1
from mtl_system_items msi
where msi.inventory_item_id = :1
AND msi.segment1=:2)';
l_sql:=3;
l_bind_var1 := p_item_id ;
l_bind_var2 :=p_item_number;
END IF;
END IF;
l_query_item :='SELECT sc.configuration,st.producttype, sp.internalproductname, sp.numberofheads , sp.numberofdiscs,
sp.generation,sp.factoryapplication, st.productfamily,st.formfactor , st.formattedcapacity , st.formattedcapacity_uom,
st.interface,st.spindlespeedrpm,st.productcache,st.warrantymonths, st.physical_sector_size, st.modelheight, st.encryption_type
FROM pm sp , st st, seaeng_ccitemnumber sc ';
l_query_model :='SELECT '|| l_config|| ' , st.producttype, null,null , null, null, sp.factoryapplication, null,st.formfactor, st.formattedcapacity,
st.formattedcapacity_uom,st.interface , st.spindlespeedrpm, st.productcache, st.warrantymonths,st.physical_sector_size, st.modelheight,
st.encryption_type
FROM pm sp , st st, seaeng_ccitemnumber sc ';
IF l_sql = 1 THEN
EXECUTE IMMEDIATE l_query_model ||l_where
BULK COLLECT INTO l_item_attr_list
USING l_bind_var1 ;
dbms_output.put_line(l_query_model||l_where);
ELSIF
l_sql =2 THEN
EXECUTE IMMEDIATE l_query_item || l_where
BULK COLLECT INTO l_item_attr_list
using l_bind_var1;
dbms_output.put_line(l_query_item||l_where);
ELSE
EXECUTE IMMEDIATE l_query_item ||l_where
BULK COLLECT INTO l_item_attr_list
USING l_bind_var1, l_bind_var2 ;
dbms_output.put_line(l_query_item||l_where);
END IF;
END test_attribute;
END test_common_api;
show errorsI think you forget to declare "PROCEDURE test_attribute" procedure in your package definition. like:
CREATE OR REPLACE PACKAGE test_common_api
AS
TYPE item_attr_rec IS RECORD (CONFIGURATION VARCHAR2(20),
PRODUCTTYPE VARCHAR2(30),
INTERNALPRODUCTNAME VARCHAR2(20),
NUMBEROFHEADS VARCHAR2(2),
NUMBEROFDISCS VARCHAR2(2),
GENERATION VARCHAR2(10),
FACTORYAPPLICATION VARCHAR2(150),
PRODUCTFAMILY VARCHAR2(60),
FORMFACTOR VARCHAR2(10),
FORMATTEDCAPACITY NUMBER,
FORMATTEDCAPACITY_UOM VARCHAR2(20),
INTERFACE VARCHAR2(30),
SPINDLESPEEDRPM NUMBER,
PRODUCTCACHE VARCHAR2(10),
WARRANTYMONTHS VARCHAR2(2),
PHYSICAL_SECTOR_SIZE NUMBER,
MODELHEIGHT VARCHAR2(10),
ENCRYPTION_TYPE VARCHAR2(40));
PROCEDURE test_attribute (p_stmodel IN VARCHAR2,
p_item_number IN VARCHAR2,
p_item_id IN NUMBER,
l_item_attr_list OUT l_item_attr_tab);
TYPE l_item_attr_tab IS TABLE OF item_attr_rec;
END test_common_api;
show errors
create or replace package body test_common_api
AS
PROCEDURE test_attribute (p_stmodel IN VARCHAR2,
p_item_number IN VARCHAR2,
p_item_id IN NUMBER,
l_item_attr_list OUT l_item_attr_tab)
IS
l_stmodel st.stmodelnumber%TYPE;
l_market_segment VARCHAR2(10) ;
l_sub_market_segment VARCHAR2(10) ;
l_app_segment VARCHAR2(10);
l_market_name VARCHAR2(40) ;
l_ccitem seaeng_ccitemnumber.ccitemnumber%TYPE;
l_query_item VARCHAR2(1000);
l_query_model VARCHAR2(1000);
l_where VARCHAR2(1000);
l_bind_var1 VARCHAR2(40);
l_bind_var2 VARCHAR2(40);
l_sql NUMBER:=0;
l_config VARCHAR2(40):=null;
BEGIN
IF p_stmodel is not null THEN
l_where :='WHERE sc.ccmodel = sp.productmodelnumber AND sp.stmodelnumber = st.stmodelnumber
AND sc.pricingdescriptor=''MODEL''
AND sc.ccdashnumber =''000''
AND sp.detailedproductname=''GENERIC''
AND st.stmodelnumber= :1';
IF p_item_number is null AND p_item_id is null THEN
l_config :='null';
ELSE
l_config :='sc.configuration';
END IF;
l_bind_var1 :=p_stmodel;
l_sql :=1;
ELSE
IF p_item_id is null and p_item_number is not null THEN
l_where := 'WHERE sc.ccmodel = sp.productmodelnumber AND sp.stmodelnumber = st.stmodelnumber and sc.ccitemnumber = :1';
l_bind_var1 :=p_item_number;
l_sql:=2;
ELSIF p_item_id is NOT null and p_item_number is null THEN
l_where := 'WHERE sc.ccmodel= sp.productmodelnumber AND sp.stmodelnumber = st.stmodelnumber and sc.ccitemnumber in ( select msi.segment1
from mtl_system_items msi
where msi.inventory_item_id = :1)';
l_bind_var1 := p_item_id;
l_sql:=2;
ELSIF p_item_id is not null and p_item_number is not null THEN
l_where :='WHERE sc.ccmodel = sp.productmodelnumber AND sp.stmodelnumber = st.stmodelnumber and sc.ccitemnumber in (select msi.segment1
from mtl_system_items msi
where msi.inventory_item_id = :1
AND msi.segment1=:2)';
l_sql:=3;
l_bind_var1 := p_item_id ;
l_bind_var2 :=p_item_number;
END IF;
END IF;
l_query_item :='SELECT sc.configuration,st.producttype, sp.internalproductname, sp.numberofheads , sp.numberofdiscs,
sp.generation,sp.factoryapplication, st.productfamily,st.formfactor , st.formattedcapacity , st.formattedcapacity_uom,
st.interface,st.spindlespeedrpm,st.productcache,st.warrantymonths, st.physical_sector_size, st.modelheight, st.encryption_type
FROM pm sp , st st, seaeng_ccitemnumber sc ';
l_query_model :='SELECT '|| l_config|| ' , st.producttype, null,null , null, null, sp.factoryapplication, null,st.formfactor, st.formattedcapacity,
st.formattedcapacity_uom,st.interface , st.spindlespeedrpm, st.productcache, st.warrantymonths,st.physical_sector_size, st.modelheight,
st.encryption_type
FROM pm sp , st st, seaeng_ccitemnumber sc ';
IF l_sql = 1 THEN
EXECUTE IMMEDIATE l_query_model ||l_where
BULK COLLECT INTO l_item_attr_list
USING l_bind_var1 ;
dbms_output.put_line(l_query_model||l_where);
ELSIF
l_sql =2 THEN
EXECUTE IMMEDIATE l_query_item || l_where
BULK COLLECT INTO l_item_attr_list
using l_bind_var1;
dbms_output.put_line(l_query_item||l_where);
ELSE
EXECUTE IMMEDIATE l_query_item ||l_where
BULK COLLECT INTO l_item_attr_list
USING l_bind_var1, l_bind_var2 ;
dbms_output.put_line(l_query_item||l_where);
END IF;
END test_attribute;
END test_common_api;
show errors -
Compare table data between two schemas?
Hi,
I am looking for a script to compare the table data between the schemas (two different databases)? I know how to compare table by table but looking for a generic script where I can compare all the tables data from one schema to another schema?
Thanks a lot...here the idea, adapt it with your needs :)
Connected to Oracle Database 11g Enterprise Edition Release 11.1.0.7.0
Connected as SYS
SQL> create user user1 identified by user1;
User created
SQL> grant create session to user1;
Grant succeeded
SQL> grant create table to user1;
Grant succeeded
SQL> alter user user1 quota 10m on DATA;
User altered
SQL> create user user2 identified by user2;
User created
SQL> alter user user2 quota 10m on DATA;
User altered
SQL> grant create table to user2;
Grant succeeded
SQL> grant create session to user2;
Grant succeeded
SQL> create table user1.test(a Number) tablespace DATA;
Table created
SQL> create table user2.test(a Number) tablespace DATA;
Table created
SQL> insert into user1.test values (1);
1 row inserted
SQL> insert into user1.test values (2);
1 row inserted
SQL> commit;
Commit complete
SQL> insert into user2.test values (2);
1 row inserted
SQL> commit;
Commit complete
SQL> create table sys.logs(Diff number) tablespace data;
Table created
SQL> select * from sys.logs;
DIFF
SQL>
CREATE OR REPLACE PROCEDURE TEST_MY_DIFF IS
CURSOR CUR_ IS
SELECT D.TABLE_NAME T_NAME FROM DBA_TABLES D WHERE D.OWNER = 'USER1';
W_DIFF NUMBER;
TYPE CV_TYP IS REF CURSOR;
CV CV_TYP;
BEGIN
EXECUTE IMMEDIATE 'TRUNCATE TABLE SYS.LOGS';
FOR I IN CUR_ LOOP
W_DIFF := 0;
OPEN CV FOR 'select count(*)
from
( select * from USER1.' || I.T_NAME || '
minus
select * from USER2.' || I.T_NAME || ' )
union all
( select * from USER2.' || I.T_NAME || '
minus
select * from USER1.' || I.T_NAME || ')
LOOP
FETCH CV
INTO W_DIFF;
INSERT INTO SYS.LOGS VALUES (W_DIFF);
COMMIT;
EXIT WHEN CV%NOTFOUND;
END LOOP;
END LOOP;
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
SQL> BEGIN
2 test_my_diff;
3 end;
4 /
PL/SQL procedure successfully completed
SQL> select * from sys.logs;
DIFF
1
1 -
Data Editor - clicking on Data tab - gets error
Hi all.
I don't think this has anything to do with 30EA2, but I when I click on a table in the schema browser to display columns, data, constraints, triggers, etc..., all the tabs work ok, except I am getting an error on the data tab. I get the following in the data editor log pane at the bottom.
ORA-01785: ORDER BY item must be the number of a SELECT-list expression.
Granted, we just had a change to that table where we dropped some columns and I don't remember if I had any filters on the table that might be saved somewhere prior to the change. However, I don't think any of the columns we dropped I had done anything special with. Anyway, is something saved somewhere that would now prevent the displaying of the data in the data editor. It must be something on my machine because other developers here do not have the issue.
Thanks,
MarkHi,
The error given is referring to ORDER BY clause.
Therefore on the Data tab, have you checked by clicking the Sort... button (next to Filter) to make sure there is no Sort-ing defined on that table?
Sometimes SQL Dev keeps the Sort / Filter which user has put on, and ever since the column has been dropped, the Sort / Filter may not be changed until we do so.
Regards,
Buntoro -
[SQL SERVER 2000] Generic table exporter
Hello every body.
First of all sorry for my bad english but I'm french ;-)
My internship consits into making a generic table exporter (with a table list). Export into csv files.
I have tried 2 solutions :
1 - Create a DTS with a Dynamic Properties Task. The problem is I can easily change the destination file but when I change the table source I don't know how to remap the transformations between source and destination (do you see what I mean ?). Any idea ?
2 - Use the bcp command. Very simple but how to do when tables contains the separator caracter ? for example : If a table line is "toto" | "I am , very happy" --> the csv file will look like this : toto, I am , very happy --> problem to get back the data ( to much comma ).
Does someone has a solution ?
Last point is how to export the table structure ? For the moment, using the table structure, I generate an sql query which creates a table (I write this query in a file). Isn't there any "cleaner" solution ?
Thanks in advance and have a nice day allAnswers,
1. Use ActiveX script to transform. Refer
http://technet.microsoft.com/en-us/library/aa933459(v=sql.80).aspx
2. Replace the pipe delimiter first with comma if it is a single column and use bcp command. Refer
http://technet.microsoft.com/en-us/library/aa174646(v=sql.80).aspx
3. Regarding generating script refer
http://stackoverflow.com/questions/4058977/exporting-tables-and-indexes-from-one-sql-server-2000-database-to-another
Regards, RSingh
Maybe you are looking for
-
PB no longer recognizes VGA connection to projector
I use my PowerBook with two different external displays. It works fine with the DVI connection to an external desktop monitor. It used to also work fine connecting to a classroom A/V system with a projector (using the DVI-VGA adaptor), but it has mos
-
Install and setup problem with Acrobat XI pro
I have downloaded the Acrobat XI Pro trial program, with no error messages. When I clisk on "setup.exe" the following error message appears, see screen shot : "This patch package could not be opened. Verify that the patch package exixts and that you
-
I am new to mac and am trying to transfer files via usb from my rca lyra to my mini mac. The files are .asf the mac is asking me to id the software to open the files with, this is were I am encountering the problem, how do I acc. this task? thanks in
-
I have had my IPOD mini for a couple of months but the last several weeks it will not update the new songs I have purchased from ITunes to my IPOD. The battery is being recharged when I connect my IPOD to my computer but nothing is being updated. I h
-
Can't open my website outside of my web server
I have installed lion server on my mini. I want to use it to host my website url. www.bigislanprivatechef.com after setting up web server I can type the url into any of my browsers and my site fires right up. I can go to statcounter and see my hits r