Hi All sum of qty
hi all,
i want to display the quantity sum of bill of materials line item in the title udf total_qty.
is it possible .
awaiting soon reply
Rajkumar
to the title UDF add FS as
select coalesce(sum(quantity),0) as qty1 from ITT1 T0 where T0.Father = $[OITT.CODE]
Edited by: Petr Verner on Dec 22, 2008 2:31 PM
Similar Messages
-
Sum of qty of four tables comapring with other table
I had four tables voy,bl,subbl,dcd, i have to find sum of qty form SUBBL and qty from DCD for all subbl group by CCD
TABLE VOY
INTVCN VCN
10 TEST
TABLE BL
VCN BL
10 200
10 201
TABLE SUBBL
subbl bl subbl ccd qty
100 200 s1 c1 100
101 200 s2 c1 60
102 200 S3 C2 20
103 201 s1 c1 40
104 201 s2 c1 20
TABLE DCD
crg_seq_no subbl qty weight
1 100 50
2 100 25
3 101 30
4 101 20
5 102 20
6 103 20
7 103 10
8 104 20
Following query was executed but we are getting wrong sum for qty (SUBBL)
Query
select d.ccd,sum(d.qty),sum(f.qty) from
(Select distinct a.ccd,a.subbl,a.qty from subbl A, bl B, voy C
Where a.bl = b.bl and b.vcn = c. intvcn and c. vcn = 'TEST') D,subbl E, dcd F
where d.ccd = e.ccd and d.subbl = e.subbl and d.subbl = f.subbl
group by d.ccd
Result
CCD SUM(D.QTY) SUM(F.QTY)
C1 420 175
C2 20 20
Expected result
CCD SUM(D.QTY) SUM(F.QTY)
C1 220 175
C2 20 20Hi,
This query is OK with you.
But i don't know why you use distinct in first inline view
select d.ccd,sum(d.qty),sum(f.qty) from
(Select distinct a.ccd,a.subbl,a.qty from subbl A, bl B, voy C
Where a.bl = b.bl and b.vcn = c. intvcn and c. vcn = 'TEST') D,
(select subbl,sum(qty) qty from dcd group by subbl) F
where d.subbl = f.subbl
group by d.ccd
Bye
Chitta -
102 combines all the GR qty for the same part # line item in the PO
I had a question on the behavior of movement 102 in SAP
In earlier versions, SAP combines all the GR qty for the same part # line item in the PO both in MIGO & in MB01.
Is a change in functionality in ECC which combines all the qty or is there any config that we are missing?Hi,
Check your PO item details....is there GR based IV active in your current PO? I know, it should have effect on LIV only but, still trying to see a possibility if it has any impact on GR reversals too....
Regards
Message was edited by:
Gopala Turaga -
To show all months of qty values for each fiscal year in report?
Our cube contains different fiscal years of order qty/delivered qty for a material (e.g. material A). We use fiscal year variant V9 (Oct. - Sep). We would like to generate the following query result to list the material, order qty, fiscal year, and then for each calender month, the delivered qty value for the corresponding fiscal year:
Column title:
Material --- Order Qty --- Fiscal Year --- Oct --- Nov --- Dec --- Jan --- Feb --- Mar --- Apr --- May --- Jun --- Jul --- Aug --- Sep
Just give two rows of data for material A:
1st row data example:
A (material) --- 23 (Order Qty) --- 2006 (fiscal year) --- 2 (delivered qty in Oct of the calendar year 2005 ) --- 4(delivered qty in Nov of the calendar year 2005 ) ---1 (delivered qty in Dec of the calendar year 2005 ) --- 5 (delivered qty in Jan of the calendar year 2006 ) --- .... 2 (delivered qty in Sep. of the calendar year 2006)
2nd row data example:
A (material) --- 45 (Order Qty) --- 2007 (fiscal year) --- 3(delivered qty in Oct of the calendar year 2006 ) --- 6 (delivered qty in Nov of the calendar year 2006 ) ---1 (delivered qty in Dec of the calendar year 2006 ) --- 5 (delivered qty in Jan of the calendar year 2007 ) --- .... 2 (delivered qty in Sep. of the calendar year 2007)
How to generate this query?
Thanks!hi Chandran,
Actually in each row data for material in different fiscal year, all the KFs in columns should be restricted to the fiscal year value. What we do is to use selections other than structure or RKF. What we is following listed in details that you can check if what we do is correct:
Under KF structure:
1. Create a selection for the 1st KF (Order Qty). In this selection, Order Qty is restricted with the characteristic 0FISCYEAR.
2. Create a formular as 2nd KF for the FY value. This formula KF use the value of a formular variable with Replacement Path of the the characteristic 0FISCYEAR. But somehow this KF value shows "X" values in this column. We defined this Replacement Path variable with the Reference Characteristic as 0FISCYEAR and all others keep default. But don't know why this column shows "X" values. We also add 0FISCYEAR to the row, and find the one does have data in the row. Any idea why put it in formular variable onto column not working?
3. Create a selecction for the 3rd KF (Oct). In this selection, restrict Delivered Qty with the characteristic 0CALMONTH2 (Calendar month) and further restrict 0CALMONTH2 to a fixed value: October
4. Create a selecction for the 4th KF (Nov). In this selection, restrict Delivered Qty with the characteristic 0CALMONTH2 (Calendar month) and further restrict 0CALMONTH2 to a fixed value: November.
Then the following steps are similar to step 3 and 4 to create all other Month columns. We wonder in all these selections, would we have to restrict them further with 0FISCYEAR?
Therefore we've got two questions:
1. Why in step 2, the formular variable doesn't work and the FY column shows "X" values?
2. Do we need to further restrict the delivered qty with the characteristic 0FISCYEAR for each month column which corresonding to the fiscal year in the same row?
Thanks alot and we are keeping giving you reward points! -
I am developing a report where I have qty on hand. I am putting it into a report that reports sales and need to show qty on hand for all locations. Example. I have stores numbered 1,2,3,4,5 but only stores 1 and 2 have sales and the report shows that they sold 3 each for a total of six size 9 shoes sold. However, the qty on hand field needs to show the qty on hand in all stores. So, if each store has 5 size 9 shoes left, this field should 25 size 9 shoes left.
I am sure I need to write a formula to pull all stores inventory into some sort of variable, then total it and put it on the report, but I can't get my brain around it. Any help would be appreciated.Hi Edison,
I'm going to make some huge assumptions here because I don't know how your report is laid out.
Assuming your report is grouped like:
Group1 - Location
Group2 - SalesDate
Your report is laid out like:
QTY On Hand Sold
Location 1
June 1 2 0
June 2 1 1
June 3 0 1
Total 0 2
QTY On Hand Sold
Location 2
June 1 5 0
June 2 5 0
June 3 5 0
Total 5 0
QTY On Hand Sold
Grand Total 5 2
To get the total for QTY on Hand try this formula:
Assuming you have the totals in GroupFooter1, drop the {table.QTYONHAND} field onto the GroupFooter1 section. This will show the quantity on hand from the last record.
To get the grand total for the QTY on hand, create a formula like,
WhilePrintingRecords;
NumberVar QTYonHand;
QTYonHand := QTYonHand + {table.QTYONHAND};
Drop this formula onto the GroupFooter1 section also. This formula has a variable called QTYonHand and will accumulate each time the formula is called in GroupFooter1.
Now create one last formula like:
WhilePrintingRecords;
NumberVar QTYonHand;
Drop this into the Report Footer where the Grand Total should be. This will be be the total for the QTYonHand.
Good luck,
Brian -
How to Calculate Net weight, Gross Price, Surhcarges for Confirmed Qty
Hello,
I have a requirement where I need to calculate the Net weight, Amount( gross price), Surhcarges etc.. for the Confirmed qty of
a sales order item. In SAP standard the pricing procedure will run for the Order Qty and all the prices are related to Order qty, not for Confirmed Qty. Confirmed Qty will be sum of all scheudle lines qty.
Is there any standard Function Module to get the prices and weights for Confirmed qty? Just I need to display this data in a Report.
Pelase advise me.
Thanks.Hello,
Instead of simulating the order I am using the User Exit so that that actaul values will appear in item conditions tab. I am using the Exit USEREXIT_PRICING_PREPARE_TKOMP where I am doing the sum of the scheduled lines confirmed qty and passing the same to TKOMP-MGAME field and the pricing is calculation is done for the confirmed qty. But I am facing some problems when the order has credit block. When the order credit is released via VKM3, the pricing doesn't updated. When doing the credit release, the order cofirms the full order qty and the pricing(Gross price) is not getting updated.
How can we run the pricing update in Order change mode with pricing procedure as 'C'.
Did anyone has worked on this type of req? let me know your thoughts.
Thanks.
prabha -
How to Sum the datafield of a sub-group?
Post Author: [email protected]
CA Forum: General
Hello guys,
I am having this issue that I want to only Sum the datafield at sub-group level, not the detail level. But when I do the sum, it is adding all the details. The reason I am having this is because I have somewhat duplicated details (they complement each other). I merge them using group (by Item). The Item QTY is the feild that they all have and they have the same value, but I only need one of them. Now I want to group them by order number and show the total of items I ordered. I Sum all the items' QTY, but instead of sum the QTY that's merged, it sums all the QTY from detail. Basically I am suming duplicate numbers.
Is there any solution to this? Thank you.Post Author: [email protected]
CA Forum: General
Hello Jagan,
Thank you for the help. I treid the Average running total, but the problem is that I cannot do Summary on those new fields on the parent group. Also I can't get rid of the dupliate because the singel record does not contain enough info, I need all the records to merge togather to collect all the required inforamtion. Before I will just created a merged view on my DB to get rid of duplicate records. But this time, I am linking too much tables (includes external server DB table) that I can't make a view for that.
Basically I have an order that splits into multiple invoices that get shipped using an external server where the Actual Ship Date does not write back to our own ordering system. I am trying to see if all my items are ship on time. So I need to merge all the items QTY from invoices that linked with external shipping DB, and group them in one order.
The main problem I have is that I can't do summary on many custome fields. I can made the correct amount using Formula Field that has a shared flag to not include duplicate numbers. But once I use the shared flag, the forumla is no longer useable by Summary.
Anyway, I think I will just use Excel instead. I already have all the proper data, just that when I do group summary in Crystal, it becomes a problem. I will export the data and do analysis from there.
Thank you for the help -
Hello folks!:
I have made a query and created a new field related to the invoice qty. All at item level and referenced to the sales order.
This new field is configured to pull the invoice qty from the document flow:
FACPOS = ' '.
select RFMNG into FACPOS
from vbfa
where vbelv = vbap-vbeln
and posnn = vbap-posnr
and vbtyp_n = 'M'.
endselect.
Then the report shows the sales order qty and the invoice qty per item. Everything looks perfect at this time. The problem starts when the invoice is partially created from partial deliveries (which is very often) and then a partially invoice is made. Due to the fact that the data is generated from the VBFA table, it will always going to bring the latest invoice qty and not the sum of all the invoices.
Example:
Order for 6 pcs of product A
Delivery for 4 pcs and Invoice for 4 pcs
Pending 2 pcs
Report shows: Invoice qty 4 pcs
Then another invoice is created for 2 pcs
Nothing left from the sales order
Report shows: Invoice qty 2 pcs <----
PROBLEM
PROBLEM: The report only shows as a total of the invoice qty just the 2 pcs from the last invoice. I actually want to add up all the invoice qty's generated per line item in the document flow.
1. Any idea on how to configure the code so that I can have the sum of all the invoices in the document flow per item?
2. Is there a special function that can do this?
Pls let me know
RegardsHi,
Pass the sales order number in VBFA for the field "VBELV".
Execute.
Here there is a chance of two cases.
1)If the billing document is created w.r.t. order:In this case,you will get the invoice number from VBELN field.
Pass the same to VBRP table as VBELN and then fetch "FKIMG".
This will give you the quantity.
2)If the billing document is created w.r.t. a delivery:In this case,take VBELN and again pass it to VBELN into VBFA table as VBELV and then fetch VBELN
Pass the same to VBRP table as VBELN and then fetch "FKIMG".
Regards,
Krishna. -
Hi Experts
I stuck with small problem ,any one please solve the problem i appreciate ur help
Below is my table , i need to get maximum operation i..e from order 10 the maxi operation is #/02 and for order 20 operation is #/01 . and i need to sum it up for respective operations Actual qty values ..
Ext material grp Order Number Operation key Actual Qty
100 A.H 10 #/01 200
100A.H 10 #/02 300
100 A.H 20 #/o1 100
100 A.H 30 #/02 400
i want to show the table like
Operation Keys
Ext material grp 10 20
100A.H 100 700(300+400 )
All Objects from same dataprovider,
Please help me on this .Hello,
I am having some difficulty interpreting your requirement. You say:
I need to get maximum operation i..e from order 10 the maxi operation is #/02 and for order 20 operation is #/01
Is the output you described more likely to look like that below?
Ext material grp..... Order Number.....Operation key.....Actual Qty
100 A.H.........................10....................... #/02.............. 500 (200 + 300)
100 A.H........................ 20....................... #/01...............100
100 A.H........................ 30....................... #/02...............400
If so, you could use extended syntax to pull back the max operation key and actual qty sum in the context of each ext material grp, order number combination (or whatever dimensions are needed to give you the grain needed). EG
max operation key = max (operation key) in (ext material grp; order number)
sum actual qty = sum(actual qty) in (ext material grp; order number)
Hope this helps
Jacqui -
Hi guys,
I'm working on a SSAS 2012 Tabular Model and am running into some difficulties with one of my measures.
What my setup looks like:
Dim Time hierarchy: Year - Season (Quarter) - Month
Fact Forecast: Account - Material - Month - Forecast Quantity - Bookings Quantity
I now need to calculate the Forecast accuracy but scoped to the period shown.
On a Month level, this is working by doing the following:
Forecast Accuracy:=1- (SUMX('Forecast',ABS(Forecast Quantity - Bookings Quantity))/Forecast Quantity)
My problem here starts on a higher grain, like Season or Year.
The biggest problem here is this part:
ABS(Forecast Quantity - Bookings Quantity)
Both quantities should first be aggregated to Account - Material - <Period> level and then subtracted from eachother but I'm not able to get this to work.
Has anyone encountered this before because I don't have a clue how to solve this after crawling the web for half a day...
Kind regards,
JanHi Marco,
Thanks for your response, I first tried implementing the Forecast Error by slightly altering the measure as you suggested:
Forecast Error:=
SUMX (
VALUES ( Time[Business Season] ),
CALCULATE (
ABS (
SUM ( [Forecast Qty] ) - SUM ( [Bkgs Qty])
However, this does not give me the correct information either...
On the lowest level this works as expected like my measures tried beforehand.
Once I start rolling up, the calculations are happening incorrectly.
For example, in the image below, for the account *test* it gives Forecast Error 76450 total, but should return 482152 which is the sum of all the values on the lowest level (entire range selected in Excel here for demonstration).
Any thoughts on this?
Kind regards,
Jan -
Reg: i want to get total qty of partculary month
Hi All,
i have developed a report
the output fields are material,plant and qty.
my requirment is for that material and plant what is the total qty in that month
who to sum the qty?
example is
material plant qty
10000023 4210 1
10000023 4210 2
10000023 4210 3
But i want get like this
material plant qty
10000023 4210 6
please can you help
thanks
kaviTry this sample code..
Sort I_ZQMBW_FUJ_VENDQFR by MATNR PLANT
LOOP AT I_ZQMBW_FUJ_VENDQFR INTO WA_DATA.
AT END OF MATNR.
LOOP AT I_ZQMBW_FUJ_VENDQFR INTO WA_DATA WHERE LIFNR = WA_DATA-MATNR.
V_COUNT = V_COUNT + 1.
AT END OF PLANT.
WA_DATA-TOTAL_QFR = V_COUNT.
MODIFY I_ZQMBW_FUJ_VENDQFR FROM WA_DATA TRANSPORTING TOTAL_QFR
WHERE MATNR = WA_DATA-MATNR
AND MTH = WA_DATA-MTH.
CLEAR V_COUNT.
ENDAT.
ENDLOOP.
ENDAT.
ENDLOOP.
Hope this helps... -
User LIS average ratios instead of sum
Hi guys,
Im creating a user LIS, i know that when creating LIS on MC21 there is flag with indicates if its reasonable to add the values on this ratio, and i need to know if by any chance instead of adding the rations on LIS, system can make an average of them. See in LIS MCI7 system calculate MTBF & MTBR and average them, how can i make that with a user created ratio.
Thanks.Hello,
Plese see below the correct syntax for the SUM function
The following examples are applicable to both Basic and Crystal syntax:
Sum({file.QTY})
Calculates the sum of all values in the QTY field.
Sum({orders.AMOUNT}, {orders.CUSTOMER ID})
Sums (totals) the orders in each group of orders in the Amount field. The orders are separated into groups whenever the value in the Customer ID field changes.
Sum({orders.AMOUNT}, {orders.DATE}, "monthly") % Sum({orders.AMOUNT })
Groups values in the Amount field by month, and calculates the sum of the values for each month group as a percentage of the sum of the values for the entire report.
Sum([{file.AMOUNT}, {file.PRICE}, {file.COST}])
Sum of values in the Amount, Price, and Cost fields. -
How to get two Results - Sum and Average for one KeyFigure
I have "Material" in Rows and "Cal Year/Month" in Columns and also KeyFigure "Qty" in Columns.
The Results (Yellow) of "Qty" is defined as "Avg of all values <>0". This works fine but how do I get two Results - one is a "Sum" and the other "Avg" for just one KeyFigure. The output basically should look like below:
Cal Yr/Month 01/2006 02/2006 03/2006... Result Result
Material Qty Qty Qty Sum of Qty Avg of Qty
ABC 100 0 200 300 150
DEF 100 200 300 600 200
GHI 500 300 400 1200 400Hi Srinivas,
I think you must use Restricted Key Figures and Formula.
Do not introduce CALMONTH in columns, but restrict 12 times the Key Figure Qty with 0CALMONTH3, that is 01-02-03-...
Then create a Formula that is the Sum of all Restricted KF and call it SUM.
Then copy the previous Formula (SUM) and call it AVG and give the option of Average of all Values <>0.
Try.
Ciao.
Riccardo. -
Difference between Available , ATP , Cumulated Qty
Hi expert ,
What is the difference between ,
1. Available Qty ,
2. ATP Qty
3. Cumulated Qty.
And How they all are inter related to each other.. And there Uses..
With regards,
James..
Valuable answers will be rewarded..1. Available Qty = quantity you hav in your sotk
2. ATP Qty = quantity you can reserve on your sales order or delivery that is composed by: stock - qty reserved by other orders/deliveries + qty from good receipts from production orders, purchase orders that is not yet posted.
3. Cumulated Qty = sum of all schedule line qty in one item.
pls. reward points if helpful
Roberto -
Avoid splitting the sum according to uom
Dear All,
In an ALV Grid I have got columns viz. UOM, Qty in litre, Qty in Metric Tonne etc...
When I carry out sum on Qty in MT it shows me 2 lines of total:
one for EA (Each)
and one for CAR (Carton)
Is it possible that it shows only one line of sum of Qty in MT and not split the sum UOM wise.
Thanks.Dear Ankur,
I have not mentioned the subtotal attribute. Even though it displays uom wise in ALV grid.
Any suggestions..
Thanks.
Maybe you are looking for
-
DBMS_PROPAGATION_ADM.CREATE_PROPAGATION not available in Oracle 8i
Hi, I need to propagate message from queue in Oracle 8i to queue in Oracle 9i. From Oracle 9i, I am able to propagate message by creating subscriber and creating propagation by DBMS_PROPAGATION_ADM.create_propagation. I am using same steps to propaga
-
-24994,ERR_RTE: Runtime environment error 4,connection broken server state
Hi gurus I am facing this problem when trying to start the Database: Starting Database Instance... OK Opening Database... ERR -24994,ERR_RTE: Runtime environment error 4,connection broken server state 4 I have check the knldiag.err: 2008-08-18 08:52:
-
Can I build a XY chart control to define a spline on the front panel
Dear LabView users, I would like to replace a 2d numeric array control with a XY chart where the users could drag data points on the chart to create the spline of their choice. Is this possible? best regards Richard Elliott Cardiff University
-
Error at oracle 9i installation on solaris9
Hi, I got error when oracle 9i installtion on solris 9i. at iinstallation it halts on 90%. I got this message from oraInventory istallltion logfile i.e: java.lang.OutOfMemoryError <<no stack trace available>>+ Please suggest how to overcome this prob
-
Flash drive as safety startup disk?
Do you think I can get a big [2 GB] USB flash drive and load a bare bones OSX onto it and some utilities like disk warrior and techtool and use it as a worst case scenerio startup disk? Can I startup from a USB device if it had an OS on it?