Creation of tables using JDBC or SQLJ in webdynpro application
Hi,
I am trying to create tables in javadictionary(MaxDB)using my WebDynpro application.I tried creating tables using SQLJ and JDBC.But I was not able to do it.I can select and insert data into already created tables.
Whwn I tried creating a table using JDBC I encountered the following exception.
com.sap.sql.log.OpenSQLException: The SQL statement "CREATE TABLE TMP_DEPID (DEPID varchar(10) NOT NULL,DEPNAME VARCHAR(25))" contains the syntax error[s]: Open SQL syntax error: CREATE ... TABLE is not supported
SQL syntax error: "VARCHAR" is a reserved keyword and cannot be used as an unquoted identifier
Does this mean that creating tables is not supported?
Can anyone help me in this matter?
Thanks in advance,
regards
~Pradeep Shetty
Hi Pradeep,
Yes, OpenSQL does not support creation of tables. But why would you need to create tables at runtime?! The natural way is to create the model at design time of your application, i.e. with the Java DataDictionary.
However, if for any reason you really need to create database tables at runtime, you can achieve this by using a non-OpenSQL datasource, e.g. you could create a VendorSQL one and use it to obtain JDBC connections in your app. See also http://help.sap.com/saphelp_nw04/helpdata/en/c0/3ad4d5cdc66447a188b582aad537d3/frameset.htm.
Hope that helps!
Vladimir
Similar Messages
-
Problem regarding the creation of Table using CSS.
Hi ,
Here I have a Problem regarding the creation of Table using CSS.
In My Application i have a table with multiple rows(Rows are Dynamically added to the table).First i am setting the table with the following properties:
width:900px;
height : auto,
Overflow : visible,
Max-height: : 200px.
If I use above properties,I'm getting a table with 5 or 6 rows(height upto 200px).After that i am getting the Vertical ScrollBar.
The problem is when a table has many columns, Vertical and Horizontal Scrolls are coming at the time of setting the table. The table height is not Increasing dynamically.
How can i use "height" property in CSS? (I want the table height to be increased when the columns are more.)
Thanks & Regards
MadhaviHey humble user. Errr I'm trying to understand what ur trying to do. U want to create a section of a region destructively from an existing region right? If so select the option convert to new region (opt-comm-R or selecting it by right clicking). Check your audio bin to make sure. Whats the "merge" function? Are u refering to the glue tool?
-
Populating SAP Database table using JDBC adapter
Hi Folks,
I have a requirement to populate a SAP database table say ZTABLE using XI. The Model is the table has to be populated through a file which will be processed by SAP XI. Basically this is a File to JDBC scenario. The database used is ORACLE. Kindly provide me some idea to go ahead.I tried to place the MS access table in the shared folder of the Application server system but still it seems the table is not being populated.
did you check the log in your receiver channel? (/people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn)
The requirement is to update the tables directly as those are the custom tables.
i would still say that do not update SAP tables directly from XI/ PI.....this is not a standard architecture/ solution.... -
Inserting Multiple Rows into Database Table using JDBC Adapter - Efficiency
I need to insert multiple rows into a database table using the JDBC adapter (receiver).
I understand the traditional way of repeating the statement multiple times, each having its <access> element. However, I am just wondering whether this might be performance-inefficient, as it might insert records one by one.
Is there a way to ensure that the records are inserted into the table as a block, rather than record-by-record?Hi Bhavesh/Kanwaljit,
If we have multiple ACCESS tags then what happens is that the connection to the database is made only once. But the data is inserted row by row.
Why i am saying this?
If we add the following in JDBC Adapter..logSQLStatement = true. Then incase of multiple inserts we can see that there are multiple
<i>Insert into tablename(EMP_NAME,EMP_ID) VALUES('J','1000')
Insert into tablename(EMP_NAME,EMP_ID) VALUES('J','2000')</i>
Doesnt this mean that rows are inserted one by one?
Correct me if i am wrong.
This does not mean that the transaction is not guaranted. Either all the rows will be inserted or rolled back.
Regards,
Sumit -
Updating multiple tables using JDBC Adapter
Hi,
I am trying to insert/update multiple tables using one message via JDBC adapter. The following is the message being posted. However, only the first statement was executed. Anything wrong?
Thanks in advance!
Hart
<?xml version="1.0" encoding="UTF-8"?>
<ns0:DeliveryDBUpdate xmlns:ns0="http://test.com/r3_integration"><DeliveryData><DelHeader action="UPDATE_INSERT"><table>DelHeader</table><access><DelNo>0080000230</DelNo><DelType>LF</DelType><XOverwrite>X</XOverwrite><ShipTo>0000000026</ShipTo><SoldTo>0000000026</SoldTo><Priority>00</Priority><DocDate>02/17/2007</DocDate><GText>CIF Test</GText><DelDate>02/20/2007</DelDate><PickDate>02/20/2007</PickDate><ShipPoint>NO02</ShipPoint><PackCount>00000</PackCount></access><key><DelNo>0080000230</DelNo></key></DelHeader>
<DelItem action="INSERT"><table>DelItem</table><access><DelNo>0080000230</DelNo><ItemNo>000010</ItemNo><GText>10# GRAN-GREAT VALUE</GText><Material>G04410G611</Material><Plant>6005</Plant><SLoc>6005</SLoc><RefDoc>mmenon32</RefDoc><RefItem>00000000</RefItem><DelQty>5.000</DelQty><UOM>BL</UOM></access><access><DelNo>0080000230</DelNo><ItemNo>000020</ItemNo><GText>25# GRAN- GREAT VALUE</GText><Material>G04025G611</Material><Plant>6005</Plant><SLoc>6005</SLoc><RefDoc>mmenon32</RefDoc><RefItem>00000000</RefItem><DelQty>5.000</DelQty><UOM>BG</UOM></access></DelItem></DeliveryData></ns0:DeliveryDBUpdate>Hi,
You need 2 STATEMENT level tags,
<?xml version="1.0" encoding="UTF-8"?>
<ns0:DeliveryDBUpdate xmlns:ns0="http://test.com/r3_integration">
<b><DeliveryData1></b>
<DelHeader action="UPDATE_INSERT">
<table>DelHeader</table>
<access>
<DelNo>0080000230</DelNo>
<DelType>LF</DelType>
<XOverwrite>X</XOverwrite>
<ShipTo>0000000026</ShipTo>
<SoldTo>0000000026</SoldTo>
<Priority>00</Priority>
<DocDate>02/17/2007</DocDate>
<GText>CIF est</GText>
<DelDate>02/20/2007</DelDate>
<PickDate>02/20/2007</PickDate>
<ShipPoint>NO02</ShipPoint>
<PackCount>00000</PackCount>
</access>
<key>
<DelNo>0080000230</DelNo>
</key>
</DelHeader>
<b><DeliveryData1></b>
<b><DeliveryData2></b>
<DelItem action="INSERT">
<table>DelItem</table>
<access>
<DelNo>0080000230</DelNo>
<ItemNo>000010</ItemNo>
<GText>10# GRAN-GREAT VALUE</GText>
<Material>G04410G611</Material>
<Plant>6005</Plant>
<SLoc>6005</SLoc>
<RefDoc>mmenon32</RefDoc>
<RefItem>00000000</RefItem>
<DelQty>5.000</DelQty>
<UOM>BL</UOM>
</access>
<access>
<DelNo>0080000230</DelNo>
<ItemNo>000020</ItemNo>
<GText>25# GRAN- GREAT VALUE</GText>
<Material>G04025G611</Material>
<Plant>6005</Plant>
<SLoc>6005</SLoc>
<RefDoc>mmenon32</RefDoc>
<RefItem>00000000</RefItem>
<DelQty>5.000</DelQty>
<UOM>BG</UOM>
</access>
</DelItem>
<b></DeliveryData2></b>
</ns0:DeliveryDBUpdate>
Try with such a strcuture and let us know if it works.
Regards
Bhavesh -
Inserting rows in a database table using JDBC
Hi,
I am trying to insert a row in a table using the follwing code:
String Query_String = "Insert into Table_Name (Field_1, Field_2, Field_3)" +
"Values (Value_1, Value_2, Value_3)";
stmt.executeUpdate (Query_String);
Field_1 is a Date field, Field_2 is a String, and Field_3 is an integer.
Any of the fields could be null. If the user does not enter a value for any
one of these fields what would be the values for
Value_1, Value_2, or Value3 in the Query_String?
Thanks.Hi,
I am trying to insert a row in a table using the
follwing code:
String Query_String = "Insert into Table_Name
(Field_1, Field_2, Field_3)" +
"Values (Value_1,
"Values (Value_1, Value_2, Value_3)";
stmt.executeUpdate (Query_String);
Field_1 is a Date field, Field_2 is a String, and
Field_3 is an integer.
Any of the fields could be null. If the user does not
enter a value for any
one of these fields what would be the values for
Value_1, Value_2, or Value3 in the Query_String?
Thanks.Keep in mind that each database server probably has their own way of storing date values. For now, I'm going to assume that you're going to be using MySQL.
// Initialize variables to null
String Value_1 = "";
String Value_2 = "";
String Value_3 = "";
try
// Get Date
Date date = new Date();
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Value_1 = dateFormat.format(date);
// Get String value
Value_2 = "some string";
// Get Integer value
Value_3 = String.valueOf("2");
String query = INSERT INTO T_NAME VALUES('" + Value_1 +"', '" + Value_2 + "', '" + Value_3 + "');
int iUpdated = stmt.executeUpdate(query);
catch(Exception e)
// Catch Code
System.out.println("Number of records updated: " + iUpdated);
This will just enter empty string values if the strings are empty.
Is this what you wanted to know?
If not, provide a bit more information and I'll try to help as best as I can -
How to use call transaction stmt from webdynpro application
Hi Expers,
Can I use call transaction 'tcode' in my webdynpro application, I have tried in my application but i am getting short dump saying
Error analysis+
An exception occurred that is explained in detail below.The exception, which is assigned to class'CX_SY_SEND_DYNPRO_NO_RECEIVER', was not caught and therefore caused a runtime error. The reason for the exception is: During background processing, the system attempted to send a screen to a user. Current screen: "SAPLMGMM " 0060.
I haven't used any more statements in my application am sure from my application side everything perfect. but I have seen a screen shot
with SAP screen in webbrowser.
Please help me out if you are not clear abt my doubt please ask me for clear idea.
Thanks in advance
Phalani MHello,
Since you can't use the call transaction command in web dynpros components, I suggest you to create a report and fill a BDC table on this and use the call transaction in this report.
So, in your web dynpro component you can use a command SUBMIT to create a job in background.
DATA: number TYPE tbtcjob-jobcount,
name TYPE tbtcjob-jobname VALUE 'JOB_TEST',
print_parameters TYPE pri_params.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = name
IMPORTING
jobcount = number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc = 0.
SUBMIT submitable TO SAP-SPOOL
SPOOL PARAMETERS print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB name NUMBER number
AND RETURN.
IF sy-subrc = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = number
jobname = name
strtimmed = 'X'
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
ENDIF.
Regards. -
Print functionality using PDF form in a webdynpro application
Hello! All
Currently, we have a webdynpro application and we need to provide the print feature to print the content of the iview display on IE browser. We try the File-> print feature provide by Microsoft through IE but this doesn't work. We are looking for any other option like print to pdf form. We don't know if it is possible. Is there any tutorial, help or anything that can help us to print to pdf form. Please share any other suggestion, comment and it will be much appreciated. Thank you very much.Hi,
The content (which is a pdf content) can be exported as a PDF from a WD Application. For this you can use File Download control whose source is in the form of bytes (which is PDF content).
Do you have the PDF content already generated?
If so it is very easy to generate PDF from WD.
If you need further help, kindly let us know.
Thanks and regards
RK -
Reg using the GP APIs with webdynpro applications
Hi Experts,
I have been implementing webdynpro appln using GP APIs as a callable object in my application. In my webdynpro application i have been using RFCs to access data from the R/3 system.
Are there any setting I need to do in Guided Procedures (portal) to run the application in portal.
Can any one of you explain me regarding what are all the setting i need to do from the Guided Procedures perspective while using callable object that interact with an R/3 system?
Also, I would be grateful for any other valuable suggestions from you regarding implementing webdynpro appln using GP APIs as a callable object.
Thank You.
Regards,
Murthy J N.Please follow the below links for Webdynpro Development with Guided Procedures :
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/50d74ada-0c01-0010-07a8-8c118d408e59
https://www.sdn.sap.com/irj/sdn/xapps?rid=/library/uuid/73cc8084-0b01-0010-1788-b2304424605a
Hope it helps.
Regards,
Shikhil -
Inserting RFC Response to Tracking table using JDBC as a receiver
Hi All
I want to update my tracking table with the RFC response but the problem is I cant figure out he Target structure on my JDBC.
Every time when testing on my http://xxxxxx:50000/mdt/channelmonitorservlet I get nothing on the "Processing Details"
I've configured my RFC Response as a sender (ASYN) and JDBC as a receiver, I do have RFC destination and it working fine.
My is like this:
<?xml version="1.0" encoding="UTF-8"?>
<ns1:RFC_JDBC_MT xmlns:ns1="http://yonela.com">
<StatementName_response>
<PI_JDBC_TBL ACTION="UPDATE">
<TABLE>PI_JDBC_TBL</TABLE>
<access>
<TYPE></TYPE>
</access>
<key>
<key><CARRID>AA</CARRID></key>
</key>
</PI_JDBC_TBL>
</StatementName_response>
</ns1:RFC_JDBC_MT>
Any suggestionHi,
Use Insert in the action field instead of Update and try again.
-Supriya. -
Codepage conversion from multi-lingual table using JDBC
Hello,
I have an Oracle database that has been around since before any unicode was available. It is currently 9.2.0.7.0 and the charset is WE8ISO8859P1. I am trying to port all of the data in the 'Translation' table to a UTF-8 database. The problem is that each of the translated strings is stored in its own native MS Windows codepage. This table was populated over the years via OCI connections in C/C++, and this method worked. But now we need it moved to UTF-8 and are using JAVA. Obviously, all the cp1252 languages come over just fine, but all the other languages get converted to garbage by JDBC, since it is auto-converting them and assumes the source is 8859. I could do it with OCI, as I mentioned, but I am mandated to use JAVA and a web interface, so users can choose what data to move/convert to the new DB (on-demand) from a web page.
Is there a way to force the Oracle connection to think the database is in a different codepage so that the conversion comes out correct? OR
Is there a way to get the data from Oracle as unconverted chars, or generic binary, or something, and then have JAVA convert it to UTF-8 from the correct codepage before writing it to the new table?
Any help is appreciated.
Monte
Message was edited by:
Wookie## Is there a way to force the Oracle connection to think the database is
## in a different codepage so that the conversion comes out correct?
No.
## Is there a way to get the data from Oracle as unconverted chars,
## or generic binary, or something, and then have JAVA convert it
## to UTF-8 from the correct codepage before writing it to the new table?
Yes. Use:
SELECT UTL_RAW.CAST_TO_RAW(col) FROM tab;
and retrieve the value with ResultSet.getBytes. Then convert the retrieved byte[] to java.lang.String using String(byte[] bytes, String charsetName) constructor. Note, charsetName is Java name. Then, you can use setString() on PreparedStatement containing the INSERT for the converted value.
-- Sergiusz -
Query regarding creation of tables using AET
Hi Experts,
First of all is it advisable to create a assignment block (table view/ form view) using AET?
We are going to implement an upgrade project from CRM 5.0 to CRM 7.0. In CRM 5.0 there was a two custom tables which needs to implemented in CRM 7.0 as an assignment block. One view will be form view and the other table view. The custom tables has data. What is the best way to go about it?
If we create assignment block using AET by using the option 'CREATE TABLE' a new database table is created which has three fields 'RECORD_ID' 'OBJECT_ID' and 'PARENT_ID'. Object ID stores the External ID of the campaign as GUID (RAW 16). Parent ID stores the Campaign GUID value. How is the Record ID generated?
Now the challenge is to move the data from the custom table to the table created using AET. Is there a standard function module to take care of it or we have to write a one time report?
Thanks in advance.
Regards,
Sayan
Edited by: jana6586 on Nov 23, 2011 12:14 PMHi Sayan,
I had to do the same story with the aet and the data we need to transfer into the Z table.
I have been looking for a function that takes care of it, but unfortunately i didnt found one.
If you didnt found one until now, i higherly recommand you to right a report that handles the transfer between the two tables in a generic way, and mabye even to share it
The Recoed id is simply a guid that is generetad behind the scenes, in order to keep a PK for each and each row of the Z table.
I hope that the answer helped you !
Regards,
mapatz. -
Inserting into two tables using JDBC Receiver Adapter
I've defined following type for Receiver JDBC to save data in two different tables
Name Category Type Occurrence
ReceiverDB_DT Complex Type
STATEMENT Element 1..unbounded
TABLE_NAME Element 1
ACTION Attribute xsd:string required
TABLE Element xsd:string 1
ACCESS Element Table1_DT 1
STATEMENT2 Element 1..unbounded
TABLE_NAME Element 1
ACTION Attribute xsd:string required
TABLE Element xsd:string 1
ACCESS Element Table2_DT 1
When I send data of two tables, it is showing data for both the two tables in MONI of PI System, but ultimately it shows only one table's data in message monitoring payload.
what could be the problem?
Thanks,
-HareshIt solved!!!
by just changing Occurrence only as rightly pointed by Ankesh
Name Category Type Occurrence
ReceiverDB_DT Complex Type
STATEMENT Element 1..unbounded
TABLE_NAME Element 1
ACTION Attribute xsd:string required
TABLE Element xsd:string 1
ACCESS Element Table1_DT 1
STATEMENT2 Element 1..unbounded
TABLE_NAME Element 1
ACTION Attribute xsd:string required
TABLE Element xsd:string 1
ACCESS Element Table2_DT 1
Name Category Type Occurrence
ReceiverDB_DT Complex Type
STATEMENT Element 1
TABLE_NAME Element 1
ACTION Attribute xsd:string required
TABLE Element xsd:string 1
ACCESS Element Table1_DT 1..unbounded
STATEMENT2 Element 1
TABLE_NAME Element 1
ACTION Attribute xsd:string required
TABLE Element xsd:string 1
ACCESS Element Table2_DT 1..unbounded
Thanks a lot ankesh -
Updating 3rd parties db table using JDBC adapter at sender side
hi all.
i just want to know how i can updated the 3rd party db table field.
my scenario is just to retrieve data from 3rd party DB table where the condition is like " to select records where processed (field name ) = " ".
but i just need to update this field to x immediately after retrieving data from it.
so i simply wote the sql statement select REC_NO, ACTN_DAT, METRNO, MET-READ from PHAKAMA_CONN where processed = " ". under jdbc CC query sql stmt at sender side .
but i want to know how we can updated the processed (field ) from " " to "x"immeidtely after retrieving.
so could any body advice me how we can achiev this through UPDATE SQL STMT under sender jdbc cc.i just want to know wat stmt do we need to srite under this.
waiting for u r response.
cheers.
seeta ram.Ram,
Execute your Select statement as needed and in the sender jdbc communication channel in the update SQL statement give this:
UPDATE <tablename> SET <fieldname> = 'X' WHERE <fieldname>= ' '
Also just to make sure if you have access to the database just login and execute this statement which should give the results as expected. If this works here successfully then it executes the same in XI also.
Regards,
---Satish -
What is the use of 3 controllers in webdynpro application?
Hi experts,
I have seen that in a webdynpro component (ABAP) there are three(3) controllers namely, Component controller, View Controller and Interface controller.
Why do we have 3 controllers? For what conditions I can use them? When to use Component controller, View Controller and Interface controller?
thanks
GopalHi Gopal
The purpose and usage of 3 controllers are :
1. View Controller is associated with a view .It is used for context elements/mapping, code etc that is specific to the view only.It's lifetime is only the duration for which the view is shown.
2.Component Controller is linked with the particular webdynpro component.It's a common place inside the controller in which context creation/mapping, code, functions are kept and it is shared by all views inside the controller.
Note: Custom controller is same as component controller which the user creates.
3. Interface controller is the place when you use the functionalities of a external component preferably DC (development component features which are published thru Public part - for sharing with other DC).
So if you are using the context, code, functions of a "Used DC" you use the Interface Controller.
Practically many developers are creating several DC and the sharing of code happens thru Public part.You add DC in the "Used DC" node , map the context to component controller and map again the view controller for the specific nodes you require.
Pleas post for more information.
Hope this helps
Regards
Ananda
Maybe you are looking for
-
How Can I Get Rid Of This?
I've just downloaded a new toolbar and on my browser it doesn't show the top part of the page and there's a big line on the bottom and parts of the toolbar aren't showing up. It looks just like this: http://i.imgur.com/uRjCb6p.png Also whenever i scr
-
trying to download a rental movie i get the followinf error: There was an error with itunes request error 5103 how do i resolve
-
I'm trying to install a tool that requires that "the JAVA_HOME environment property is set to match the top level directory containing the JVM you want to use." The example they give for bash is JAVA_HOME=/whatever; export JAVA_HOME And I can run tha
-
We're in the process of converting from WL 8.1 to 10.2. Previously both static and dynamic content was served up from the app server. I'm in the process of correcting that so the 400+ meg of static content does not have to be in the WAR file. I have
-
How can i verify that this is a legitimate seller of apple products.
Sales in large bulk, older apple products. See link http://www.aakash.com.sg/index.php?option=com_virtuemart