How do I modify invoice request xml file by adding posting date?
Hi,
We import customer invoice requests via xml files from an external data source. Currently the standard SAP xml file does not include the posting date, and invoices enter SAP with a blank posting date. When the invoice is released, the posting date is taken from the invoice date.
Due to our month end processes, we have hundreds of invoice requests every month where we do not want posting date to equal the invoice date, and for each of those invoices the posting date is manually entered one invoice at a time during the release process. This is very time consuming.
We would like to build functionality in our external system to create the posting date at the xml file generation stage. Could anyone let us know the following:
- what is the name of the posting date field on invoice requests (invoice documents)?
- where would we place the additional script in the xml file?
I'm attaching one of our current xml files (which already contains one section that has been customized)
Your suggestions would be appreciated.
Thanks,
Kerstin
Kerstin,
The closest i could find in the WSDL of the Manage Invoice Request Web Service that handles this integration is "<ProposedInvoiceDate>" or possibly even "<ProposedDeviatingPostingdate>", both of which sit directly under the <CustomerInvoiceRequest> element.
For more information, go to the Service Explorer, find the ManageInvoiceRequestsIn Web Service, download the WSDL, and open it in SOAP-UI or something similar. This way you can see all the fields that you can write to, which is where i found these two elements.
Similar Messages
-
How to view AR dunning letter XML file (raw data)?
Hi,
Can anybody tell how to view AR dunning letter XML file (raw data) as I like to modified the dunning letter and like to know which fields I can add to our dunning letter layout. thanks.Hi
These are the steps you need to do to get the output in XML Raw format.
Step 1
1- Go to System Administrator -> Concurrent -> Program - Define
2- Query the Dunning Letter Print
3- Set the format output as XML
Step 2
1- Ftp Oracle E-business suite Server
2- Get the file ARDLP.rdf from $AR_TOP/reports
3- Open the report using Oracle Reports
4- Change the output to XML.
ARDLP.rdf is a report provided by Oracle Corporation so it is a good idea to make a backup of the same,
before making any changes. Hope this will help.
Regards
Ali -
How do you modify the web.xml to lock down the pages from a user role
how do you modify the web.xml to lock down the pages from a user role
I'll make a stab at your question:
The following is an example of where a URL is protected within a web.xml deployment descriptor. In this example, the URL /protectedA within the application is protected:
<!-- security constraints -->
<security-constraint>
<web-resource-collection>
<web-resource-name>protectedA</web-resource-name>
<url-pattern>/protectedA</url-pattern>
</web-resource-collection>
<!-- authorization -->
<auth-constraint>
<role-name>sr_developer</role-name>
</auth-constraint>
</security-constraint>
Sun's explaination here:
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/Security4.html -
Customer Invoice Request XML Specification
Hi All,
I've been searching my butt off looking for the customer invoice request XML spec.
Where is it?
JudsonMinimal Request:
<?xml version="1.0" encoding="utf-8"?>
<CustomerInvoiceRequestRequest>
<MessageHeader>
<CreationDateTime />
</MessageHeader>
<CustomerInvoiceRequest actionCode="04" reconciliationPeriodCounterValue="1">
<BaseBusinessTransactionDocumentID>V00064348</BaseBusinessTransactionDocumentID>
<BaseBusinessTransactionDocumentTypeCode>29</BaseBusinessTransactionDocumentTypeCode>
<ProposedInvoiceDate>2012-05-07</ProposedInvoiceDate>
<name>Extreme Reach - DEV</name>
<ReferenceBusinessTransactionDocumentID>V00064348</ReferenceBusinessTransactionDocumentID>
<BusinessProcessVariantType>
<BusinessProcessVariantTypeCode>1</BusinessProcessVariantTypeCode>
<MainIndicator>true</MainIndicator>
</BusinessProcessVariantType>
<BusinessProcessVariantType>
<BusinessProcessVariantTypeCode>319</BusinessProcessVariantTypeCode>
<MainIndicator>false</MainIndicator>
</BusinessProcessVariantType>
<BuyerParty>
<InternalID>2113</InternalID>
</BuyerParty>
<EmployeeResponsibleParty>
<InternalID>8000000017</InternalID>
</EmployeeResponsibleParty>
<SalesUnitParty>
<InternalID>TV3003</InternalID>
</SalesUnitParty>
<SalesAndServiceBusinessArea>
<DistributionChannelCode>01</DistributionChannelCode>
</SalesAndServiceBusinessArea>
<PricingTerms>
<PricingProcedureCode listID="2">PPSTD1</PricingProcedureCode>
<CurrencyCode>USD</CurrencyCode>
</PricingTerms>
<Item actionCode="04">
<BaseBusinessTransactionDocumentItemID>10</BaseBusinessTransactionDocumentItemID>
<BaseBusinessTransactionDocumentItemTypeCode>002</BaseBusinessTransactionDocumentItemTypeCode>
<SettlementRelevanceIndicator>true</SettlementRelevanceIndicator>
<BaseItemCancelledIndicator>false</BaseItemCancelledIndicator> <ReceivablesPropertyMovementDirectionCode>2</ReceivablesPropertyMovementDirectionCode>
<Product>
<InternalID>V-SD-NEXTDAY-STN-ONLINE-FIRST</InternalID>
<TypeCode>2</TypeCode>
</Product>
<CashDiscountDeductibleIndicator>false</CashDiscountDeductibleIndicator>
<Quantity unitCode="EA">1</Quantity>
<QuantityTypeCode>EA</QuantityTypeCode>
<PriceAndTax>
<PriceComponent>
<TypeCode listID="2">7PR1</TypeCode>
<CategoryCode>1</CategoryCode>
<PurposeCode>1000</PurposeCode>
<MajorLevelOrdinalNumberValue>10</MajorLevelOrdinalNumberValue>
<MinorLevelOrdinalNumberValue>1</MinorLevelOrdinalNumberValue>
<Rate>
<DecimalValue>2.0000</DecimalValue>
<CurrencyCode>USD</CurrencyCode>
<BaseDecimalValue>1</BaseDecimalValue>
<BaseMeasureUnitCode>EA</BaseMeasureUnitCode>
</Rate>
<RateBaseQuantityTypeCode>EA</RateBaseQuantityTypeCode>
<CalculationBasis>
<BaseCode>3</BaseCode>
<Quantity unitCode="EA">1</Quantity>
<QuantityTypeCode>EA</QuantityTypeCode>
<Amount currencyCode="USD">0</Amount>
</CalculationBasis>
<CalculatedAmount currencyCode="" />
<RoundingDifferenceAmount currencyCode="" />
<EffectiveIndicator>true</EffectiveIndicator>
<ManuallyChangedIndicator>true</ManuallyChangedIndicator>
<GroupedIndicator />
<OriginCode>2</OriginCode>
<PriceSpecificationUUID />
<PriceSpecificationDeterminationTimePoint>
<TypeCode>1</TypeCode>
<Date>2012-05-07</Date>
</PriceSpecificationDeterminationTimePoint>
</PriceComponent>
</PriceAndTax>
<AccountingCodingBlockAssignment> <AccountingCodingBlock>A1520<GeneralLedgerAccountAliasCode>Z0003</GeneralLedgerAccountAliasCode></AccountingCodingBlock>
</AccountingCodingBlockAssignment>
</Item>
</CustomerInvoiceRequest>
</CustomerInvoiceRequestRequest> -
How can we get tag of XML file using SAX
Hi ,
I'm parsing one SAX parser , I'have almost done this parsing. i have faced problem for one case, i'e how can we get tag from XML file using SAX parser?
XML file is
<DFProperties>
<AccessType>
<Get/>
</AccessType> <Description>
gdhhd
</Description>
<DFFormat>
<chr/>
</DFFormat>
<Scope>
<Permanent/>
</Scope>
<DFTitle>gsgd</DFTitle>
<DFType>
<MIME>text/plain</MIME>
</DFType>
</DFProperties>
I want out like GET and Permanent... means this one tag which is present inside of another tag.
Handler class like
public void startElement(String namespaceURI, String localName,
String qName, Attributes atts) throws SAXException {
if(_ACCESSTYPE.equals(localName)){
accessTypeElement=ACCESSTYPE;
public void characters(char[] ch, int start, int length)
throws SAXException {
if (_ACCESSTYPE.equals(_accessTypeElement)) {
String strValue = new String(ch, start, length);
System.out.println("Accestype-----------------------------> " + strValue);
//System.out.println(" " + strValue);
public void endElement(String namespaceURI, String localName, String qName)
throws SAXException {
if (_ACCESSTYPE.equals(localName)) {
_accessTypeElement = "";
. please any body help meHi ,
I have one problem,Please help me.
1. How can I'll identify where exactly my Node is ended,means how how can we find corresponding nodename? in partcular place
<Node> .............starttag1
<NodeName>Test</NodeName>
<Node>................starttag2
<nodeName>test1</NodeName>
</Node>..................endtag2
<Node>.....................starttag3
<NodeName><NodeName>
<Node> .........................starttag4
<NodeName>test4</NodeName>
</Node>.......enddtag4
</Node>...........end tag3
</Node>............endtag1
my code is below
private final String _NODENAME = "NodeName";
private final String _NODE = "Node";
private String _nodeElement = "";
private String _NodeNameElement = "";
public void startElement(String namespaceURI, String localName,
String qName, Attributes atts) throws SAXException {
if (_NODENAME.equals(localName)) {
NodeNameElement = NODENAME;
if(_NODE.equals(localName)){
System.out.println("start");
if (_NODENAME.equals(localName)) {
NodeNameElement = NODENAME;
public void characters(char[] ch, int start, int length)
throws SAXException {
if (_NODENAME.equals(_NodeNameElement)) {
String strValue = new String(ch, start, length);
String sttt=strValue;
System.out.println("NODENAME: ************* " + strValue);
if(_NODE.equals(_nodeElement)){
if (_NODENAME.equals(_NodeNameElement)) {
String strValue = new String(ch, start, length);
String sttt=strValue;
System.out.println("nodevalue********** " + strValue);
public void endElement(String namespaceURI, String localName, String qName)
throws SAXException {
if (_NODENAME.equals(localName)) {
_NodeNameElement = "";
if(_NODE.equals(localName)){
System.out.println("NODENAME: %%%%%%%%%");
please help me. How can I figure node ending for particular nodename -
How to convert DOM Tree in XML File
Hi there,
I am successful to build a DOM tree in memory where i am adding elements. Now after all this i want to make a XML file of that DOM representation. Now, i am confused with my code that how to transfer DOM structure to xml file ? A small code is attached herewith ?
doc = db.newDocument();
doc.normalizeDocument();
doc.setXmlVersion("1.0");
doc.createComment("Created By: Sachin Kulkarni");
Element rn = doc.createElement("RootNode");
Element n1 = doc.createElement("A1");
((Node)n1).setNodeValue("Element A1");
Element n11 = doc.createElement("A11");
((Node)n11).setNodeValue("Element A11");
Element n12 = doc.createElement("A12");
((Node)n12).setNodeValue("Element A12");
((Node)n1).appendChild( ((Node)n11) );
((Node)n1).appendChild( ((Node)n12) );
Element n2 = doc.createElement("A2");
((Node)n2).setNodeValue("Element A2");
Element n3 = doc.createElement("A3");
((Node)n3).setNodeValue("Element A3");
((Node)rn).appendChild( ((Node)n1) );
((Node)rn).appendChild( ((Node)n2) );
((Node)rn).appendChild( ((Node)n3) );
//creating the xml file
Source source = new DOMSource((Element) doc.getElementsByTagName("RootNode").item(0));
StringWriter out = new StringWriter();
StreamResult result = new StreamResult(out);
Transformer transformer = TransformerFactory.newInstance().newTransformer();
transformer.setOutputProperty("encoding", "iso-8859-1");
transformer.setOutputProperty("indent", "yes");
//transformer.setOutputProperty("test.xml","1");
//transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
transformer.transform(source,result);
result.getWriter().toString();
==================
Is it any problem with the implementation ? How to use fileoutputstream with this ?I have done like this:
DocumentBuilderFactory docBuildFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = docBuildFactory.newDocumentBuilder();
Document doc = builder.newDocument();
Element root = (Element)doc.createElement("Root");
doc.appendChild(root);
Element address = (Element)doc.createElement("Address");
address.appendChild((Element)doc.createElement("Street"));
address.appendChild((Element)doc.createElement("PostCode"));
address.appendChild((Element)doc.createElement("Town"));
Element country = (Element)doc.createElement("Country");
country.setAttribute("type","EU");
Text cname = doc.createTextNode("Spain");
country.appendChild(cname);
address.appendChild(country);
root.appendChild(address);
TransformerFactory tranFactory = TransformerFactory.newInstance();
Transformer aTransformer = tranFactory.newTransformer();
aTransformer.setOutputProperty(OutputKeys.INDENT, "yes");
Source src = new DOMSource(doc);
Result dest = new StreamResult(new FileOutputStream(new File("test.xml")));
aTransformer.transform(src, dest); -
How to create Inbound Idoc from XML file-Need help urgently
Hi,
can any one tell how to create inbound Idoc from XML file.
we have xml file in application server Ex. /usr/INT/SMS/PAYTEXT.xml' we want to generate inbound idoc from this file.we are successfully able to generate outbound XML file from outbound Idoc by using the XML port. But not able to generate idoc from XML file by using we19 or we16.
Please let me know the process to trigger inbound Idoc with out using XI and any other components.
Thanks in advance
Dora ReddyHi .. Did either of you get a result on this?
My question is the same really .. I am testing with WE19 and it seems SAP cannot accept an XML inbound file as standard.
I see lots of mention of using a Function Module.
Am I correct in saying therefore that ABAP development is required to create a program to run the FM and process the idoc?
Or is there something tht can be done with Standard SAP?
Thanks
Lee -
How to read XML file and update the data in MS CRM 2011?
Hi Folks,
Can anyone please help me finding some references to read XML files and push the data to MS CRM 2011 preferably by using a console application.
Please let me know if any ways of handling it in simple ways.
Thanks,
SriHI,
How to read XML file:
https://social.msdn.microsoft.com/Forums/en-US/5dd7261b-86c4-4ca8-ba87-95196ef3ba50/need-to-display-xml-file-in-textboxes-edit-the-data-and-save-the-new-xml-file?forum=csharpgeneral
How to work with CRM:
ClientCredentials credentials = new ClientCredentials();
credentials.Windows.ClientCredential = new System.Net.NetworkCredential("USER", "Password", "Domain");
Uri uri = new Uri("http://server/Organization/XRMServices/2011/Organization.svc");
OrganizationServiceProxy proxy = new OrganizationServiceProxy(uri, null, credentials, null);
proxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior());
IOrganizationService service = (IOrganizationService)proxy;
//using "service" you can create, update and retrieve entities.
More information here about service functions:
https://msdn.microsoft.com/en-us/library/gg328198.aspx -
How to check the element in xml file by xpath
hi all,
* How to check the element in xml file by xpath
for the following XML file,
* I want to check whether
the element (sage) is present or not in the following xml file XPATH expression...
* I have tried by the following expression ,
NodeList result = (NodeList) xpath.evaluate("//*:student/*:sage/text()",xml_dom,XPathConstants.STRING);
System.out.println(result.item(0).getLocalName()); * I want to get the Element sage as String value....
but i am not able to get the element,why that ??? and How to do that ???
MyXML File :
<x:student>
<x:sname>aaa</x:sname>
<x:sage>26</x:sage>
</x:student>
Thanks,
JavaImran<code>* Thanks for reply....
* </code><code>In </code>
<code>x:student element x represents the namespace...thats why i put *:student in my expression....
"//*[local-name() = 'student']/*[local-name() = 'sage']/text()"* By the above code , i am not able to get the sage as string from
</code> resul.item(0).getLocalName() method.......?
* How to get that as string format ? -
My "itunes library" folder is empty. My libray music (prior to upgrading itunes) is now in an .xml file in my itunes location under my music. How do I extract/convert this .xml file to a Itunes database and restore my Itunes music library??? Thanks, Tom
Empty/corrupt library after upgrade/crash
Hopefully it's not been too long since you last upgraded iTunes, in fact if you get an empty/incomplete library immediately after upgrading then with the following steps you shouldn't lose a thing or need to do any further housekeeping. In the Previous iTunes Libraries folder should be a number of dated iTunes Library files. Take the most recent of these and copy it into the iTunes folder. Rename iTunes Library.itl as iTunes Library (Corrupt).itl and then rename the restored file as iTunes Library.itl. Start iTunes. Should all be good, bar any recent additions to or deletions from your library.
See iTunes Folder Watch for a tool to catch up with any changes since the backup file was created.
When you get it all working make a backup!
tt2 -
How to convert database table into xml file
Hi.
How to convert database table into XML file in Oracle HTML DB.
Please let me know.
Thanks.This not really a specific APEX question... but I search the database forum and found this thread which I think will help
Exporting Oracle table to XML
If it does not I suggest looking at the database forum or have a look at this document on using the XML toolkit
http://download-east.oracle.com/docs/html/B12146_01/c_xml.htm
Hope this helps
Chris -
How to save infopath form in XML file
How to save InfoPath form in XML file.
I want every new record in InfoPath form save in XML file and also retrieve these records from XML like databasesHi,
Based on your description, my understanding is that you want to save InfoPath form in XML file.
I have done a test in my SharePoint, Do the following steps:
Create an form library and publish an InfoPath form into it, Then when we create new document into the form library, it is by default that InfoPath form is saved in XML file.
Best Regards,
Lisa Chen
Lisa Chen
TechNet Community Support -
Problem of modifying dp-providers.xml file
did it must run "dpadmin list" command first before run "dpadmin modify" command on the modified dp-providers.xml file(or other xml files)?
I run "dpadmin list" command first,then edit the xml file and run "dpadmin modify" command .now,the demo portal can't display conrrectly.why?
Thans for your helpset logging to message in the
AMConfig.properties. Then take a look at the debug logs in /var/opt/SUNWam/debug/desktop.debug
that should give you information on whats going on ..
alternatively you can also paste the logs here .. -
Problem converting data in XML file to internal table data
Hi all,
I have a requirement. I need to convert an XML file to internal table data and based on that data do Goods Receipt in SAP.
With the help of this blog /people/r.eijpe/blog/2005/11/10/xml-dom-processing-in-abap-part-i--convert-an-abap-table-into-xml-file-using-sap-dom-approach
I am able to convert the XML file to data in SAP. But this blog will display the output on screen as ELELEMNT = nodename VALUE= value of that node.
But I donu2019t want in that way, I want to store all the data in XML file in an internal table so that I can make use of those values and do Goods Recipt in SAP.
Can some one suggest how should I read the data in an internal table.
Here is my code..what changes should I make?
*& Report z_xit_xml_check
REPORT z_xit_xml_check.
TYPE-POOLS: ixml.
TYPES: BEGIN OF t_xml_line,
data(256) TYPE x,
END OF t_xml_line.
DATA: l_ixml TYPE REF TO if_ixml,
l_streamfactory TYPE REF TO if_ixml_stream_factory,
l_parser TYPE REF TO if_ixml_parser,
l_istream TYPE REF TO if_ixml_istream,
l_document TYPE REF TO if_ixml_document,
l_node TYPE REF TO if_ixml_node,
l_xmldata TYPE string.
DATA: l_elem TYPE REF TO if_ixml_element,
l_root_node TYPE REF TO if_ixml_node,
l_next_node TYPE REF TO if_ixml_node,
l_name TYPE string,
l_iterator TYPE REF TO if_ixml_node_iterator.
DATA: l_xml_table TYPE TABLE OF t_xml_line,
l_xml_line TYPE t_xml_line,
l_xml_table_size TYPE i.
DATA: l_filename TYPE string.
PARAMETERS: pa_file TYPE char1024 DEFAULT 'c:\temp\orders_dtd.xml'.
Validation of XML file: Only DTD included in xml document is supported
PARAMETERS: pa_val TYPE char1 AS CHECKBOX.
START-OF-SELECTION.
Creating the main iXML factory
l_ixml = cl_ixml=>create( ).
Creating a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
PERFORM get_xml_table CHANGING l_xml_table_size l_xml_table.
wrap the table containing the file into a stream
l_istream = l_streamfactory->create_istream_itable( table = l_xml_table
size = l_xml_table_size ).
Creating a document
l_document = l_ixml->create_document( ).
Create a Parser
l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
istream = l_istream
document = l_document ).
Validate a document
IF pa_val EQ 'X'.
l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
ENDIF.
Parse the stream
IF l_parser->parse( ) NE 0.
IF l_parser->num_errors( ) NE 0.
DATA: parseerror TYPE REF TO if_ixml_parse_error,
str TYPE string,
i TYPE i,
count TYPE i,
index TYPE i.
count = l_parser->num_errors( ).
WRITE: count, ' parse errors have occured:'.
index = 0.
WHILE index < count.
parseerror = l_parser->get_error( index = index ).
i = parseerror->get_line( ).
WRITE: 'line: ', i.
i = parseerror->get_column( ).
WRITE: 'column: ', i.
str = parseerror->get_reason( ).
WRITE: str.
index = index + 1.
ENDWHILE.
ENDIF.
ENDIF.
Process the document
IF l_parser->is_dom_generating( ) EQ 'X'.
PERFORM process_dom USING l_document.
ENDIF.
*& Form get_xml_table
FORM get_xml_table CHANGING l_xml_table_size TYPE i
l_xml_table TYPE STANDARD TABLE.
Local variable declaration
DATA: l_len TYPE i,
l_len2 TYPE i,
l_tab TYPE tsfixml,
l_content TYPE string,
l_str1 TYPE string,
c_conv TYPE REF TO cl_abap_conv_in_ce,
l_itab TYPE TABLE OF string.
l_filename = pa_file.
upload a file from the client's workstation
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = l_filename
filetype = 'BIN'
IMPORTING
filelength = l_xml_table_size
CHANGING
data_tab = l_xml_table
EXCEPTIONS
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Writing the XML document to the screen
CLEAR l_str1.
LOOP AT l_xml_table INTO l_xml_line.
c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data replacement = space ).
c_conv->read( IMPORTING data = l_content len = l_len ).
CONCATENATE l_str1 l_content INTO l_str1.
ENDLOOP.
l_str1 = l_str1+0(l_xml_table_size).
SPLIT l_str1 AT cl_abap_char_utilities=>cr_lf INTO TABLE l_itab.
WRITE: /.
WRITE: /' XML File'.
WRITE: /.
LOOP AT l_itab INTO l_str1.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab IN
l_str1 WITH space.
WRITE: / l_str1.
ENDLOOP.
WRITE: /.
ENDFORM. "get_xml_table
*& Form process_dom
FORM process_dom USING document TYPE REF TO if_ixml_document.
DATA: node TYPE REF TO if_ixml_node,
iterator TYPE REF TO if_ixml_node_iterator,
nodemap TYPE REF TO if_ixml_named_node_map,
attr TYPE REF TO if_ixml_node,
name TYPE string,
prefix TYPE string,
value TYPE string,
indent TYPE i,
count TYPE i,
index TYPE i.
node ?= document.
CHECK NOT node IS INITIAL.
ULINE.
WRITE: /.
WRITE: /' DOM-TREE'.
WRITE: /.
IF node IS INITIAL. EXIT. ENDIF.
create a node iterator
iterator = node->create_iterator( ).
get current node
node = iterator->get_next( ).
loop over all nodes
WHILE NOT node IS INITIAL.
indent = node->get_height( ) * 2.
indent = indent + 20.
CASE node->get_type( ).
WHEN if_ixml_node=>co_node_element.
element node
name = node->get_name( ).
nodemap = node->get_attributes( ).
WRITE: / 'ELEMENT :'.
WRITE: AT indent name COLOR COL_POSITIVE INVERSE.
IF NOT nodemap IS INITIAL.
attributes
count = nodemap->get_length( ).
DO count TIMES.
index = sy-index - 1.
attr = nodemap->get_item( index ).
name = attr->get_name( ).
prefix = attr->get_namespace_prefix( ).
value = attr->get_value( ).
WRITE: / 'ATTRIBUTE:'.
WRITE: AT indent name COLOR COL_HEADING INVERSE, '=',
value COLOR COL_TOTAL INVERSE.
ENDDO.
ENDIF.
WHEN if_ixml_node=>co_node_text OR
if_ixml_node=>co_node_cdata_section.
text node
value = node->get_value( ).
WRITE: / 'VALUE :'.
WRITE: AT indent value COLOR COL_GROUP INVERSE.
ENDCASE.
advance to next node
node = iterator->get_next( ).
ENDWHILE.
ENDFORM. "process_dom
Any help would be highly apperciated.
regards,
Jessica SamPavel Vera,
With your example i tries doing the following .....
I tried to convert the data of XML file to internal table data. I am collecting the data in internal table to do goos recipt with that data.
Please find my XML file, ABAP pgm and XSLT pgm . I donu2019t know what I am missing I am not getting any output. I donu2019t know what is wrong please help me with this
Below is my XML file, My code and XSLT Program. In the below XML file I need to collect Vendor Number, Order Number, and Date tags which occur only once for one XML file.
I also need to collect the following tags from <Shipmentdetail>
<Shipmentdetail> has following child nodes and I need to collect them
TrackingNumber
Freight
Weight
ShipmentDate
ShipmentMethod
Need to collect to collect the following tags from <ProductInformation>
<ProductInformation> has following child nodes and I need to collect them
LineNumber
SKUNumber
OrderedQuantity
ShippedQuantity
UOM
The <Shipmentdetail> and <ProductInformation> are child nodes of <OrderShipment>
The <Shipmentdetail> occurs only ones but the <ProductInformation> can occur once or many times and will be dynamic and differs depening on the input file.
My XML file is as follows
<?xml version="1.0" encoding="iso-8859-1" ?>
- <ShipmentHeader>
<AccountID />
- <OrderShipment>
<VendorNumber>1000</VendorNumber>
<OrderNumber>P00009238</OrderNumber>
<OrderType>Stock</OrderType>
<Company />
<Division />
<Department />
<Date>20061120</Date>
<CartonCount>2</CartonCount>
<ShipAllProducts>No</ShipAllProducts>
- <ShipmentDetail>
<TrackingNumber>1ZR3W891PG47477811</TrackingNumber>
<Freight>000000010000</Freight>
<ShipmentDate>20061120</ShipmentDate>
<ShipmentMethod>UPS1PS</ShipmentMethod>
</ShipmentDetail>
- <ProductInformation>
<LineNumber>000000001</LineNumber>
<SKUNumber>110FR</SKUNumber>
<AdvSKUNumber>003 4518</AdvSKUNumber>
<SKUID />
<OrderedQuantity>00000001000000</OrderedQuantity>
<ShippedQuantity>00000001000000</ShippedQuantity>
<UOM>EA</UOM>
<Factor>1</Factor>
</ProductInformation>
- <ProductInformation>
<LineNumber>000000002</LineNumber>
<SKUNumber>938EN</SKUNumber>
<AdvSKUNumber>001 7294</AdvSKUNumber>
<SKUID />
<OrderedQuantity>00000000450000</OrderedQuantity>
<ShippedQuantity>00000000450000</ShippedQuantity>
<UOM>EA</UOM>
<Factor>1</Factor>
</ProductInformation>
- <CaseInformation>
<LineNumber>000000001</LineNumber>
<SKUNumber>110FR</SKUNumber>
<AdvSKUNumber>003 4518</AdvSKUNumber>
<SKUID />
<SSCCNumber>00000001668000002487</SSCCNumber>
<CaseQuantity>00000001000000</CaseQuantity>
<UOM>EA</UOM>
<Factor>1</Factor>
</CaseInformation>
<CaseInformation>
<LineNumber>000000001</LineNumber>
<SKUNumber>110FR</SKUNumber>
<AdvSKUNumber>003 4518</AdvSKUNumber>
<SKUID />
<SSCCNumber>00000001668000002487</SSCCNumber>
<CaseQuantity>00000001000000</CaseQuantity>
<UOM>EA</UOM>
<Factor>1</Factor>
</CaseInformation>
- </OrderShipment>
</ShipmentHeader>
My Program
TYPE-POOLS abap.
CONSTANTS gs_file TYPE string VALUE 'C:\temp\test.xml'.
* This is the structure for the data from the XML file
TYPES: BEGIN OF ts_shipment,
VendorNumber(10) TYPE n,
OrderNumber(20) TYPE n,
OrderType(8) TYPE c,
Date(8) TYPE c,
END OF ts_shipment.
TYPES: BEGIN OF ts_shipmentdetail,
TrackingNumber(30) TYPE n,
Freight(12) TYPE n,
Weight(14) TYPE n,
ShipmentDate(8) TYPE c,
ShipmentMethod(8) TYPE c,
END OF ts_shipmentdetail.
TYPES: BEGIN OF ts_productinformation,
LineNumber(9) TYPE n,
SKUNumber(20) TYPE c,
OrderedQuantity(14) TYPE n,
ShippedQuantity(14) TYPE n,
UOM(4) TYPE c,
END OF ts_productinformation.
* Table for the XML content
DATA: gt_itab TYPE STANDARD TABLE OF char2048.
* Table and work ares for the data from the XML file
DATA: gt_shipment TYPE STANDARD TABLE OF ts_shipment,
gs_shipment TYPE ts_shipment.
DATA: gt_shipmentdetail TYPE STANDARD TABLE OF ts_shipmentdetail,
gs_shipmentdetail TYPE ts_shipmentdetail.
DATA: gt_productinformation TYPE STANDARD TABLE OF ts_productinformation,
gs_productinformation TYPE ts_productinformation.
* Result table that contains references
* of the internal tables to be filled
DATA: gt_result_xml TYPE abap_trans_resbind_tab,
gs_result_xml TYPE abap_trans_resbind.
* For error handling
DATA: gs_rif_ex TYPE REF TO cx_root,
gs_var_text TYPE string.
* Get the XML file from your client
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = gs_file
CHANGING
data_tab = gt_itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "ISHIPMENT".
GET REFERENCE OF gt_shipment INTO gs_result_xml-value.
gs_result_xml-name = 'ISHIPMENT'.
APPEND gs_result_xml TO gt_result_xml.
* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "ISHIPDET".
GET REFERENCE OF gt_shipmentdetail INTO gs_result_xml-value.
gs_result_xml-name = 'ISHIPDET'.
APPEND gs_result_xml TO gt_result_xml.
* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "IPRODDET".
GET REFERENCE OF gt_productinformation INTO gs_result_xml-value.
gs_result_xml-name = 'IPRODDET'.
APPEND gs_result_xml TO gt_result_xml.
* Perform the XSLT stylesheet
TRY.
CALL TRANSFORMATION z_xml_to_abap3
SOURCE XML gt_itab
RESULT (gt_result_xml).
CATCH cx_root INTO gs_rif_ex.
gs_var_text = gs_rif_ex->get_text( ).
MESSAGE gs_var_text TYPE 'E'.
ENDTRY.
* Writing the data from file for gt_shipment
*Collecting the Shipping Data from the XML file to internal table gt_shipment
*and writing the data to the screen
LOOP AT gt_shipment INTO gs_shipment.
WRITE: / 'VendorNumber:', gs_shipment-VendorNumber.
WRITE: / 'OrderNumber :', gs_shipment-OrderNumber.
WRITE: / 'OrderType :', gs_shipment-OrderType.
WRITE: / 'Date :', gs_shipment-Date.
WRITE : /.
ENDLOOP. "gt_shipment.
LOOP AT gt_shipmentdetail INTO gs_shipmentdetail.
WRITE: / 'TrackingNumber:', gs_shipmentdetail-TrackingNumber.
WRITE: / 'Freight :', gs_shipmentdetail-Freight.
WRITE: / 'Weight :', gs_shipmentdetail-Weight.
WRITE: / 'ShipmentDate :', gs_shipmentdetail-ShipmentDate.
* WRITE: / 'ShipmentMethod :' gs_shipmentdetail-ShipmentMethod
WRITE : /.
ENDLOOP. "gt_shipmentdetail.
LOOP AT gt_productinformation INTO gs_productinformation.
WRITE: / 'LineNumber:', gs_productinformation-LineNumber.
WRITE: / 'SKUNumber :', gs_productinformation-SKUNumber.
WRITE: / 'OrderedQuantity :', gs_productinformation-OrderedQuantity.
WRITE: / 'ShippedQuantity :', gs_productinformation-ShippedQuantity.
WRITE: / 'UOM :', gs_productinformation-UOM.
WRITE : /.
ENDLOOP. "gt_productinformation.
XSLT Program
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<ISHIPMENT>
<xsl:apply-templates select="//OrderShipment"/>
</ISHIPMENT>
</asx:values>
</asx:abap>
</xsl:template>
<xsl:template match="OrderShipment">
<item>
<VENDORNUMBER>
<xsl:value-of select="VendorNumber"/>
</VENDORNUMBER>
<ORDERNUMBER>
<xsl:value-of select="OrderNumber"/>
</ORDERNUMBER>
<ORDERTYPE>
<xsl:value-of select="OrderType"/>
</ORDERTYPE>
<DATE>
<xsl:value-of select="Date"/>
</DATE>
</item>
</xsl:template>
<xsl:template match="/">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<ISHIPDET>
<xsl:apply-templates select="//OrderShipment/ShipmentDetail"/>
</ISHIPDET>
</asx:values>
</asx:abap>
</xsl:template>
<xsl:template match="ShipmentDetail">
<item>
<TRACKINGNUMBER>
<xsl:value-of select="TrackingNumber"/>
</TRACKINGNUMBER>
<FREIGHT>
<xsl:value-of select="Freight"/>
</FREIGHT>
<SHIPMENTDATE>
<xsl:value-of select="ShipmentDate"/>
</SHIPMENTDATE>
<SHIPMENTMETHOD>
<xsl:value-of select="ShipmentMethod"/>
</SHIPMENTMETHOD>
</item>
</xsl:template>
</xsl:transform> .
Any help is highly appreciated. If anyone encountered this situation before please let me know where i am going wrong in my XSLT transformation.
Any Help will be highly apppreciated. Thanks in advance
Regards,
Jessica Sam -
Hi ,
We have a catalog that defines 2 types of products (they have too many different properties), so wanted to keep them on two different MDEX engines and serve the applications requests. Here DB catalog and front end ATG application is same for both the MDEX instances.
Is it possible to have 2 different output config XML files and index the data into 2 endeca apps using the same indexing component ProductCatalogSimpleIndexingAdmin?
Thanks
DevHi, also have had some problem some monthes ago - I created separete component ProductCatalogSimpleIndexingAdminSecond. After that one of my colleage gave me some advice:
The creating separate component like ProductCatalogSimpleIndexingAdmin for the second IOC is possible way for resolving your situation. But I afraid that this way will be required creating mane duplicates for already existed components.
In my opinion the better way is the following:
starting from AssemblerApplicationConfiguration and ApplicationConfiguration component. It contains details for connecting between ATG and Endeca. Of course you should configure different components for different Endeca Apps.
After that:
Find all components that uses AssemblerApplicationConfiguration and ApplicationConfiguration. Customize these components for using one or another *Configuration component depending on what index works. (many variants released it: the most simple global custom component with flag.)
Then customize the existed ProductCatalogSimpleIndexingAdmin. Using one or another IOC and setting the flag in global custom component when index started. You can add some methods into your custom ProductCatalogSimpleIndexingAdmin like:
Execute baseline index for both IOC (one by one)
Execute baseline for IOC 1
Execute baseline for IOC 2.
Note: you should be afraid about incremental (partial) index in this configuration. But resolving conflicts in incremental index should be done after full implementation these changes.
Regards
Maybe you are looking for
-
Delete overlapping requests in Cube
Dear all, I need delete the requests uploaded in the previous day when transferring new request into Cube,and the system is BW 7.0,but I use 3.5 data source and infoSource. The issue is that when I
-
Have Pavillion dv7-4177nr laptop. It says I can stream from it to my TV. with TV adaptor and HDMI. I have HDMI hooked ot TV from cable box. What does TV adaptor look like and can you help on how to hook everything up? Thanks
-
Alternate methods of Payment other than credit cards?
To whom this may concern, I was on the iTunes store recently, and I came across the "free" download single of the week. Well I clicked the link, and it said you need to login. So I logged in, and it said that I needed to review my account information
-
Extended IDOC shipment SHPMNT02
How Should i fill the data to newly Created Segment having one filed bedau for Parent segment E1EDL24 for Extended IDOC of basic IDOC SHPMNT02
-
Mac laptop screen going to sleep and changing desktop background
last weekend my daughter called to say that her Macbook was acting strange. On Friday night she saw the battery icon said 25%, so she shut the system down. The next morning she plugged it in and booted. It took a while and the desktop background had