Fetch only required tags from Columnar Sales Register report using XML Request.

Discussion in 'Tally Integration' started by Researcher1, Jun 7, 2024 at 1:24 PM.

    
  1. Researcher1

    Researcher1 Member


    I am using the below XML Request to fetch a Columnar Sales Register Report of a month in Tally prime.

    Code:
    <ENVELOPE>
    <HEADER>
    <TALLYREQUEST>Export Data</TALLYREQUEST>
    </HEADER>
    <BODY>
    <EXPORTDATA>
    <REQUESTDESC>
    <STATICVARIABLES>
    <!--Specify the Voucher Type here-->
    <VOUCHERTYPENAME>Sales</VOUCHERTYPENAME>
    <!--Specify the Export format here  HTML or XML or SDF-->
    <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
    <SVFROMDATE TYPE='Date'>20240401</SVFROMDATE>
    <SVTODATE TYPE='Date'>20240401</SVTODATE>
    <!--Set the Columnar format variable here -->
    <COLUMNARDAYBOOK>Yes</COLUMNARDAYBOOK>
    <!--Set the SVColumntype variable here -->
    <SVCOLUMNTYPE>$$SysName:AllItems</SVCOLUMNTYPE>
    </STATICVARIABLES>
    <!--Specify the Report Name here-->
    <REPORTNAME>Voucher Register</REPORTNAME>
    </REQUESTDESC>
    </EXPORTDATA>
    </BODY>
    </ENVELOPE> 
    I want to modify the request such that it fetches only the tags that are required for me.
    I want to fetch only the tags that are mentioned below:
    Code:
    VOUCHER\DATE
    VOUCHER\LEDGERENTRIES.LIST\AMOUNT
    VOUCHER\ALLINVENTORYENTRIES\AMOUNT
    Can you please modify my XML request so that it fetches only specific tags and not all tags.
     
    Last edited: Jun 11, 2024 at 6:17 PM


  2. Sai Vineeth

    Sai Vineeth Active Member



  3. Researcher1

    Researcher1 Member


    I have altered the XML request according to my requirement but I am unable to fetch the VATASSESSABLEVALUE which is a child element of ALLINVENTORYENTRIES.LIST tag.
    can u please help me modify the request to get the VATASSESSABLEVALUE value?

    Code:
    <ENVELOPE>
        <HEADER>
            <VERSION>1</VERSION>
            <TALLYREQUEST>Export</TALLYREQUEST>
            <TYPE>Data</TYPE>
            <ID>DaybookGR</ID>
        </HEADER>
        <BODY>
            <DESC>
                <STATICVARIABLES>
    
                </STATICVARIABLES>
                <TDL>
                    <TDLMESSAGE>
                        <REPORT NAME="DaybookGR"> <FORMS>DaybookGR</FORMS></REPORT>
                        <FORM NAME="DaybookGR"><TOPPARTS>DaybookGR</TOPPARTS></FORM>
                        <PART NAME="DaybookGR"><TOPLINES>Daybook Details</TOPLINES><REPEAT>Daybook Details : GetLedgerCollAmt</REPEAT><SCROLLED>Vertical</SCROLLED></PART>
                        <PART NAME="Ledgerlist Line Title"><TOPLINES>Ledger Details</TOPLINES><REPEAT>Ledger Details:LedgerEntries</REPEAT> </PART>
                        <LINE NAME="Daybook Details"><RIGHTFIELDS>vchType,VoucherNumber</RIGHTFIELDS><XMLTAG>Voucher</XMLTAG><EXPLODE>Ledgerlist Line Title</EXPLODE></LINE>
                        <LINE NAME="Ledger Details"><LEFTFIELDS>LedgerName, Amount</LEFTFIELDS><XMLTAG>LedgerList</XMLTAG></LINE>
                        <FIELD NAME="LedgerName"><SET>$LedgerName</SET></FIELD>
                        <FIELD NAME="VoucherNumber"><SET>$VoucherNumber</SET> </FIELD>
                        <FIELD NAME="Amount"><SET>$Amount</SET><USE>Amount Field</USE></FIELD>
                        <COLLECTION NAME="GetLedgerCollAmt" ISMODIFY="No"><TYPE>Voucher</TYPE>
         <FETCH>VoucherNumber,LedgerName,VoucherTypeName</FETCH></COLLECTION>
                    </TDLMESSAGE>
                </TDL>
            </DESC>
        </BODY>
    </ENVELOPE>
     


  4. Sai Vineeth

    Sai Vineeth Active Member


    try adding that in fetch inside collection,
    <FETCH>ALLINVENTORYENTRIES.VATASSESSABLEVALUE </FETCH>
     


  5. Researcher1

    Researcher1 Member


    tried , did not work
     


  6. Sai Vineeth

    Sai Vineeth Active Member


    xml is wrong
    refer the post answer, names should be unique (add some prefix or suffix) it should not collide with existing,

    In this approach you will only get what you mentioned in request XML
    if you want inventory allocations you need to add new part line and fields for inventory allocations, then only they will get fetched
     


  7. Researcher1

    Researcher1 Member


    I have tried adding Part, line and fields . Still not able to get the details. Please modify the below request so that it works for me.
    Code:
    <ENVELOPE>
        <HEADER>
            <VERSION>1</VERSION>
            <TALLYREQUEST>Export</TALLYREQUEST>
            <TYPE>Data</TYPE>
            <ID>DaybookGR</ID>
        </HEADER>
        <BODY>
            <DESC>
                <STATICVARIABLES>
                    <EXPLODEFLAG>Yes</EXPLODEFLAG>
                    <SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
        <SVFROMDATE>20240401</SVFROMDATE>
                    <SVTODATE>20240430</SVTODATE>
                </STATICVARIABLES>
                <TDL>
                    <TDLMESSAGE>
                        <REPORT NAME="DaybookGR"> <FORMS>DaybookGR</FORMS></REPORT>
                        <FORM NAME="DaybookGR"><TOPPARTS>DaybookGR</TOPPARTS></FORM>
                        <PART NAME="DaybookGR"><TOPLINES>Daybook Details</TOPLINES><REPEAT>Daybook Details : GetLedgerCollAmt</REPEAT><SCROLLED>Vertical</SCROLLED></PART>
                        <PART NAME="Ledgerlist Line Title"><TOPLINES>Ledger Details</TOPLINES><REPEAT>Ledger Details:LedgerEntries</REPEAT> </PART> 
                       <PART NAME="Inventorylist Line Title"><TOPLINES>Inventory Details</TOPLINES><REPEAT>inventory Details:AllInventoryEntries</REPEAT> </PART>
    
          <LINE NAME="Daybook Details"><RIGHTFIELDS>vchType,VoucherNumber,Date,VOUCHER REMOTEID,BANKERSDATE,PartyGSTIN</RIGHTFIELDS><XMLTAG>Voucher</XMLTAG><EXPLODE>Ledgerlist Line Title</EXPLODE></LINE>
                        <LINE NAME="Ledger Details"><LEFTFIELDS>LedgerName,PARTYNAME,Amount</LEFTFIELDS><XMLTAG>LedgerList</XMLTAG></LINE> 
           <LINE NAME="Inventory Details"><LEFTFIELDS>InvAmount</LEFTFIELDS><XMLTAG>InventoryList</XMLTAG></LINE> 
                        <FIELD NAME="LedgerName"><SET>$LedgerName</SET></FIELD>
         <FIELD NAME="PARTYNAME"><SET>$PARTYNAME</SET></FIELD>
    <FIELD NAME="InvAmount"><SET>$VATAssblValue</SET></FIELD>      
                        <FIELD NAME="Date"><SET>$$DDMMYYYYDateFormat:$Date:"-"</SET></FIELD>
         <FIELD NAME="BANKERSDATE"><SET>$$DDMMYYYYDateFormat:$BANKERSDATE:"-"</SET></FIELD>
                        <FIELD NAME="VoucherNumber"><SET>$VoucherNumber</SET> </FIELD>
         <FIELD NAME="VOUCHER REMOTEID"> <SET>$GUID</SET></FIELD>
                        <FIELD NAME="Amount"><SET>$Amount</SET><USE>Amount Field</USE></FIELD>
           <FIELD NAME="PartyGSTIN"><SET>$PartyGSTIN</SET></FIELD>
                        <COLLECTION NAME="GetLedgerCollAmt" ISMODIFY="No"><TYPE>Voucher</TYPE>
         <FETCH>VoucherNumber,GUID,LedgerName,PARTYNAME,VoucherTypeName,Date,BANKERSDATE,PartyGSTIN,InvAmount</FETCH></COLLECTION>
                    </TDLMESSAGE>
                </TDL>
            </DESC>
        </BODY>
    </ENVELOPE>
     


Share This Page