The billing document has incorrect gross weight on the output

Hi All,
I'm facing a problem - the billing document has the incorrect gross weight on the output.
The output of gross weight is 3 x the true gross weight.
The program was looping three time during this select causing the value in t_weights-brgew to be 3 times the true value.
Could someone advise how to resolve this problem?
Below is part of the program for gross weight.
  REFRESH t_weights.
  SELECT vekp~brgew INTO t_weights-brgew
                    FROM vekp JOIN vepo ON vekpvenum EQ vepovenum
                         WHERE vepo~vbeln = w_vbeln
                         AND vepo~matnr = w_matnr.
    COLLECT t_weights.
  ENDSELECT.
  IF NOT t_weights[] IS INITIAL.
    READ TABLE t_weights INDEX 1.
    READ TABLE out_tab WITH KEY name = 'BRGEW'.
    IF sy-subrc = 0.
    move t_weights-brgew TO out_tab-value.
      MOVE t_weights-brgew TO w_gross.
      MOVE w_gross TO out_tab-value.
      WRITE w_gross TO out_tab-value LEFT-JUSTIFIED NO-ZERO DECIMALS 2.
      MODIFY out_tab INDEX sy-tabix.
    ENDIF.
  ENDIF.
ENDFORM.                               " of get_nett_gross_weights
Thank you.

What is the Structure of the t_weights.
This may happen due to that condition in select stament, there might be more record for it, so it will add twice or thrice especially due to the JOIN/INNER JOIN statements,
Try SELECT DISTINCT <..followed by your same code...>

Similar Messages

  • Error while saving the billing document

    Dear All,
    I am getting an Error- "No taxes on sales/purchase are allowed for account 870205 L002, AB is not allowed" when i save the billing document. when i go to the conditions tab under item data in the billing document after saving the document and try to view the detail for the discount condition type it shows that the discount condition type has a tax code AB assigned to it.
    I am using the same pricing procedure in another company code where it works fine and I don't get any error. Besides here on viewing the same discount condition type there is no tax code assigned.
    Can anybody explain what could be the possible reason?
    I searched for the solution in the forum and came to know that if I go to FS00 and assign * to Tax Category under control data then it works fine and i don't encounter the problem after saving the billing document.
    Although i have found the solution But what troubles me is that when the same pricing procedure works fine in the first company code without assigning * to the tax category then why do i need to assign * in the second company company code to be able to save the billing document.
    Thanks and Regards
    Deepak Joshi

    First of all let me ask you to indicate the name correctly.
    Secondly,  the root cause to the issue what you have indicated is in FS00 and you need to compare the settings in both the company codes.  
    Finally, the issue is not because of your pricing procedure but because of some missing FI settings.  Thats all I can say now based on the information you have provided.
    thanks
    G. Lakshmipathi

  • User Exits for transaction VF01 before saving the billing document

    Can any one say is there any user exit which exits before saving the billing document since i want to check the net value of the billing with the net value of sales order so that it should not go beyond the total amount specified in sales order.

    J_3RSINV
    SDVFX001  User exit header line in delivery to accounting
    SDVFX002  User exit for A/R line in transfer to accounting
    SDVFX003  User exit cash clearing in transfer to accounting
    SDVFX004  User exit G/L line in transfer to accounting
    SDVFX005  User exit reserves in transfer to accounting
    SDVFX006  User exit tax line in transfer to accounting
    SDVFX007  User exit: Billing plan during transfer to Accounting
    SDVFX008  User exit: Processing of transfer structures SD-FI
    SDVFX009  Billing doc. processing KIDONO (payment reference numbe
    SDVFX010  User exit item table for the customer lines
    SDVFX011  Userexit for the komkcv- and kompcv-structures
    V05I0001  User exits for billing index
    V05N0001  User Exits for Printing Billing Docs. using POR Procedu
    V60A0001  Customer functions in the billing document
    V60P0001  Data provision for additional fields for display in lis
    V61A0001  Customer enhancement: Pricing
    These are the Exits Available in the Package
    Jus try finding which will suffice ur Requirement.
    Regards,
    Mithun

  • Cancel the Release to Accounting but not the Billing Document

    Hi Gurus,
    Is there a way to Cancel the release to accounting billing document but it will not cancel the billing document. I can't cancel the billing documen because it is already used as a reference to one of our orders.
    I hope you can help me...
    Thanks a lot!
    Mon Magallanes

    Hi,
    As per my understanding the accounting document in itself cannot be canceled. Because once the posting is done it will be reflected in the PL. If you cancel the billing document itself then the Accounting entries would be reversed.
    Thanks,
    Mukund

  • Excange rate should trigger in the billing document as per the billing date

    Hi Folks,
    I have a below scenario.
    Today I have created the Sales order and after 2 days I am creating the billing document. In the billing document the  exchange rate is triggering as per the sales order date, but I want  my billing document should be pick up the exchange rate as per the billing document  date.
    Please help me on this issue.
    Thanks
    ANGKS.

    Hi,
    Thanks for all your replays, but still my requirement is incomplete.
    Once again I am explaining here.
    Step 1. I created the sales order on 01/01/2009 and Delivery.
    Step 2. I created the Invoice on the same day that is 01/01/2009 the system calculates the exchange rate from the sales order pricing date which is on 01/01/2009.
    Step 3. I have created the Intercompany Billing document after 2 months i.e. march.
    Mean while my exchange rates are changed.
    My Intercompany billing document should pick up the exchange rate as per the billing document date. This is for the march.
    But the problem is: My intercompany billing document is picking the exchange rate as per the pricing date in the sales order which is 01/01/2009.
    As mentioned my intercompany billing document should calculate exchange rate for March.

  • Problem in releasing the billing document

    When I am trying to release the billing document to accounting, I am getting the following error.
    "Account XYZ requires an assignment to CO object".
    What could be the cause of it?

    Hi Christino,
    Carefully think about it first as to which account groups belong to which chart of accounts (or which profit center groups to which controlling area).
    Then call report ZECPCA11 for the respective top hierarchy node of a hierarchy of account groups (or profit center groups).
    Enter the name of the hierarchy node under "Group", the name "RACCT" for account groups (or "RPRCTR" for profit center groups) under "Field" and the required chart of accounts (or controlling area) under "Searchf".
    The "0H_Kennz" indocator should generally be marked (all groups that were created with the maintenance transactions in EC-PCA are technically stored as 0H sets in the database, that is, with prefixed "0H").
    Report ZECPCA11 fills the T800S-SEARCHFLD field with the required chart of accounts (or controlling area) for all groups of the entered hierarchy.
    After you have corrected all hierarchies this way, you should be able to maintain the account groups or profit center groups again.
    You can find report ZECPCA11 on SAPSERV in directory /ftp/general/R3Server/ABAP/note.0042821 under the name "ZECPCA11.TXT". Alternatively, create the report from the 'Corrections' section using Transaction SE38.
    For further more details, please refer the SAPnote 42821
    https://websmp230.sap-ag.de/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/sapnotes/index2.htm?numm=42821
    hope it will be useful.  Appreciate with points if it useful.
    Thanks and Regards
    Vetrivelan

  • Wrong profit center capture in the billing document of intercompany sales

    Hi Experts,
         I am facing a problem on the incorrect profit center capture in the billing document while billing to external customer. I did try to search SAP notes found that it can be use substitution user exit to correct it. So I try to find out the substitutions by T-code GBB1 in the folder  "profit center accounting" under create sale order.
    The problem is how to maintain the substitution? Besides that did any one knows how to write the user exit for this substitution.  I will appreciate if you can give me some sample program. Thanks in advance.
    Regards,
    Jennie Tan

    Hi,
    Refer to program RGGBS000 FORM u100. Your user exit has to be modelled along those lines.  Change the select statement to select the profit center from the material master using the material number field (PCASUB-MATNR) and plant (PCASUB-WERKS). Move this profit center to the profit center field (PCASUB-PRCTR).
    Copy RGGBS000 to ZGGBS000 and then write this code.
    Just writing this out of my mind. Get an abaper to help you with this.
    TABLES: MBEW.
    DATA: WA_MARC TYPE MARC.
      exits-name  = 'U345'.
      exits-param = c_exit_param_none.
      exits-title = 'profit center subs'.            
      APPEND exits.
    FORM u345.
    SELECT * FROM MARC INTO WA_MARC WHERE MATNR = PCASUB-MATNR AND WERKS = PCASUB-WERKS.
    IF SY-SUBRC = 0.
       MOVE WA_MARC-PRCTC TO PCASUB-PRCTR.
    ENDIF.
    ENDFORM.
    In SM30 table V_T80D assign the program ZGGBS000 to application area GBLS.
    Then write your substitution in 0KEM. Make sure in TCode 0KEL the the activation level is 1 or 3.
    Thanks and Regards
    Shivram.

  • Error while releasing the billing document to accounting

    Dear All,
    I need your favor to resolve the below issue:
    (System SAP SAP ECC 6.0)
    User is getting the below error message while releasing the billing document to accounting in VF02:
    This is an inter-company billing document (B. type : IV) created in company code 0151. Payer is "IC0186", verified the customer has been setup in 151.
    Corresponding invoice has been successfully posted in company code 0186. (Partner : P0151)
    User is able to post the inter-company document in 0151 using other inter- company partner (ex. IC0183). Therefore, seems that Document type can't be an issue here.
    "Consolidated companies 151 and 186 are different
    Message no. F5080
    Diagnosis
    The number of the affiliated company must be clear for the selected document type for all the line items. In this case at least two different companies or a company in connection with a business partner who does not belong to a company are stated.
    Procedure
    If you selected the correct accounts, you must enter the document with a document type that allows cross-company posting. Otherwise, please correct the entered account."
    Could anyone please suggest what can be the reason, if any configuration is missing. Any help is this regard will be highly appreciated
    Thanks in advance,
    Praveen

    Hi Murali,
    Thanks for the prompt input, however as mentioned document type can't be an issue. Since user is able to post the document (same document type) using other inter-company partner in 0151.
    Thanks,
    Praveen

  • While releasing the billing document error

    Dear TEAM,
    While releasing the billing document system was showing the message like NO STANDARD COST ESTIMATE COULDBE FOUND FORTHE MATERIAL.
    I have suggested to the user to release the price through ck24.At that time system is showing the message like cost has not been created for the inhouse production.
    The samething was tested in Qualiy server and the transaction was through.I have not done any price release for the samematerial.I have checked the table under VBAP the documents was made against to the samematerial.That time we have not faced any issues like this.
    Note:Material ledger concept using by client.
    Please kindly advice how to proceed further.
    Regards,
    Suma

    have you checked in ck13n if there is a standard cost estimate for the material and what status it has, if there is one? Also, what are the dates in that cost estimate? How do they compare to the date of the billing document? What does the customizing say about the selection of cost estimates for valuation of SD documents? SPRO>Controlling>profitability analysis>master data->valuation-->Set up valuation using material cost estimates
    Nikolas

  • Retriggering pricing while saving the billing document (vf01)

    Hi all,
             Please help me in the issue. I want to determine the pricing 'carry out new pricing B' at the time of saving invoice doucment . Can anyone tell me the userexit for doing the same.
    Thanks ina advance,

    Isn't there a configuration settings in copy control to the billing documents? Why do you need to use a user exit for this?
    In any case, please use search here and in the SD forums (all 3 of them). I believe this has already been discussed. Search for 'invoice repricing' as well.

  • Problem in Save the Billing Document

    Hi,
    We have a problem while saving the Billing Document i.e.
    Document 83034087 saved (error in account determination)
    Message no. VF051
    when we saw it;s Revenue accounts, found there -
    Condition type............Message.................Description
    ZM05............................121.......................No G/L account found in Account determination type KOFI
    Access     Message     Description
    08     121     No G/L account found in Account determination type KOFI
    10     121     No G/L account found in Account determination type KOFI
    20     121     No G/L account found in Account determination type KOFI
    30     121     No G/L account found in Account determination type KOFI
    40     121     No G/L account found in Account determination type KOFI
    50     121     No G/L account found in Account determination type KOFI
    Plz guide...

    Hello Anil.Sap321,
    Your problem has to do with ACCOUNT DETERMINATION.
    Step 1: Check which account determination procedure is assigned to your billing type i.e. SPRO>SD>Basic Functions> Account Assignment/Costing>Revenue Account Determination>Define and Assign Account Determination
    HINT: normally, this is KOFI00 in standard sap
    Step 2: Check the Condition Types in your account determination in the control data in the same path as in step 1 for the Definition (e.g. KOFI, KOFK)
    Step 3: Check your accesses e.g. for KOFI (this should correspond to your VKOA tables).  Here, you can see the sequence in which your accounts are determined. Plus, at field level you can see where the data are taken from and then you can check your master data etc. during troubleshooting.
    Step 4: Identify in which combination your G/L should be in and you or your FI counterpart should configure the G/L in the designated VKOA table (transaction VKOA).
    TIP: To know which G/L account you need to input, you need the help of Financial guys as different companies have their different set of G/Ls or Chart of Accounts.
    Step 5: When this is configured in your VKOA, you can re-test.  Look at your Revenue Account determination analysis to see if your "access" in which you made your VKOA entry is successfully read during account determination.  
    NOTE: The G/L you or your FI contact have configured must exist in the Company Code involved in your accounting process.
    Good luck and let me know if this helps you,
    Eva

  • Runtime error while saving the billing document after creation

    hi friends ,
    while saving the billing document after creation , the fallowing discriptive runtime error has come.
    Run time errors    -
      SAPSQL_INVALID_TABLENAME
    Except.              -
      CX_SY_DYNAMIC_OSQL_SEMANTICS

    Dear Unnam,
    There may be several reasons...
    1. If u have enhanced the tcode with some z tables,and that might not be moved properly to prod or not active in data dictonary.
    2. u may not be entering proper data to the input fields.
    3. please check if u have added any z tables to the std tcode.I am exepcting this prob.u may not moved the table or enhancement properly to prod server,
    Please check it...
    Thanks N Regards
    SettyKY

  • To make  the Billing document header  updated with the new VAT number.

    Hi Experts
    Due the business requirement we change the VAT number of  customers  for the European countries.
    And now how can we ensure that the Billing document header gets updated with the new VAT Reg.Number for the existing Billing documents.
    The intention is to ensure that when we Print an already existing invoice,the new changed VAT number should appear in the invoice output.
    Please suggest.
    Montee

    Hi,
       Have these documents been released to accounting? If yes then you have top canecl all the documents to update the billing documents and repost them with the new vat number. I think you might know how VAT gets determined in SAP. If not please go to SPRO-IMG-SD-BF-TAXES-MAINTAIN SALES TAX IDENTIFICATION UMBER DETERMINATION.
      1.  If the payer has a VAT ID number and RG <> AG, then the tax number
          and tax classification are copied from the payer (in this case, the
          ship-to party is not relevant).
          The tax number is taken according to the 'tax country of
          destination'.
      2.  If 1. does not apply:
          If the ship-to party has a VAT registration number and the sold-to
          party does not, tax number and tax classification are copied from
          the ship-to party.
      3.  If 2. does not apply:
          Tax number and tax classification are copied from the sold-to party.
      If you enter A, tax number and tax classification are generally copied
      from the sold-to party.
      The tax number is copied according to the 'country of destination
      relevant for taxes'.
      If you enter B, tax number and tax classification are generally copied
      from the payer.
      The tax number is copied according to the 'country of destination
      relevant for taxes'.
    Kindly please let me know If you need any more information on this.
    Regards
    Ram Pedarla

  • Two price discount A & B , Discount B only active in the Billing document

    Dear Gurus
    we have 2 discount , A & B,
    In the sales order , the  user is only see the Discount A,
    when create the billing document, we hope the Discount B has active,
    Example :
    in sales order :
    PR00 = 100
    MWST = 17%
    Discount A = -10%
    Total = (100-10) *1.17 = 105.3
    In the Billing
    PR00= 100
    MWST = 17%
    Discount A = 10%
    Discount B = 2%
    Total = (100-10-2) *1.17 = 102.96
    in the price procedure , I'd set the "Discount B "  requirement = 24 ,
    But in the testing , seems the Discount B is not active ,
    How to setting to let this Discount B active ?
    Thanks.

    Hi ,
    You can check in following sequence :
    1. First verify the condition records are all set fine. Check the validity dates of condition records vs. the date you are creating the invoice.
    2. Check the pricing analysis option so that you can see the reason why the values are not coming .
    3. Also , on which value you want to calculate the disc B ? Is it on value after disc A or on value after tax ? Verify the relevant  steps coorectly in pricing procedure .
    Hope this helps. !
    BOL ..

  • Not allow to save the billing document in the back date if FI period closed

    Hi ,
    We have a requirment in which end user should not be able to create the billing document if the billing date lies in FI posting period which has been closed.
    As of now the users are being able to create the billing documents even if the Billing date lies in the closed posting period but the sccounting document does not gets generated.
    Now we want to block the billing document creation as well.
    Please provide some pointers to the above scenaio. Thanks..

    hello,
    Has your query been solved.
    if not , here is the solution.
    go to the program RV60AFZZ. This is the exit for billing.
    In that there is a form called
    FORM userexit_number_range USING us_range_intern.
    in the form you have to write the code.
    variables to pass for the function module.
    DATA: lv_buper  LIKE  t009b-poper,
            lv_gjahr  LIKE  t009b-bdatj.
    CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
          EXPORTING
            i_date               = syst-datum
            i_periv              = 'V3'
         IMPORTING
           e_buper              = lv_buper
           e_gjahr              = lv_gjahr
    in lv_buper you will get the last posting period which is open ie the posting period month.
    based on lv_buper you get , you can write your validations.
    You have to remember that the posting period which u get is based on the fiscal year.
    hope that helps.
    reward if useful.
    cheers,
    Ravi Kiran.

Maybe you are looking for

  • Why does my Macbook show it's the year 2554 BE? How can I fix it?

    My Macbook stopped showing the correct year. It shows that it is the year "2554 BE" I don't even know what BE stands for! The time, month, and day are all right but the year keeps bugging me! The text is in spanish but I guess we all get the same win

  • How to Supress null target Elements in XSLT Mapping

    Hi Experts, I need to Strip off (remove) Null tags from my ouput XML document. My XSLT Mapping file <?xml version='1.0' ?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <a:A2ACU> <a:PartNo> <

  • Stock Analysis

    Hi Experts, I am doing a report on stock analysis, And I am in trouble for one of the field ' Po quantity ' which is calculated by , sum of  ekpo-menge and substracting it from ekbe-menge which is [ movement type ( 101 ) - (102)  is ekbe-menge] . Bot

  • Not Showing the UI API and DI API reference

    Hi Experts, I have SAPB1 8.81 pl 5.  I have also installed the sdk 8.81 pl5 but when i am opening my .Net project in visual studio 2008 the older refence to ui api and di api is showing some warning so i have just remove both the references and try t

  • Why is Airplay image jerky on my TV?

    I am watching a TV show that is running on my computer but projected onto my TV through Apple TV.  The image on my computer is fine but it is jerky on the TV, often freezing and the sound goes in and out.  How do I get a smooth image and sound on my