Skip to Content
author's profile photo Former Member
Former Member

Query report field update with code

I'm working on a report with table join VBRP & VBRK where main table is VBRP.

My goal to build a report to check Sales Order Item Qty compare with that SO/Item's billed Qty.

I can get billed qty from VBRP-FKLMG and also that Sales order's item qty available in VBRP-LMENG field.

Now the problem is, VBRP-FKLMG as increasing more than single line because of multiple billing, VBRP-LMENG also duplicates for what my report getting incorrect.

Now what can I do for not to repeat the Sales Order Item line Qty in VBRP-LMENG.

Please advice. Many thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Aug 01, 2012 at 08:42 PM

    I'm assuming you're talking about SQ01 query. This is, unfortunately, kind of a problem with the queries. If you link two tables via JOIN and there is "1 to many" relatonship, then it would cause duplicates and it's not possible to total correctly.

    If you just need to get the quantity, instead of joining the tables create a custom field (Extras button), say BILLED_QTY and add your own code (SELECT ... ). You can use SUM with SELECT to get the total quantity, but please be cognizant of different billing types (e.g. proformas F8 should not be counted) and cancelled invoices.

    This solution is not good for performance but, unfortunately, sometimes there is no other way. If this does not work or is performing too poorly then a custom ABAP report would be needed.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.