Using Types versus XMLElement/XMLForest
Ok, no one seems to have an answer for my previous problems with oracle types and the OracleXMLQuery facility. So I have a new question.
Basically what I have is a program that sends and receives XML messages. All the data elements in these messages must come from the database and be updated by the received XML.
The oracle XSU seemed to answer that question easily. But it appears to have problems.
Instead of creating an object-relational database would I be better off creating a generic relational database and using the oracle extensions for XML (XMLElement/XMLForest etc)?
This adds significant complexity to the queries I will have to write, but leaves the database in a more standard format.
What other options do I have for easily generating XML from queries to a database (and saving data contained in XML back to the database)?
Thanks!
Conrad D. Seaman
Conrad,
There are some articles by Johnathan Gennick regarding xmlelement/xmlforest and views.
http://www.oracle.com/technology/oramag/oracle/03-may/o33xml.html
http://www.oracle.com/technology/oramag/oracle/03-jan/o13xml.html
Similar Messages
-
XMLElement/XMLForest used together with schema
If I want to use schema when generating XML, looks like I have to put all the elements in global scope of the target namespace in the XML schema, otherwise XMLelement/XMLForest will complain that the defintion of the element can not be found.
For example, in the schema, if I use:
<xs:element name="Link">
<xs:complexType>
<xs:sequence>
<xs:element name="NavStateID" type="xs:integer" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
and Select XMLElement("Link", XMLForest(nav_id AS "NavStateID")) from table
it will complain that NavStateID is not defined in the target namespace of the schema.
I have to use following to get around of this issue:
<xs:element name="Link">
<xs:complexType>
<xs:sequence>
<xs:element ref="NavStateID" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NavStateID" type="xs:integer"/>
Is there other way to get aroud since if the schema is big, there will be name conflict issues if I put all the element defintions in the global scope.Oops - my bad
Had the namespace for the Schema Instance incorrect in the above example. However I do the cause of the problem. It's the setting of the elementDefaultForm qualified attribute. With it ommitted it defaults to unqualified and you get the error you are reporting..
SQL> DECLARE
2 xmlSchema xmlType := xmlType(
3
4 '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.abc.com/goodmorning" xmlns="http://www.abc.com/g
oodmorning" xmlns:xdb="http://xmlns.oracle.com/xdb">
5 <xs:element name="FeatureLinks" xdb:defaultTable="ST_LINK_FEATURE">
6 <xs:complexType>
7 <xs:sequence>
8 <xs:element name="Link" type="LinkType" maxOccurs="unbounded"/>
9 </xs:sequence>
10 </xs:complexType>
11 </xs:element>
12 <xs:complexType name="LinkType">
13 <xs:sequence>
14 <xs:element name="ID" type="xs:integer" minOccurs="0"/>
15 <xs:element name="Nav_State_ID" type="xs:integer"/>
16 </xs:sequence>
17 </xs:complexType>
18 </xs:schema>');
19
20 res boolean;
21 xmlData XMLTYPE;
22 schemaURL VARCHAR2(256):='http://localhost:8080/RDF/st_link_feature.xsd';
23 schemaPath VARCHAR2(256):='/public/st_link_feature.xsd';
24 xmlPath VARCHAR2(256):='/public/test.xml';
25
26 BEGIN
27 IF (dbms_xdb.existsResource(schemaPath)) THEN
28 dbms_xmlSchema.deleteSchema(schemaURL,4);
29 dbms_xdb.deleteResource(schemaPath);
30 END IF;
31 res := dbms_xdb.createResource(schemaPath,xmlSchema);
32 dbms_xmlschema.registerSchema(schemaURL,xdbURIType(schemaPath).getClob(),TRUE,TRUE,FALSE,TRUE);
33 END;
34
35 /
PL/SQL procedure successfully completed.
SQL> drop table ST_LINK_DATA
2 /
Table dropped.
SQL> create table ST_LINK_DATA
2 (
3 ID varchar2(20),
4 NAV_ID varchar2(20)
5 )
6 /
Table created.
SQL> insert into ST_LINK_DATA values ('456','123')
2 /
1 row created.
SQL> commit
2 /
Commit complete.
SQL> set long 100000
SQL> --
SQL> select xmlelement
2 (
3 "FeatureLinks",
4 xmlAttributes
5 (
6 'http://www.w3.org/2001/XMLSchema-instance' as "xmlns:xsi",
7 'http://www.abc.com/goodmorning' as "xmlns",
8 'http://www.abc.com/goodmorning http://localhost:8080/RDF/st_link_feature.xsd' as "xsi:schemaLocation"
9 ),
10 xmlElement
11 (
12 "Link",
13 xmlForest
14 (
15 NAV_ID as "Nav_State_ID"
16 )
17 )
18 ).extract('/*')
19 from ST_LINK_DATA
20 /
ERROR:
ORA-30937: No schema definition for 'Link' (namespace
'http://www.abc.com/goodmorning') in parent '/FeatureLinks'
ORA-06512: at "SYS.XMLTYPE", line 111
no rows selected
SQL> declare
2 myxml xmltype;
3 begin
4 select xmlelement
5 (
6 "FeatureLinks",
7 xmlAttributes
8 (
9 'http://www.w3.org/2001/XMLSchema-instance' as "xmlns:xsi",
10 'http://www.abc.com/goodmorning' as "xmlns",
11 'http://www.abc.com/goodmorning http://localhost:8080/RDF/st_link_feature.xsd' as "xsi:schemaLocation"
12 ),
13 xmlElement
14 (
15 "Link",
16 xmlForest
17 (
18 NAV_ID as "Nav_State_ID"
19 )
20 )
21 ).extract('/*')
22 into myXML
23 from ST_LINK_DATA;
24 myXML := myXML.createSchemaBasedXML();
25 myXML.schemaValidate();
26 end;
27 /
declare
ERROR at line 1:
ORA-30937: No schema definition for 'Link' (namespace
'http://www.abc.com/goodmorning') in parent '/FeatureLinks'
ORA-06512: at "SYS.XMLTYPE", line 111
ORA-06512: at line 4
SQL>With it present and set to qualified everthing works as expected
SQL> DECLARE
2 xmlSchema xmlType := xmlType(
3
4 '<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.abc.com/goodmorning" xmlns="http://www.abc.com/g
oodmorning" xmlns:xdb="http://xmlns.oracle.com/xdb" elementFormDefault="qualified">
5 <xs:element name="FeatureLinks" xdb:defaultTable="ST_LINK_FEATURE">
6 <xs:complexType>
7 <xs:sequence>
8 <xs:element name="Link" type="LinkType" maxOccurs="unbounded"/>
9 </xs:sequence>
10 </xs:complexType>
11 </xs:element>
12 <xs:complexType name="LinkType">
13 <xs:sequence>
14 <xs:element name="ID" type="xs:integer" minOccurs="0"/>
15 <xs:element name="Nav_State_ID" type="xs:integer"/>
16 </xs:sequence>
17 </xs:complexType>
18 </xs:schema>');
19
20 res boolean;
21 xmlData XMLTYPE;
22 schemaURL VARCHAR2(256):='http://localhost:8080/RDF/st_link_feature.xsd';
23 schemaPath VARCHAR2(256):='/public/st_link_feature.xsd';
24 xmlPath VARCHAR2(256):='/public/test.xml';
25
26 BEGIN
27 IF (dbms_xdb.existsResource(schemaPath)) THEN
28 dbms_xmlSchema.deleteSchema(schemaURL,4);
29 dbms_xdb.deleteResource(schemaPath);
30 END IF;
31 res := dbms_xdb.createResource(schemaPath,xmlSchema);
32 dbms_xmlschema.registerSchema(schemaURL,xdbURIType(schemaPath).getClob(),TRUE,TRUE,FALSE,TRUE);
33 END;
34
35 /
PL/SQL procedure successfully completed.
SQL> drop table ST_LINK_DATA
2 /
Table dropped.
SQL> create table ST_LINK_DATA
2 (
3 ID varchar2(20),
4 NAV_ID varchar2(20)
5 )
6 /
Table created.
SQL> insert into ST_LINK_DATA values ('456','123')
2 /
1 row created.
SQL> commit
2 /
Commit complete.
SQL> set long 100000
SQL> --
SQL> select xmlelement
2 (
3 "FeatureLinks",
4 xmlAttributes
5 (
6 'http://www.w3.org/2001/XMLSchema-instance' as "xmlns:xsi",
7 'http://www.abc.com/goodmorning' as "xmlns",
8 'http://www.abc.com/goodmorning http://localhost:8080/RDF/st_link_feature.xsd' as "xsi:schemaLocation"
9 ),
10 xmlElement
11 (
12 "Link",
13 xmlForest
14 (
15 NAV_ID as "Nav_State_ID"
16 )
17 )
18 ).extract('/*')
19 from ST_LINK_DATA
20 /
XMLELEMENT("FEATURELINKS",XMLATTRIBUTES('HTTP://WWW.W3.ORG/2001/XMLSCHEMA-INSTAN
<FeatureLinks xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http:
//www.abc.com/goodmorning" xsi:schemaLocation="http://www.abc.com/goodmorning ht
tp://localhost:8080/RDF/st_link_feature.xsd">
<Link>
<Nav_State_ID>123</Nav_State_ID>
</Link>
</FeatureLinks>
SQL> -
Implicit and explicit Type conversion using Type object in heap
Hi,
I am surprised how Implicit and explicit Type conversion works using Type object in heap. for example when implicit type conversion occur what pointer it returns to object and similarly with explicit type conversion.Hello,
>> I am surprised how Implicit and explicit Type conversion works using Type object in heap.
For Implicit conversions: Typical examples are conversions from smaller to larger integral types, and conversions from derived classes to base classes. For the first one, the reference would be different which means it would return a different pointer to
a new object. For the reference type, it actually points to the same memory location, you could use the object.ReferenceEquals() to check it.
For Explicit conversions (casts):Typical examples include numeric conversion to a type that has less precision or a smaller range, and conversion of a base-class instance to a derived class. For first one, it would perform the same with implicit conversions.
While for the conversion of conversion of a base-class instance to a derived class, actually, there's no built-in way to do this conversion.
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Using TYPES with out in a procedure
Can you use TYPES with the OUT parameter when executing a procedure?
CREATE OR REPLACE PROCEDURE get_assoc_status (fin_aor_id IN ASSOCIATE_OFFICE_RECORDS.ASSOCIATE_OFFICE_RECORD_ID%TYPE,
v_amr_id OUT ASSOCIATE_MASTER_RECORDS.ASSOCIATE_MASTER_RECORD_ID%TYPE, ....
In all documentation where I've looked procedures up, all the examples use internal defined types, like NUMBER, VARCHAR2,etc...It seems like there shouldn't be a problem but I keep getting this message:
Error at line 2
ORA-06550: line 2, column 70:
PLS-00103: Encountered the symbol "," when expecting one of the following:
:= ( ; not null range default character
ORA-06550: line 9, column 1:Yes, you can use typed output parameters:
sql>create or replace procedure p_test(p_empno in emp.empno%type, p_sal out emp.sal%type)
2 is
3 begin
4 select sal
5 into p_sal
6 from emp
7 where empno = p_empno;
8 end;
9 /
Procedure created.
sql>var the_salary number
sql>exec p_test(7369, :the_salary)
PL/SQL procedure successfully completed.
sql>print the_salary
THE_SALARY
800 -
Jdbc connectivity using type 4 driver using oracle10g
Hi while running a jdbc program using type 4 driver using oracle 10 g I am Getting following exception
java.lang.NullPointerException
java.lang.NullPointerException
at Type4ConnectTest.main(Type4ConnectTest.java:31)
Exception in thread "main" java.lang.ClassNotFoundException: oracle.jdbc.driver.
OracleDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at Type4ConnectTest.main(Type4ConnectTest.java:15)
My Program Code is..
import java.sql.*;
class Type4ConnectTest
public static void main(String args[])throws Exception
Connection con=null;
Statement st=null;
ResultSet rs=null;
try
// DriverManager.registerDriver(new Oracle:jdbc:OracleDriver());
Class.forName("oracle.jdbc.OracleDriver");
String url="jdbcracle:thin:@localhost:1521";
con=DriverManager.getConnection(url,"sarika","sarika");
catch(NullPointerException e)
System.out.println("e");
e.printStackTrace();
finally
try
con.close();
st.close();
rs.close();
catch(Exception e)
System.out.println(e);
e.printStackTrace();
I also set path of ojdbc14.jar and orai18n.jar in environment variable.
pls help to solve the problemClass.forName("SOME_DRIVER_CLASS");Is tricky to use because it will compile not needing to reference the vendors jar file.
You have to remember to deploy it though where ever you plan to run this program.
If you are running from command line
java -cp PATH_TO_JAR Type4ConnectTest -
Why we use type casting ' ?='
Hii Team
sample code for fetching the input value from search view which is connected to btq1order contextnode
DATA : lr_qs TYPE REF TO cl_crm_bol_dquery_service,
lr_qr TYPE REF TO if_bol_bo_col,
lr_qs ?= me->typed_context->btq1order->collection_wrapper->get_current( ).
lr_qr = lr_qs->get_query_result( ).
I am new to SAP CRM .while understanding the code i got stuck in one problem that ,
1.what is the main purpose behind
TYPE CASTING ie; '?='
2.what happens if we write ?= becoz if we write '=' instead of '?=' the system thows an error.
3.when to use this operator ?= and when we cannot use ?
It is used almost every where in BOL coding .please help me by giving complete explaination with an example if possible.
Thanks in AdvanceHi Abhishek,
Please check returning parameter type for get_current_dquery() method. In case returning type is mutually convertible then you don't have to use type casting.
But in case where you are taking results in some other type where results are compatible but with different structure then you use type casting.
best example would be cl_crm_bol_entity and if_bol_bo_property_access. Here property access is an interface to class and hence we use type casting.
Please refer to:
type casting
You can find more documentation on internet if you search for type casting.
Regards,
BJ -
How to use TYPE addition with the OPEN DATASET ?
Hi,
How to use TYPE addition with the OPEN DATASET and what is the use ?
For Example:
OPEN DATASET 'test.dat'
TYPE 'lrecl=80, blksize=8000, recfm=FB'
FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
Also, if I wish to do the same for a .CSV file how can we do it.
Thanks,
-SidHi,
OPEN DATASET 'test.dat'
TYPE 'lrecl=80, blksize=8000, recfm=FB'
FOR OUTPUT IN TEXT MODE ENCODING DEFAULT
For more information press F1 on OPEN DATASET.
Thanks -
How to use Type Casting in JSF Expression Language
I have an attribute CategoryId in my VO of type oracle.jbo.domain.Number. I am trying to use the expression of Boolean item in JSF as #{row.CategoryId != 4}
Here is the JSF code:
<af:column id="s141NewItem3Col" noWrap="true" width="100"
rowHeader="false">
<f:facet name="header">
<af:outputLabel value="CAtIDDeq4" showRequired="false"
id="ol18"/>
</f:facet>
<af:inputText id="s141NewItem3"
value="#{row.CategoryId != 4}"
label="CAtIDDeq4" required="false"
readOnly="#{((pageFlowScope.ContractRightCategoriesTable.newRow) and (!(jhsUserRoles['RM, ADMIN, AllButTitl, AllButAdmn']))) or ((!pageFlowScope.ContractRightCategoriesTable.newRow) and (!(jhsUserRoles['RM, ADMIN, AllButTitl, AllButAdmn'])))}"></af:inputText>
</af:column>I am getting the run time exception as "Can not convert 4 of type class oracle.jbo.domain.Number to class java.lang.Long".
I am wondering how the row.CategoryId is treated as Long?. PLease advise. Also, will I be able to use type casting expressions in JSF Expression Language?
Thanks, Pradeepuse attributeValue
Try *#{row.bindings.CategoryId.attributeValue != 4}* ?
Check this thread for details which discusses about the same:
El expression to disable or enable
Thanks,
Navaneeth -
How to use type cast change string to number(dbl)?can it work?
how to use type cast change string to number(dbl)?can it work?
Do you want to Type Cast (function in the Advanced >> Data Manipulation palette) or Convert (functions in the String >> String/Number Conversion palette)?
2 simple examples:
"1" cast as I8 = 49 or 31 hex.
"1" converted to decimal = 1.
"20" cast as I16 = 12848 or 3230 hex.
"20" converted to decimal = 20.
Note that type casting a string to an integer results in a byte by byte conversion to the ASCII values.
32 hex is an ASCII "2" and 30 hex is an ASCII "0" so "20" cast as I16 becomes 3230 hex.
When type casting a string to a double, the string must conform the the IEEE 32 bit floating point representation, which is typically not easy to enter from the keyboard.
See tha attached LabView 6.1 example.
Attachments:
TypeCastAndConvert.vi 34 KB -
When i use type tool photoshop stopped working
hi,
please help me in this problem
when i try to use type tool,photoshop stopped working
its photoshop cs3 ex> i have 500+ fonts
Take out 250 fonts. See if the problem goes away. If it does, then you know the bad font is in them. Load the other fonts back in small batches (10-12) and test after each one.
If the first 250 fonts does not solve the problem, take out most of the other 250 ... leave only the basic fonts that came with the system. Then load the others in 10-12 at a time, testing after each.
Free fonts are not always free. Sometimes you have to spend a lot of time to make sure they are good fonts. -
Gnome-shell Crash Using Type To Search In Dash
When I change Gnome-shell theme from the default Adwaita, I can't use Type To Search in the Dashboard. As soon as I type that first letter, it freezes and nothing works, keyboard, mouse. I had to do a hardware reset to log back in. In the dash, I can click on Application, Windows and it works. I just can't use the Search.
Any ideas?
Thanks in advance.I have the same problem since my last reboot. Searching isn't possible, but clicking on Application and Windows.
I did my last update yesterday.
These are the last installed packages: (yaourt -Q --date)
core/linux 3.0.7-1 (base)
core/linux-headers 3.0.7-1
extra/mousetweaks 3.2.1-1 (gnome-extra)
extra/notification-daemon 0.7.3-1 (gnome)
core/openssh 5.9p1-4
extra/orca 3.2.1-1 (gnome-extra)
extra/seahorse 3.2.1-1 (gnome-extra)
extra/sushi 0.2.1-1 (gnome-extra)
extra/totem 3.2.1-1 (gnome-extra)
extra/vinagre 3.2.1-1 (gnome-extra)
extra/vino 3.2.1-1 (gnome-extra)
multilib/lib32-libpulse 1.1-1
core/krb5 1.9.1-5
extra/gnome-contacts 3.2.2-1 (gnome-extra)
core/libltdl 2.4.2-1
core/libtool 2.4.2-1 (base-devel)
extra/poppler 0.18.0-2
extra/poppler-glib 0.18.0-2
extra/lame 3.99-1
multilib/lib32-gtk2 2.24.7-1
multilib/lib32-libltdl 2.4.2-1
extra/libtracker-sparql 0.12.6-1
extra/tracker 0.12.6-1 (gnome-extra)
core/util-linux 2.20.1-1 (base) -
Connecting JDBC-ORACEL database using type 3 thin driver.
I'm new in Java. Could someone please send me the source code how to connect to remote oracle database with jdbc using Type 3 driver. I'm sure millions of people have already done this. I will appreciate if anyone could help me.
Have you written any Java or done JDBC before? I don't mean to insult you if you have, but look in any JDBC book or the Java Tutorial and you'll see how to connect to a database:
Class.forName("fullyResolvedJdbcDriverClassName");
Connection connection = DriverManager.getConnection("databaseURL");
Gotta put the JDBC driver class in your CLASSPATH somewhere.
Gotta follow the directions for your database URL to the letter.
But if you do all that, it should work.
Oracle and Type 3 won't change any of this. Personally, I connect to Oracle using the Type 4 thin driver. Why are you using Type 3?
Did you look at the JDBC tutorial on-line? Sun has great materials there. Have you checked any of that out? - MOD -
ALV Using TYPE-POOLS: SLIS
hi
Using TYPE-POOLS: SLIS
I created a "special group" using structure
slis_sp_group_alv
and appending it to table of type
slis_t_sp_group_alv
i call this special group internal table using the function module:
"REUSE_ALV_HIERSEQ_LIST_DISPLAY"
the sample code will look something like this:
DATA: gt_sgroup TYPE slis_t_sp_group_alv.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
IT_SPECIAL_GROUPS = gt_sgroup.
My question is How should i add the contents of my internal tables which i create using 'fieldcat' into this "special group" say 'xyzw' is the name of my special group.
DeepakHi Deepak,
First you have to populate the internal table ( i.e, Fill the internal table ). Then pass that internal table to that function u r calling.
See d below code for your reference for how to add the rows to the internal table. Follow similarly,
REPORT zsomalv3 NO STANDARD PAGE HEADING.
TYPE-POOLS: slis.
DATA: BEGIN OF i_data OCCURS 0,
qmnum LIKE qmel-qmnum,
qmart LIKE qmel-qmart,
qmtxt LIKE qmel-qmtxt,
ws_row TYPE i,
ws_char(5) TYPE c,
chk,
END OF i_data.
DATA: report_id LIKE sy-repid.
DATA: ws_title TYPE lvc_title VALUE 'An ALV Report'.
DATA: i_layout TYPE slis_layout_alv.
DATA: i_fieldcat TYPE slis_t_fieldcat_alv.
SELECT qmnum
qmart
qmtxt
INTO TABLE i_data
FROM qmel
WHERE qmnum <= '00030000010'.
LOOP AT i_data.
i_data-ws_row = sy-tabix.
i_data-ws_char = 'AAAAA'.
MODIFY i_data.
ENDLOOP.
report_id = sy-repid.
PERFORM f1000_layout_init CHANGING i_layout.
PERFORM f2000_fieldcat_init CHANGING i_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = report_id
i_grid_title = ws_title
is_layout = i_layout
it_fieldcat = i_fieldcat
i_save = 'A'
TABLES
t_outtab = i_data
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*& Form F1000_Layout_Init
FORM f1000_layout_init USING i_layout TYPE slis_layout_alv.
CLEAR i_layout.
i_layout-colwidth_optimize = 'X'.
i_layout-edit = 'X'.
ENDFORM. " F1000_Layout_Init
*& Form f2000_fieldcat_init
FORM f2000_fieldcat_init CHANGING i_fieldcat TYPE slis_t_fieldcat_alv.
DATA: line_fieldcat TYPE slis_fieldcat_alv.
CLEAR line_fieldcat.
line_fieldcat-fieldname = 'QMNUM'.
line_fieldcat-tabname = 'I_DATA'.
line_fieldcat-key = 'X'.
line_fieldcat-seltext_m = 'Notification No.'
APPEND line_fieldcat TO i_fieldcat.
CLEAR line_fieldcat.
line_fieldcat-fieldname = 'QMART'.
line_fieldcat-ref_tabname = 'I_DATA'.
line_fieldcat-hotspot = 'X'.
line_fieldcat-seltext_m = 'Notif Type'.
APPEND line_fieldcat TO i_fieldcat.
CLEAR line_fieldcat.
line_fieldcat-fieldname = 'QMTXT'.
line_fieldcat-tabname = 'I_DATA'.
line_fieldcat-seltext_m = 'Description'.
APPEND line_fieldcat TO i_fieldcat.
CLEAR line_fieldcat.
line_fieldcat-fieldname = 'WS_ROW'.
line_fieldcat-tabname = 'I_DATA'.
line_fieldcat-seltext_m = 'Row Number'.
APPEND line_fieldcat TO i_fieldcat.
CLEAR line_fieldcat.
line_fieldcat-fieldname = 'WS_CHAR'.
line_fieldcat-tabname = 'I_DATA'.
line_fieldcat-seltext_l = 'Test Character Field'.
line_fieldcat-datatype = 'CHAR'.
line_fieldcat-outputlen = '15'.
APPEND line_fieldcat TO i_fieldcat.
CLEAR line_fieldcat.
line_fieldcat-fieldname = 'CHK'.
line_fieldcat-tabname = 'I_DATA'.
line_fieldcat-seltext_l = 'Checkbox'.
line_fieldcat-checkbox = 'X'.
line_fieldcat-edit = 'X'.
APPEND line_fieldcat TO i_fieldcat.
ENDFORM. " f2000_fieldcat_init
Here i_fieldcat is the internal table u r passing to the function above. Just see how it is populated.
Regs,
Venkat -
Connection using type 4 driver
Hi,
We are using type 4 driver to connect to Oracle.
I am getting an exception as
"com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Object not found in lookup of CWD".
Can anyone tell me the reason and how to solve it?This s my code:-
try
InitialContext ic = new InitialContext();
DataSource ds = (DataSource)ic.lookup("jdbc/CWD");
con=ds.getConnection();
st = con.prepareStatement("select desig from Users where username like cusername and cpassword like password");
rs = st.executeQuery();
String desig=null;
while(rs.next())
desig=rs.getString("desig");
if(desig.equals("admin"))
wdThis.wdFirePlugToadminview();
else if(desig.equals("customer"))
wdThis.wdFirePlugTouserview();
else
wdComponentAPI.getMessageManager().reportSuccess("Invalid Username/Password");
catch(Exception e)
{wdComponentAPI.getMessageManager().reportException(e.toString(),true);}
finally
try
rs.close();
st.close();
con.close();
catch(Exception e)
can u pls tel me wht is the problem? -
Assigning structures using types
Hi all,
There is a structure declared in the program as follows
TYPES : BEGIN OF TY_CUMM .
INCLUDE STRUCTURE ZHRCUMWTMAP.
TYPES : END OF TY_CUMM.
but its giving extended check error as " Within classes and interfaces, you can only use "TYPE" to refer to ABAP Dictionary
types (not "LIKE" or "STRUCTURE")."
So frnds any suggestions.
regards,
sahaklaHi!
Yes, the coding, you wrote is obsolete. It is working, but a newver version of SAP, this coding will cause problems.
You might try out this style.
TYPES : BEGIN OF TY_CUMM .
hrcum TYPE ZHRCUMWTMAP.
TYPES : END OF TY_CUMM.
DATA: gt_hrcum TYPE STANDARD TABLE OF TY_CUMM,
wa_hrcum LIKE LINE OF gt_hrcum.
* access fields in the work area
wa_hrcum-hrcum-field1 = wa_hrcum-hrcum-field2.
Regards
Tamá
Maybe you are looking for
-
PARAMETERS: p_table LIKE dd02t-tabname OBLIGATORY. SELECT * FROM (p_table) CLIENT SPECIFIED INTO CORRESPONDING FIELDS OF TABLE <dyn_table> WHERE mandt = '800'. mandt is the system client number as 800. dyn_table: dynamic internal table p_table
-
Create a beep at specific intervals
Hello, I was only introduced to LabView today and must create a program that will produce a beep sound at (random) intervals and then repeat the cycle for a behavioral experiment I am conducting. In other words, I have to create something with the fo
-
Nokia 800 no Automatic Replies option for Outlook
I have 30 users all with brand new Lumia 800's. We have found the option to set an Outlook "Out of Office" message or automatic reply is missing. From what I have managed to ascertain this should be an option in the Outlook settings below the Synchro
-
Problem in finding PO no in ekko table
Hi all I have one invoice document 9000451049. in vf03 i have displayed the document . in item details of that inovice i found one PO no 123560-3. but when i opened ekko table this PO no is not found. it is not found in me23n transaction also
-
Adobe Acrobat CS3 window doesn't resize
Hello, I'm currently using Adobe CS 3 on a Lenovo X200T with Windows 7 installed. I have a problem with Acrobat CS3 which I have not had with prior computers. I find that whatever size the window is when I open an acrobat document, it stays that si