Database table in Web dynpro
Hi All,
I am trying to use a database table in Web Dynpro. For this, o already created and deployed a dictionary project and one database table in that project. In my web dynpro project when i am accessing this table columnname it works fine, but its not allowing to insert the data.It is giving following error:
The SQL statement "INSERT INTO "TMP_2" ("NAME") VALUES ( "ASDFGH") " contains the semantics error[s]: - 1:36 - the column >>ASDFGH<< is undefined in the current scope where NAME is my column name.
Also when i change some column name or add one more column to my table and then deploy it. After this, when i run my web dynpro project it doesn't show the updated column name and column count.
Please help.
Regards,
Chirag Aneja
Hi,
Try using prepare statement as follows
PreparedStatement pstmt = con.prepareStatement("INSERT INTO TMP_2(NAME) VALUES ( ?) );
pstmt.setString(1, "ASDF");
Regards
Ayyapparaj
Similar Messages
-
Java dictionary database table in web dynpro application
Hi,
I want to access java dictionary database table in my web dynpro application in java.
Right now I have created one java dictionary DC.
and in that Dc i have created two database table .
Now I want to use this table in my web dynpro application.
Can anyone help me.You can use the Dictionary Projects to create tables in Database. You must use codes to access these database tables that is created using Dictionary projects.
You have to use the DataSource in order to get connection ; Use Visual Administrator to see the data source name.
You can use the following code to access the database table.
ResultSet result = null;
try
InitialContext initialcontext = new InitialContext();
DataSource datasource = (DataSource)initialcontext.lookup("jdbc/<DataSourceName>");
Connection connection = datasource.getConnection();
Statement statement = connection.createStatement();
result = statement.executeQuery( <Query>);
connection.close();
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Regards
Vinod -
Adobe Forms - Table control data Saved in Database table through Web Dynpro
Hello Friends,
I Am facing a Problem in Adobe Forms through Web Dynpro.
i Want to Make Interactive online Adobe Forms - In Table Control user enter the multiple entry in the table control and after that Click on SAVE button , entry will saved in Database table.
Please guide me.
Thanks in advance.
Gaurav.Hi Gaurabh,
For interactive form you have to check the property DisplayType = native and PdfSource should be a Context Attribute of type 'Xstring'.
For data retrieval, create a NODE and have all the required attributes within that node of AOBE form.
Fetch the data in WDDOINIT.
Also check, that the offline senario for this form is working.
Hope it helps you. -
Update cluster table from Web dynpro
Hi
I am trying to export data to a cluster table from web dynpro using this statement:
EXPORT zhr_sanct_st100 FROM zhr_sanct_st100 TO DATABASE zhr_clrm(ep) ID zhr_clrm-srtfd.
same piece of code work well if I include it in a report program through se38, but If I use it in Web dynpro, it doesnt update the cluster table and there is no error shown.
please reply ASAP.
Vishal kapoorThanks for your immediate reply. it worked this way:
IMPORT structure name TO structure name
FROM DATABASE cluster table name
TO wa_zhr_clrm
ID zhr_clrm-srtfd.
initially i missed to insert a work area wa_zhr_clrm, which has all the key fields of the cluster table.
Regards
Vishal Kapoor -
How to create the Dynamic UI element table in web dynpro in abap
Hi All,
Does anybody have reference note or teach me how to create dynamic UI element table in web dynpro in abap ?
Regards,
LukeHI LukeWong ,
for creating any UI dynamically you shoul use their runtime class that always start with cl_wd_* ui element name*
so for the Table UI element the runtime class is CL_WD_TABLE
now reffer the below code for creating the Table UI dynamically
METHOD wddomodifyview.
DATA lr_table TYPE REF TO cl_wd_table.
DATA lr_flow_data TYPE REF TO cl_wd_flow_data.
DATA lr_container TYPE REF TO cl_wd_uielement_container.
DATA lr_column_name TYPE REF TO cl_wd_table_column.
DATA lr_text_view TYPE REF TO cl_wd_text_view.
DATA lr_table_header TYPE REF TO cl_wd_caption.
DATA lr_column_name_header TYPE REF TO cl_wd_caption.
IF first_time EQ abap_true.
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_table = cl_wd_table=>new_table(
id = 'TBL_TABLE'
bind_data_source = 'TABLE'
design = cl_wd_table=>e_design-alternating
visible_row_count = 3
lr_flow_data = cl_wd_flow_data=>new_flow_data( element =
lr_table ).
lr_container->add_child( lr_table ).
lr_column_name = cl_wd_table_column=>new_table_column(
id = 'TBL_EXAMPLE_NAME'
lr_table_header ?= cl_wd_caption=>new_caption( text = 'Table UI elem
ent - example').
lr_table->add_column( the_column = lr_column_name ).
lr_table->set_header( lr_table_header ).
lr_text_view = cl_wd_text_view=>new_text_view(
id = 'TXV_NAME'
bind_text = 'TABLE.NAME'
lr_column_name_header ?= cl_wd_caption=>new_caption( text = 'Name').
lr_column_name->set_table_cell_editor( the_table_cell_editor = lr_text_view).
lr_column_name->set_header( lr_column_name_header ).
ENDIF.
ENDMETHOD.
Regards
Chinnaiya P
Edited by: chinnaiya pandiyan on Sep 17, 2010 12:01 PM -
How to display an status Icon in Table UI web dynpro ABAP?
Hi Experts ,
How to display an status Icon ( Traffic light ) in Table UI web dynpro ABAP? can somebody tell with a coding example. also I need to update status on condition so whats the best way?
Thanks in advance.
Regards,Hi Laeeq,
click on table cntrol n place it on the screen..
now click on the icon button n place it in the table control area.. a column of icons get created. name it (say) ICON.
in the PBO..
loop at internal table and call module in the loop (say) .
MODULE ICON_DISP.
now in the module try the foll code :
module icon_display output.
check some condition and assign the icon to the variable icon_r
icon_R = 'ICON_GREEN_LIGHT'.
CALL FUNCTION 'ICON_CREATE'
EXPORTING
name = ICON_R
TEXT = ' '
INFO = ' '
ADD_STDINF = 'X'
IMPORTING
RESULT = ICON
EXCEPTIONS
ICON_NOT_FOUND = 1
OUTPUTFIELD_TOO_SHORT = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
endmodule.
where icon(35) and icon_r(35) type c .
hope this helps u..
Regards
Aparna -
Binding arraylist, list, or multi-dimensional array to table in web dynpro
Greetings,
I like to ask if anyone knows how to bind data from an arraylist, list, or multi-dimensional array list to a table in web dynpro, your help is much appreciated.
Thanks in advance.
CoryIs there a way to create or cast a multi-dimensional
array from a Collection or Vector ?
ArrayList list = new ArrayList();
list.add( new Object[4] );
Object[] array2 = list.toArray(); // is only
single dimension !
Of course it is a single dimension array.
Check the definition of the toArray() function, and the specification of arrays in general.
toArray() returns a one dimensional array.
In your case it will return an array of arrays. So array2[0] will be an array of 4 objects.
That just happens to be a 2 dimensional array though you may (I haven't checked it) need some parentheses to call the elements.
Try Object o = array2[0][1]; and if that doesn't work Object o = (array2[0])[1]; -
Drop down in allready displaying table in web dynpro
Hi Experts,
We have a requirement where we are displaying the data of the table KNA1 in a table form (Web dynpro) which is editable.for the field NAME1 there must be drop down box which contain some values , so that for any row user can select one of the value and then when press SAVE button the table KNA1 should be updated with the new value of NAME1.
Can you please let us know how to do this.
Thanks
Mahesh>Can you please let us know how to do this.
Which part of what you describe and what exactly are you having problems with. You can of course change the cell editor of your column to DDLB. Is that where you are having problems. Or are you trying to decied between DDLBByKey and DDLBByIndex. For that I would suggest you read the following:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/bb/69b441b0133531e10000000a155106/frameset.htm -
Declare global table in web dynpro
Hi,
How can I declare a global table in web dynpro?Hi,
If you want to declare an global internal table,
You can declare it in componentcontroller's 'ATTRIBUTES' Tab,
This internal table you can access in componentcontroller's method using 'wd_this' reference.
for example: "wd_this->itab".
If you want to access the same in any view's methods then you can do it using 'ig_componentcontroller' reference.
for example: "ig_componentcontroller->itab". -
How to create dictionary table using web dynpro?
Dear Experts,
Please clarify my doubts.Im new in this EP development.
Im using EP6 portal with NWDS6 for dev.
My Doubts are :
Im trying to develop a web dynpro application which captures some data and insert/update in Table.
=> If we create a structure Dictionary in web dynpro application will that automatically create the table in Portal database?
=> If it is automatically created how to insert or update that table.
can any one plz help.
thanks and regards,
Viswes.Hi Visweswara
This will use the concept of EJB.
Refer these for creating Dictionary tables...
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70929198-0d36-2b10-04b8-84d90fa3df9c]
[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c]
As far as answer to your second question is concerned,
=> If u create a structure Dictionary in web dynpro application it will not create the table in Portal database..
You can access that table via creating a web dynpro iview in Portal..
Only application can accessed after deployment via iviews in Portal..
Thanks...
Rewards Appreciated... -
Create a DB-Table through Web Dynpro
Hi everybody,
how can i create a new DB-Table on my Database (oracle) through a Web Dynpro Application. In my Web Dynpro Application i create in the dictionary area a table with some colums. After deploying it into my WAS i opened the SQL-Developer but i could not see the new table which i have create in my Web Dynpro Application. Should i restart the WAS?
regards
SidHi,
It will not create a table in a outside database. When you create table through Dictionary project, it creates table in the database associated with server instance which can be MAX DB or Oracle database. Just check with your basis team about the connection parameters and then check the table through the SQL-Developer. Provided that you have done everything correctly.
Regards,
Manoj -
Database operation with web dynpro java
Hi,
Our portal installed on MaxDB database.We need to develop web dynpro java application has some database opeartions (insert,update, delete, select) on MaxDB database.
1- Is there a blog or sample how can it be done over MaxDB?
2- Is there exploring tool for MaxDB to create tables?
Thanks.hi,
point 1, it is just pure java programing
you can go with this:
ResultSet result = null;
try
InitialContext initialcontext = new InitialContext();
DataSource datasource = (DataSource)initialcontext.lookup("jdbc/<DataSourceName>");
Connection connection = datasource.getConnection();
Statement statement = connection.createStatement();
result = statement.executeQuery( <Query>);
connection.close();
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
2. maxdb has standard client you can use to manage the database
Best regards,
john -
Date Column not getting sorted in a table in web Dynpro Java
Hi All,
I am facing an issue while sorting the date column in a table in my web dynpro java application.
When the date is displayed in the sql format in tha table, I am able to sort the date column successfully but when we convert the date field from sql format to util format in our table and then sort it does not work.
Kindly let us know the steps to be followed in this case to sort the date column of a table in Simple Date format as we do not want date in the sql format to be displayed.
Thanks & Regards,
AnuragHi,
You might want to check whether both your browser's language settings are identical. The browser language could also determine the date format.
As a workaround, you could add an extra attribute to your context, and set the calculated property to 'true'.
In your table, add a new column and bind to this new attribute, and hide your original date column
If you sort using the date column that's hidden now, you could use the calculated field to fixed-format your date the way you prefer (by using the SimpleDateFormatter class for instance)
Cheers,
Robin -
Creating a radio button group in a column of a table in Web Dynpro
Hi,
I want to put a radio button group in a column of a table in Webdynpro. I added a column to a web dynpro view and then inserted a tableCellEditor for that column.. But I cannot define it as Radio Button group. I want the user to be able to select 3 statuses using this group.
Does anyone have a solution for this??
Thanks in advance...
NakulHi,
You wont be able create three RB in one cell.
Create as many column as the no of options is.Here it is 3.
Create 4 attributes inside the node , option 1,option 2,option 3 and selectedoption.
Map each RB s keytoSelect to option 1,2,3. Map all the RBs selectedKey atribute to selectedoption.
Now selection for each row will be stored in the selected option.
Regards
Bharathwaj -
Using the XML returned by XI to populate table in Web Dynpro UI
Hi,
In Web Dynpro,I have a scenario where i have to generate reports. For this, I enter the "Customer number", "Date" & "Item No" in 'Generate report' page and hit the "submit" button. These details are sent as XML to XI which interacts with the ABAP R/3 system, performs the search and returns the search results as an XML
Now, I want to display search results contained in this XML by populating it in a table.
From, the point where the XML is returned by XI, could you please tell me the step by step process to populate this XML in a table. Please include code, if any.
Kindly help.Hello Sandeep,
Create context node with following strucure:
<i>
result
-CustomerNumber
-ItemNumber
-Material
-OrderDate</i>
Create data handler:
public class XIDataHandler extends DefaultHandler {
private String lastAttribute;
private IWDNodeElement newElement;
public void startElement(String namespaceURI, String localName, String rawName, Attributes atts) {
if ("Result".equals(localName)) {
newElement = wdContext.createResultElement();
wdContext.nodeResult().addElement(newElement);
} else {
if(null!=newElement)
lastAttribute = localName.trim();
public void endElement(String namespaceURI, String localName, String rawName) {
if ("Result".equals(localName)) {
newElement = null;
lastAttribute = null;
public void characters(char[] data, int off, int length) {
if(null!=newElement && null!=lastAttribute) {
final String value = new String(data, off, length).trim();
if(!"".equals(value)) {
newElement.setAttributeValue(lastAttribute, value);
And parse XML in appropriate place within your application:
try {
SAXParserFactory factory = SAXParserFactory.newInstance();
SAXParser parser = factory.newSAXParser();
//Loading XML from string (XI_DOCUMENT), change if source differs
StringReader sr = new StringReader(XI_DOCUMENT.trim());
InputSource is = new InputSource(sr);
parser.parse(is, new XIDataHandler());
} catch (Exception e) {
final StringWriter sw = new StringWriter();
final PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
wdComponentAPI.getMessageManager().reportException(sw.toString(), true);
Create table and table columns and map your context to it.
Best regards, Maksim rashchynski.
Maybe you are looking for
-
is it possible to buy an Apple monitor for this macbook?
-
I have and Ipod and a IPhone (not 3G). I made some short videos, converted to MP4, added to my ITunes library and transfered to my Ipod. Everything worked fine. When I hooked up my IPhone I synced the 4 movies but I don't see them on my IPhone. I cli
-
Hello Experts, I have created one class which contains a method having one import parameter and one export parameter.Export parameter is of type table, say iTab In the code of the method, i called one RFC which has one table parameter. Ex.- method ge
-
Must I have an account with Microsoft (or AOL or whoever) if I use Firefox? Why am I making a monthly payment to Microsoft if all I use for internet action is Firefox?? I would rather pay Firefox! I use Windows Vista. I have IE8 installed and use it
-
How to do validation with a class that extends DispatchAction?
I'm trying to mess around with some validation with struts for a .jsp form and I've read a tutorial that says I need to extend ValidatorForm instead of ActionForm...however, I'm using DispatchAction instead of ActionForm. What is the best way to do v