Withholding tax based on segments/profit center

Hello Friends
Iam developing withholding tax report for our FI module.I need to show report based on segments which are our different company offices.Now WITH_ITEM table does not has segment otherwise I would have directly picked data from WITH-ITEM. .Iam using this complex logic,which I have a feeling is not the right way and is taking lot of time to run.
My report logic  is as follows:
First I pick from BKPF those documents which are vendor payments.
SELECT * INTO CORRESPONDING FIELDS OF TABLE ibkpf
         FROM bkpf
         WHERE bukrs =  p_bukrs
           AND gjahr =  p_gjahr
           AND belnr IN s_belnr
           AND blart IN ('KZ')
           AND budat IN s_budat.
Next I find the invoice number against that payment number.
LOOP AT ibkpf.
  SELECT SINGLE belnr FROM BSak
                        INTO v_belnr
                        WHERE bukrs =  p_bukrs
                          AND gjahr =  p_gjahr
                          AND augbl = ibkpf-belnr
                          AND BLART = 'KR'.
Then I get the segment against that invoice and remove from internal table those values whose segment is different.
    SELECT SINGLE segment FROM bsis
                     INTO v_segment
                      WHERE bukrs =  p_bukrs
                        AND gjahr =  p_gjahr
                        AND belnr = v_belnr
                       AND segment = p_seg.
IF sy-subrc NE 0.
      DELETE ibkpf.
   ENDIF.
  ENDLOOP.
Now getting from with_iem data against the remaining document numbers.
SELECT * FROM with_item FOR ALL ENTRIES IN ibkpf
     WHERE bukrs     = p_bukrs
       AND belnr     = ibkpf-belnr
       AND gjahr     = p_gjahr
       AND wt_acco   IN s_lifnr
       AND wt_withcd IN s_taxc
       AND witht     IN S_WITHT.
If some one has experience in withholding tax reports,he can check my code and suggest some other logic as our data base is not too heavy at this time still report is very slow.
Thank you

Hi Nouman,
For performance related issue,please select only required entries because use of *SELECT ** will degrade its performance.
Make a structure and avoid using CORRESPONDING FIELDS OF .
Regards,
Praveen

Similar Messages

  • Segment & Profit Center Activation

    Hello Gurus,
    Could you please forward me some good links on  Segment & Profit Center Activation.
    ie How & Where to configure for Segments?
    & How & Where to configure for Profit Center Activation?
    If you can help me on this, it will really be very nice of you.
    Thanks in Anticipation,
    Warm Regards,
    Debojit Dey

    Hi,
    Profit Center field should normally be available in Sales order line item in Account Assignment tab. If it is not visible, please check the field status group of Revenue GL Code. (Profit center field should be made optional). Also check the settings of Movement type 601 (hope this is the movement type which is used when PGI for this Sales order is done)
    Please revert if it helped.
    Regards
    Vineet
    Edited by: Vineet Bhardwaj on May 1, 2010 7:31 PM

  • 3.Tax Report - Splitted by Profit Center

    Hi Colleagues,
    My customer has following problem.
    They have a vendor and customer invoice posted to more profit centers, but in the tax report the firts Profit centers wehre the document is posted is only visable?
    Do they need to activate a New GL (document splitt) in order to get a tax reports splitted by Profit centers.
    Thanks in advance.
    Best Regards,
    Slavisa Lecic

    Hi Ashish,
    If you have hierarchy node like "ALL" which have all the base members of Account and there is no data for other combination.
    Ex - Combination of Profit Center A with Accounts 100001 - 100010, 420000, 430000 etc.
    Combination of Profit Center B with Accounts 100001 - 100010, 520000, 530000 etc.
    In this case if there is no data for combination of Profit Center A and Account 520000, 530000 etc.
    and Profit Center B and Account 420000, 430000
    then you can use hierarchy node.
    Regards,
    Shrikant

  • Profit center based on cogs profit center

    Hi All,
    Based on a business requirement, I need to auto populate the profit center based on the cogs profit center selected at row level.
    I have made a query but it auto populates the profit center only on the second row when we add a item and not when we select the first item? Any suggestions..
    The fms used is
    SELECT $[DLN1.CogsOcrCod]
    which is set to display saved user defined values.
    Thanks,
    Joseph

    Hi!
    In whcih document you have this FMS.
    Is the FMS is  auto refresh ? On which field it is been set for refresh
    When you click the magnifier on First row, did the FMS is working ?
    Change your Auto refresh field and check.
    If you are using Copy From or Copy To option , there is a chance of not triggering the FMS

  • Segment - Profit center

    I have activate new ledger and created segment. While creating profit center , the segment field is missing.
    what could be the reason
    Thks
    Bali

    I have activate new ledger and created segment. While creating profit center , the segment field is missing.
    what could be the reason
    Thks
    Bali

  • Account-based PA vs. profit center accounting

    Hello,
    I am pretty new to this area. We are planning to use account-based PA in SAP and we are already using PCA.
    So we are wondering if it is possible to "copy/convert" existing reports in PCA (KE5A) into PA?
    The second question is, are PA and PCA "using" the same data?
    Thanks
    Anne

    Hi,
    Definitely, not. The reports of PCA not only based on different tables, but also use different extraction logic than reports of CO-PA. You will have to build a separate set of reports for CO-PA.
    Regards,
    Eli

  • Profit center in Miro

    Dear friends,
    When I make a Invoice verification entry for purchase in MIRO, the system is generating an invoice entry along with withholding tax. But the profit center is not picked up in the line item of TDS GL account. In F-43, it is allowing me to enter while simulating but not at the time of MIRO. Can anybody help me out on this issue, how to enter profit center in Line item of TDS at the time of invoice verification.
    Thanks
    Uma

    Hi,
    Please check your cusdtomiztion at 3KEH and also go through the note 854944.
    Regards
    Ravinagh Boni
    Rewards me if it useful.

  • Default Profit Center Problem - Withholding Tax GL

    Dear SAP New GL Gurus,
    I am trying to configure the system for automated Withholding Tax postings.  We are on ECC6.0 New GL with Doc Splitting active.
    I have successfully done the Doc Splitting and it works perfectly fine.
    I am facing problem at Auto derivation of Profit Center for GL Accounts.
    I have configured the Withholding Tax Codes and assigned the GL Accounts.  The Tax codes are assigned for Vendors.
    When there is a posting for the Vendors the system generates an additional line item for the Tax Codes.  However the system fails to post this for want of Profit Center.
    I went to path: FA New - GL New - Master Data - Profit Center - Assign Default Profit Center to Accounts: Over here I gave the GL Account of Tax Code and a Profit Center.
    The system still does not grab the PC automatically.
    Whether I am missing some config here?
    Please advise.
    Many Thanks
    Rob

    I am not bringing Bank Account at all.  The Accounting entry goes this way -
    Expense    DR
    Vendor       CR
    TDS Payable (Automatic) CR - This is where the problem for the Profit Center comes up.
    As such the postings are going perfectly fine for Vendor without TDS and Expense lines (even with different Cost and Profit Centers).  That is to say the Doc Splitting is working fine.
    Any clues?
    Many Thanks.

  • Change company code based on profit center at line item level in FB50

    Hi All,
    Following is my requirement, would be thankful if anyone can provide inputs on the same.
    When posting documents through FB50, In line item table control company code column gets un-editable ones correct entries are entered for that line. But after this if we want to change the profit center which belongs to different company code system throws error and makes company code column un-editable. In this situation there is no option left for user to correct the values unless he deletes the current line and creates a new one.
    Here can we make the company code field always editable?
    If not can we update the company code based on the profit center entered on that line item?
    I looked for exits but couldn't find any, validation and substitution are also not working because error message thrown by SAP is getting triggered before the substitution or validation code is executed.
    Please drop in your comments/inputs.
    Thanks in advance.
    Lucky.

    Transaction Code - FB50                     G/L Acct Pstg: Single Screen Trans.
    Exit Name           Description
    RFAVIS01            Customer Exit for Changing Payment Advice Segment Text
    RFEPOS00            Line item display: Checking of selection conditions
    RFKORIEX            Automatic correspondence
    SAPLF051            Workflow for FI (pre-capture, release for payment)
    F050S001            FIDCMT, FIDCC1, FIDCC2: Edit user-defined IDoc segment
    F050S002            FIDCC1: Change IDoc/do not send
    F050S003            FIDCC2: Change IDoc/do not send
    F050S004            FIDCMT, FIDCC1, FIDCC2: Change outbound IDoc/do not send
    F050S005            FIDCMT, FIDCC1, FIDCC2 Inbound IDoc: Change FI document
    F050S006            FI Outgoing IDoc: Reset Clearing in FI Document
    F050S007            FIDCCH Outbound: Influence on IDoc for Document Change
    F180A001            Balance Sheet Adjustment
    FARC0002            Additional Checks for Archiving MM Vendor Master Data
    FEDI0001            Function Exits for EDI in FI
    No of Exits:         14
    USER EXIT
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sapgenie.com/abap/code/abap26.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    http://www.easymarketplace.de/userexit.php
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sappoint.com/abap/userexit.pdfUser-Exit
    http://www.sap-img.com/ab038.htm
    http://help.sap.com/saphelp_46c/helpdata/en/64/72369adc56d11195100060b03c6b76/frameset.htm
    USER EXIT
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://expertanswercenter.techtarget.com/eac/knowledgebaseAnswer/0,295199,sid63_gci982756,00.html
    Rewards if useful.........
    Minal

  • Profit Center to be updated in Service Tax GL's as per Project Profit Cente

    Hello Experts
    We are facing a problem please if any1 can help?
    In case of Billing Document with Service Tax Code, Service Tax line items require Profit Center field.
    If we maintain Default Profit Center in FAGL3KEH, then system picks only that Profit Center against Service TAx GL's.
    But for each Projects there is Profit Centers & also 1 Plant assigned in Project System.
    Now for all Profit Center's there are only 3 Service TAx GL's(Main GL, Education Cess & S & HS ECess).
    In FAGL3KEH, we cannot maintain same GL's for different Profit Centers.
    Client Requirement is that, In Service TAx GL's line items in Journal Entry Profit Center to be updated as per Profit Center of Project.
    So where can we do such settings?
    Can Profit Center field be updated in an entry based on Project chosen for entering Billing?

    Hi,
    Are you generating the billing docuemnt aginst the Project/WBS element. if so please delete the default account assignment to service tax accounts. it will read the Profit center from Revenue line item int he delivery document.
    Regards
    Murali

  • Deferred Tax - Incorrect Profit center at the time of Transfer

    Hi,
    We are on ECC 6.0 ehp4. We have created the service tax codes with target service tax codes & every month end we run standard sap program S_AC0_52000644 to transfer the service tax from receivable to availed account. Following is the issue
    Invoice Posted with following entry (In GL view)
    SRIR A/c Dr..............                                          Profit center 5001
    Service Tax Recevble A/c Dr...............                  Profit center 5001
    R/off A/c Cr                                                         Profit center 9001
    Tds A/c cr                                                           Profit center 5001
    domestic vendor A/c cr                                         Profit center 5001
    domestic vendor A/c cr                                         Profit center 9001
    This entry was reversed with transaction code MR8M & exact reversal entry was posted. Now this reversal entry and the above original entry was cleared, after that when in the mont end I ran the service tax transfer report below is the scenario
    Service Tax Receivable for Original Invoice entry got transfered correctly to profit center 5001. Service tax receivable for reversed entry also got transfere correctly but the entire amount of service tax was transfered to profit center 9001 instead of 5001, can any one advise on system behaviour. Now in this my issue is, for reversal entery, the service tax got credited to profit center 5001, but when it got transfered system credited to profit cetner 9001.
    Please advise
    Shailesh

    Hi,
    Please consider notes :
    1469580
    1073837
    BR,
    Raquel

  • Profit Center determination for Tax clearing

    Hi Experts,
    Stock transfer has been processed from factory plant (1000) to depot (4226). Since the material is produced (FG material) in the factory plant and supplied it to depot, there involves inventoried of excise values.
    On posting goods issue (PGI), the material document is as follows:
    Description--Amount--
    Profit center
    Dr. Stock(4226)---1103--
    4000
    Cr. Stock(1000)---1000--
    1000
    Cr. Tax clearing----100--
    4000
    Cr. Tax clearing-----02--
    4000
    Cr. Tax clearing-----01--
    4000
    In the above entry, "STO tax clearing a/c" profit center should be 1000, since factory plant is supplying the material to Depot. For the stock GL entries, profit center are getting determined from the Material master w.r.t plant.
    Tax clearing GL a/c is configured in OBYC under the Transaction IXD. Please help me on how the profit center is getting determined for the Tax clearing a/cs. Profit center has to be 1000 for the Tax clearing, not 4000.
    Thanks in advance.
    Regards,
    Vijay N

    Dear Mr. AP,
    Thank you for your reply. Have checked the same but no STO clearing a/c has been assigned with 4000 profit center.
    Any other help? thanks in advance.
    Regards,
    Vijay N

  • Profit center -- segment as entry ifield in customer posting

    Hi,
    we're in a New GL environment with the document splitting active.
    I wonder if it is possible to have the profit center -segment field open for entry in the customer line of a posting?
    I tried to make profit center and segment as 'mandatory entry' in the field status of the posting key and the customer reconciliation account but without succes.
    thanks for advice,
    François

    Christian,
    I'm using F-28 transaction. What I'm willing to do is to allocate some money I received from my client to the correct site (Segment->profit center). The thing is that the remittance advice has not yet been received so I can not yet clear my bank account against my customer.
    On the other hand I'm not allowed to allocate the cash to another profit center than the one linked to the bank accounts (business rule). So I can not indicate the profit center of the site on the bank account. this is the reason why I want to set one particular profit center on the customer side/
    thanks for info
    fx

  • Spec. Purpose ledger-Profit center

    Hello,
    We have a issue with Spec. Purpose Ledger account.
    There are 5 items in that account with 5 g/l accounts are updating. Out of 5, in 2 accounts profit center is updating wrongly.
    When we check that one of them is updating tax value. The profit center is updating from defaulted profit center assigned to company code and that specific G/L account. This is because when the value of the profit center is blank from where it has to pick the profit center, then default profit center should come. So this case is happening.
    Now I would like to know for tax values, from where the profit center will be picking.
    What are the different areas where this profit center will be maintained.
    Please reply if this information is not sufficient.
    Best regards,
    SASi

    Check table MSEG Document Segment: Material
    PRCTR    Profit Center
    MBLNR   Number of Material Document

  • Profit Center Accounting in BCS

    Dear Experts,
    I'm going to have Profit Center based consolidation reporting in SEM-BCS. Since I'm using NewGL (with segmented Profit Center), I don't have to activate Profit Center Accounting Module.
    Is it possible to have Profit Center based consolidation report in SEM-BCS without PCA Module activation?
    Thank you.

    Although I have never encountered this situation, if the profit center is provided in the source infocube for the data load without activating the PCA module, then should not be a problem.

Maybe you are looking for