LinkToAction in a Table Element
Hello everybody,
how can i determine the row in a table for which the respective LinkToAction Element fired the event onAction?
Regards,
Markus
Markus,
Lead selection occurs before onAction -- so you may refer wdContext.nodeYourTableNode().currentYourTableNodeElement() inside action handler.
For more advanced options read https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c092333b-0601-0010-e7af-8c227fb6d052
Valery Silaev
EPAM System
http://www.NetWeaverTeam.com
Similar Messages
-
Hello all,
I created a table element which contains a column of check boxes.
I want to add to my table an option to check/uncheck all the check boxes.
I already created the events but I dont know how to call the events I created using the table?
Thanks in advance,
TomerHi Tomer,
you haven't said how your gui should look like. For example you can add two buttons ("select all" and "Unselect all") for this task. Now you add two actions, one for each button. Add the actions as eventtarget in the properties of the buttons. And in the event-methods of the actions you write your code to select/deselect the checkboxes, like
public void onActionSelectAll(...) {
for (int i = 0; i < wdContext.nodeMyTableDataSource().size(); i++) {
wdContext.nodeMyTableDataSource().getMyTableDataSourceElementAt(i).setMyCheckboxAttribute(true);
public void onActionUnselectAll(...) {
for (int i = 0; i < wdContext.nodeMyTableDataSource().size(); i++) {
wdContext.nodeMyTableDataSource().getMyTableDataSourceElementAt(i).setMyCheckboxAttribute(false);
HTH,
Frank -
Editing Cell Column of a selected row in UI table element.
Hi Experts,
I have a UI Table Element with three columns. First two columns are input fields in read only mode. Third column is a text edit field.
Now when I Select a row and press a button 'EDIT' i want that particular rows third column CELL alone to be in editable mode.
In order to achieve this, I created a WDY_BOOLEAN attribute in the same node which is used to bind the table. I binded this attribute to the READ ONLY property of third column.
In the EDIT button i wrote the following code.
lo_el_n_stp->set_attribute(
EXPORTING
name = 'A_EDIT'
value = ' ' ).
Here A_EDIT is the name of the attribute.
When i do this, my first rows third column is only going to EDIT mode and not the row which i selected.
Please tell me how to solve this problem.
Thanks in advance.Hi thanks for your reply.I have already tried this, the problem is i am not getting the seleted row value by using the below code
l
lo_nd_node1->get_static_attributes(
IMPORTING
static_attributes = ). "here you will get the selected row
Its giving me the first row value.
Edited by: Delphi on Mar 11, 2010 11:52 AM -
Error message in UI Table element
Hi Experts,
I am having a UI table element in my view. If there are zero records fetched in the select query, i am displaying an error message using message class in the top of the screen.
Is it possible to display this error message inside the UI table (may be in the first row of the blank table)
If so what should be done?
Please help.
Thanks in advance.Hi,
When there are no records in the table, then the TABLE UI elements shows the message inside the table as
'Table data not found' something likethis....by the framework. there is no need of explictily throwing a message.
As we get the same with ALV.
Please check it out.
You can UNCHECK the DISPLAYEMPTYROWS option.
Regards,
Lekha. -
Regarding excel file download from webdynpro table element
Hi All,
I want steps to do excel download from webdynpro table element.
Thanks in advance.
Regards,
Muneesh Gitta.Hi Gitta,
There are 2 ways in doing it, one is using GUI DOWNLOAD FM or using class clwd_runtime_services.
DATA:
node_node_alv TYPE REF TO if_wd_context_node,
elem_node_alv TYPE REF TO if_wd_context_element,
stru_node_alv TYPE wd_this->element_node_alv,
itab_node_alv TYPE TABLE OF wd_this->element_node_alv..
navigate from <CONTEXT> to <NODE_ALV> via lead selection
@TODO handle not set lead selection
IF ( node_node_alv IS INITIAL ).
ENDIF.
get all declared attributes
node_node_alv->get_static_attributes_table(
IMPORTING
table = itab_node_alv ).
DATA:
node_file_download TYPE REF TO if_wd_context_node,
elem_file_download TYPE REF TO if_wd_context_element,
stru_file_download TYPE wd_this->element_file_download ,
item_fname LIKE stru_file_download-fname.
navigate from <CONTEXT> to <FILE_DOWNLOAD> via lead selection
node_file_download = wd_context->get_child_node( name = wd_this->wdctx_file_download ).
get element via lead selection
elem_file_download = node_file_download->get_element( ).
get single attribute
elem_file_download->get_attribute(
EXPORTING
name = `FNAME`
IMPORTING
value = item_fname ).
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = item_fname
FILETYPE = 'ASC'
TABLES
data_tab = itab_node_alv.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
OR
check this blog for
Re: Export to Excel Sheet functionality -
How to use linktoaction and linktourl ui elements
Hi All,
I am working with the ui elements of a webdynpro.In that i am unable to understand the linktoaction and linktourl ui elements.Can anybody tel me how to use those ui elements with simple steps of coding.
Thanks in Advance,Those are fairly basic UI elements. They are just hyperlinks. LinkToURL works just like a normal HTML hyperlink and fires clientside navigation to the URL you specify. LinkToAction looks the same to the user (hyperlink), but instead fires a server side event triggering ABAP logic when clicked. Consider reading the online help for more details and the listed samples applications:
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/49/e8884118aa1709e10000000a155106/content.htm
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/0f/e8884118aa1709e10000000a155106/content.htm -
Cannot deselect line of a table element
Hi all,
I use a table in my WD abap. I have a simple problem : once I've selected a line, I cannot deselect it. Is it a normal behaviour ? I want the user to be able to delesect the line, so that no line of the table is selected.
Here are my settings :
- Context node :
Cardinality : 0..n
Selection : 0..1
Initialization lead selection : blank
Singleton : blank
- Table element :
selectionChangeBehaviour : auto
selectionMode : auto
Thanks for your help.Thanks Saud, it helped me a lot.
Finally I was forced to add some code to deselect the line. I think it's strange to have to do this, but I don't find any alternative...
Here's the code I put in the ONSELECT action of the table :
DATA : ls_old_ev_param TYPE wdr_event_parameter,
ls_new_ev_param TYPE wdr_event_parameter.
DATA : ls_old_sel TYPE wd_this->element_histo,
ls_new_sel TYPE wd_this->element_histo.
DATA : lo_element TYPE REF TO cl_wdr_context_element.
DATA : lv_index TYPE i.
FIELD-SYMBOLS : <ls_data> TYPE ANY.
DATA : lo_node_table TYPE REF TO if_wd_context_node.
READ TABLE wdevent->parameters
WITH KEY name = 'OLD_LEAD_SELECTION'
INTO ls_old_ev_param.
IF sy-subrc = 0.
ASSIGN ls_old_ev_param-value->* TO <ls_data>.
IF <ls_data> IS NOT INITIAL.
lo_element ?= <ls_data>.
CALL METHOD lo_element->if_wd_context_element~get_static_attributes
IMPORTING
static_attributes = ls_old_sel.
ENDIF.
ENDIF.
READ TABLE wdevent->parameters
WITH KEY name = 'NEW_LEAD_SELECTION'
INTO ls_new_ev_param.
IF sy-subrc = 0.
ASSIGN ls_new_ev_param-value->* TO <ls_data>.
IF <ls_data> IS NOT INITIAL.
lo_element ?= <ls_data>.
CALL METHOD lo_element->if_wd_context_element~get_static_attributes
IMPORTING
static_attributes = ls_new_sel.
ENDIF.
ENDIF.
*** Same selection -> deselection
IF ls_old_sel-objid = ls_new_sel-objid.
lo_node_table = wd_context->get_child_node( 'HISTO' ).
CALL METHOD lo_element->if_wd_context_element~get_index
RECEIVING
my_index = lv_index.
CALL METHOD lo_node_table->set_selected
EXPORTING
flag = abap_false
index = lv_index.
lo_node_table->set_lead_selection_index( lo_node_table->no_selection ).
ENDIF.
Edited by: Julien999 on May 31, 2010 3:56 PM -
Validating the value in the table element
hello all,
I have a column in the table element as editable and i want to validate the value entered in the editable column with value in another column.can this achieved without selecting the row in the table...like on change of value etc...
i am new to web dynpros..can any one help me on this.
with regards,
sandeep akella.
Edited by: sandeep akella on Aug 10, 2009 2:42 PMI now create a toolbar for my table and within that toolbar am creating a Toolbarbutton. Now upon pressing this button I want to validate the entries of SEATS_NEEDED against the entry in SEATS_AVAILABLE. In case of any inconsistency I not only throw an error message but also highlight the particular columns cell in which the error has occured. Below is the coding inside my buttons action handler:
METHOD onactionvalidate_booking .
DATA: lr_node TYPE REF TO if_wd_context_node,
lt_sflight TYPE wd_this->elements_sflight,
wa_sflight TYPE wd_this->element_sflight,
lr_element TYPE REF TO if_wd_context_element.
lr_node = wd_context->get_child_node( name = wd_this->wdctx_sflight ).
" Fetch the entire tables data into an internal table for validation purpose
lr_node->get_static_attributes_table( EXPORTING from = 1
to = 2147483647
IMPORTING table = lt_sflight ).
LOOP AT lt_sflight INTO wa_sflight WHERE seats_available <> 0.
" Check if user is trying to book more seats than what are available & throw an error message if needed
IF wa_sflight-seats_needed > wa_sflight-seats_available.
lr_element = lr_node->get_element( index = sy-tabix ).
" get message manager
DATA lo_api_controller TYPE REF TO if_wd_controller.
DATA lo_message_manager TYPE REF TO if_wd_message_manager.
lo_api_controller ?= wd_this->wd_get_api( ).
CALL METHOD lo_api_controller->get_message_manager
RECEIVING
message_manager = lo_message_manager.
" report message
CALL METHOD lo_message_manager->report_attribute_error_message
EXPORTING
message_text = 'Number of desired seats greater than available seats!'
element = lr_element
attribute_name = 'SEATS_NEEDED'.
ENDIF.
ENDLOOP.
ENDMETHOD. -
Multiple row selection for table element
Hi,
I have a requirement where I require to select multiple rows from a table element in a WD for abap application.
I have defined a node with cardinality and selection set to 1..n.
The contex node contains 4 fields : emp_name, pernr, manager and position.
The attributes of the table element for selectionmode is set to 'multi' and 'selectionchangebehaviour' is set to 'auto'.
I have defined an action on the 'onleadselection' event.
The code in this method also includes the statement 'lo_el_team_view->set_selected( EXPORTING flag = abap_true ).'
When I execute the application only 1 row is highlighted at any one time when I select it. You can select multiple rows by holding down the 'ctrl' key but I want to avoid having to do this. Is there anything I have missed out causing multiple row selections not to be all highlighted.
Thanks in advance for any assistance.Hi raj,
you can try the following code in the 'onleadselect' event of the table,
create one attribute ' Flag' of type WDY_BOOLEAN under the node which has been binded to the table.
DATA lo_nd_node_tab1 TYPE REF TO if_wd_context_node.
DATA lo_el_node_tab1 TYPE REF TO if_wd_context_element.
DATA lo_elements TYPE wdr_context_element_set.
DATA lo_ele_select_new TYPE REF TO if_wd_context_element.
DATA lv_deselect TYPE wdy_boolean.
DATA lv_flag TYPE wdy_boolean.
DATA lv_select TYPE wdy_boolean.
DATA lv_index TYPE i VALUE 0.
lo_nd_node_tab1 = wd_context->get_child_node( name = wd_this->wdctx_node_tab1 ).
get the current selected element
lo_ele_select_new = wdevent->get_context_element( name = 'NEW_ROW_ELEMENT' ).
CHECK lo_ele_select_new IS NOT INITIAL.
check whether it has been selected or not
CALL METHOD lo_ele_select_new->is_selected
RECEIVING
flag = lv_select.
lo_ele_select_new->get_attribute( EXPORTING name = 'FLAG' IMPORTING value = lv_deselect ).
check whether element has been previously selected or not,if not, set the flag to select it
IF lv_select IS NOT INITIAL AND lv_deselect IS INITIAL.
lo_ele_select_new->set_attribute( name = 'FLAG' value = 'X' ).
if selected currently and previously then set the flag as false,in order to delect it
ELSEIF lv_select IS NOT INITIAL AND lv_deselect IS NOT INITIAL..
lo_ele_select_new->set_attribute( name = 'FLAG' value = ' ' ).
ENDIF.
CALL METHOD lo_nd_node_tab1->get_elements
RECEIVING
set = lo_elements.
according to the falg, select and delect the elements
LOOP AT lo_elements INTO lo_el_node_tab1.
lo_el_node_tab1->get_attribute( EXPORTING name = 'FLAG' IMPORTING value = lv_flag ).
IF lv_flag = 'X'.
lo_el_node_tab1->set_selected( abap_true ).
lo_nd_node_tab1->set_lead_selection_index( lv_index ). * this statement deselects the lead selection index*
ELSE.
lo_el_node_tab1->set_selected( abap_false ).
lo_nd_node_tab1->set_lead_selection_index( lv_index ).
ENDIF.
ENDLOOP.
I hope this resolves your problem.
Thanks,
krishna -
How to bind the values of a RFC to a table element in WDA
Hi,
I have a RFC that returns some set of rows for a particular pernr.I want to bind this RFC to a table element in WDA.
please let me know how to do this and points will be rewarded for the helpful anwersHi,
Pl post in Web Dynpro ABAP
This tutorial may help https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7a89b067-0801-0010-8192-a9896a60938e
If its WD java
bind the datasource to the RFC model node
Regards
Ayyapparaj -
How to display table data without using ALV and table element.
Hi,
Its possible to display table data without using ALV and table element.
Every time i am fetching data based on (customer,status) fields and displaying these data in my output using alv
(every time i am fetching single row data ),
But problem is alv occupying more space in the output , i want to display data part only i dont want field names,
settings and header data etc..things.
Give solution to display data part..
Regards,
Rakhi.Hi,
Does you mean that you need ALV without default Function Toolbar...? If this is the case, the easy solution would have been to use Table Element rather. But, if you need to use ALV only without Function Toolbar, you can do away with that as well.
In that case, after calling GET_MODEL, you need to add few more lines of codes to achieve your goal. Those lines are --
DATA LV_VALUE TYPE REF TO CL_SALV_WD_CONFIG_TABLE.
LV_VALUE = LO_INTERFACECONTROLLER->GET_MODEL(
* Standard Filter Function setting to FALSE
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_COMPLEX_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_COMPLEX_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_FILTER_FILTERLINE_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_DISPLAY_SETTINGS_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_VIEW_LIST_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_SORT_HEADERCLICK_ALLOWED( ABAP_FALSE ).
LV_VALUE->IF_SALV_WD_STD_FUNCTIONS~SET_HIERARCHY_ALLOWED( ABAP_FALSE ).
* Standard Filter Function setting to FALSE Ends
Here as you can easily notice that LV_VALUE is instantiated on CL_SALV_WD_CONFIG_TABLE. Now, using this LV_VALUE, you set standard functions as False to dis-allow their display.
Hope this answers your query.
Thanks.
Kumar Saurav. -
Table Element & Other HTML in JSC
Hi,
A few questions:
1). Is the <table> component allowed in the JSF source of the creator? I wrote it manually, and the designer picked it up and displayed correctly.
2). Why is the <table> element not available as a standard JSF component? I know datatable is there, but sometimes you need the <table> component for layout design, which is not achievable through the data grid component.
e.g. the following look could NOT be created using the standard JSC components:
<table cellSpacing="0" cellPadding="0" width="100%" bgColor="#000000" border="0">
<tbody>
<tr>
<td>
<table cellSpacing="1" cellPadding="4" width="100%" border="0">
<tbody>
<tr bgColor="#ffffff">
<td vAlign="top" height="32" bgcolor="#3366CC"><b><font color="#FFFFFF">Locations</font></b></td>
</tr>
<tr>
<td vAlign="top" width="20%" bgColor="#ffffff" height="32"> </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>Is it possible to generate the above using JSC components?
3). What are rules for using HTML within the JSC created pages?
Would appreciate any inputs!
Thanks
HaroonI don't quite understand your code but here is what you can do with JSC components
1. Create a foo.jsp
2. Drag and drop the following components onto foo.jsp
<?xml version="1.0" encoding="UTF-8"?>
<div style="-rave-layout: grid" xmlns:h="http://java.sun.com/jsf/html">
<h:panelGrid binding="#{pages$common$Foo.gridPanel1}" border="0" cellpadding="4" cellspacing="1" columns="1" id="gridPanel1" width="100%">
<h:panelGrid binding="#{pages$common$Foo.gridPanel2}" id="gridPanel2">
<h:panelGroup binding="#{pages$common$Foo.groupPanel1}" id="groupPanel1">
<h:outputText binding="#{pages$common$Foo.outputText1}" id="outputText1" style="color:#FFFFFF; font-weight: bold;"> value="Locations"/>
</h:panelGroup>
<h:panelGroup binding="#{pages$common$Foo.groupPanel2}" id="groupPanel2" style=" width:20% ; height:32px"/>
</h:panelGrid>
</h:panelGrid>
</div>
3. Preview in browser
4 View page source to see you html code
GENERATES:
<html>
<head><base href="file:/<YOUR FILE PATH >"/><title>Foo.jspf</title></head>
<body>
<div style="-rave-layout: grid" xmlns:h="http://java.sun.com/jsf/html">
<table border="0" cellpadding="4" cellspacing="1" id="gridPanel1" width="100%">
<tbody>
<tr>
<td><table id="gridPanel2">
<tbody>
<tr>
<td><span id="groupPanel1"><span id="outputText1" style="color:#FFFFFF; font-weight: bold;
">Locations</span></span></td>
</tr>
<tr>
<td><span class="rave-design-border" id="groupPanel2" style=" width:20% ; height:32px"></span></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div></body>
</html>
WHICH IS ALMOST EQUIVALENT TO YOUR PIECE OF CODE:
<table cellSpacing="0" cellPadding="0" width="100%" bgColor="#000000" border="0">
<tbody>
<tr>
<td>
<table cellSpacing="1" cellPadding="4" width="100%" border="0">
<tbody>
<tr bgColor="#ffffff">
<td vAlign="top" height="32" bgcolor="#3366CC"><b><font color="#FFFFFF">Locations</font></b></td>
</tr>
<tr>
<td vAlign="top" width="20%" bgColor="#ffffff" height="32"> </td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table> -
WDA Table element - scroll buttons missing
Hi !
Being a relative newbie in WDA, I am trying out the table control [tutorial|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/cb243c45-0801-0010-eb9c-88669007f130] for web dynpro ABAP. Even though I get the results on a browser screen from table SFLIGHT, I cannot see the next screen scroll buttons of 'next page' / 'last page' in NW 7.0 EHP2. I tried inserting the 'toolbar' element and still am not able to see the buttons. Is it a separate setting ?
The tutorial is all pre NW7.0 EHP2 and seems to come automatically along with the table element.
Oogway.Oogway wrote:
I am interested in getting the Footer (for accessible mode) buttons at the bottom of the page displayed. Setting the parameter of WDTABLENAVIGATION to PAGINATOR or SCROLLBAR doesn't show any difference as the scrollbar is still visible. However, for tables containing many columns, it is difficult to use the browser scrollbar to get the edge of the table control to use the table scrollbar. It is for this case that the accessble mode buttons at the footer would be really helpful.
Hi,
your question should be paginator is missing.
as per your requirement, you want paginator (footer with buttons) for your table. from NW 7.01 and onwards, srollbar is the default value for table and in lightspeed rendering only scrollbar is used.
There are still some ways to get back paginator as discussed in thread row count in table ui element
and WDTABLENAVIGATION
But shifting to pagintor may cause performance issue as well.
I hope this will solve your problem.
Thanks,
Chandra
Edited by: Chandrashekhar Mahajan on Nov 15, 2011 11:41 AM -
Hi,
I have a report shown in a view in form of a table. Suppose the report shows: Purchase order number, Currency and Total Amount. These information comes from a BAPI in SAP.
Now when user clicks on the Purchase order number, a view with Purchase order header details should be shown.
When user clicks on the total amount, a view with purchase order line item details should be shown.
I am planning to use LinkToAction for both the columns.
My Question is:
1. If user clicks on a purchase order number on any row, how do I get the purchase order number?
2. If user clicks on the total amount on any row, then how do I get the corresponding purchase order number?
Thanks in advance.
Regards,
Suresh.Suresh,
If you left Table "selectionMode" as auto, or anything else except none, then the following sequence of events occurs when user clicks Link2Action:
1. First, row is selected
2. Second, action event fired.
So you may refer wdContext.node<YourTblNode>().current<YorblNode>Element() in action handler (and get necessary fields as element attributes)
VS -
Web Services with table element dont work
I, am trying to use a web service that returns a xml with code and description.
When i test the web service it works fine but when i use it in a page doesnt work at all.
There is no parameters to call and the response is:
<?xml version="1.0" encoding="utf-8" ?>
- <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <soap:Body>
- <instituicaoResponse xmlns="http://tempuri.org/">
- <instituicaoResult>
- <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
- <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:Locale="pt-PT">
- <xs:complexType>
- <xs:choice maxOccurs="unbounded">
- <xs:element name="Table">
- <xs:complexType>
- <xs:sequence>
<xs:element name="INST" type="xs:decimal" minOccurs="0" />
<xs:element name="DESCRICAO" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:schema>
- <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
- <NewDataSet xmlns="">
- <Table diffgr:id="Table1" msdata:rowOrder="0">
<INST>0</INST>
<DESCRICAO>Beneficiários - SAMS Norte</DESCRICAO>
</Table>
- <Table diffgr:id="Table2" msdata:rowOrder="1">
<INST>1</INST>
<DESCRICAO>Utentes - SAMS Norte (ex.Benef)</DESCRICAO>
</Table>
- <Table diffgr:id="Table3" msdata:rowOrder="2">
<INST>2</INST>
<DESCRICAO>Beneficiários - SAMS Sul e Ilhas</DESCRICAO>
</Table>
- <Table diffgr:id="Table4" msdata:rowOrder="3">
<INST>3</INST>
<DESCRICAO>Beneficiários - SAMS Centro</DESCRICAO>
</Table>
- <Table diffgr:id="Table5" msdata:rowOrder="4">
<INST>4</INST>
<DESCRICAO>Beneficiários - PALOP's (excl. Benef. BCA)</DESCRICAO>
</Table>
- <Table diffgr:id="Table6" msdata:rowOrder="5">
<INST>6</INST>
<DESCRICAO>Utentes - SAMS Sul e Ilhas</DESCRICAO>
</Table>
- <Table diffgr:id="Table7" msdata:rowOrder="6">
<INST>7</INST>
<DESCRICAO>Funcionários do SBN/SAMS</DESCRICAO>
</Table>
- <Table diffgr:id="Table8" msdata:rowOrder="7">
<INST>10</INST>
<DESCRICAO>Utentes - Banco Comercial Angolano</DESCRICAO>
</Table>
- <Table diffgr:id="Table9" msdata:rowOrder="8">
<INST>15</INST>
<DESCRICAO>Utentes - SAMS Centro</DESCRICAO>
</Table>
</NewDataSet>
</diffgr:diffgram>
</instituicaoResult>
</instituicaoResponse>
</soap:Body>
</soap:Envelope>
Can anyoone tell me waht is the problem, thanksAs far as I can tell the problem is the null namespace attribute on the NewDataSet element:
<NewDataSet xmlns="">As I understand it, either a namespace value should be given, or the xmlns attribute should not appear at all. If it's removed from the source XML then the data can be extracted:
SQL> l
1 with webservice as (
2 select xmltype(q'{
3 <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
4 <soap:Body>
5 <instituicaoResponse xmlns="http://tempuri.org/">
6 <instituicaoResult>
7 <xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
8 <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:Locale="pt-PT">
9 <xs:complexType>
10 <xs:choice maxOccurs="unbounded">
11 <xs:element name="Table">
12 <xs:complexType>
13 <xs:sequence>
14 <xs:element name="INST" type="xs:decimal" minOccurs="0" />
15 <xs:element name="DESCRICAO" type="xs:string" minOccurs="0" />
16 </xs:sequence>
17 </xs:complexType>
18 </xs:element>
19 </xs:choice>
20 </xs:complexType>
21 </xs:element>
22 </xs:schema>
23 <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
24 <NewDataSet xmlns="">
25 <Table diffgr:id="Table1" msdata:rowOrder="0">
26 <INST>0</INST>
27 <DESCRICAO>Beneficiários - SAMS Norte</DESCRICAO>
28 </Table>
29 <Table diffgr:id="Table2" msdata:rowOrder="1">
30 <INST>1</INST>
31 <DESCRICAO>Utentes - SAMS Norte (ex.Benef)</DESCRICAO>
32 </Table>
33 <Table diffgr:id="Table3" msdata:rowOrder="2">
34 <INST>2</INST>
35 <DESCRICAO>Beneficiários - SAMS Sul e Ilhas</DESCRICAO>
36 </Table>
37 <Table diffgr:id="Table4" msdata:rowOrder="3">
38 <INST>3</INST>
39 <DESCRICAO>Beneficiários - SAMS Centro</DESCRICAO>
40 </Table>
41 <Table diffgr:id="Table5" msdata:rowOrder="4">
42 <INST>4</INST>
43 <DESCRICAO>Beneficiários - PALOPs (excl. Benef. BCA)</DESCRICAO>
44 </Table>
45 <Table diffgr:id="Table6" msdata:rowOrder="5">
46 <INST>6</INST>
47 <DESCRICAO>Utentes - SAMS Sul e Ilhas</DESCRICAO>
48 </Table>
49 <Table diffgr:id="Table7" msdata:rowOrder="6">
50 <INST>7</INST>
51 <DESCRICAO>Funcionários do SBN/SAMS</DESCRICAO>
52 </Table>
53 <Table diffgr:id="Table8" msdata:rowOrder="7">
54 <INST>10</INST>
55 <DESCRICAO>Utentes - Banco Comercial Angolano</DESCRICAO>
56 </Table>
57 <Table diffgr:id="Table9" msdata:rowOrder="8">
58 <INST>15</INST>
59 <DESCRICAO>Utentes - SAMS Centro</DESCRICAO>
60 </Table>
61 </NewDataSet>
62 </diffgr:diffgram>
63 </instituicaoResult>
64 </instituicaoResponse>
65 </soap:Body>
66 </soap:Envelope>}') xml
67 from dual)
68 select
69 extractvalue(
70 value(t)
71 , '/Table/INST'
72 , 'xmlns="http://tempuri.org/"') inst
73 , extractvalue(
74 value(t)
75 , '/Table/DESCRICAO'
76 , 'xmlns="http://tempuri.org/"') descricao
77 from
78 webservice ws
79 , table(
80 xmlsequence(
81 extract(
82 ws.xml
83 , '//instituicaoResponse/instituicaoResult/diffgr:diffgram/NewDataSet/*'
84* , 'xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1" xmlns="http://tempuri.org/"'))) t
SQL> /
no rows selected
SQL> l 24
24* <NewDataSet xmlns="">
SQL> c/ xmlns=""//
24* <NewDataSet>
SQL> /
INST DESCRICAO
0 Beneficiários - SAMS Norte
1 Utentes - SAMS Norte (ex.Benef)
2 Beneficiários - SAMS Sul e Ilhas
3 Beneficiários - SAMS Centro
4 Beneficiários - PALOPs (excl. Benef. BCA)
6 Utentes - SAMS Sul e Ilhas
7 Funcionários do SBN/SAMS
10 Utentes - Banco Comercial Angolano
15 Utentes - SAMS Centro
9 rows selected.This is not an APEX problem: try the XML DB, but I think the problem lies in the web service XML rather than in Oracle or your XPath expressions...
Maybe you are looking for
-
MacBook pro won't start up, and quits during safe boot
The machine in question is my MacBook pro mid 2009. I never upgraded to Mavericks, so its on the previous OS to that (can't remember now I'm afraid!). It froze the other day while I was on Safari and playing football manager on steam. I couldn't ac
-
Problem with OM...
when a manager has 2 positions, it doesn't seems that the manager is caught for both org units. he has 2 positons, 50% each. eg: when we run variant INDIA in HP1-001. the manager for org unit IT_PLM is blank, but is in reality Chrisanth Jebakumar wit
-
Why can't I dress up my firefox for android with a persona?
have tried to 'dress up' my browser but it won't accept the persona when I apply it.
-
hi this is naveen... i had newly started programming in it.. there are some controls on my designer form and i want to submit those filled data to new XML file... please describe me in detai
-
Netflix stopped working today 5/27/14
Netflix stopped working on my dinosaur iPad this evening. Tried all Netflix fixes, spoke to tech support, no help. App loads to browse screen, then crashes back to iPad home screen. Was working earlier in the day, and roku was fine up until I switche