Query of TDS tax

Dear Experts
Please guide me follow
1) How can i create a new tax code of TDS in sap business one ?
2) How can i set a TDS tax code for a particular business partner ?
3) How can i create a new TDS invoice ?
Awaiting all the expert adwise.
Thanks in advanced

Hi Sai...........
Please update your ID in your SCN Business Card so that I can send you the documentation for how to work on TDS entries......
Regards,
Rahul

Similar Messages

  • TDS Tax codes

    Hi
    Dear friends, please tell me why do we require two type of tax codes in TDS like tax code for invoice posting & tax code for payment.  Please explain briefly the scenario for each case. 
    Regards

    Hi Arun
    Please go through the following whether my understanding is correct:
    Tax code at the time of invoice:
    Here we will enter the invoice value including TDS (?) and apply the tax code defined for invoice posting and the system then splits the invoice value into purchase value + TDS amounts applicable.  Then we make the final payment and at that time we will not mention any TDS tax codes and the system automatically adjust the entries and clear the invoice.
    Tax code at the time of payment:
    Here I am required to make a downpayment.  At the time of downpayment, I will post the downpayment with a tax code defined for payment and the system debits the applicable TDS on the downpayment.  I then post the invoice for purchase.  What would be my amount of invoice in this case ?  Do I need to enter a tax code on this invoice ?  I then post the final payment and I apply the tax code (defined for payment) at the time of payment.  System then adjust the downpayment and clears the invoice with the balance amount.  Is my understanding correct ?
    I am confused what would be the amount of invoice I should be putting in both these cases. 
    If you do not mind, please clarify me taking these two situations separately.
    Thanx in advance.
    Regards

  • Query on Withholding Tax

    Hi Expert,
    I'm using the following query to inquire on withholding tax.
    SELECT T0.[DocDate], T0.[TransId], T0.[CardName], T0.[LicTradNum] as 'TIN', T0.[WTApplied], T0.[WTSum], T0.[WTSum]-T0.[WTApplied] as 'Tax Due' FROM OPCH  T0 WHERE T0.[DocDate] >=[%0] and  T0.[DocDate] <=[%1] and   T0.[WTSum] > 0 ORDER BY T0.[CardName]
    I have setup different withholding tax rate depending on the payment however I want to include in the query the withholding tax rate.
    How can I include the tax rate on the query.
    Thanks,
    Arlmi2000

    Hi Hendry
    Thanks for your reply. I tried your query but there was a syntax error in your query.
    1). [Microsoft][SQL Native Client][SQL Server]Incorrect syntax near '0'. 2). [Microsoft][SQL Native Client][SQL Server]Statement 'Service Contracts' (OCTR) (s) could not be prepared.
    But I was able to get an Idea on what table I need to include in my query.
    Below is the query I develop and it already include the tax rate. 
    SELECT T0.[DocDate], T0.[TransId], T0.[CardName], T0.[LicTradNum] as 'TIN', T1.[Rate], T0.[WTApplied], T0.[WTSum], T0.[WTSum]-T0.[WTApplied] as 'Tax Due' FROM OPCH  T0 INNER JOIN PCH5 T1 ON T0.DocEntry = T1.AbsEntry WHERE T0.[DocDate] >=[%0] and  T0.[DocDate] <=[%1] and   T0.[WTSum] > 0 ORDER BY T0.[CardName]
    However, I still facing problem, How can I exclude in the result  the documents with previously applied Credit Memo?
    Thanks,
    Arlmi2000

  • Disable old TDS tax code

    Hi Experts,
    I have created new TDS tax codes; I want to disable old TDS tax code. It should not be display at the time of user entry. Please suggest me how I can do this.
    Thanks & Regards,
    Hemant Kumar Maurya

    HI,
    It is not possible...
    But remove that Tax Code and respective withholding tax type so that it can not be used at the time of entry....
    If anyhow you want it then you will have build validation user exit with the help of ABAPer.
    Regards,
    Chintan Joshi

  • Blocking of FTXP - tax codes & TDS tax codes

    Hi viewers,
    my client is being with SAP from last 7 yrs. Every year we used to create new Tax codes..... so now it became a big list. my client wants to block all the previous years tax codes.( i.e it should not appear in FTXP) & also TDS tax codes...... so pls let me know is there any process to block.
    Rgds,
    Swathi

    Hi
    Regarding EWT Tax Types and codes.There is a step Activate Extended Withholding Tax, DESELECT the extended withholding tax checkbox. then these tax types and codes will not get displayed.ie they in HIDE mode.
    Regards
    Venkat
    Edited by: Venkat Dara on Jan 6, 2009 9:05 AM
    Edited by: Venkat Dara on Jan 6, 2009 9:44 AM

  • TDS Amount on Vendor Advance Shows positive value in *QUERY* for TDS Report

    Hi Everybody,
    I have made a query for List of TDS Report with Vendor informations as required by my client. In which the value of TDS on Vendor Advance Payment appears as positive value instaead of negative value. Please suggest how to rectify.
    Thanks,
    Paul

    Dear,
    If you have cleared the advance in F-54, then this will reverse the tax amount. That could be the reason for tax amount in debit.

  • TDS TAX AMOUNT  IS NOT MACHING WITH INVOICE WTAX AMOUNTu2019

    Dear All,
    I am Facing Following Problem in TDS
    While creating an A/P Invoice after putting row level information when user click on u2018ADDu2019 button u201CWithholding Tax Tableu201D opens for deduction of TDS amount. When user selects u201CWithholding Tax Codeu201D in u201CWithholding Tax Tableu201D to deduct TDS amount for an invoice system shows WTax amount as per rate of deduction. But when user click on u2018OKu2019 to u201CWithholding Tax Tableu201D window, WTax Amount will comes as zero on A/P Invoice window.
    Then when again user will go to u201CWithholding Tax Tableu201D and manually put the value of WTax Amount system reflects it on A/P Invoice window.
    In case when we set approval procedure to A/P Invoice, this invoice goes for an approval. After coming back as approved invoice when originator of invoice going to u2018ADDu2019 the same document system shows an error as u2018TDS TAX AMOUNT  IS NOT MACHING WITH INVOICE WTAX AMOUNTu2019
    please reply me ASAP
    Thanks & Regards,
    Swapnil

    hi
    try this
    We need to follow  the following steps
    u2022     Open the BP master for which TDS needs to be deducted go to the accounting tab followed by tax option and then  click on the checkbox subject to withholding tax
    u2022     Click on the option WTAX codes Allowed and select the TDS Category
    u2022     On the previous window click the check box pertaining the checkbox  u201CTDS OVERLOOKu201D
    Regards,
    Manish

  • TDS (tax) not deducted in MIRO

    Hi,
    I have config. LE-Transportation for my client.
    Now my Freight costs and TDS (Service Tax) charges are coming in my Shipment Cost doc.
    When i do the "Transfer"  as usual the Automatic Service PO & Entry sheet are prepared.
    But the problem is that the entry sheet is prepared of the value of only the freight costs and the taxes are not coming in that.
    SO thus when i do a subsequent Miro its showing me only the freight amont for the forwerder..
    EG: Freight in Shpmnt Cost is 4000 and TDS - serv tax is say minus 50..
    thus the entry sheet is prepared onlly of value 4000..
    and thus miro is for 4000 only..
    Rgds

    Hi,
    you check Withholding Tax tab in MIRO, there are all necessary date are appering or Not.
    Pls. give me the input.
    Regards,
    Spradip

  • Query for TDS

    Hi all
    My problem is that i want a report in this report i need some field like docnum,docdate,cardname from opch table and baseamount,taxamount,wtname,wtrate from inv5 it is tds table but i am unable to get link between opch and inv5 how can we generate this report
    i have a query but it not working fine due to link .
    query-
    SELECT T0.[DocNum], T0.[DocDate], T0.[CardName], T0.[DocTotal], T0.[WTSum],T1.[WTName], T1.[Rate] 
    FROM OPCH T0 , OWHT T1
    Thanks & regard
    areeba ali

    Hi,
    My dear for purchasing it is going in pch5 not inv5.
    Try this...
    select T0.DocNum, T0.DocDate, T0.CardName, T0.DocTotal, T0.WTSum,T2.WTName, T1.Rate from opch T0
    inner join pch5 T1 on T0.Docentry=T1.Absentry
    inner join owht T2 on T1.WTcode=T2.WTCode
    Thanks
    Sachin

  • How to Query E-Business Tax tables/views

    I run SQL queries on the following tables:
    ZX_TRANSACTION
    ZX_TRANSACTION_LINES
    but it returns no rows. How to query ZX tables/views?
    My main purpose is to retrieve tax code which is in 12i no longer available in AP Transaction Distributions table/view.
    Please advise.
    Thanks in advance.

    Hi Srini,
    I followed PL/SQL procedure stated in note 415860.1. But still can't do the query. See below.
    SQL> begin
    2 fnd_global.apps_initialize(1079,51569,235);
    3 mo_global.init('ZX');
    4 end;
    5 /
    PL/SQL procedure successfully completed.
    SQL> select count(*) from ZX_TRANSACTION
    2 /
    COUNT(*)
    0
    SQL> select count(*) from ZX_TRANSACTION_LINES
    2 /
    COUNT(*)
    0
    Thanks,
    Corry

  • Query on Grouping Tax Base Balances for Italian Report Customer/Vendor List

    Hello Experts,
    We are implementing the new italian report for customer/vendor List as per Note : 1090857 - Customer/Vendor List for Italy:New Legal Requirement (2007)
    This requires a customizing in Table/View V_T007K(Group Tax Base Balances) where we need to group the tax codes.
    Based on what logic is this table required to be maintained and what considerations need to be taken care of when mainting the tax codes for each column.
    Anyone who has maintained this table or who is ware of the procedure and logic of maintainance , could kindly advise on the same.
    Points would be awarded for any helpful answer.
    Thanks & Regards,
    Rajeshwari

    Hello,
    Thanks for your answer,
    On what basis should the grouping be done.
    Is it only based on the tax codes types?
    or is there any specific rule.
    has anyone maintained this grouping for a Italian company code before?
    Points would be awarded immediately for any help in this.
    Thanks & Warm Regards,
    Rajeshwari

  • Query for Consolidated tax details

    Dear All
    I need an output through query in PO in the following format:
    BASIC
    FREIGHT
    VAT
    CST
    EXCISE (should include cess & hecess)
    I have the query for individual breakup. ex. vat,cst,bed,cess,hecess, bed on frieht,cess on freight,hecess on freight,vat on freight,cst on freight,vat on excise, cst on excise etc.,
    But i need to have consolidated values for VAT,CST & EXCISE Amounts.
    Can anyone help me on this asap
    regards
    KARTHIK

    You can use dsquery and dsget at the command line of a Domain Controller for most of this. To get displayName, email address (mail attribute), and sAMAccountName (pre-Windows 2000 logon name) of all users:
    dsquery user -limit 0 | dsget user -display -samid -email
    If you want the Common Name, specify  -dn for the distinguishedName. Getting the password expiration date takes more code. I have VBScript and PowerShell scripts for generic queries of AD linked on this page:
    http://www.rlmueller.net/GenericADO.htm
    You are prompted first for the base of the search. Enter nothing for the entire domain. Then you are prompted for the LDAP syntax filter. For all users use:
    (&(objectCategory=person)(objectClass=user))
    Finally you are prompted for the names of the attributes to retrieve. You can enter:
    cn,displayName,mail,pwdLastSet
    The pwdLastSet is a large integer, but the program converts this into the corresponding date (in the local time zone) when the password was last changed. Using the domain maximum password age policy, you can tell when the password will expire. The program
    has an optional parameter to display results in comma delimited format. You would redirect the output to a text file.
    There are scripts to determine the date the passwords will expire, but there is more code. See this example for just one user:
    http://support.microsoft.com/kb/323750
    Richard Mueller - MVP Directory Services

  • Query on WHT TAX

    Hi Friends,
    We have three withholding tax types.
    1. salaries
    2. payment to suppliers(individual)
    3. payment to suppliers(juristic)
    Can we assign one GL account to all WHT types?
    If yes how can we get the tax amount for each type
    Let me know the solution ASAP
    Thanks in advance
    NMB

    yes u can assign one GL account for multiple tax type, report will come base on Official Withholding Tax Key(194c,194K,194J...), this official tax key assigned in tax type and code.
    for more details pl. see the below link
    http://help.sap.com/saphelp_erp2004/helpdata/en/09/ebf138cdd78a4be10000000a114084/frameset.htm

  • Report for Sales and purchase tax (selection criteria-Tax code)

    Hi
    I have one query for sales tax details which gives me detail for all A/R invoices and taxes involved in it. But i want that while executing query system should ask tax code and gives detail of tax amount in front of item and invoice according to tax code selected.
    The query is:
    SELECT M.DocNum AS 'Inv.No ', M.DocDate as 'Date', M.CardName as 'Customer Name',L.Dscription,L.Quantity,L.Price, (Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)', (SELECT Avg(TaxRate) FROM INV4 where statype=1 and DocEntry=M.DocEntry) as ' VAT % ', (SELECT Sum(TaxSum) FROM INV4 where statype=1 and DocEntry=M.DocEntry) as ' VAT (Rs.) ', (SELECT Avg(TaxRate) FROM INV4 where statype=4 and DocEntry=M.DocEntry) as ' CST % ', (SELECT Sum(TaxSum) FROM INV4 where statype=4 and DocEntry=M.DocEntry) as ' CST (Rs.) ', (SELECT Avg(TaxRate) FROM INV4 where statype=7 and DocEntry=M.DocEntry) as ' TAXEXEMPT % ', (SELECT Sum(TaxSum) FROM INV4 where statype=7 and DocEntry=M.DocEntry) as ' TAXEXEMPT ', (SELECT Avg(TaxRate) FROM INV4 where statype=8 and DocEntry=M.DocEntry) as ' VAT% ', (SELECT Sum(TaxSum) FROM INV4 where statype=8 and DocEntry=M.DocEntry) as 'VAT12.5 ', (SELECT Avg(TaxRate) FROM INV4 where statype=9 and DocEntry=M.DocEntry) as ' CST 2% ', (SELECT Sum(TaxSum) FROM INV4 where statype=9 and DocEntry=M.DocEntry) as ' CST @2 ', (SELECT Avg(TaxRate) FROM INV4 where statype=11 and DocEntry=M.DocEntry) as ' CENVCST % ', (SELECT Sum(TaxSum) FROM INV4 where statype=11 and DocEntry=M.DocEntry) as ' CENVCST ', (SELECT Avg(TaxRate) FROM INV4 where statype=-90 and DocEntry=M.DocEntry) as ' BED % ', (SELECT Sum(TaxSum) FROM INV4 where statype=-90 and DocEntry=M.DocEntry) as ' BED ', (SELECT Avg(TaxRate) FROM INV4 where statype=-60 and DocEntry=M.DocEntry) as ' Cess% ', (SELECT Sum(TaxSum) FROM INV4 where statype=-60 and DocEntry=M.DocEntry) as ' Cess ', (SELECT Avg(TaxRate) FROM INV4 where statype=-55 and DocEntry=M.DocEntry) as ' HCess % ', (SELECT Sum(TaxSum) FROM INV4 where statype=-55 and DocEntry=M.DocEntry) as ' Hcess ', L.LineTotal as 'Row Total (Rs.)',M.DocTotal as 'Doc Total' FROM OINV M LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry WHERE (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]') AND TargetType ! = 14 GROUP BY M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.DiscSum,M.WTSum,L.Dscription,L.Quantity,L.Price,L.LineTotal,M.DocTotal ORDER BY M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.DiscSum,M.WTSum,L.Dscription,L.Quantity,L.Price,L.LineTotal,M.DocTotal
    I want 2 queries which asks tax code during selection criteria for both cases sales and purchase.

    Hi Malhotra,
    Try this,
    1st remove the FROM/TO Doc. Date where Condition in your Query report.
    AND add the below where condition in your Query report.
    WHERE statype = '[%0]'
    OR
    Try this Query Report.
    SELECT
    M.DocNum as 'A/R Invoice No.',
    M.DocDate as 'Inv. Date',
    M.CardCode as 'Customer Code',
    M.CardName as 'Customer Name',
    M.NumAtCard as 'Bill No. & Date',
    ISNULL(L.ItemCode,'Service Item') as 'Item Code',
    L.Dscription,
    L.Quantity,
    L.LineTotal,
    L.TaxCode,
    L.[VatSum],
    M.WTSum AS 'TDS (Rs.)',
    M.DocTotal as 'Total (Rs.)'
    FROM OINV M
    LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry
    LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum
    LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry
    LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry
    WHERE
    (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]')
    AND
    L.TaxCode='[%2]'
    GROUP BY
    M.DocNum,M.DocDate,M.CardCode,M.CardName,M.NumAtCard,L.ItemCode,L.Dscription,L.Quantity,
    L.LineTotal,M.DocEntry,M.[DiscSum],L.TaxCode,L.[VatSum],M.WTSum,M.DocTotal
    ORDER BY
    M.DocNum,M.DocDate,M.CardCode,M.CardName,M.NumAtCard,L.ItemCode,L.Dscription,L.Quantity,
    L.LineTotal,M.DocEntry,M.[DiscSum],L.TaxCode,L.[VatSum],M.WTSum,M.DocTotal
    Regards,
    Madhan.

  • Tds details of vendor coming but not business area.

    Hi Experts,
    I am making a report to display vendor data with its TDS details in accounting documents.
    I am getting all the data from other tables rather 1 table BSEG, which is a cluster table. I need to retrieve business are from BSEG i.e. (BSEG-GSBER).
    I am using another select query for this, but when i put debugger at loop of business are, it is showing the data, but in alv display it is not showing business area.
    Hence i need your help on that.
    Please go through the program code given below.
    Thanks,
    Deepanshu Mathur
    TABLES: BSEG,BKPF,WITH_ITEM,T059Z,T059ZT,LFA1.
    DATA: BEGIN OF ITAB OCCURS 0,
            BELNR LIKE BKPF-BELNR,                    " Accounting Document Number
            GJAHR LIKE BKPF-GJAHR,                    " Fiscal Year
            BUKRS LIKE BKPF-BUKRS,                    " Company Code
            BLDAT LIKE BKPF-BLDAT,                    " Document Date in Document
            BUDAT LIKE BKPF-BUDAT,                    " Posting Date in the Document
            LIFNR LIKE BSEG-LIFNR,                    " Account Number of Vendor or Creditor
            GSBER LIKE BSEG-GSBER,                    " Business Area
            WT_QSSHH LIKE WITH_ITEM-WT_QSSHH,         " Withholding tax base amount (local currency)
            WT_QBSHH LIKE WITH_ITEM-WT_QBSHH,         " Withholding tax amount (in local currency)
            WITHT LIKE WITH_ITEM-WITHT,               " Indicator for withholding tax type
            WT_WITHCD LIKE WITH_ITEM-WT_WITHCD,       " Withholding tax code
            QSCOD LIKE T059Z-QSCOD,                   " Official Withholding Tax Key
            QSATZ LIKE T059Z-QSATZ,                   " Withholding tax rate
            NAME1 LIKE LFA1-NAME1,                    " vendor name
            LAND1 LIKE LFA1-LAND1,                    " Country Key
            TEXT40 LIKE T059ZT-TEXT40,                " Text, 40 Characters Long
            WAERS LIKE BKPF-WAERS,                    " Currency
            WT_ACCO LIKE WITH_ITEM-WT_ACCO,
          END OF ITAB.
    DATA: BEGIN OF LT_BSEG OCCURS 0,
            BELNR LIKE BSEG-BELNR,                    " Accounting Document Number
            GJAHR LIKE BSEG-GJAHR,                    " Fiscal Year
            BUKRS LIKE BSEG-BUKRS,                    " Company Code
            LIFNR LIKE BSEG-LIFNR,                    " Account Number of Vendor or Creditor
            GSBER LIKE BSEG-GSBER,                    " Business Area
          END OF LT_BSEG.
    SELECTION-SCREEN: BEGIN OF BLOCK FRAME WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: COCO FOR BKPF-BUKRS,
                    DOC_DATE FOR BKPF-BLDAT,
                    POST_DAT FOR BKPF-BUDAT,
                    FIS_YEAR FOR BKPF-GJAHR.
    SELECTION-SCREEN: END OF BLOCK FRAME.
    TYPE-POOLS:slis.
    DATA: body        TYPE slis_t_fieldcat_alv,
          header      TYPE slis_fieldcat_alv,
          gd_layout   TYPE slis_layout_alv,
          gd_repid    LIKE sy-repid.
    START-OF-SELECTION.
      PERFORM FETCH.
    END-OF-SELECTION.
    *&      Form  FETCH
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM FETCH .
    SELECT
      BKPF~BELNR BKPF~GJAHR BKPF~BUKRS BKPF~BLDAT BKPF~BUDAT BKPF~WAERS
      WITH_ITEM~BELNR WITH_ITEM~GJAHR WITH_ITEM~BUKRS WITH_ITEM~WT_QSSHH WITH_ITEM~WT_QBSHH WITH_ITEM~WITHT
      WITH_ITEM~WT_WITHCD WITH_ITEM~WT_ACCO
      LFA1~LIFNR LFA1~NAME1 LFA1~LAND1
      T059Z~WITHT T059Z~WT_WITHCD T059Z~QSCOD T059Z~QSATZ
      T059ZT~WITHT T059ZT~TEXT40 T059ZT~WT_WITHCD
      INTO CORRESPONDING FIELDS OF TABLE ITAB FROM BKPF
      JOIN WITH_ITEM ON WITH_ITEM~BELNR = BKPF~BELNR AND
                        WITH_ITEM~GJAHR = BKPF~GJAHR AND
                        WITH_ITEM~BUKRS = BKPF~BUKRS AND
                        WITH_ITEM~WT_QSSHH NE ' ' AND WITH_ITEM~WT_QBSHH NE ' '
      JOIN LFA1 ON LFA1~LIFNR = WITH_ITEM~WT_ACCO
      JOIN T059Z ON T059Z~WITHT = WITH_ITEM~WITHT AND T059Z~WT_WITHCD = WITH_ITEM~WT_WITHCD
      JOIN T059ZT ON T059ZT~WITHT = WITH_ITEM~WITHT AND T059ZT~WT_WITHCD = WITH_ITEM~WT_WITHCD
      WHERE
            BKPF~BUKRS IN COCO AND
            BKPF~BLDAT IN DOC_DATE AND
            BKPF~BUDAT IN POST_DAT AND
            BKPF~GJAHR IN FIS_YEAR.
    SELECT
      BELNR GJAHR BUKRS LIFNR GSBER
      FROM BSEG
      INTO CORRESPONDING FIELDS OF TABLE LT_BSEG
      FOR ALL ENTRIES IN ITAB
      WHERE BELNR = ITAB-BELNR AND GJAHR = ITAB-GJAHR AND BUKRS = ITAB-BUKRS AND LIFNR NE ' ' .
    IF SY-SUBRC EQ 0.
    SORT ITAB BY BLDAT BELNR.
    LOOP AT LT_BSEG WHERE BELNR = ITAB-BELNR AND GJAHR = ITAB-GJAHR AND BUKRS = ITAB-BUKRS AND LIFNR NE ' '.
    IF ( LT_BSEG-BELNR = ITAB-BELNR AND LT_BSEG-GJAHR = ITAB-GJAHR AND LT_BSEG-BUKRS = ITAB-BUKRS AND
         LT_BSEG-LIFNR NE ' ').
        MOVE LT_BSEG-GSBER TO ITAB-GSBER.
    ENDIF.
    APPEND ITAB.
    ENDLOOP.
      PERFORM BUILD_LAYOUT.
      PERFORM FIELDCATALOG.
      PERFORM ALVDISPLAY.
    ELSE.
      MESSAGE 'DATA NOT FOUND !' TYPE 'I'.
    ENDIF.
    ENDFORM.
    *&      Form  BUILD_LAYOUT
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM BUILD_LAYOUT .
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-info_fieldname = 'WS_COLOR'.
      gd_LAYOUT-coltab_fieldname = 'CELL_COLOR'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  FIELDCATALOG
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM FIELDCATALOG .
      header-col_pos = '1'.
      header-tabname = 'ITAB'.
      header-fieldname = 'BLDAT'.
      header-seltext_l = 'Doc. Date'.
      header-just = 'C'.
      APPEND header TO body.
      CLEAR header.
      header-col_pos = '2'.
      header-tabname = 'ITAB'.
      header-fieldname = 'BUDAT'.
      header-seltext_l = 'Posting Date'.
      header-just = 'C'.
      APPEND header TO body.
      CLEAR header.
      header-col_pos = '3'.
      header-tabname = 'ITAB'.
      header-fieldname = 'GJAHR'.
      header-seltext_l = 'Fiscal Year'.
      header-just = 'C'.
      APPEND header TO body.
      CLEAR header.
      header-col_pos = '4'.
      header-tabname = 'ITAB'.
      header-fieldname = 'BUKRS'.
      header-seltext_l = 'Company Code'.
      header-just = 'C'.
      APPEND header TO body.
      CLEAR header.
      header-col_pos = '5'.
      header-tabname = 'ITAB'.
      header-fieldname = 'GSBER'.
      header-ref_tabname = 'BSEG'.
      header-ref_fieldname = 'GSBER'.
      header-just = 'L'.
      APPEND header TO body.
      CLEAR header.
      header-col_pos = '6'.
      header-tabname = 'ITAB'.
      header-fieldname = 'BELNR'.
      header-seltext_l = 'Doc. No.'.
      header-ref_tabname = 'WITH_ITEM'.
      header-ref_fieldname = 'BELNR'.
      header-just = 'L'.
      APPEND header TO body.
      CLEAR header.
      header-col_pos = '7'.
      header-tabname = 'ITAB'.
      header-fieldname = 'LIFNR'.
      header-seltext_l = 'Vendor'.
      header-ref_tabname = 'LFA1'.
      header-ref_fieldname = 'LIFNR'.
      APPEND header TO body.
      CLEAR header.
      header-col_pos = '8'.
      header-tabname = 'ITAB'.
      header-fieldname = 'NAME1'.
      header-seltext_l = 'Vendor Name'.
      APPEND header TO body.
      CLEAR header.
      header-col_pos = '9'.
      header-tabname = 'ITAB'.
      header-fieldname = 'LAND1'.
      header-seltext_l = 'Country'.
      header-ref_tabname = 'LFA1'.
      header-ref_fieldname = 'LAND1'.
      header-just = 'C'.
      APPEND header TO body.
      CLEAR header.
      header-col_pos = '10'.
      header-tabname = 'ITAB'.
      header-fieldname = 'WITHT'.
      header-seltext_l = 'Withholding Tax Type'.
      header-ref_tabname = 'WITH_ITEM'.
      header-ref_fieldname = 'WITHT'.
      header-just = 'L'.
      APPEND header TO body.
      CLEAR header.
      header-col_pos = '11'.
      header-tabname = 'ITAB'.
      header-fieldname = 'WT_WITHCD'.
      header-seltext_l = 'Withholding Tax Code'.
      header-ref_tabname = 'WITH_ITEM'.
      header-ref_fieldname = 'WT_WITHCD'.
      header-just = 'L'.
      APPEND header TO body.
      CLEAR header.
      header-col_pos = '12'.
      header-tabname = 'ITAB'.
      header-fieldname = 'QSCOD'.
      header-seltext_l = 'Tax Key'.
      header-ref_tabname = 'T059Z'.
      header-ref_fieldname = 'QSCOD'.
      header-just = 'L'.
      APPEND header TO body.
      CLEAR header.
      header-col_pos = '13'.
      header-tabname = 'ITAB'.
      header-fieldname = 'TEXT40'.
      header-seltext_l = 'Section Code'.
      header-ref_tabname = 'T059ZT'.
      header-ref_fieldname = 'TEXT40'.
      header-just = 'L'.
      APPEND header TO body.
      CLEAR header.
      header-col_pos = '14'.
      header-tabname = 'ITAB'.
      header-fieldname = 'WAERS'.
      header-seltext_l = 'Currency'.
      header-just = 'C'.
      APPEND header TO body.
      CLEAR header.
      header-col_pos = '15'.
      header-tabname = 'ITAB'.
      header-fieldname = 'WT_QSSHH'.
      header-seltext_l = 'TDS Base Amount'.
      header-ref_tabname = 'WITH_ITEM'.
      header-ref_fieldname = 'WT_QSSHH'.
      header-do_sum = 'X'.
      header-just = 'R'.
      APPEND header TO body.
      CLEAR header.
      header-col_pos = '16'.
      header-tabname = 'ITAB'.
      header-fieldname = 'QSATZ'.
      header-seltext_l = 'TDS Tax Rate'.
      header-just = 'R'.
      APPEND header TO body.
      CLEAR header.
      header-col_pos = '17'.
      header-tabname = 'ITAB'.
      header-fieldname = 'WT_QBSHH'.
      header-seltext_l = 'TDS Amount'.
      header-ref_tabname = 'WITH_ITEM'.
      header-ref_fieldname = 'WT_QBSHH'.
      header-do_sum = 'X'.
      header-just = 'R'.
      APPEND header TO body.
      CLEAR header.
    ENDFORM.                    " FIELDCATALOG
    *&      Form  ALVDISPLAY
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM ALVDISPLAY .
    gd_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       i_callback_program      = gd_repid
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
       IS_LAYOUT                         = gd_layout
       IT_FIELDCAT                       = body
      TABLES
        T_OUTTAB                          = ITAB
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2.
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " ALVDISPLAY
    Form TOP_OF_PAGE.
    *ALV Header declarations
      data: t_header type slis_t_listheader,
            wa_header type slis_listheader,
            t_line like wa_header-info,
            ld_lines type i,
            ld_linesc(10) type c.
    * Title
      wa_header-typ  = 'H'.     " H = Header
      wa_header-info = 'TDS Report'.
      append wa_header to t_header.
      clear wa_header.
    * Date
      wa_header-typ  = 'S'.     " S = Selection
      wa_header-key = 'Date: '.
      CONCATENATE  sy-datum+6(2) '.'
                   sy-datum+4(2) '.'
                   sy-datum(4) INTO wa_header-info.   "todays date
      append wa_header to t_header.
      clear: wa_header.
    * Total No. of Records Selected
      describe table ITAB lines ld_lines.
      ld_linesc = ld_lines.
      concatenate 'Total No. of Records Selected: ' ld_linesc
                        into t_line separated by space.
      wa_header-typ  = 'A'.     " A = Action
      wa_header-info = t_line.
      append wa_header to t_header.
      clear: wa_header, t_line.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = t_header.
    *            i_logo             = 'Z_LOGO'.
    endform.                    "top-of-page

    Hi,
    Try Below code.
    1) your code is very bad I am not sure whether it will work or not because it has inner join queries on many tables.
    2) I made certain changes, please check the data selection part as below
    SELECT bkpf~belnr bkpf~gjahr bkpf~bukrs bkpf~bldat bkpf~budat bkpf~waers with_item~belnr
        with_item~gjahr with_item~bukrs with_item~wt_qsshh
      with_item~wt_qbshh with_item~witht with_item~wt_withcd with_item~wt_acco lfa1~lifnr
         lfa1~name1 lfa1~land1 t059z~witht t059z~wt_withcd t059z~qscod
         t059z~qsatz t059zt~witht t059zt~text40 t059zt~wt_withcd
        INTO CORRESPONDING FIELDS OF TABLE itab
         FROM bkpf
      INNER JOIN with_item ON with_item~belnr = bkpf~belnr AND with_item~gjahr = bkpf~gjahr
        AND with_item~bukrs = bkpf~bukrs AND with_item~wt_qsshh NE ' '
        AND with_item~wt_qbshh NE ' '
        INNER JOIN lfa1 ON lfa1~lifnr = with_item~wt_acco
        INNER JOIN t059z ON t059z~witht =
      with_item~witht AND t059z~wt_withcd = with_item~wt_withcd
        INNER JOIN t059zt ON t059zt~witht = with_item~witht AND t059zt~wt_withcd = with_item~wt_withcd
        WHERE bkpf~bukrs IN coco AND bkpf~bldat IN doc_date
        AND bkpf~budat IN post_dat AND bkpf~gjahr IN fis_year.
      IF itab[] IS NOT INITIAL.
        SELECT belnr gjahr bukrs lifnr gsber FROM bseg
          INTO CORRESPONDING FIELDS OF TABLE lt_bseg
          FOR ALL ENTRIES IN itab
          WHERE belnr = itab-belnr
          AND gjahr = itab-gjahr AND bukrs = itab-bukrs
          AND lifnr NE ' ' .
        IF sy-subrc EQ 0.
          SORT itab BY bldat belnr.
    *    LOOP AT lt_bseg WHERE belnr = itab-belnr AND
    *      gjahr = itab-gjahr AND bukrs = itab-bukrs AND lifnr NE ' '.
    *      IF ( lt_bseg-belnr = itab-belnr AND lt_bseg-gjahr = itab-gjahr
    *        AND lt_bseg-bukrs = itab-bukrs AND lt_bseg-lifnr NE ' ').
    *        MOVE lt_bseg-gsber TO itab-gsber.
    *      ENDIF.
    *      APPEND itab.
    *    ENDLOOP.
          LOOP AT itab.
            READ TABLE lt_bseg
            WITH KEY belnr = itab-belnr
            gjahr = itab-gjahr
             bukrs = itab-bukrs.
            MOVE lt_bseg-gsber TO itab-gsber.
            MODIFY itab.
            CLEAR :lt_bseg,itab.
          ENDLOOP.
          PERFORM build_layout. PERFORM fieldcatalog. PERFORM alvdisplay.
        ELSE.
          MESSAGE 'DATA NOT FOUND !' TYPE 'I'.
        ENDIF.
      ENDIF.

Maybe you are looking for

  • Printing with Lithuanian language without installing it in SAP 4.6 C system

    Hello Expert guys , I have 4.6C that is non unicode system for one of my customer . Customer wants to print sapscript document (some line in document are entered in Lithuania characters from pc with Lithuania os on it ) On sap system it looks good bu

  • Internal Orders versus Project Systems

    Hi My client is currently using WBS elements for capital projects.   Project System is not in scope; thus, we are trying to decide whether we should bring it in scope with limited functionality or use internal orders for capital projects. I'm writing

  • Worried about number of photos

    My wife is running a MBP and is just scaring 15,000 photos. My kids are only 3 and 6 so at this rate I'm really worried what to do with all these? I'm thinking of building a media locker with http://lime-technology.com/ to store all these. So here's

  • I have updated my flash player and I am still promoted to update to the latest version to run a spec

    I have update my flash player but keep getting prompted to indtall the latest version. I am unable to run a program for my kids homework (classzone.com). Why?

  • Call to WPG_SESSION API Failed. Error-Code:20001

    Here is the error I am getting while accessing portal. This error comes 2 out of 5 times.: Call to WPG_SESSION API Failed. Error-Code:20001 Error TimeStamp:Fri, 23 Mar 2001 17:28:33 GMT Database Log In Failed TNS is unable to connect to destination.