Our etext output needs a combination of XML tags from multiple levels

Our etext output needs a combination of XML tags from multiple levels. Each unique combination of <OutboundPayment>/<Payee>/<SupplierNumber> and <OutboundPayment>/<DocumentPayable>/<ReferenceNumber> needs to be on a unique line. That means we need to combine information from different levels into a single e-text line before there is an end of record.
Right now, it pulls the supplier number for the first invoice and matches it up to the proper line, but each line after that just repeats the supplier number it pulled the first time and uses that on each line matched to the different invoices instead of looping back and picking up the correct supplier associated with each invoice in the Format Payments Instructions.
I have Oracle Support trying to resolve this in an SR, but so far they have made no progress. Has anyone else done this before? What command do I need to use to combine these two levels into one line of output.
If I create a header line just above the detail line just for the supplier number it gives me exactly what I need, but on two lines in the etext output. I need it all on a single line.
Thanks.

If anyone needs the solution, I finally have it:
I created a level for grouping criteria as PaymentReferenceNumber/Payee/Address/AddressName, DocumentInternalIDSegment2, called InvoiceDetailLevel. The base level is OutboundPayment.
I then added a level (InvoiceDetailLevel) between OutboundPaymentInstruction and the DocumentPayable level.
Then in the syntax for the supplier number and the address I entered this in the Data column:
../../ OutboundPayment/Payee/SupplierNumber
and
../../ OutboundPayment/Payee/Address/AddressName
That did the trick and now it is working correctly on every line, looping back to get the proper information.

Similar Messages

  • Creating an XML file from multiple sql tables

    I have very little xml experience, but need to generate an xml file from multiple table. I know what the output needs to look like, but do not know how to setup the code. Any help would be appreciated.
    - <Practice SourceID="EPIC" ExternalPracticeID="PPAWB">
    - <Provider ExternalProviderID="TB2" FirstName="THOMAS G" LastName="BREWSTER">
    - <Patient ExternalPatientID="99999" OldExternalPatID="" FirstName="test" MiddleName="J" LastName="test" Gender="M" DateOfBirth="2005-08-12" SocSecNumber="000-00-0000" LanguageID="22" AddressOne="test" AddressTwo="" City="test" StateID="20" ZipCode="99999" DayPhone="" EveningPhone="207-999-9999" StatusID="">
    <Measure MeasureID="2" MeasureValue="5" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="2" MeasureValue="5" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="3" MeasureValue="1" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="3" MeasureValue="1" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="32" MeasureValue="3" MeasureDate="2008-10-24 13:51:00" />
    <Measure MeasureID="33" MeasureValue="1" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="33" MeasureValue="1" MeasureDate="2009-02-09 10:09:00" />
    <Measure MeasureID="4" MeasureValue="5" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="4" MeasureValue="5" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="40" MeasureValue="2008-10-24 13:43:00" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="40" MeasureValue="2008-10-24 14:23:00" MeasureDate="2008-10-24 14:23:00" />
    <Measure MeasureID="41" MeasureValue="2008-10-24 13:43:00" MeasureDate="2008-10-24 13:43:00" />
    <Measure MeasureID="41" MeasureValue="2008-10-24 13:51:00" MeasureDate="2008-10-24 13:51:00" />
    </Patient>
    </Provider>
    </Practice>

    You are interested in XMLElement and probably XMLAgg. Since you didn't list a version, I can't provide links to the corresponding documentation. I cringe at all the attributes on the Patient element as that info should really be elements.
    To create the Measure node, your overall SQL statement may look something like (not tested)
    SELECT XMLElement....
              XMLAgg(SELECT XMLElement
                       FROM measures_table
                      WHERE join condition to parent)
      FROM patient,
           provider,
           practice
    WHERE join conditionsFor additional help, please include your version (4 digits), some sample data, and what you have tried.

  • Remove XML tags from XML element in Oracle

    Hi,
    I have a requirement where I have to remove all the xml tags from xml element with banks, currently I'm using replace 4 times to replace all different types of xml tags, performance is really bad. is there any better option to remove xml tags from xml data leaving the actual data. please find the example data below.
    select
    TO_CLOB(REPLACE(REPLACE(REPLACE(REPLACE
    ('<Concatcolumn><ConcatGroupID>MyText Data goes here </ConcatGroupID><ConcatGroupID>Data agian</ConcatGroupID></Concatcolumn>','<ConcatGroupID>'),'<Concatcolumn>'),'</ConcatGroupID>',';'),';</Concatcolumn>')) AS Concatcolumn
    from dual
    **************Out put*************
    MyText Data goes here ;Data agian

    One way is to use xquery:
    SQL> with t as
    select xmltype('<Concatcolumn>
                          <ConcatGroupID>MyText Data goes here </ConcatGroupID><ConcatGroupID>Data agian</ConcatGroupID></Concatcolumn>'
       ) xml from dual
    select xmlquery('string-join(//text(), ";")' passing xml returning content).getclobval() xml from t
    XML                                                              
    MyText Data goes here ;Data agian                                
    1 row selected.

  • Need FM to read XML document from appliacation server.

    Hi all .
       I need a FM which can read the XML data from Apllication server into internal table.Example code will be very helpful.
    Kind Regards,
    sami.

    Check This code :
    ===============
    Local data delaration.
      DATA: v_string    TYPE  string.
    Opening the file from the given location.
      OPEN DATASET p_pathup FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc <> 0.
        MESSAGE i000 WITH text-018.
        LEAVE LIST-PROCESSING.
      ENDIF.
    File opened, Reading the contents and transfering to internal table.
      DO.
        READ DATASET p_pathup INTO v_string.
        IF sy-subrc = 0.
          SPLIT v_string AT c_sep
                         INTO w_upload-lifnr
                              w_upload-loevm_ven
                              w_upload-banksrec
                              w_upload-bankkrec
                              w_upload-banknrec
                              w_upload-loevm_rec
                              w_upload-waers
                              w_upload-bankssnd
                              w_upload-bankksnd
                              w_upload-loevm_snd
                              w_upload-chainno
                              w_upload-chainbankt
                              w_upload-chainbanks
                              w_upload-chainbankk
                              w_upload-chainbankn
                              w_upload-loevm_cor.
        ELSE.
          EXIT.
        ENDIF.
        APPEND w_upload TO i_upload.
        CLEAR: w_upload,
               v_string.
      ENDDO.
    Closing the file.
      CLOSE DATASET p_pathup.
    Let me know if you need any help on understanding the logic.
    Regards

  • Output to the printer printing xml tags with actual output

    Hi,
    we are calling fnd_request.submit_request with 'XDOREPPB' and assigning a printer to it.
    the output that is getting printed has both the xml tags and the actual output.
    anyone has any idea what might be the reason.
    Regards,

    Got the solution. These tags are getting generated from standard report and we can use <columnname>[1], <columnname>[2]... etc if there are multiple tags with same tag names.

  • ALE/IDOC to XML - Need to Change the xml tags

    Hi Experts,
    I am creating xml files from idocs via ALE and an XML Port and sending them to a third party system (no programming required, all standard functionality).  The field labels or tags within these xml files are automatically generated by SAP based on the idoc segment definitions.  Unfortunately, the receiving system cannot process these tags...they require very specific tag names. 
    Is there a way to interceed before the actual files are created and change these tag names?  If so, how? 
    Thanks very much for useful information!
    Deb

    Hi Rejoice S 
    see following blog define tyour scenario step wise step
    Collecting IDocs without using BPM
    if helfull give rewrad point
    thanks
    Amit Shivhare

  • Removing XML definition & XML tage from the XML message....

    Dear All,
    We are using PI 7.1 and implementing a scenario in which we need to send a signed payment message to our partner, our implemented scenario goes as follows:
    1) We are using SOAP without header to send the message.
    2) We are signing the payload using our own java code as UDF in graphical mapping.
    3) the main issue that we have is that in the final XML message which is being sent to our partnet, XMl definition and the topmode XML tage are again added to the signed message. Please see the following for reference:
    Source Message:
    We are using only I node in the graphical mapping and one UDF to sign in between the source and the target node. So after signingwe get the following in the target node:
    Signed Message
    0u201A#u0152# *u2020Hu2020÷ ### u201A#}0u201A#y###1#0 ##+######0u201A#h# *u2020Hu2020÷ ### u201A#Y#u201A#U
    u201A#ý0u201A#¸0u201A#  ######5gu0152yu2022ݬ½´b#¿#u2019 u01780 # *u2020Hu2020÷ #####0�Ý1#0 ##U####US1#0###U# ##VeriSign, Inc.1#0###U####VeriSign Trust Network1;09##U### BLAH BLAH BLAH SOME VERISGIN CERTIFICATE SIGNING INFORMATION
    but the final message that get through the SOAP and reaches our partner look liks the following:
    , as all this is appearing twice in our final message.
    I'll appriciate if anyone can help us finding a solution for that, as we tried to remove it in our java class at the adapter level in the module tab, but that produces java error.
    Regards,

    Vijaya, we already have solved this problem by creating an EJB and adding it to SOAP Adapter processing modules, so rather signing our payload in the UDF in graphical mapping we are now signing the payload in the SOAP adapter module and removing any unwarranted characters etc over there as well. We cannot send SOAP with header in our scenario as it is adding hell lot of extra bites that our partner system cannot understand, so we have adapted the EJB way of solving it. Thanks anyways for your suggestion.
    Athar Ullah Khan

  • Generating target XML tag from a value in the Source XML document

    Hi there,
    I have a scenario where the following transformation needs to occur:
    Source Message...
    <Catalogue>
      <key>abc<\key>
      <value>123<\value>
      <key>def<\key>
      <value>456<\value>
    <\Catalogue>
    Target Message...
    <Catalogue>
      <abc>123<\abc>  --> Value of KEY becomes the XML tag and the VALUE gets assigned to it
      <def>456<\abc>
    <\Catalogue>
    The target message is written to an xml file using the receiver file adapter.
    I would like the target message generation to be dynamic so that when a new key-value pair is added, it would not require a change in the XI mapping layer.  Is there a way to accomplish this without having to code or enhance the adapter.  I am trying to avoid doing this in the mapping because that would mean changing the mapping every time a new key-value pair needs to be added.
    Any suggestions to accomplish this are welcome.
    Thanks all.

    Hi,
    I doubt if it will work for you. you can generate dynamic values using this but not tags dynamically. You need to see if there are any methods to generate tags dynamically.
    One way of doing this is by using Java Mapping and playing around with InputStream and OutputStream.It will work for sure with this.
    Thanks
    Amit

  • Indesign Javascript, find  xml tag from cursor position

    Hi All,
    I have a single textframe with multiple xml tags within formated by paragraph and character styles.
    I want to access the xml tag attribute of the xmltag, related to my first 5 characters....
    How to do it?
    Or second approch, i need to find first and last xml tag on the page.

    Try this (second approach),
    Select any text frame and try the below code:
    alert(app.selection[0].lines[0].words[0].associatedXMLElements[0].markupTag.name)\\first XML tag
    alert(app.selection[0].lines[-1].words[-1].associatedXMLElements[0].markupTag.name)\\second XML tag
    Vandy

  • Addressing   same xml  tags  on different  levels

    Dears Guys ,
    I have an XML data file with <name> tag on two levels
    <db_mapper>
    <name>Testing XSLT</name>
    <cards>
    <card type="simple">
    <name>John Doe</name>
    <title>CEO, Widget Inc.</title>
    <email>[email protected]</email>
    <phone>(202) 456-1414</phone>
    </card>
    <card type="simple1">
    <name>John Woe</name>
    <title>CEO, Sun Inc.</title>
    <email>[email protected]</email>
    <phone>(22222) xxx-1414</phone>
    </card>
    </cards>
    </db_mapper>
    in the XSLT I need the db_mapper/name in one template and
    db_mapper/cards/card/name in the other template
    how can I do this in the following templates :
    <xsl:template match="db_mapper/cards/card/name">
    <td><xsl:value-of select="text()"/></td>
    </xsl:template>
    <xsl:template match="db_mapper/name">
    <td><xsl:value-of select="text()"/></td>
    </xsl:template>
    Thanks in advance!

    I'm not sure either that I understand your question correctly. Didnt' you forget the root "/" from your XPath:
    <xsl:template match="/db_mapper/cards/card/name">
        <td><xsl:value-of select="text()"/></td>
    </xsl:template>

  • Create single XML document from multiple queries

    hi all!
    being a new programmer in XML world,my question might sound a bit stupid but your answers would mean a world to me. i have to generate a single XML document from my database by querying more than one table. for example i have 3 tables i.e HR_EMP_NAME, HR_PRODUCTS_DETAIL, HR_PAYROLL_SUMMARY. all three tables have completely different columns except one ID column which is a foreign kay from HR_MASTER_LIST. i want to get any insert operation on these tables as a single document. so far as i have studied, one option is to generate XMLDoc using XSU and then add child nodes using JAXP but i am ot geting the logic right.
    please do reply.
    thanks a lot
    usman

    This is an SQL/XML based answer so how much it helps you is hard to say, but it would be one option. You can have the SQL statement build the XML for you as shown by this simple example.
    SELECT XMLElement("root",
              XMLForest(emp.dummy AS "emp_name",
                        prod.dummy AS "prod_lvl",
                        pay.dummy AS "pay_scale"))
      FROM dual emp,
           dual prod,
           dual pay
    WHERE emp.dummy = prod.dummy
      AND emp.dummy = pay.dummy;which produces (formatted for human readability)
    <root>
      <emp_name>X</emp_name>
      <prod_lvl>X</prod_lvl>
      <pay_scale>X</pay_scale>
    </root>Whether that works with what you are trying to do via Java you will have to decide.

  • Need to get rss/xml feed from itunes

    I need to get an rss/xml feed of the albums I am selling on itunes -- to insert into an iphone app I am working on.
    Any one know how to get this feed?

    If you had iTunes Match before all this happened, yes. Just log in, activate iTM and download the music. If you did not have iTunes Match prior to these incidents, no, it can not help you.
    You should also be doing regular backups of your personal data to an extnal HDD. If you had a backup hue could simply restore it.

  • Want to create XML tag from the query

    Here i want to create a xml output from the below code for the given P_repair_number can anyone help me for the code i have written
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    facing the above error when run from concurrent program
    Procedure dfdfdf(p_repair_number number,
                              errbuf        OUT VARCHAR2,
                              retcode       OUT NUMBER) as
    v_error_code NUMBER; -- error code
      v_error_message VARCHAR2(255); -- error message
      v_text_msg VARCHAR2(100);
    cursor Rodetails(p_repair_number IN NUMBER) is
    SELECT
      dra.repair_number,
      dra.repair_line_id,
      items.concatenated_segments item_name,
      items.description item_desc,
      dra.inventory_item_id,
      sr.incident_number sr_incident_number,
      decode(dra.customer_product_id, '',dra.serial_number,cp.serial_number) serial_number,
      ltrim(oeh.order_number) rma_number,
      rstl.resource_name ro_owner_name,
      fndl.meaning flow_status_name,
      dra.status ro_status_code,
      drtt.name repair_type_name,
      dra.problem_description,
      dra.promise_date,
      rgtl.group_name repair_org_name,
      decode(dra.customer_product_id, '',dra.item_revision,cp.inventory_revision) revision,
      cp.lot_number,
      dra.unit_of_measure uom_code,
      uom.unit_of_measure_tl uom_name,
      dra.quantity,
      cp.instance_number ib_instance_number,
      plkup.meaning ro_priority_meaning
    FROM
      csd_repairs dra,
      csd_repair_types_tl drtt,  
      cs_incidents_all_b sr,
      csi_item_instances cp,
      fnd_lookups fndl, 
      csd_flow_statuses_b fsb,
      mtl_system_items_kfv items,
      mtl_units_of_measure_tl uom,
      jtf_rs_resource_extns_tl rstl,
      jtf_rs_groups_tl rgtl,
      oe_order_headers_all oeh,
      cs_estimate_details edt,
      csd_product_transactions txns,
      fnd_lookups plkup 
    WHERE dra.repair_type_id =  drtt.repair_type_id
      AND drtt.language = userenv('LANG')
      AND dra.repair_mode = 'WIP'
      AND dra.incident_id = sr.incident_id
      AND dra.CUSTOMER_PRODUCT_ID = cp.INSTANCE_ID(+)
      AND dra.flow_status_id = fsb.flow_status_id
      AND fsb.flow_status_code = fndl.lookup_code
      AND fndl.lookup_type = 'CSD_REPAIR_FLOW_STATUS'
      AND dra.inventory_item_id = items.inventory_item_id
      AND dra.unit_of_measure = uom.uom_code
      AND uom.language = userenv('LANG')
      AND dra.resource_id = rstl.resource_id (+)
      AND rstl.category (+) = 'EMPLOYEE'
      AND rstl.language (+) = userenv('LANG')
      AND dra.owning_organization_id = rgtl.group_id (+)
      AND rgtl.language (+) = userenv('LANG')
      AND dra.repair_line_id = txns.repair_line_id
      AND txns.estimate_detail_id = edt.estimate_detail_id
      AND edt.order_header_id = oeh.header_id
      AND edt.line_category_code = 'RETURN'
      AND dra.currency_code = oeh.transactional_curr_code
      AND dra.ro_priority_code = plkup.lookup_code(+)
      AND plkup.lookup_type(+) = 'CSD_RO_PRIORITY' 
      AND items.organization_id = cs_std.get_item_valdn_orgzn_id
      AND dra.repair_number=p_repair_number
      AND rownum <50;
    begin
    errbuf := NULL;
    retcode := 0;
      SAVEPOINT Create_external_orders;
      --retcode             := FND_API.G_RET_STS_SUCCESS;
      IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
        fnd_log.STRING (fnd_log.level_procedure, 'CSD.PLSQL.XXTNT_CSD_CREATEORDER.SUBMIT_CREATE_ORDER.BEGIN', 'Enter - PrintTraveller');
      END IF;
    --FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0"?>');
    --FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_ORDER>');
    FOR v_rodetails IN Rodetails(p_repair_number)
    LOOP
    /*For each record create a group tag <G_RODETAILS> at the start*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0"?>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_ORDER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<G_RODETAILS>');
      FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_NUMBER>' || v_rodetails.repair_number ||
                                       '</REPAIR_NUMBER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_LINE_ID>' || v_rodetails.repair_line_id
                                    || '</REPAIR_LINE_ID>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<ITEM_NAME>' || v_rodetails.ITEM_NAME
                                     ||'</ITEM_NAME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<ITEM_DESC>' || v_rodetails.ITEM_DESC
                                    || '</ITEM_DESC>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SR_INCIDENT_NUMBER>' || v_rodetails.SR_INCIDENT_NUMBER ||
                                       '</SR_INCIDENT_NUMBER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERIAL_NUMBER>' ||v_rodetails.SERIAL_NUMBER
                                     ||'</SERIAL_NUMBER>');                               
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RMA_NUMBER>' || v_rodetails.RMA_NUMBER
                                    || '</RMA_NUMBER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_OWNER_NAME>' ||v_rodetails.RO_OWNER_NAME ||
                                       '</RO_OWNER_NAME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<FLOW_STATUS_NAME>' || v_rodetails.FLOW_STATUS_NAME
                                     ||'</FLOW_STATUS_NAME>');                                
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_STATUS_CODE>' || v_rodetails.RO_STATUS_CODE
                                    || '</RO_STATUS_CODE>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_TYPE_NAME>' || v_rodetails.REPAIR_TYPE_NAME ||
                                       '</REPAIR_TYPE_NAME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<PROBLEM_DESCRIPTION>' || v_rodetails.PROBLEM_DESCRIPTION
                                     ||'</PROBLEM_DESCRIPTION>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<PROMISE_DATE>' || v_rodetails.PROMISE_DATE
                                    || '</PROMISE_DATE>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_OWNER_NAME>' || v_rodetails.RO_OWNER_NAME ||
                                       '</RO_OWNER_NAME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REPAIR_ORG_NAME>' || v_rodetails.REPAIR_ORG_NAME
                                     ||'</REPAIR_ORG_NAME>');                                
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_STATUS_CODE>' || v_rodetails.RO_STATUS_CODE
                                    || '</RO_STATUS_CODE>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<REVISION>' || v_rodetails.REVISION ||
                                       '</REVISION>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<LOT_NUMBER>' || v_rodetails.LOT_NUMBER
                                     ||'</LOT_NUMBER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<UOM_CODE>' || v_rodetails.UOM_CODE
                                    || '</UOM_CODE>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<UOM_NAME>' ||v_rodetails.UOM_NAME ||
                                       '</UOM_NAME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<QUANTITY>' || v_rodetails.QUANTITY
                                     ||'</QUANTITY>');                                
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<IB_INSTANCE_NUMBER>' || v_rodetails.IB_INSTANCE_NUMBER
                                    || '</IB_INSTANCE_NUMBER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<RO_PRIORITY_MEANING>' || v_rodetails.RO_PRIORITY_MEANING ||
                                       '</RO_PRIORITY_MEANING>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</G_RODETAILS>');                             
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</REPAIR_ORDER>');                                
    END LOOP;
    IF(retcode != FND_API.G_RET_STS_SUCCESS) THEN
                    RAISE FND_API.G_EXC_ERROR;
                  END IF;
                  IF (fnd_log.level_procedure >= fnd_log.g_current_runtime_level) THEN
                    fnd_log.STRING (fnd_log.level_statement, 'CSD.PLSQL.XXTNT_CSD_CREATEORDER.SUBMIT_CREATE_ORDER', ' In PrintTraveller');
                  END IF;
    fnd_file.put_line(fnd_file.log, 'Successfully completed PrintTraveller');
    EXCEPTION
    || Catch all error.
    WHEN OTHERS THEN
    ROLLBACK;
    v_error_code := SQLCODE;
    v_text_msg := 'Fatal Error, Oracle Error is: '
    || TO_CHAR (v_error_code, '99999');
    fnd_file.put_line (fnd_file.log, v_text_msg);
    v_error_message := SQLERRM;
    fnd_file.put_line (fnd_file.log, v_error_message);   
    end dfdfdf;Edited by: user12053530 on Apr 19, 2010 5:54 AM

    However using SYS.ODCIVARCHAR2LIST makes sense if your query is a part of bigger processing (PL/SQL procedure or function) and you will do some processing depending on File_Type, like in this example (not compiled, could contain syntax errors):
    DECLARE
      l_stid           VARCHAR2(10);
      l_address        VARCHAR2(30);
      l_File_Type_tab  SYS.ODCIVARCHAR2LIST;
      cur_cursor IS SELECT STID,
                    ADDRESS,
                    CAST(COLLECT(DISTINCT File_Type) AS SYS.ODCIVARCHAR2LIST) AS File_Type
                    FROM (
                          SELECT STID,
                                 ADDRESS,
                                 File_Type
                            FROM DUMMY
                    GROUP BY STID, ADDRESS;
    BEGIN
      OPEN cur_cursor;
      <<main_loop>>
      WHILE (1=1) LOOP
         FETCH cur_cursor INTO l_stid, l_address, l_File_Type_tab;
         EXIT WHEN cur_cursor%NOTFOUND;
         -- Now do processing for each File_Type in l_File_Type_tab;
         <<each_file_type>>
         FOR i IN l_File_Type_tab.FIRST .. l_File_Type_tab.LAST LOOP
           -- for example:
           -- IF l_File_Type_tab(i) = 'SALES'
           -- THEN
           --   do_something(l_stid, l_address);
           -- ELSIF l_File_Type_tab(i) = 'TRANSFER'
           -- THEN
           --   do_something_else(l_stid, l_address);
           -- ELSE
           --   do_something_default(l_stid, l_address);
           -- END IF;
         END LOOP each_file_type;
      END LOOP main_loop;
      CLOSE cur_cursor;
    END;

  • Read XML file from different server on JSP

    Dear All,
    I am a newbie to JSP with XML, now i want to read the "test.xml" from JSP.
    I read successfully this "test.xml" file from my system and I got output, but I need to read the xml file from
    different server like "http://www.domain.com/test.xml". I couldn't read such a type of file from different server.
    Is it possible to read a xml file from different server?
    If anybody have idea please let me know.
    Thanks in Advance,
    Prasath.
    <%@ page import="java.sql.*,java.io.*,java.util.*,javax.xml.parsers.*,org.w3c.dom.*,org.xml.sax.*" %>
    <%
    try {
        DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
        Document doc = docBuilder.parse (new File("http://www.domain.com/test.xml"));
        // normalize text representation
        doc.getDocumentElement ().normalize ();
        out.println ("Root element of the doc is " +
             doc.getDocumentElement().getNodeName()+"<br>");
        NodeList listOfPersons = doc.getElementsByTagName("person");
        int totalPersons = listOfPersons.getLength();
        out.println("Total no of people : " + totalPersons+"<br>");
        for(int s=0; s<listOfPersons.getLength() ; s++){
            Node firstPersonNode = listOfPersons.item(s);
            if(firstPersonNode.getNodeType() == Node.ELEMENT_NODE){
                Element firstPersonElement = (Element)firstPersonNode;
                NodeList firstNameList = firstPersonElement.getElementsByTagName("first");
                Element firstNameElement = (Element)firstNameList.item(0);
                NodeList textFNList = firstNameElement.getChildNodes();
                out.println("First Name : " +
                       ((Node)textFNList.item(0)).getNodeValue().trim()+"<br>");
                NodeList lastNameList = firstPersonElement.getElementsByTagName("last");
                Element lastNameElement = (Element)lastNameList.item(0);
                NodeList textLNList = lastNameElement.getChildNodes();
                out.println("Last Name : " +
                       ((Node)textLNList.item(0)).getNodeValue().trim()+"<br>");
                NodeList ageList = firstPersonElement.getElementsByTagName("age");
                Element ageElement = (Element)ageList.item(0);
                NodeList textAgeList = ageElement.getChildNodes();
                out.println("Age : " +
                       ((Node)textAgeList.item(0)).getNodeValue().trim()+"<br>");
            }//end of if clause
        }//end of for loop with s var
    }catch (SAXParseException err) {
    out.println ("** Parsing error" + ", line "
         + err.getLineNumber () + ", uri " + err.getSystemId ());
    out.println(" " + err.getMessage ());
    }catch (SAXException e) {
    Exception x = e.getException ();
    ((x == null) ? e : x).printStackTrace ();
    }catch (Throwable t) {
    t.printStackTrace ();
    %>

    You might try:
    Document doc = docBuilder.parse ("http://www.domain.com/test.xml");Alternatively use the java.net package to obtain an Input Stream to the xml document
    InputStream in = methodThatYouWriteYourselfCalledgetInputStreamForURI("http://www.domain.com/test.xml");
    Document doc = docBuilder.parse (in);cheers,
    evnafets

  • Collect data from a dynamic XML file into multiple internal tables

    I need to convert the XML file into multiple internal tables. I tried many links and posts in SDN but still was facing difficulty in achieving this. Can some one tell me where I am going wrong.
    My XML file is of the following type.It is very complex and the dynamice.
    The following tags occur more than once in the XML file. The "I" and "L" tags and its child tags can occur ones or more than once for each XML file and it is not constant. i.e in one file they can occur 1 time and in another they can occur 100 times.
    "I" and "L" are child tags of <C>
    <I>
           <J>10</J>
             <K>EN</K>
      </I>
    <L>
             <J>20</J>
              <N>BB</N>
      </L>
    Tags <C> and <F> occur only ones for each XML file. <C> is the child tag of "A" and "F" is the child tag of <C>.
    I need to collect <D>, <E> in one internal table ITAB.
    I need to collect <G>, <H> in one internal table JTAB.
    I need to collect <J>, <K> in one internal table KTAB.
    I need to collect <J>, <N> in one internal table PTAB.
    Below is the complete XML file.
    ?xml version="1.0" encoding="iso-8859-1" ?>
    <A>
        <B/>
        <C>
           <D>RED</D>
           <E>999</E>
        <F>
           <G>TRACK</G>
           <H>PACK</H>
        </F>
        <I>
           <J>10</J>
           <K>EN</K>
        </I>
        <I>
           <J>20</J>
           <K>TN</K>
        </I>
        <I>
           <J>30</J>
           <K>KN</K>
        </I>
        <L>
           <J>10</J>
           <N>AA</N>
        </L>
        <L>
           <J>20</J>
           <N>BB</N>
        </L>
        <L>
           <J>30</J>
           <N>CC</N>
        </L>
        </C>
      </A>
    With the help of SDN I am able to gather the values of <D> <E> in one internal table.
    Now if I need to gather
    <G>, <H> in one internal table JTAB.
    <J>, <K> in one internal table KTAB.
    <J>, <N> in one internal table PTAB.
    I am unable to do. I am following  XSLT transformation method. If some one has some suggestions. Please help.
    Here is my ABAP program
    TYPE-POOLS abap.
    CONSTANTS gs_file TYPE string VALUE 'C:\TEMP\ABCD.xml'.
    * This is the structure for the data from the XML file
    TYPES: BEGIN OF ITAB,
             D(10) TYPE C,
             E(10) TYPE C,
           END OF ITAB.
    * 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_ITAB     TYPE STANDARD TABLE OF ts_ITAB,
          gs_ITAB     TYPE ts_ITAB.
    * 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_itab1
      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
    * "IITAB".
    GET REFERENCE OF gt_shipment INTO gs_result_xml-value.
    gs_result_xml-name = 'IITAB'.
    APPEND gs_result_xml TO gt_result_xml.
    * Perform the XSLT stylesheet
    TRY.
        CALL TRANSFORMATION zxslt
        SOURCE XML gt_itab1
        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.
    * Now let's see what we got from the file
    LOOP AT gt_ITAB INTO gs_ITAB.
      WRITE: / 'D:', gs_ITAB-D.
      WRITE: / 'E :', gs_ITAB-E.
    ENDLOOP.
    Transformation
    <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>
            <IITAB>
              <xsl:apply-templates select="//C"/>
            </IITAB>
          </asx:values>
        </asx:abap>
      </xsl:template>
      <item>
          <D>
            <xsl:value-of select="D"/>
          </D>
          <E>
            <xsl:value-of select="E"/>
          </E>
        </item>
      </xsl:template>
    </xsl:transform>
    Now the above pgm and transformation work well and I am able to extract data into the ITAB. Now what changes should I make in transformation and in pgm to collect
    <G>, <H> in one internal table JTAB.
    <J>, <K> in one internal table KTAB.
    <J>, <N> in one internal table PTAB.
    Please help..i am really tring hard to figure this out. I am found lot of threads addressing this issue but not my problem.
    Kindly help.
    Regards,
    VS

    Hi Rammohan,
    Thanks for the effort!
    But I don't need to use GUI upload because my functionality does not require to fetch data from presentation server.
    Moreover, the split command advised by you contains separate fields...f1, f2, f3... and I cannot use it because I have 164 fields.  I will have to split into 164 fields and assign the values back to 164 fields in the work area/header line.
    Moreover I have about 10 such work areas.  so the effort would be ten times the above effort! I want to avoid this! Please help!
    I would be very grateful if you could provide an alternative solution.
    Thanks once again,
    Best Regards,
    Vinod.V

Maybe you are looking for

  • Download tool part of iso files?

    I have a 2 year old 640 gig dv7 laptop and I received the imminent "hard disk failure" message. So, I backed up the hard drive (8 dvds) and made recovery disks (6 dvds). I bought a new Seagate hard drive of 500 gigs and installed it. I then started t

  • JATO: How to send HTML via Component

    How does one output formatted text as HTML via a visual component? I usually have an HTML UL/LI list of "...is required" messages if a user submits a form without all required values entered. When I assign the text in the requestHandler() event, the

  • Wirefusion and Java for 3D

    I have a general knowledge of how 3D software operates but no knowledge of Java. I would like to become proficient with the program called Wirefusion and I read that it involves Java. I understand that I can program Java applications and Wirefusion h

  • Kodo problem and reference field

    Hi, Could you help me in finding a solution ? I'll give you example - we have two objects - A and B. B object has reference attribute that points to A. That requires two tables, where in table B there will be foreign key to table A index. But why I'm

  • File Permission Error

    I have a GUI for a concentration math game that I made and when i compile and run it on my computer it works perfectly. However, when i put it into a HTML page via the <applet> tag, it prings up the fololowing error. How can I avoid this? java.securi