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?
Judson

Minimal 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>

Similar Messages

  • 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.

  • Getting error while creating Customer Invoice Request via Web Service

    Hello,
    I am trying to create customer invoice request via web service.
    But I am getting the error message "No scheme configuration found for scheme '&CIRHP&' " continuously.
    It is working fine in reference tenant. But using the same payload its giving error in another tenant.
    Can you please tell me what is the root cause for this error?
    I have included the payload used in the prototype tenant(Payload.txt) and screen shot of the error.
    Thanks and Regards,
    Sriram

    Hi,
    Check the WSDL file is wellformed or not..You can test it using tools like XML Spy.
    Might be the attribute tag is missing something..If WSDL file is correct then, create proxy by selecting the WSDL file from local machine..
    Regards,
    Sunitha

  • Customer Invoice in XML format

    Hi,
    One of our Customers ask us, if we can generate his invoices in xml format and send him.
    How we can make it ?
    We create invoices with vf01 or fb70.
    I now with EDI/Idoc and convert over a subsystem it is possible. But we don't work with inbound or outbound EDI messages.
    Maybe sombody have implemented already a similar solution.
    Thanks for you help
    Marcel

    Hello,
    If you want to send an Invoice in XML instead of a print/fax output, You can check for XSF output in SMARTFORMS.
    Hope this helps you.
    Best Regards, Murugesh AS

  • Customer Invoice Upload Tool - Can't get extension fields to populate

    In the documentation for the customer invoice upload documentation, it says to get the tag for your extension field in the Customer Invoice XML Output. No issues there. But when I add the extension field to the XML for the Customer Invoice Request Service Interface, the field never populates in the generated invoice request. Note that I cannot create a new XML Upload Service interface as a workaround because this is a 3.5 customer system
    The extension fields are in a different namespace from the Request Service Interface, so I've tried the two methods below to populate my Advertiser extension field. I've had no luck with either. Here's some sample XML from the beginning of the file. The files are also attached. Any help is appreciated.
    [ I also posted on the SCN where I  attached the test files.|http://scn.sap.com/thread/3237936]
    Method 1
    <?xml version="1.0"?>
    <CustomerInvoiceRequestRequest>
    <MessageHeader>
    <CreationDateTime/>
    </MessageHeader>
    <CustomerInvoiceRequest actionCode="04" reconciliationPeriodCounterValue="1">
    <BaseBusinessTransactionDocumentID>EXT_100001_TALINV</BaseBusinessTransactionDocumentID>
    <BaseBusinessTransactionDocumentTypeCode>29</BaseBusinessTransactionDocumentTypeCode>
    <ProposedInvoiceDate>2012-09-16</ProposedInvoiceDate>
    <Name>hhhc</Name>
    <ReferenceBusinessTransactionDocumentID>100001</ReferenceBusinessTransactionDocumentID>
    <Advertiser xmlns="http://sap.com/xi/AP/CustomerExtension/BYD/A03DP">
    <EXTAdvertiser00163E027E021ED1BFDF09124EFF4876_002>JUDSON</EXTAdvertiser00163E027E021ED1BFDF09124EFF4876_002>
    </Advertiser>
    <BusinessProcessVariantType>
    <BusinessProcessVariantTypeCode>1</BusinessProcessVariantTypeCode>
    <MainIndicator>true</MainIndicator>
    </BusinessProcessVariantType>
    Method 2
    <?xml version="1.0"?>
    <CustomerInvoiceRequestRequest>
    <MessageHeader>
    <CreationDateTime/>
    </MessageHeader>
    <CustomerInvoiceRequest actionCode="04" reconciliationPeriodCounterValue="1">
    <BaseBusinessTransactionDocumentID>EXT_100002_TALINV</BaseBusinessTransactionDocumentID>
    <BaseBusinessTransactionDocumentTypeCode>29</BaseBusinessTransactionDocumentTypeCode>
    <ProposedInvoiceDate>2012-09-16</ProposedInvoiceDate>
    <Name>hhhc</Name>
    <ReferenceBusinessTransactionDocumentID>100002</ReferenceBusinessTransactionDocumentID>
    <n1:EXTAdvertiser00163E027E021ED1BFDF09124EFF4876_002 xmlns:n1="http://sap.com/xi/AP/CustomerExtension/BYD/A03DP">JUDSON</n1:EXTAdvertiser00163E027E021ED1BFDF09124EFF4876_002>
    <BusinessProcessVariantType>
    <BusinessProcessVariantTypeCode>1</BusinessProcessVariantTypeCode>
    <MainIndicator>true</MainIndicator>
    </BusinessProcessVariantType>

    Hi Judson,
    Thanks for sharing this answer, i am also facing the same issue. But here in my case i have extension field in Items nodes and also got the xml node from customer invoice xml, like below but when i process the xml it adds invoice request but dont maps th "test" nodes data to that extended column.
    <n1:test_0LIGMSME2T388H1SZMFGTNHGN_Y38WD8BTY xmlns:n1="http://0008768412-one-off.sap.com/Y38WD8BTY_">test data</n1:test_0LIGMSME2T388H1SZMFGTNHGN_Y38WD8BTY>
    Could you please suggest what i am missing.

  • Upload of Customs Duty Rates (xml file) without transport request creation

    Hi All
    Can we upload the Customs Duty Rates (xml file) without transport request directly in the system.
    Thanks & Best Regards
    Kiran

    Hi Kiran,
    Please check transaction & program /SAPSLL/TLC_CUSB_UPL in GTS.
    This allows you to upload the XML from a local source or an application server path.
    I do not think a transport request is required in this scenario.
    Best Regards,
    Eoin

  • Invoice request based on multiple sales order for same customer

    Hi Team,
    I just wanted to know if we can create manual invoice request based on multiple sales order for same customer?
    For project based invoice request i have create based on single invoice request.
    Appreciate your input here.
    Thanks,
    Nitin

    Dear Ratish,
    Thanks for yr reply.
    I already did that but it is not serving business purpose.
    Comm payment  - comes diff time than sales payment.
    so ,I will post one entry customer will get hit with total amount Sales + commission
    like below
    Let say 10, 000 is the sales value and 500 is the commission
    So , This entry will get posted
    Customer Db- 10,500
    Sales Cr- 10,000
    Comm Income Cr- 500
    But, As I said sales amt will be paid before so We need to clear it partially and some time customer pays also diff amount due to some defect.
    So, We wont be knowing for which case we have or havnet received the payment against commission.
    As , Customer account is got hit with total amount( Sales+ Comm..value).
    Pls advise how to solve this.
    Regards,
    Sukh

  • Missing Payment Term field on tcode FBR2 Customer Invoice Display

    Hi Experts,
    This is a more detailed explanation on the Payment terms field issue we are encountering since last week.
    I have some problems with their request that they want to show the payment terms field in the transation code FBR2 - Customer Invoice even if the Sales Area Data for Customer is not maintained but Company Code Payment Terms is maintained. I need help on the configuration on how to show the field.
    What I researched is that there are 2 maintainance of Payment Terms Field:one in the Company Code and another in the Sales Area. As I read on some forums, the Payment Terms in Sales Area should be the default when using the SD Process however, the Payment Terms in the Company Code should be the default value when they use FBR2 - Customer Invoice. But thay still cannot see the payment terms field in the Accounting Document they already created.
    I already checked in transaction OBC4 the Reconcilliation Account Group and the Payment Terms field is optional there and even the Posting Key 01, which is also optional.
    Please help me on this. Thank you.

    I did some checking on the past few posting, and I found some posting to the same account also the same tcode FBR2. However, the other one is with posting key 01 - Invoice.
    The Problem occurs when we use FBR2 then the posting key is 09 - which is a special g/l posting for the account. How can I check why the "Payment Terms" field is still not displayed or cannot maintain in this transaction?

  • Customer Invoice  in CRM to Vendor invoice in ECC.

    HI ,
    I have question we have in our business scenario,  customer performs service activity say repairing a Lap top, customer uses his own service person (labor)  to perform that  repair work for that  Lap top  and raises invoice on company .
    Here customer acts as Business partner to company in CRM .(Sold to Party)
    Here my question is how this customer invoice replicates in ECC as Vendor invoice.
    Is it possible to replicate Customer invoice in CRM to vendor invoice in ECC ?
    We need this as vendor invoice in ECC , so that finance person can pay him as Account payable in ECC.
    Is there any customization required for this to post as vendor invoice in ECC.
    I request you to help me in this regard. Many thanks in advance.
    Kind Regards,
    Sankar Reddy

    Hi Ritesh,
    this funbctionality is standard behaviour of ERP.
    You can only see the relevant upper nodes in the sales order.
    To see more, you've to start another transaction VDH2N; here you see the whole hierarchy.
    Kind regards
    Werner

  • Customer invoice in CRM as Vendor invoice in ECC

    HI
    It is continuation of my question , can we post Customer invoice in CRM to be replicated as vendor invoice in ECC ?
    How can we pay the payment  as Account Payable.
    I request you to answer my question , it is on proiority .
    Thanks once again if you can give the answer.
    Kind Regards,
    Sankara Reddy
    HI ,
    I have question we have in our business scenario, customer performs service activity say repairing a Lap top, customer uses his own service person (labor) to perform that repair work for that Lap top and raises invoice on company .
    Here customer acts as Business partner to company in CRM .(Sold to Party)
    We have created him (Sold to Party) as Vendor in ECC.
    Here my question is how this customer invoice replicates in ECC as Vendor
    invoice.
    Is it possible to replicate Customer invoice in CRM to vendor invoice in ECC ?
    We need this as vendor invoice in ECC , so that finance person can pay him as Account payable in ECC.
    Is there any customization required for this to post as vendor invoice in ECC.
    I request you to help me in this regard. Many thanks in advance.
    Kind Regards,
    Sankar Reddy

    Hi Ritesh,
    this funbctionality is standard behaviour of ERP.
    You can only see the relevant upper nodes in the sales order.
    To see more, you've to start another transaction VDH2N; here you see the whole hierarchy.
    Kind regards
    Werner

  • How to payment a little for a customer invoice.

    Hi all !
    I have a request, help me please !
    I enter a customer invoice with value 1000 (USD) from SAP T-Code FB70.
    When customer payment a little ( 400 USD ) for this invoice, I will post incoming invoice with value 400 USD from T-Code F-28.
    If value of customer invoice is not identical value of payment invoice, system will have 2 open item with value 1000USD and -400USD.
    I want docment 1000 USD will split to 2 line item with value of line item 1 is 400 USD and value of line item 2 is 600 USD.
    Line item 1 will clear with  payment invoice and system will exist a open item with value 600 USD.
    If you have solution for this request, help me, please !
    Thanks !

    Hi,
    By using residual clearing 400 usd is adjusted with 1000 usd. So one cleared line item is created.
    For 600 usd new open item is generated and becomes due for payment
    prasad

  • Clearing Customer down payment for down payment amount not equal to Customer Invoice amount

    Dear All,
                   Below process are posting Customer transaction directly via FI without SD cycle.
                Customer down payment = 102 INR
                Customer Invoice = 103 INR
    While doing Customer clearing w.r.t Invoice system has cleared the down payment document but posted an open item in Customer account with clearing document number  of value Rs 102  .
    Concern:-
                   1) How 1 INR difference will be countered , via receipt payment from customer from bank account ?
                   2) In case we have defined tolerance limit of 5% for Customer and this come to be > 1 INR ,does SAP provide clearing Customer items
                       automatically via any Standard Customer clearing process based on rule defined  ?
    Pls suggest
    Regards
    MJ

    Hi,
    the information of the exchange rates used for down payments, is
    stored in table TCURR ( exchange rates)
    For the request down payment the actual exchange rate of table TCURR
    or the rate of document header is taken.
    When this down payment request is payed, also the exchange rate of
    the actual day (TCURR) is taken.
    That´s why the amount in the bank posting in local currency result
    from translating the foreign currency amount at the current rate,
    instead of resulting from the total of the local currency amounts
    from the settled items.
    Regards,
    Attila

  • FIDCCP02 IDOCs : Details for Customer Invoice Clearing

    We are planning on using FIDCCP02 IDOCs to post customer invoice clearing.
    The IDOC gets created however when we check the IDOC status, it states that "Document does not contain any valid line items
    Message no. F5079"
    Can someone please let me know which segments and what fields we need to populate specifically for Invoice Clearing?
    We are populating the following segments:
    E1FIKPF
    -- E1FISEG
        ---E1FISE2
        ---E1FINBU
    --E1FISEC
    --E1FISET
    EDIDD     Data Records     
    SEGNUM     Segment Number                          000001
    SEGNAM     Segment Name                          E1FIKPF
    BUKRS     Name of global company code     ABCD
    BELNR     Accounting Document Number     3510452953
    GJAHR     Fiscal Year                                                2011
    BLART     Document Type                           AB
    BLDAT     Document Date in Document     20110329
    BUDAT     Posting Date in the Document     20110329
    MONAT     Fiscal Period     3
    WWERT     Translation Date                          20110329
    USNAM     User Name                                                TEST
    TCODE     Transaction Code     FB05
    WAERS     Currency Key     USD
    GLVOR     Business Transaction     RFBU
    AWTYP     Reference Transaction     BKPFF
    SEGNUM     Segment Number     000002
    SEGNAM     Segment Name     E1FISEG
    BUZEI     Number of Line Item Within Acc     001
    BSCHL     Posting Key     40
    KOART     Account Type     S  : G/L accounts
    SHKZG     Debit/Credit Indicator     S  : Debit
    DMBTR     Amount in Local Currency     42.79
    HKONT     General Ledger Account     0000113434
    SEGNUM     Segment Number     000003
    SEGNAM     Segment Name     E1FISE2
    SEGNUM     Segment Number     000004
    SEGNAM     Segment Name     E1FINBU
    KUNNR     Customer Number 1     0060000006
    PYCUR     Currency for Automatic Payment     USD
    PYAMT     Amount in Payment Currency     42.79
    SEGNUM     Segment Number                          000005
    SEGNAM     Segment Name                          E1FISEC
    BUZEI     Number of Line Item Within Acc     001
    SEGNUM     Segment Number                          000006
    SEGNAM     Segment Name                          E1FISET
    EDIDS     Status Records     
    EDIDS     Status Record Number     1
    Thanks

    We are planning on using FIDCCP02 IDOCs to post customer invoice clearing.
    The IDOC gets created however when we check the IDOC status, it states that "Document does not contain any valid line items
    Message no. F5079"
    Can someone please let me know which segments and what fields we need to populate specifically for Invoice Clearing?
    We are populating the following segments:
    E1FIKPF
    -- E1FISEG
        ---E1FISE2
        ---E1FINBU
    --E1FISEC
    --E1FISET
    EDIDD     Data Records     
    SEGNUM     Segment Number                          000001
    SEGNAM     Segment Name                          E1FIKPF
    BUKRS     Name of global company code     ABCD
    BELNR     Accounting Document Number     3510452953
    GJAHR     Fiscal Year                                                2011
    BLART     Document Type                           AB
    BLDAT     Document Date in Document     20110329
    BUDAT     Posting Date in the Document     20110329
    MONAT     Fiscal Period     3
    WWERT     Translation Date                          20110329
    USNAM     User Name                                                TEST
    TCODE     Transaction Code     FB05
    WAERS     Currency Key     USD
    GLVOR     Business Transaction     RFBU
    AWTYP     Reference Transaction     BKPFF
    SEGNUM     Segment Number     000002
    SEGNAM     Segment Name     E1FISEG
    BUZEI     Number of Line Item Within Acc     001
    BSCHL     Posting Key     40
    KOART     Account Type     S  : G/L accounts
    SHKZG     Debit/Credit Indicator     S  : Debit
    DMBTR     Amount in Local Currency     42.79
    HKONT     General Ledger Account     0000113434
    SEGNUM     Segment Number     000003
    SEGNAM     Segment Name     E1FISE2
    SEGNUM     Segment Number     000004
    SEGNAM     Segment Name     E1FINBU
    KUNNR     Customer Number 1     0060000006
    PYCUR     Currency for Automatic Payment     USD
    PYAMT     Amount in Payment Currency     42.79
    SEGNUM     Segment Number                          000005
    SEGNAM     Segment Name                          E1FISEC
    BUZEI     Number of Line Item Within Acc     001
    SEGNUM     Segment Number                          000006
    SEGNAM     Segment Name                          E1FISET
    EDIDS     Status Records     
    EDIDS     Status Record Number     1
    Thanks

  • IDOC PEXR2002 and Customer Invoice Clearing

    All
    We are able to successfully clear customer invoices, on account posting or clear with residual items with PEXR2002.
    We are however not able to figure out how we populate texts in the FI Postings.
    Also we have a requirement that the GL account to which the FI posting is done along with customer invoice clearing varies based on certian ID's. Is there a way to handle this or we have to use the account modification?
    Is there any field on the IDOC which will allow us to enter a GL account to which the FI posting needs to be made?
    Thanks
    Edited by: Kirti Bhardwaj on Apr 14, 2011 6:15 PM

    Hello,
    For the texts you can try a subsutition, specifically the exit program or use a BTE via the FIBF transaction.
    Mark as helpful.
    Regards
    Waza

  • Procedure to generate invoice in xml---please help

    Hi all,
    I have to write code review of a pakage which contain procedure to generate invoice in XML.The procedure contain two
    files .pkb and .pks.All i know is that it will deliver elemt of the post script layout.?But i dont understand what it mean nor i am able to understand the code.I dont have any prior knowledge about this.Please help me and tell me any tutorial to understand and know how this is done.
    Also i have pasted some part of code here .please help me in understanding what is going on.
    help help help
    * GET_INVOICE_XML
    FUNCTION GET_INVOICE_XML(inInvId NUMBER) RETURN CLOB IS
    BEGIN
      IF NOT isClobReady THEN
        dbms_lob.createtemporary(invClob, TRUE);
        isClobReady := TRUE;
      ELSE
        dbms_lob.trim(invClob, 0);
      END IF;
      vInvoice :=
        XML_VER_STR || NL ||
        ' <!DOCTYPE INVOICE_FILE SYSTEM "invoicfile.dtd">' || NL ||
        '<INVOICE_FILE VERSION="1.1">' || NL;
      GEN_PROLOG(InvId);
      GEN_INVOICE(InvId, 1);
      vInvoice := vInvoice ||
        '</INVOICE_FILE>' || NL || NL;
      APPEND_INVOICE(0);
      RETURN invClob;
    END GET_INVOICE_XML;
    PROCEDURE GEN_INVOICE(InvId NUMBER, inITBMode NUMBER) IS
    vP1    PLS_INTEGER;
    vP2    PLS_INTEGER;
    vAtt     BOOLEAN;
    inv      ABCINVOICE%ROWTYPE;
    cdr_no   NUMBER;
    t0       TIMESTAMP;
    t1       TIMESTAMP;
    execTime NUMBER(12,6);
    BEGIN
      t0 := LOCALTIMESTAMP;
      SELECT * INTO inv FROM ABCINVOICE WHERE OACT = InvId;
      dti := inv.DTI;
      SELECT NVL(SUM(cdrNO),0) INTO cdr_no FROM ABCCONTRACTS WHERE OACT = InvId AND ITB IN ('Y', 'F');
      vInvoice := vInvoice ||
        ' <INVOICE>' || NL ||
        '  <HEADER>' || NL ||
        '   <SEQ>' || inv.SEQ || '/' || inv.PROC_ID || '</SEQ>' || NL ||
        '   <LEN ';
      vPos1 := INSTR(inv.LEN, '|', 1, 1);
      vInvoice := vInvoice || 'INV="' || SUBSTR(inv.LEN, 1, vPos1-1) || '" ';
      vPos2 := INSTR(inv.LEN, '|', vPos1+1, 1);
      vInvoice := vInvoice || 'BAL="' || SUBSTR(inv.LEN, vPos1+1, vPos2-vPos1-1) || '" ';
      vPos1 := INSTR(inv.LEN, '|', vPos2+1, 1);
      vInvoice := vInvoice || 'DET="' || SUBSTR(inv.LEN, vPos2+1, vPos1-vPos2-1) || '" ';
      vPos2 := INSTR(inv.LEN, '|', vPos1+1, 1);
      vInvoice := vInvoice || 'PDET="' || SUBSTR(inv.LEN, vPos1+1, vPos2-vPos1-1) || '" ';
      vPos1 := INSTR(inv.LEN, '|', vPos2+1, 1);
      vInvoice := vInvoice || 'ITM="' || SUBSTR(inv.LEN, vPos2+1, vPos1-vPos2-1) || '" ';
      vPos2 := INSTR(inv.LEN, '|', vPos1+1, 1);
      vInvoice := vInvoice || 'PITM="' || SUBSTR(inv.LEN, vPos1+1, vPos2-vPos1-1) || '" NTF="' ||
        SUBSTR(inv.LEN, vPos2+1) || '"/>' || NL;
      vInvoice := vInvoice ||
        '   <BAR>' || inv.BAR || '</BAR>' || NL ||
        '   <BCD>' || inv.BCD || '</BCD>' || NL ||
        CASE WHEN inv.BIC IS NULL THEN '' ELSE '   <BIC>' || inv.BIC || '</BIC>' || NL END ||
        '   <REF>' || inv.REF || '</REF>' || NL ||
        '   <OHX>' || inv.OHXACT || '</OHX>' || NL ||
        '   <CID>' || inv.CID || '</CID>' || NL ||
        '   <CCO>' || inv.CCO || '</CCO>' || NL ||
        '   <CND>' || inv.CND || '</CND>' || NL ||
        '   <PBF>' || inv.PBF || '</PBF>' || NL ||
        '   <DTI>' || inv.DTI || '</DTI>' || NL ||
        '   <DTD>' || inv.DTD || '</DTD>' || NL ||
        '   <DPS>' || inv.DPS || '</DPS>' || NL ||
        '   <DPE>' || inv.DPE || '</DPE>' || NL ||
        '   <DAS>' || inv.DAS || '</DAS>' || NL ||
        '   <DAE>' || inv.DAE || '</DAE>' || NL ||
        '   <PAY>' || inv.PAY || '</PAY>' || NL ||
        '   <NAM>' || ABCUTIL.CONVERT_POL_CHAR(inv.NAM) || '</NAM>' || NL ||
        CASE WHEN inv.ADS1 IS NULL THEN '' ELSE '   <ADS>' || ABCUTIL.CONVERT_POL_CHAR(inv.ADS1) || '</ADS>' || NL END ||
        CASE WHEN inv.ADS2 IS NULL THEN '' ELSE '   <ADS>' || ABCUTIL.CONVERT_POL_CHAR(inv.ADS2) || '</ADS>' || NL END ||
        '   <ADZ>' || ABCUTIL.CONVERT_POL_CHAR(inv.ADZ) || '</ADZ>' || NL ||
        '   <NIP>' || inv.NIP || '</NIP>' || NL ||
        '   <REG>' || inv.REG || '</REG>' || NL ||
        '   <PES>' || inv.PES || '</PES>' || NL ||
        '   <BCY>' || inv.BCY || '</BCY>' || NL ||
        '   <TXT>' || ABCUTIL.CONVERT_POL_CHAR(inv.TXT) || '</TXT>' || NL ||
        '   <GRO>' || TO_CHAR(inv.GRO, 'FM999990.90') || '</GRO>' || NL ||
        '   <FBL>' || inv.FBL || '</FBL>' || NL;
      IF inv.STP > 0 THEN
        GEN_TEXT(inInvId, 1);
      END IF;
      vInvoice := vInvoice ||
        '  </HEADER>' || NL ||
        '  <ADDRESS>' || NL ||
        '   <ENV>' || inv.ENV || '</ENV>' || NL ||
        '   <TNA>' || ABCUTIL.CONVERT_POL_CHAR(inv.TNA) || '</TNA>' || NL ||
        CASE WHEN inv.TAS1 IS NULL THEN '' ELSE '   <TAS>' || ABCUTIL.CONVERT_POL_CHAR(inv.TAS1) || '</TAS>' || NL END ||
        CASE WHEN inv.TAS2 IS NULL THEN '' ELSE '   <TAS>' || ABCUTIL.CONVERT_POL_CHAR(inv.TAS2) || '</TAS>' || NL END ||
        '   <TAZ>' ||ABCUTIL.CONVERT_POL_CHAR(inv.TAZ) || '</TAZ>' || NL;
      GEN_TEXT(inInvId, 2);
      vInvoice := vInvoice ||
        CASE WHEN inv.MTX  IS NULL THEN '' ELSE '   <MTX>' || inv.MTX  || '</MTX>' || NL END ||
        '  </ADDRESS>' || NL;
      APPEND_INVOICE(0);
      IF inv.BCY <> '99' THEN
        GEN_INVOICE_BILLING(inInvId);
        GEN_BALANCE(inInvId);
        vPos1 := INSTR(inv.LEN, '|', 1, 2) + 1;
        vPos2 := INSTR(inv.LEN, '|', vPos1, 1);
        vPos1 := SUBSTR(inv.LEN, vPos1, vPos2 - vPos1);
        IF vPos1 > 1 THEN
          GEN_SUMMARY(inInvId);
        END IF;
      END IF;
      vInvoice := vInvoice || ' </INVOICE>' || NL;
      APPEND_INVOICE(0);
    END GEN_INVOICE;Edited by: BluShadow on 28-Aug-2012 09:46
    added {noformat}{noformat} tags for readability. Please read: {message:id=9360002}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Not quite sure what you want to know about it.
    If you want a code review of it, I can tell you it's very poor code, because that's not how to generate XML data in Oracle. Oracle has built in XML functionality for generating such data, and doesn't require hard-coding XML tags.
    Here's the Oracle documentation...
    http://tahiti.oracle.com/
    pick your database version and search for things like XDB, SQLX or more specifically XMLELEMENT, XMLAGG, XMLATTRIBUTES etc.

Maybe you are looking for

  • Using time machine for the first time in a while

    Hi all, I just tried backing up my laptop for the first time in ages with time machine. However , it seems to get stuck on "preparing the back up" and never actually starts the backup. The external drive I'm  using has been used before for backups,an

  • Acrobat 9.4.1 - Saving issues

    We are receiving the following error when trying to save a file, that has been downloaded from a website: The file may be read-only, or another user may have it open. Please save the document with a different name or in a different folder. I've found

  • Two physical logical source formulas for on logical column

    I have two fact tables : 1. W_SERVICE_REQ_F(opened_dt_wid, assigned_dt_wid, closed_dt_wid, QUEUE_WID, SERVICE_REQ_WID): grain is one row per service request 2. W_SERVICE_REQ_DAY_A(DATE_WID, QUEUE_WID, NUM_OPENED, NUM_CLOSED, num_assigned) The goal is

  • Alias for iCloud File

    I have just started storing some files in iCloud.  I want to make an alias for that file in iCloud and put it into my dock.  When the file is on my computer, I can just drag and drop the file onto the dock and the alias is added.  I tried that with i

  • Oracle Compatibility

    Hi, We have an application which writes to Oracle BLOBs. This is part of a stored procedure call from our application. However, when trying to write the following exception is thrown: java.lang.ClassCastException: class oracle.sql.BLOB:library:[email