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".
Similar Messages
-
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 AnejaHi,
Try using prepare statement as follows
PreparedStatement pstmt = con.prepareStatement("INSERT INTO TMP_2(NAME) VALUES ( ?) );
pstmt.setString(1, "ASDF");
Regards
Ayyapparaj -
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 -
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 -
Global settings for web dynpro ABAP: WD_GLOBAL_SETTING
Hi Experts,
SAP documentation states to maintain settings globally for all Web Dynpro for ABAP applications. Execute the WD_GLOBAL_SETTING Web Dynpro for ABAP application. i tried on transaction se80 under webdynpro appl/comp
i am unable to find this application ??
how can i call WD_GLOBAL_SETTING and set the WDTABLENAVIGATION parameter to SCROLLBAR.Hi
You can access the application using
https://<host>:<port>/sap/bc/webdynpro/sap/wd_global_setting/
I think that's available in SP13
Abhi -
Need to pass values to Internal table in Web dynpro ABAP
Hi all,
I need to pass table values for the below FM in web dynpro.
CALL FUNCTION 'ZFMHR_RWF'
TABLES
PB0006 =
How do we declare and use Internal tables in WEBDYnpro.
Regards,
Vijayakumar S.hi,
u mighnt need to show the internal table value in some table UI in the WebDynpro ABAP. So u can use the method bind_table for the same to bind ur context node with the internal table values.u can declare the internal table in the same way as u do in the normal ABAP.
DATA :itab TYPE STANDARD TABLE OF ztable.
// itab is my internal table which can be of either ztable or standard table type
now u can use the code wizrd(control+F7) and use the method bind_table .
DATA: lo_nd_cn_node TYPE REF TO if_wd_context_node,
lo_el_cn_node TYPE REF TO if_wd_context_element,
ls_cn_node TYPE wd_this->element_cn_node.
* navigate from <CONTEXT> to <CN_NODE> via lead selection
lo_nd_cn_node = wd_context->get_child_node(
name = wd_this->wdctx_cn_node ).
lo_nd_cn_node->bind_table( itab ).
// where cn_node is the context node which is bind to ur table UI and itab is the value which is populated from ur FM
regards,
Amit -
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. -
Accessing portal dictionary tables from Web Dynpro project
Hi
Am a new to whole portal and webdynpro thing, and I hope that you can help here
I created a new dictionary project through NWDS and created a table with columns and I successfully deployed it
I also created a web dynpro project and I added a TABEL UI to the layout
how can I connect or access the table I created in the dictionary project from the Web dynpro project so I can query all data to fill the TABEL UI in the web dynpro ?
is there a driver that I can use like JDBC where I can just write regular SQL queries ?
regardsHi swathi
See the persistence API--Adv and Disadvantages what ever you mentioned come under the persistence API
Relational Persistence
=================
SQL-based coding: expressive!
SQLJ: for static SQL, checked at design time,
recommended
JDBC: for dynamic SQL, can be combined with SQLJ
=======================
Object-relational Persistence
======================
SQL-free! Portable!
JDO: light-weight object persistence, Java-like dynamic
query language
EJB CMP: part of J2EE standard, relatively heavy-weight,SQL-like static query language
Regards,
Venkata Kalyan Karanam -
Create dynamic table in web dynpro abap
Hi Friends,
I want to create several tables in a web dynpro. For this reason I have created a View, a group1 and a context node.
Now I want create a table for each characteristic group from cabn in the ui group1.
For this reason I want to use create_table_from_node and I have to craete dynamicly attributes in the node.
Is it the propper way or is there a different approach.
So in this case
1. I read the node
2. craete attribute for each characteristic group in this node
3. create a UI Table with create_table_from_node for each attribute
4. bind the data to the UI Table
Can I do the same without to craete attributes?
Thank in advance.
RG. JimbobHi Jimbob,
Have you looked at using the row-repeater UI element? You could then have as many tables as per your characteristic groups.
Although this would be more difficult if the attributes of each table were to also be only known at run-time. (I'm not sure that this is the case though from your description of the issue.)
so have a context of the form:
Context Root
--->node_characteristic_group (0..n)
>node_char_group_details(0...n) (non-singleton child node)
then bind your row repeater to node "node_characteristic_group " and bind the table inside the row repeater to node "node_char_group_details".
Each time you had a new element in the node_characteristic_group you would get a new table...
Much easier to support that anything dynamically created.
Cheers,
Chris -
Upload .xls file in internal table in web dynpro abap
Hi everyone,
i want to upload .xls(excel file) into an internal table.....after lots of attempts i came to a conclusion that web dynpro only supports .CSV(another format of excel file) to be uploaded into internal table....i tried many ways....is there a way i can upload .xls file...kindly help me in the same. following is the code i m using
DATA LO_EL_CONTEXT TYPE REF TO IF_WD_CONTEXT_ELEMENT.
DATA LS_CONTEXT TYPE WD_THIS->ELEMENT_CONTEXT.
DATA ITEM_FILE TYPE WD_THIS->ELEMENT_CONTEXT-EXCEL_UPLOAD.
get element via lead selection
LO_EL_CONTEXT = WD_CONTEXT->GET_ELEMENT( ).
@TODO handle not set lead selection
IF LO_EL_CONTEXT IS INITIAL.
ENDIF.
get single attribute
LO_EL_CONTEXT->GET_ATTRIBUTE(
EXPORTING
NAME = `EXCEL_UPLOAD`
IMPORTING
VALUE = ITEM_FILE ). "xstring format
DATA S_CONT TYPE STRING.
DATA CONVT TYPE REF TO CL_ABAP_CONV_IN_CE.
DATA: FIELDS1 TYPE STRING_TABLE.
1st tried this code-> using "cl_abap_conv_in_ce"
CALL METHOD cl_abap_conv_in_ce=>create
EXPORTING
*encoding = c_encoding "optional
input = ITEM_FILE
RECEIVING
conv = CONVT.
CALL METHOD CONVT->read
IMPORTING
data = S_CONT.
when it didnt work out...then tried followin function module
CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
EXPORTING
IN_XSTRING = ITEM_FILE "xsrting
IMPORTING
OUT_STRING = S_CONT
TYPES: BEGIN OF TY_TAB,
NAME_CHAR TYPE STRING,
DESCR_CHAR TYPE STRING,
NUMBER_DIGITS TYPE STRING,
END OF TY_TAB.
DATA: FIELDS TYPE STRING_TABLE.
DATA: LV_FIELD TYPE STRING.
DATA: S_TABLE TYPE STRING_TABLE.
DATA: ITAB TYPE TABLE OF TY_TAB.
DATA: STR_ITAB TYPE TY_TAB.
*splits string based on new line
SPLIT S_CONT AT CL_ABAP_CHAR_UTILITIES=>CR_LF INTO TABLE S_TABLE.
FIELD-SYMBOLS: <WA_TABLE> LIKE LINE OF S_TABLE.
LOOP AT S_TABLE ASSIGNING <WA_TABLE>.
splits string on basis of tabs
SPLIT <WA_TABLE> AT ',' INTO
STR_ITAB-NAME_CHAR
STR_ITAB-DESCR_CHAR
STR_ITAB-NUMBER_DIGITS.
APPEND STR_ITAB TO ITAB.
ENDLOOP.
I am able to do the uploading if the file is in .CSV format and not .XLS format....
there are lots of forums on SDN for the same....but at the end there is no solution provided.....
experts kindly solve it this time...thanks in advanceHi,
It is not possible to upload an xls file because it will be having some binary characters. better to go with .csv file format.
Refer this [link too|Re: Excel File Uplaod] it will explain you clearly.
Regards
Arun.P
Maybe you are looking for
-
New firefox 10.0 wont let me open mult windows, only tabs
new firefox 10.0 wont let me open mult windows, only tabs. I have looked at tools/options/tabs and the open new windows in tabs is not clicked. have rebooted computer with no better results
-
I have around 25,000 photos in jpeg and tiff and in version sets plus some slide shows and blurb books created in the 32 bit system of Windows Vista Home Premium with PSE 10.0 and Premier and have to change to a 64 bit Windows 7 system since Adobe
-
White screen of death but can see screen when hold down power button?
I've had my iPod Touch 4g for a few months (in December it will be a year) and for the past two months, I haven't been able to use it because of the white screen of death. I tried reseting it, restoring it (which didn't work because of error 1394 or
-
How do I make deleted gmail stay deleted? All of a sudden, everything that I have deleted reappears the next time I open the mail.
-
Problem in at the time of migo transaction
Dear cons I have created a sub contract p.o . we have given some raw mtl. to subcontractor. In this raw mtl. he has made some no. of final product. During the production of final product , some amount scrap has produced near vendor. when we do 'MIGO'