How To Store XML Fragments Using Functions Such As XMLElement
Hi
Not sure what I am missing. I wish to store XML fragments in variables so can pass around and concatenate with other fragments to make final XML document. Even before attempting to concatenate XML fragments, I am struggling to store any XML fragment in a variable. I am trying to use simple functions such as XMLElement to generate XML so can store in variable. I have seen many examples of XMLElement in SQL select statement. Can XMLElement be used in plsql? XMLElement says it returns value of type XMLType. Functions such as XMLElement make generating XML easier than creating all tags manually.
Below is simple example that demonstrates what I would like to do. I would like to be able to pass the XML fragment as either XMLType or clob. I receive error saying PLS-00201: identifier 'XMLELEMENT' must be declared
declare
vTheData XMLType;
vTheDataClob clob;
begin
vTheData:= XMLelement("empno",'1234567');
vTheDataClob:= xmlelement("empno",'1234567').getclobval();
end;
Where as I can use below, but surely don't have to use select into from dual method. I just expect can use XMLElement function in plsql same as sql, such as most other functions eg length, rtrim etc.
declare
vTheData XMLType;
vTheDataClob clob;
begin
select xmlelement("empno",'1234567')
into vTheData
from dual;
select xmlelement("empno",'1234567').getclobval()
into vTheDataClob
from dual;
end;
Hope this makes sense.
Thanks
Having said that, is there a more elegant way to achieve below. That is populate two XML fragments and concatenate together.
Sure, why not just only one statement?
select XMLConcat(
XMLElement( ... )
, XMLElement( ... )
into vTheResult
from dual;
As a second question, is it better to build and pass XML fragments as XMLType or clob?
I would say stay with XMLType but it depends on your requirement.
I generally avoid passing around pieces of data, SQL/XML functions are powerful in the way they can be used with set operations, so using them in a piecewise approach kinda negates what they're for.
Similar Messages
-
How to store XML fragments in a XMLTYPE column
Hi all,
maybe just another newbie question.
I've imported a lot of xml documents into an Oracle table with a xmltype column (stored as CLOB). Now I try to select a specific part of these documents and store thsi xml fragment in another table, also in a xmltype column.
Unfortunately this doesn't work, I get ORA-19010: Cannot insert XML fragments.
What can I do to store part of a xml document?
Best regards
MatthiasIs there a way to transform the xml fragments into valid xml documents?
-
How can we store xml data using jsp
hai,
Can anyone please explain in brief how to store xml data using jsp. Also if possible please explain by specifying the code.
regards,
Praveen Vinnakota.[email protected] wrote:
how can we publish Labview data using the web?
You could use shared variables and publish them to the network or use data sockets.
Kudos always welcome for helpful posts -
Assign default namespace to XML fragment using XQuery
Hi everybody!
I need to add a default namespace declaration to a XML fragment using XQuery. I wrote following statement to assign fragment to $body:
<soap-env:Body>{
fn-bea:inlinedXML($content/text())}
</soap-env:Body>
The problem is "$content/text()" has no namespace declaration so I need to assign a default namespace (xmlns="") to it in order to apply some XQuery transformations to its content.
I know this can be easily done with a XSLT but I would like use XQuery instead.
Could anyone tell me how I could perform this task?
Thank you in advance,
Daniel.Re: xquery function - send namespace as binding variable and define it in a tag
-
How to access xml file using c
how to access xml file using c. are there any libraries regarding xml fastinfoset in c? Please let me know about any resources if u know? thanks!!!
samithaThere are different methods to access XML data which have pro's and cons. Let us know more about what you want to do and we can help you.
-
How to extract data by using function module in generic extraction please
how to extract data by using function module in generic extraction please give me steps required
Dear Deba,
Generic Extraction via Function Module
/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
If the requirement is like extracting data from multiple tables with some complex logic then views cannot be used..so u cna go for FM is used where it can be achieved.
Chk these
/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33
check the following thread
generic extraction with function module
Generic Extraction with function module
Regards,
Ram. -
How to separate this hyperlink using function in Infopath?
HI All,
How to separate this hyperlink using function in Infopath?http://Site:90/Lists/attachment/Attachments/6/Capture.PNGhttp://Site:90/Lists/attachment/Attachments/6/Capture1.PNG
Actually I have two fields
in infopath form, attachment field and hyperlink field. If attachment attached, then set value for hyperlink field value as attachment link.
When I attach more than one attachment, then hyperlink field value gets like above link. I need to separate into two link. How to achieve this?try this
substring(text, start_position, char_count)
http://office.microsoft.com/en-us/infopath-help/add-formulas-and-functions-in-infopath-2010-HA101821255.aspx#_Text_functions
Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog -
How to store xml data into file in xml format through java program?
HI Friends,
Please let me know
How to store xml data into file in xml format through java program?
thanks......
can discuss further at messenger.....
Avanish Kumar Singh
Software Engineer,
Samsung India Development Center,
Bangalore--560001.
[email protected]Hi i need to write the data from an XML file to a Microsoft SQL SErver database!
i got a piece of code from the net which allows me to parse th file:
import java.io.IOException;
import org.xml.sax.*;
import org.xml.sax.helpers.*;
import org.apache.xerces.parsers.SAXParser;
import java.lang.*;
public class MySaxParser extends DefaultHandler
private static int INDENT = 4;
private static String attList = "";
public static void main(String[] argv)
if (argv.length != 1)
System.out.println("Usage: java MySaxParser [URI]");
System.exit(0);
String uri = argv[0];
try
XMLReader parser = XMLReaderFactory.createXMLReader("org.apache.xerces.parsers.SAXParser");
MySaxParser MySaxParserInstance = new MySaxParser();
parser.setContentHandler(MySaxParserInstance);
parser.parse(uri);
catch(IOException ioe)
ioe.printStackTrace();
catch(SAXException saxe)
saxe.printStackTrace();
private int idx = 0;
public void characters(char[] ch, int start, int length)
throws SAXException
String s = new String(ch, start, length);
if (ch[0] == '\n')
return;
System.out.println(getIndent() + " Value: " + s);
public void endDocument() throws SAXException
idx -= INDENT;
public void endElement(String uri, String localName, String qName) throws SAXException
if (!attList.equals(""))
System.out.println(getIndent() + " Attributes: " + attList);
attList = "";
System.out.println(getIndent() + "end document");
idx -= INDENT;
public void startDocument() throws SAXException
idx += INDENT;
public void startElement(String uri,
String localName,
String qName,
Attributes attributes) throws SAXException
idx += INDENT;
System.out.println('\n' + getIndent() + "start element: " + localName);
if (localName.compareTo("Machine") == 0)
System.out.println("YES");
if (attributes.getLength() > 0)
idx += INDENT;
for (int i = 0; i < attributes.getLength(); i++)
attList = attList + attributes.getLocalName(i) + " = " + attributes.getValue(i);
if (i < (attributes.getLength() - 1))
attList = attList + ", ";
idx-= INDENT;
private String getIndent()
StringBuffer sb = new StringBuffer();
for (int i = 0; i < idx; i++)
sb.append(" ");
return sb.toString();
}// END PRGM
Now , am not a very good Java DEv. and i need to find a soln. to this prob within 1 week.
The next step is to write the data to the DB.
Am sending an example of my file:
<Start>
<Machine>
<Hostname> IPCServer </Hostname>
<HostID> 80c04499 </HostID>
<MachineType> sun4u [ID 466748 kern.info] Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 360MHz) </MachineType>
<CPU> UltraSPARC-IIi at 360 MHz </CPU>
<Memory> RAM : 512 MB </Memory>
<HostAdapter>
<HA> kern.info] </HA>
</HostAdapter>
<Harddisks>
<HD>
<HD1> c0t0d0 ctrl kern.info] target 0 lun 0 </HD1>
<HD2> ST38420A 8.2 GB </HD2>
</HD>
</Harddisks>
<GraphicCard> m64B : PCI PGX 8-bit +Accel. </GraphicCard>
<NetworkType> hme0 : Fast-Ethernet </NetworkType>
<EthernetAddress> 09:00:30:C1:34:90 </EthernetAddress>
<IPAddress> 149.51.23.140 </IPAddress>
</Machine>
</Start>
Note that i can have more than 1 machines (meaning that i have to loop thru the file to be able to write to the DB)
Cal u tellme what to do!
Even better- do u have a piece of code that will help me understand and implement the database writing portion?
I badly need help here.
THANX -
How ejb-jar.xml is Used by ejb Container
Hi,
Can anyone please explain me about how ejb-jar.xml is Used by ejb Container when a request is sent by a client(ie StandAlone program or a WebService)
Thanks in Advance
Venkat.Hi Benny,
Nice answer to a self explainig question :-).
Regards,
Daniel
p.s. THX to Sun and J2EE 5 and especially EJB3 (and don't forget about SAP, NWCE is really cool!!!) -
How to store xml data fragments, that will not be queried?
Hello,
Delphi Client application communicates with Java Server application via XML messages. Client sends XML message over HTTP Post method. Java Servlet gets XML message, parses it, performs requested action (select/insert/update/delete), generates resulting response and sends it back to the Client.
I use Oracle DB XE 10.2.
For example: Client sends a request to the server, to append certain Order with new Product info:
Request:
<?xml version="1.0" encoding="UTF-8" ?>
- <Request OrderID="123123123" Action="NewProduct">
- <Product TempProdID="2" ProdName="L01" VisualID="1" Amount="1" TechClass="1" TechSubject="1" TechVersion="0" TechName="TestTech" ElemOk="0">
<Modified UserID="XXX" UserGroup="XXX" GroupLevel="0" />
- <QuickInfo>
<ProdIcon Format="PNG"
Encoding="Base64">iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAIAAAA
lC+aJAAAAA3RSTlP////6yOLMAAAAvElEQVR42u3aQQ6EIAwAQP7/afe0
mo1mBVur0emJgwGmRDFNWwvH9I153OpjyoisefqXW3afm4WypP+MgomvT
z8AAAAAAAAAAAAAAMAzAClzAWQAdvexfqATEKmA/Fm0rYs5ozvoAWyWj4
ZqJ9efQKR8BJAHOPEdKAAc/lLdAhC/K68EBG+JWwAixfABgF8Jf6MAAAA
AAAAAAAAAAAAALwRUGgAAAAAAsgGJ3cfVrcfFl2jiIZzV+V7Zd/8BOtNi
0MnJ58oAAAAASUVORK5CYII=
</ProdIcon>
<Parameters />
</QuickInfo>
- <TechProduct CurVer="1" MinVer="1" TotalItems="330" ItemNodeSize="55074">
- <SubItem Class="TPlGraph" BindID="00B9C004">
<PropList />
- <SubItem Ident="Profiles" Class="TProfileList" Child="1" BindID="0188598C">
<PropList />
- <SubItem Class="TPlProfile" Child="1" BindID="018CA6CC">
- <PropList>
<Property PropIdent="ProfBaze0X" ValText="0" />
<Property PropIdent="ProfBaze0Y" ValText="990" />
<Property PropIdent="ProfBaze1X" ValText="990" />
<Property PropIdent="ProfHier0" ValText="0" />
- <Property PropIdent="InBorder" ValIdent="None" ValText="Nėra">
<ExtValue ColIdent="ItemCode" Value="None" />
<ExtValue ColIdent="Type" Value="" />
<ExtValue ColIdent="Filter" Value="" />
<ExtValue ColIdent="Width" Value="0" />
<ExtValue ColIdent="TechCall" Value="" />
</Property>
</PropList>
</SubItem>
</SubItem>
</SubItem>
</TechProduct>
</Product>
</Request>
I use DOM parsers to parse the received requests, extract certain info and insert it into relational tables using standart SQL queries.
My question is: what is the best way to store XML data fragments, that are not required to be saved relationally? I need to save the content of node <TechProduct> from the above example to relational table's column. There will be no need to query this column, no need to use relational views. I will use it only when Client application will request to modify certain order's product. Then I will have to send back the same <TechProduct> node via XML response.
So what column type do I have to use? CLOB? XMLType? Is it better to use object types? Do I have to register XML Schema for better performance? The size of the fragment can be ~2MB.
Thanks for your help
Message was edited by:
KichasThank you for reply,
As you suggested, I will use XMLType storage as CLOB (without XML Schema).
As I mentioned before, I use Java Servlet, deployed on Tomcat WebServer, to receive XML messages from Client application via HTTP POST method.
I use these libs to get the XML payload and parse it into a Document:
import org.w3c.dom.*;
import org.xml.sax.InputSource;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
And here is the code:
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
try {
// get the XML payload and parse it into a Document
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document dom;
InputSource input = new InputSource(request.getInputStream());
dom = docBuilder.parse(input);
catch(Exception ex) {
System.out.println("Exception thrown in XmlService");
ex.printStackTrace();
throw new ServletException(ex);
I create a relational table, that contains XMLType column:
CREATE TABLE xwarehouses (
warehouse_id NUMBER,
warehouse_spec XMLTYPE)
XMLTYPE warehouse_spec STORE AS CLOB;
Now I want to insert all DOM Document into XMLType column. So I do like this:
import oracle.xdb.XMLType;
String SQLTEXT = "INSERT INTO XWAREHOUSES (WAREHOUSE_ID, WAREHOUSE_SPEC) VALUES (?, ?)";
XMLType xml = XMLType.createXML(con,dom);
PreparedStatement sqlStatement = con.prepareStatement(SQLTEXT);
sqlStatement.setInt(1,2);
sqlStatement.setObject(2,xml);
sqlStatement.execute();
sqlStatement.close();
dom is the Document, that I got from HTTP Request input stream.
My servlet throws an exception:
java.lang.NoClassDefFoundError: oracle/xml/parser/v2/XMLParseException
at XmlService.GetMatListServiceHandler.processRequest(GetMatListServiceHandler.java:111)
at XmlService.XmlServiceHandler.handleRequest(XmlServiceHandler.java:43)
at XmlService.XmlServiceServlet.doPost(XmlServiceServlet.java:69)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:716)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:809)
why does he needs oracle.xml.parser.v2.XMLParseException? I don't use Oracle parser? Does this code line throws the exception (I am not able to debug my code, because I have not configured JDeveloper to be able to use Remote Debuging):
XMLType xml = XMLType.createXML(con,dom);
Does it reparses the given dom Document or what?. When I deploy xmlparserv2.jar to Tomcat, everything is ok, application inserts XML data into XMLType column.
Is there another way to insert the whole org.w3c.dom Document or Document fragment (that is already parsed) into XMLType column. Can you provide any sample code?
The Document may contain national symbols, so they should be correctly stored and then later retrieved.
Many thanks. -
How to update XML file using XSLT
Hi there,
I have a "small" issue with exporting data to an XML file using XSLT.
A two steps process is needed to import data from a non-hierarchical XML file into ABAP, change the data, and then update the XML file with new values. The problem is not trivial, since the format of the XML file is a complex one: there are many interdependent elements on the same level, pointing to each other by using id and ref attributes. Based on these values the data can be read and written into an internal table. I use XSLT and XPath for that. So the inbound process is done and seems to work correctly. I have to mention that the file contains much more data than I need. I am working only with a small part of it.
Now the changed data must be exported back into the XML file, meaning that the content of certain elements must be updated. How can this be done with XSLT? I can pass only the internal table to the transformation, so how do I access the XML file in order to update it? I have tried to use the <B>xsl:document()</B> function to access the content of the file store locally on my PC, but it fails each time by throwing and URI exception. I have tried the absolute path without any addition and the path with the file:/// addition. Same result. Please advise.
Many thanks,
Ferenc
P.S. Please provide me with links only if they are relevant for this very matter. I will not give points for irrelevant postings...Now the changed data must be exported back into the XML file, meaning that the content of certain elements must be updated. How can this be done with XSLT?
XSLT approach: check these online tutorial
http://www.xml.com/pub/a/2000/08/02/xslt/index.html
http://www.xml.com/pub/a/2000/06/07/transforming/index.html
ABAP approach:
for example you have the xml (original) in a string called say xml_out .
data: l_xml type ref to cl_xml_document ,
node type ref to if_ixml_node .
create object l_xml.
call method l_xml->parse_string
exporting
stream = xml_out.
node = l_xml->find_node(
name = 'IDENTITY'
ROOT = ROOT
l_xml->set_attribute(
name = 'Name'
value = 'Charles'
node = node
(the above example reads the element IDENTITY and sets attribute name/value to the same)
like wise you can add new elements starting from IDENTITY using various methods available in class CL_XML_DOCUMENT
so how do I access the XML file in order to update it?
you have already read this XML into a ABAP variable right?
Sorry couldnt understand your whole process, why do you need to read local XML file?
Raja -
How to store xml-file direct on file-directory on server ?
Hello,
I have created a xml-data by using xmlelements, xmlforest .... and so on in a sql-statement and want to store it as file in a ( windows) server-directory.
I can find some samples to store it in XML-DB by using dbms_xmlGEN and dbms_XDB,
but how to store it direct ?
thank you
NorbertTry dbms_xmldom.writeToFile()..
Or create a resource from your SQL Statement using dbms_xdb.createResource() and then access the resource via FTP or HTTP -
Hi
I am following below link to hide/show my columns dynamically. See "Column Formatting"
http://docs.oracle.com/cd/E12844_01/doc/bip.1013/e12187.pdf
As per doc, element can be made private/public.
<items type="PUBLIC">
<item>
<name>Plasma TV</name>
<quantity>10</quantity>
<price>4000</price>
</item>
<item>
And same can be used to hide the column using condition
<?if@column:/items/@type="PUBLIC"?>
MY QUESTION IS HOW TO DO THIS IN MY XML BELOW?
Below is part of my XML code which I am using in Data Definition for RTF.
<group name="GH3" source="QH3">
<element name="COLUMN_HEAD3" value="COLUMN_NAME" />
</group>
<group name="GH4" source="QH4">
<element name="COLUMN_HEAD4" value="COLUMN_NAME" />
</group>
I am getting output like this.
<LIST_GH3>
<GH3>
<COLUMN_HEAD3>REBILL_TO_OTHER_BUSINESS_UNIT</COLUMN_HEAD3>
</GH3>
</LIST_GH3>
<LIST_GH4>
<GH4>
<COLUMN_HEAD4>XYZ</COLUMN_HEAD4>
</GH4>
</LIST_GH4>
In order to use logic as per oracle document I want output like this.
<LIST_GH3 type="PUBLIC">
<GH3>
<COLUMN_HEAD3>REBILL_TO_OTHER_BUSINESS_UNIT</COLUMN_HEAD3>
</GH3>
</LIST_GH3>
<LIST_GH4 type="PRIVATE">
<GH4>
<COLUMN_HEAD4>BLANK</COLUMN_HEAD4>
</GH4>
</LIST_GH4>
What changes I need to make in my XML code to get the runtime output as above? Please help. Where do i need to make changes in the above xml? Group name? Element name?
I am planning to use below condition in RTF template to hide the column, but dont know how to set the type of column as PRIVATE/PUBLIC in the XML output used to populate data in the RTF at runtime.
<?if@column:/BTSPIEXP/LIST_GH3/@type=”PUBLIC”?>COLUMN_HEAD3<?end if?>
Regards,
Swapnil K.Hi,
Issue has been resolved. I used the value of the element to determine to display it or not.
Regards,
Swapnil K. -
How to edit ALV report using function modules
I have a ALV report , i want to edit the report
using function modules.
how can i do that...
Edited by: ms kumar on Mar 6, 2008 3:24 PMhi i had used this report with the check box,
using the fm of alvs.....
*& Report ZZZ00
REPORT ZPR_02.
TYPE-POOLS: SLIS.
TABLES:pa0002,pa0008.
data:begin of it_pa0002 occurs 0,
checkbox,
pernr like pa0002-pernr,
begda like pa0002-begda,
endda like pa0002-endda,
vorna like pa0002-vorna,
nachn like pa0002-nachn,
end of it_pa0002.
data:begin of it_pa00021 occurs 0,
pernr like pa0002-pernr,
begda like pa0002-begda,
endda like pa0002-endda,
vorna like pa0002-vorna,
nachn like pa0002-nachn,
expand TYPE xfeld value 'X',
end of it_pa00021.
data:begin of it_pa0008 occurs 0,
pernr like pa0008-pernr,
begda like pa0008-begda,
endda like pa0008-endda,
ANSAL like pa0008-ANSAL,
LGA01 like pa0008-LGA01,
BET01 LIKE PA0008-BET01,
end of it_pa0008.
DATA: IT_FIELD_CAT TYPE SLIS_T_FIELDCAT_ALV,
IT_FIELD_CAT1 TYPE SLIS_T_FIELDCAT_ALV,
IT_LAYOUT1 TYPE SLIS_LAYOUT_ALV,
WA_FIELD_CAT TYPE SLIS_FIELDCAT_ALV,
WA_FIELD_CAT1 TYPE SLIS_FIELDCAT_ALV,
IT_LAYOUT TYPE SLIS_LAYOUT_ALV,
IT_EVENTS TYPE SLIS_T_EVENT,
WA_EVENTS TYPE SLIS_ALV_EVENT,
IT_HEADER TYPE SLIS_T_LISTHEADER,
WA_HEADER TYPE SLIS_LISTHEADER,
wa_keyinfo TYPE slis_keyinfo_alv.
CONSTANTS:c VALUE 'X'.
SELECT-OPTIONS: S_pernr FOR pa0002-pernr.
START-OF-SELECTION.
SET PF-STATUS 'DATA' .
PERFORM GET_DATA.
PERFORM BUILD_FIELD_CAT.
PERFORM GET_EVENTS.
PERFORM DISPLAY_DATA.
*& Form get_data
text
FORM GET_DATA .
SELECT pernr
begda
endda
vorna
nachn
FROM pa0002
INTO CORRESPONDING FIELDS OF TABLE IT_pa0002
WHERE pernr IN S_pernr.
ENDFORM. " get_data
*& Form build_field_cat
text
FORM BUILD_FIELD_CAT .
wa_field_cat-tabname = 'PA0002'.
WA_FIELD_CAT-FIELDNAME = 'CHECKBOX'.
wa_field_cat-ref_tabname = 'IT_PA0002'.
WA_FIELD_CAT-REPTEXT_DDIC = 'Check Box'.
APPEND WA_FIELD_CAT TO IT_FIELD_CAT.
CLEAR WA_FIELD_CAT.
wa_field_cat-tabname = 'PA0002'.
WA_FIELD_CAT-FIELDNAME = 'PERNR'.
wa_field_cat-ref_tabname = 'IT_PA0002'.
WA_FIELD_CAT-REPTEXT_DDIC = 'Personnel no'.
APPEND WA_FIELD_CAT TO IT_FIELD_CAT.
CLEAR WA_FIELD_CAT.
wa_field_cat-tabname = 'PA0002'.
WA_FIELD_CAT-FIELDNAME = 'BEGDA'.
wa_field_cat-ref_tabname = 'IT_PA0002'.
WA_FIELD_CAT-REPTEXT_DDIC = 'Start date'.
APPEND WA_FIELD_CAT TO IT_FIELD_CAT.
CLEAR WA_FIELD_CAT.
wa_field_cat-tabname = 'PA0002'.
WA_FIELD_CAT-FIELDNAME = 'ENDDA'.
wa_field_cat-ref_tabname = 'IT_PA0002'.
WA_FIELD_CAT-REPTEXT_DDIC = 'End date'.
APPEND WA_FIELD_CAT TO IT_FIELD_CAT.
CLEAR WA_FIELD_CAT.
wa_field_cat-tabname = 'PA0002'.
WA_FIELD_CAT-FIELDNAME = 'VORNA'.
wa_field_cat-ref_tabname = 'IT_PA0002'.
WA_FIELD_CAT-REPTEXT_DDIC = 'First name'.
APPEND WA_FIELD_CAT TO IT_FIELD_CAT.
CLEAR WA_FIELD_CAT.
wa_field_cat-tabname = 'PA0002'.
WA_FIELD_CAT-FIELDNAME = 'NACHN'.
wa_field_cat-ref_tabname = 'IT_PA0002'.
WA_FIELD_CAT-REPTEXT_DDIC = 'Last name'.
APPEND WA_FIELD_CAT TO IT_FIELD_CAT.
CLEAR WA_FIELD_CAT.
wa_field_cat1-tabname = 'PA0002'.
WA_FIELD_CAT1-FIELDNAME = 'PERNR'.
wa_field_cat1-ref_tabname = 'IT_PA00021'.
WA_FIELD_CAT1-REPTEXT_DDIC = 'Personnel no'.
APPEND WA_FIELD_CAT1 TO IT_FIELD_CAT1.
CLEAR WA_FIELD_CAT1.
wa_field_cat1-tabname = 'PA0002'.
WA_FIELD_CAT1-FIELDNAME = 'BEGDA'.
wa_field_cat1-ref_tabname = 'IT_PA00021'.
WA_FIELD_CAT1-REPTEXT_DDIC = 'Start date'.
APPEND WA_FIELD_CAT1 TO IT_FIELD_CAT1.
CLEAR WA_FIELD_CAT1.
wa_field_cat1-tabname = 'PA0002'.
WA_FIELD_CAT1-FIELDNAME = 'ENDDA'.
wa_field_cat1-ref_tabname = 'IT_PA00021'.
WA_FIELD_CAT1-REPTEXT_DDIC = 'End date'.
APPEND WA_FIELD_CAT1 TO IT_FIELD_CAT1.
CLEAR WA_FIELD_CAT1.
wa_field_cat1-tabname = 'PA0002'.
WA_FIELD_CAT1-FIELDNAME = 'VORNA'.
wa_field_cat1-ref_tabname = 'IT_PA00021'.
WA_FIELD_CAT1-REPTEXT_DDIC = 'First name'.
APPEND WA_FIELD_CAT1 TO IT_FIELD_CAT1.
CLEAR WA_FIELD_CAT.
wa_field_cat1-tabname = 'PA0002'.
WA_FIELD_CAT1-FIELDNAME = 'NACHN'.
wa_field_cat1-ref_tabname = 'IT_PA00021'.
WA_FIELD_CAT1-REPTEXT_DDIC = 'Last name'.
APPEND WA_FIELD_CAT1 TO IT_FIELD_CAT1.
CLEAR WA_FIELD_CAT1.
wa_field_cat1-tabname = 'PA0008'.
wa_field_cat1-fieldname = 'PERNR'.
wa_field_cat-ref_tabname = 'IT_PA0008'.
wa_field_cat1-REPTEXT_DDIC = 'personnelno'.
APPEND wa_field_cat1 TO it_field_cat1.
CLEAR WA_FIELD_CAT1.
wa_field_cat1-tabname = 'PA0008'.
wa_field_cat1-fieldname = 'BEGDA'.
wa_field_cat-ref_tabname = 'IT_PA0008'.
wa_field_cat1-REPTEXT_DDIC = 'begindate'.
APPEND wa_field_cat1 TO it_field_cat1.
CLEAR WA_FIELD_CAT1.
wa_field_cat1-tabname = 'PA0008'.
wa_field_cat1-fieldname = 'ENDDA'.
wa_field_cat-ref_tabname = 'IT_PA0008'.
wa_field_cat1-REPTEXT_DDIC = 'enddate'.
APPEND wa_field_cat1 TO it_field_cat1.
CLEAR WA_FIELD_CAT1.
wa_field_cat1-tabname = 'PA0008'.
wa_field_cat1-fieldname = 'ANSAL'.
wa_field_cat-ref_tabname = 'IT_PA0008'.
wa_field_cat1-REPTEXT_DDIC = 'annualsalary'.
APPEND wa_field_cat1 TO it_field_cat1.
CLEAR WA_FIELD_CAT1.
wa_field_cat1-tabname = 'PA0008'.
wa_field_cat1-fieldname = 'LGA01'.
wa_field_cat-ref_tabname = 'IT_PA0008'.
wa_field_cat1-REPTEXT_DDIC = 'wagetype'.
APPEND wa_field_cat1 TO it_field_cat1.
CLEAR WA_FIELD_CAT1.
wa_field_cat1-tabname = 'PA0008'.
wa_field_cat1-fieldname = 'BET01'.
wa_field_cat-ref_tabname = 'IT_PA0008'.
wa_field_cat1-REPTEXT_DDIC = 'Amount'.
APPEND wa_field_cat1 TO it_field_cat1.
CLEAR WA_FIELD_CAT1.
ENDFORM. " build_field_cat
*& Form display_data
text
FORM DISPLAY_DATA .
it_layout-box_fieldname = 'CHECKBOX'.
it_layout-EDIT = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IT_FIELDCAT = IT_FIELD_CAT
IS_LAYOUT = IT_LAYOUT
IT_EVENTS = IT_EVENTS
TABLES
T_OUTTAB = IT_pa0002.
ENDFORM. " display_data
*& Form get_events
text
FORM GET_EVENTS .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
IMPORTING
ET_EVENTS = IT_EVENTS .
READ TABLE IT_EVENTS INTO WA_EVENTS
WITH KEY NAME = SLIS_EV_TOP_OF_PAGE.
IF SY-SUBRC = 0.
WA_EVENTS-FORM = 'TOP_OF_PAGE'.
MODIFY IT_EVENTS FROM WA_EVENTS INDEX SY-TABIX.
ENDIF.
ENDFORM. " get_events
*& Form top_of_page
text
FORM TOP_OF_PAGE.
WA_HEADER-TYP = 'H'.
WA_HEADER-INFO = 'EMPLOYEE DATA'.
APPEND WA_HEADER TO IT_HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = IT_HEADER
ENDFORM. "top_of_page
*& Form GUI_SET
FORM GUI_SET USING RT_EXTAB TYPE SLIS_T_EXTAB .
SET PF-STATUS 'DATA' .
ENDFORM. "GUI_SET
*& Form USER_COMMAND
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
R_SELFIELD TYPE SLIS_SELFIELD.
DATA:V_PERNR LIKE PA0002-PERNR.
CASE R_UCOMM.
WHEN 'DET'.
DATA: V_FLAG.
clear : v_flag.
LOOP AT IT_PA0002.
if it_PA0002-checkbox = 'X'.
v_flag = 'X'.
v_pernr = IT_PA0002-PERNR.
SELECT PERNR
BEGDA
ENDDA
VORNA
NACHN
FROM PA0002
INTO CORRESPONDING FIELDS OF TABLE IT_PA00021
WHERE PERNR = V_PERNR.
SORT IT_PA00021 BY PERNR.
DELETE ADJACENT DUPLICATES FROM IT_PA00021 COMPARING PERNR.
READ TABLE IT_PA00021 INDEX 1.
SELECT PERNR
BEGDA
ENDDA
ANSAL
LGA01
BET01
FROM PA0008
INTO TABLE IT_PA0008
FOR ALL ENTRIES IN IT_PA00021
WHERE PERNR = IT_PA00021-PERNR.
if not it_PA0008[] Is initial.
SORT IT_PA0008 BY PERNR.
delete adjacent duplicates from it_PA0008 comparing pernr.
READ TABLE IT_PA0008 INDEX 1.
endif.
endif.
enddo.
it_layout1-group_change_edit = c.
it_layout1-colwidth_optimize = c.
it_layout1-zebra = c.
it_layout1-detail_popup = c.
it_layout1-get_selinfos = c.
it_layout-expand_fieldname = 'EXPAND'.
wa_keyinfo-header01 = 'PERNR'.
wa_keyinfo-item01 = 'PERNR'.
IF NOT V_FLAG IS INITIAL.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = IT_LAYOUT1
IT_FIELDCAT = IT_FIELD_CAT1
I_TABNAME_HEADER = 'PA0002'
I_TABNAME_ITEM = 'PA0008'
IS_KEYINFO = wa_keyinfo
TABLES
T_OUTTAB_HEADER = IT_PA00021
T_OUTTAB_ITEM = IT_PA0008.
ENDIF.
CLEAR: IT_PA00021,IT_PA0002,IT_PA0008.
ENDLOOP.
WHEN 'BACK'.
EXIT.
ENDCASE.
ENDFORM. "USER_COMMAND
reward points if useful,
venkat. -
How to get XML value using servlet?
how to get values from a XML file using servlet ? Thank you.
for example: how can I get the location value (aaa) from this XML file?
abc.xml:
<business>
<location>aaa</location>
</business>Try to use XML Parsers to do the job.
Use DOM or SAX Parsers that are freely available.
Some of the popular ones are xerces, DOM, SAX.
Maybe you are looking for
-
This is frustrating and seems to be a known issue. Regular calendar items work fine but any meeting invitations sent to and accepted on PC running Outlook 2010 with iCloud add in only show up on default (local) calendar. Must add them manually. Also
-
How to force a jsp page to reload an "include" file?
Hi there, I'm using WebSphere 4.0.2 with the Java 1.3.1 API. Some of my JSP files includes another JSP file as follows: <%@include file="constants.jsp"%>The above line came from one of the files entitled "main.jsp". Other jsp files on our system can
-
Tiles jsf 1.2 and web ui components
Hello, I'm using standalone tiles for my jee5 application which also happens to use and require the ui: components as supplied with Studio Creator. I am able to get the tiles to work, with the only issue being that the ui components are not rendering
-
One site's ad page won't display
One site's home page displays fine but the ad page doesn't. Tried IE and ad page displayed
-
LowMemory errors log on IPAD 1 16GB wi-fi
Hi Can you please tell me what is these errrors and how to go about solve it.. Thanks. Incident Identifier: 80767AE3-47C1-459F-9B8A-2DFECE8FDC10 CrashReporter Key: db10477f0828781b046811f8f117ecfc245a71f8 Hardware Model: iPad1,1 OS Version: