Total and pending quantity
i have to make report of Total Quantity received as well as pending Qty against an Inbound No. in a single transaction.
how i will do this. which table and field i will take. Please help me...
Inbound delivery against PO
LIPS-VGBEL = Reference Document ( In this case it would be PO number)
EKES Vendor Confirmations table also use for it
Go to EKBE table for GR document and get the field ETENS (Sequential number of vendor confirmation).
Go to EKES table and select the record based on EBELN, EBELP and ETENS to get the corresponding delivery number
Similar Messages
-
Total and pending quantity of inbound delivery
From which table i will find total and pending quantity of inbound delivery number.
Which table and field name???Dear,
Find out report using T'Code MR11, you will get all required fields (this is standard report)
Regards,
A. Wankhede -
Total quantity and pending quantity against Inbound number
I have to make report to view total quantity and pending quantity against Inbound number in a single entry transaction.
How will I do this...
Please help me.It depends on your client / company requirement.
Generally the following parameters can be taken as selection
PO Document date
PO Number
Vendor
Plant
And Out put
Po Number, PO Line item, PO Date, Vendor, Vendor Name, Plant, Plant text, Inbound delivery Number, PO Qty, ID Sequence Number, Inbound Delivery Qty, Inbound delivery date, UOM, GR Number, GR Date, GR Posting date, Material, Material Description, Batch etc... -
Hi Guys...
We need a report for pending Orders and pending Quantities for Sales.
And for this i used a query .
SELECT T0.DocNum as 'SO No', T0.DocDate as 'SO Date',
T0.CardCode, T0.CardName, T1.ItemCode, T1.Dscription,
T1.Quantity AS 'SO Qty', (T1.Quantity-T1.OpenQty) AS 'Delivered Qty',
T1.OpenQty AS 'Balance Qty'
FROM ORDR T0
INNER JOIN RDR1 T1 ON T1.DocEntry = T0.DocEntry
INNER JOIN ITM1 T2 ON T2.ItemCode = T1.ItemCode
WHERE
T1.LineStatus = 'O'
AND
T0.DocDate BETWEEN '[%0]' AND '[%1]' and ((T1.Quantity-T1.OpenQty) != 0 )
But i need the report like
Sales Quotation No ,Sales Quotation Date,Sales Order No,Sales Order Date,Delivery No,Delivery Date,Invoice No,Invoice Date,
Customer Name,Item Code,Item Des, and Pending Quantity.
Thanks & Regards,
VamsiHi,
do you mean this?
SELECT T0.DocNum as 'SO No', T0.DocDate as 'SO Date',
T0.CardCode, T0.CardName, T1.ItemCode, T1.Dscription,
T1.Quantity AS 'SO Qty', (T1.Quantity-T1.OpenQty) AS 'Delivered Qty',
T1.OpenQty AS 'Balance Qty'
FROM ORDR T0
INNER JOIN RDR1 T1 ON T1.DocEntry = T0.DocEntry
INNER JOIN ITM1 T2 ON T2.ItemCode = T1.ItemCode
WHERE
T1.LineStatus = 'O'
AND
T0.DocDate BETWEEN '[%0]' AND '[%1]' and ((T1.Quantity-T1.OpenQty) Like '[%%_%%]' )
Edited by: Doreen Cieslewski on Apr 27, 2010 5:52 PM
Edited by: Doreen Cieslewski on Apr 27, 2010 5:54 PM -
Total lot transaction quantity does not match transaction quantity
Hello All,
I have a few transactions that are pending and show the error:
"Total lot transaction quantity does not match transaction quantity".
I see there is a patch 2538686 to fix this but I don't have access to Oracle support. And also I checked the version of inctcm.ppc. It is higher than what is mentioned in the patch readme.
$Header: inctcm.ppc 115.56 2003/04/14 04:19:23 aalex ship $
Is there any workaround to process these transactions?
We are on 11.5.9 (HP Unix) and the rdbms version is 9i.
Thank you all in advance.
A/ACLOSED
-
Picking the value of PBEG and PEND incase of multiple entries 2002 on a day
Hi Experts,
Our client's business requirement is to have provision handling multiple entries multiple entries of same subtype of IT 2002 on same day with different Time entries.For example one IT 2002 Styp 1 has entry 10 am to 14 pm & other entry of IT 2002 styp 1 as 14 pm to 16 pm.
In this scenario I want to have TWT with start time of 1st 2002 record i.e 10 & another TWT with end time of last 2002 record i.e. 16.
I have written a PCR as
OUTTPORIGS Origin status
COLOP* TIP >TOP curr.TType
P
HRS=PBEG Set
ADDDB90T3 Add to day balance
HRS=PEND Set
ADDDB90T4 Add to day balance
But its giving me value of 2002 start time as (1014=24) & END time (1416=30) respectively.
Since TIP will have entries with origin E & A as well with P and any entry can be 1st or last entry depending on time, I can't use VRSTFIRST & VARSTLAST.
Please suggest me how to handle such scenario through PCR. Is there a way we can make decision on From & To of TIP entries.
You can also suggest me if such need can be handled at masterdata level so that we can have just one entry
Regards
S S
Hi All,
Please also suggest me a better operation to pick the value of PBEG and PEND incase of multiple entries various subtypes of 2002 on same day.I need to compare start- end time of 2002 with 2011 entries and calculate total attendence hrs. Once again, I can't use VRSTFIRST & VRSTLAST as 1st & last TIP entry could be come from any infotype viz 2011,2002, 2001.
Regards
Sunita
Edited by: Sunita on Feb 5, 2011 10:02 AMIf you want to do it the T-SQL way, follow this article I wrote on deleting duplicates..
http://sqlsaga.com/sql-server/how-to-remove-duplicates-from-a-table-in-sql-server/
To read about what ranking functions does and how will they help you use this link..
http://sqlsaga.com/sql-server/what-is-the-difference-between-rank-dense_rank-row_number-and-ntile-in-sql-server/
Please mark as answer, if this has helped you solve the issue.
Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles. -
Pending quantity report for a manufacuting firm
Hi Guys,
I need a report to know the daily pending quantity report for a manufacturing company..
I have tried a query and to some extent its working fine.. i need some more changes in the query.
The report should be look lie below,
ITEMCODE,ITEMNAME,ORDERED QUANTITY,ORDERED VALUE,SALES QTY(DELIVERED QTY),SALES VALUE,PENDING QTY,PENDING VALUE ,SHORTFALL(IF THE INSTOCK QTY IS LESS THAN PENDING QTY).
Here there are using 5 different price lists.
and the above report has to be classifed seperately for each price list seperately and also in the given period if there is a item which has not been ordered then it also be needs to list in the report with eventhoug it dont have any values .
Could anybody pls modify the below query.
SELECT T1.ItemCode, Max(T1.[Dscription]) As 'Item Description' ,t3.price as 'Unit Price/PC',Sum(T1.[OrderedQty]) as 'Ordered Qty' ,(Sum(T1.[OrderedQty]) * t3.price ) as 'Ordered Value' , Sum(T1.[Quantity]) as 'Del Qty',(Sum(T1.[Quantity]) * t3.price) as 'Sales Value',(Sum(T1.[Quantity]) - Sum(T1.[OrderedQty])) as 'Pending Qty',((Sum(T1.[Quantity]) - Sum(T1.[OrderedQty])) * t3.price) as 'Pending Value',T2.OnHand, (T2.OnHand - (Sum(T1.[Quantity]) - Sum(T1.[OrderedQty]))) as 'SHORT'
FROM ODLN T0
INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OITM T2 ON T1.ITEMCODE = T2.ITEMCODE
inner join itm1 t3 on t1.itemcode = t3.itemcode
inner join opln t4 on t3.pricelist = t4.listnum
WHERE T0.[DocDate] >=[%0] AND T0.[DocDate] <=[%1] and t4.listname = '[%2]'
Group By T1.ItemCode,T2.OnHand,t4.listname,t3.priceTry this query
SELECT T1.ItemCode, Max(T1.[Dscription]) As 'Item Description' ,t3.price as 'Unit Price/PC',Sum(T1.[OrderedQty]) as 'Ordered Qty' ,(Sum(T1.[OrderedQty]) * t3.price ) as 'Ordered Value' , Sum(T1.[Quantity]) as 'Del Qty',(Sum(T1.[Quantity]) * t3.price) as 'Sales Value',(Sum(T1.[Quantity]) - Sum(T1.[OrderedQty])) as 'Pending Qty',((Sum(T1.[Quantity]) - Sum(T1.[OrderedQty])) * t3.price) as 'Pending Value',T2.OnHand, (T2.OnHand - (Sum(T1.[Quantity]) - Sum(T1.[OrderedQty]))) as 'SHORT'
FROM ODLN T0
INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OITM T2 ON T1.ITEMCODE = T2.ITEMCODE
left join itm1 t3 on t1.itemcode = t3.itemcode
left join opln t4 on t3.pricelist = t4.listnum
WHERE T0.[DocDate] >='[%0]' AND T0.[DocDate] <='[%1]' and t4.listname = '[%2]'
Group By T1.ItemCode,T2.OnHand,t4.listname,t3.price
union all
select B.ItemCode, B.ItemName,D.Price,SUM(C.OnOrder), 0,0,0,0,0,SUM(C.OnHand),SUM(C.OnHand)-SUM(C.OnOrder)
from OITM B
INNER JOIN OITW C ON B.ItemCode = C.ItemCode
INNER JOIN ITM1 D ON C.ItemCode=D.ItemCode
WHERE B.ItemCode NOT IN (SELECT T1.ItemCode FROM ODLN T0
INNER JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OITM T2 ON T1.ITEMCODE = T2.ITEMCODE
left join itm1 t3 on t1.itemcode = t3.itemcode
left join opln t4 on t3.pricelist = t4.listnum
WHERE T0.[DocDate] >='[%0]' AND T0.[DocDate] <='[%1]' and t4.listname = '[%2]' )
GROUP BY B.ItemCode, B.ItemName, D.Price
Regards,
Bala
Edited by: Balakumar Viswanathan on Nov 15, 2010 4:23 PM -
Reg Open sales order item and the quantity
Hi experts:
I am getting open sales order item based on inner join of tables(vbak, vbap, vbep). Not using vbbe table in inner join as it doesnt carry all pending open records.
can any one say how open sales order items and their quantity can be retrieved?
I searched forum and saw usage of vbuk and vbup tables, but it does not accomplish our scenario.
Thanks in advance,
Sashti.Hi,
1) fetch the header information from VBAK table.
2) Based on VBAK table fetch all the line items from VBAP table.
3) Now fetch from VBFA table.
*-Fetch from VBFA to get the delivered qty
SELECT vbelv " Preceding sales and distribution document
posnv " Preceding item of an SD document
rfmng " Referenced quantity in base UOM
FROM vbfa
INTO TABLE lt_vbfa
WHERE vbelv = gv_vbeln
and vbtyp_n = 'J'.
4) By comparing VBFA-POSNR just filter the records from the VBAP internal table. Remained lines are open lines of the sales order.
Regards,
~Satya -
Pending Quantity in PO for stock transfer
Dear All,
I want to know the pending order quantity for stock transfer orders (plant to plant),I have tried
ME80FN,ME2L Etc. but all report are showing the pending quantity only after MIGO done by
the receiving plant.
Our requirement is like this that one plant created one stock transfer order to one
plant and he want to know the actual pending order quantity as on date considering
by deducting stock in transit (5B5T) (i.e. PO quantity 100 pcs - quantity delivered 50 pcs then actual
pending quantity should be 50 pcs but in mentioned report it is showing 100 pcs pending).
Please note in our case in every PO more than 800 line items are there.
Can any one inform me about standard report or any table where net pending quantity are getting
stored.I have checked table EKBE,MARD,MARC.
Regards,
SP Shukla.Hi,
In mb5b u give movement type & check
Generally i do not think there is a std report, this we also faced, we developed a report with the help of ABAPer
Pandari -
Need Query to find Pending Quantity for Receipts
Hi all,
Can any one please help me in finding the pending quantity for a particular Receipt.
ex. If a receipt has
transaction_type Quantity
Receive 15
Accept 5
Deliver 5
then my accepted quantity should be (Receive-Deliver) = 10
I have written a query
SELECT RSH.RECEIPT_NUM RECEIPT_NUM, RSH.CREATION_DATE CREATION_DATE, RT.TRANSACTION_TYPE TRANSACTION_TYPE, NVL(RT.QUANTITY, 0) QUANTITY,rt.destination_type_code destination_type_code,
RT.UNIT_OF_MEASURE UNIT_OF_MEASURE, RSL.ITEM_DESCRIPTION ITEM_DESCRIPTION, NVL(RT.PO_UNIT_PRICE, 0) PO_UNIT_PRICE,
RT.CURRENCY_CODE CURRENCY_CODE, NVL(RT.CURRENCY_CONVERSION_RATE,0) RATE, RSL.SHIPMENT_LINE_ID SHIPMENT_LINE_ID,
NVL(RT.QUANTITY * RT.PO_UNIT_PRICE * RT.CURRENCY_CONVERSION_RATE ,0) VALUE
FROM RCV_TRANSACTIONS RT, RCV_SHIPMENT_HEADERS RSH, RCV_SHIPMENT_LINES RSL, PO_VENDORS POV, PO_VENDOR_SITES POVS,
ORG_ORGANIZATION_DEFINITIONS ORG, HR_LOCATIONS_ALL_TL HRL, PO_LOOKUP_CODES PLC,
RCV_SUPPLY RS
WHERE RSH.SHIPMENT_HEADER_ID = RT.SHIPMENT_HEADER_ID
AND RSH.SHIPMENT_HEADER_ID = RSL.SHIPMENT_HEADER_ID
AND RSH.RECEIPT_NUM IS NOT NULL
AND POV.VENDOR_ID (+) = RSH.VENDOR_ID
AND POVS.VENDOR_SITE_ID (+) = RSH.VENDOR_SITE_ID
AND HRL.LOCATION_ID (+) = RSH.SHIP_TO_LOCATION_ID AND HRL.LANGUAGE(+) = USERENV('LANG')
AND ORG.ORGANIZATION_ID (+) = RSH.ORGANIZATION_ID AND RSH.RECEIPT_SOURCE_CODE = PLC.LOOKUP_CODE
AND PLC.LOOKUP_TYPE = 'SHIPMENT SOURCE TYPE'
AND RS.RCV_TRANSACTION_ID = RT.TRANSACTION_ID
AND RT.SHIPMENT_LINE_ID = RSL.SHIPMENT_LINE_ID
AND RT.TRANSACTION_TYPE IN ('RECEIVE','TRANSFER')
ORDER BY 1
I want want the pending quantity...
Please helpYou can get the quantities in po line locations, then you can find the balance quantity to be received.
you can get the following from po line locations.
quantity
quantity_received
quantiy_accepted
quantity_rejected
quantity_billed
quantity_cancelled
--Prasanth -
How to create a sub total and grand total using my query.
How can I create a sub total for each section and grand total for using my query like this. your help is appreciated. I am working with 9g
WITH BidItemsInformation AS
( SELECT DISTINCT q.iplineno "Line Number", q.section "Section Number",
i.item "Item Number",
initcap(i.idescr) "Description" ,
i.iunits "Unit",
q.qty "Quantity" ,q.price "Engineers Unit Price",
(q.price * q.qty) "Engineers Estimate"
FROM letprop l,
proposal p,
propitem q,
bidlet b,
bidtabs c,
itemlist i,
vendor v,
bidders d
WHERE(l.letting = b.letting
And b.letting = c.letting
And p.cspecyr = i.ispecyr)
AND q.prpitem = i.item
AND p.contid = l.lcontid
AND q.contid = p.contid
AND c.vendor = l.avendor
AND l.CALL = c.CALL
AND q.lineflag = c.lineflag
AND q.iplineno = c.iplineno
AND l.letting = d.letting
AND c.letting = l.letting
AND c.CALL = d.CALL
AND v.vendor = d.vendor
-- AND AND l.letstat = 'A'
AND c.lineflag = 'L'
AND l.letting ='&letting'
AND l.CALL = '&call'
), BiddersInformation AS
-- This is where you make your changes for vendor name and vendor number Do not touch the above code
-- It is always the same for any call number and letting date
( SELECT IPLINENO "BLine Number",
MAX(CASE WHEN VENDOR='K020' THEN bidprice ELSE NULL END) "K020:: Unit Price",
MAX(CASE WHEN VENDOR='K020' THEN bidprice ELSE NULL END) K,
MAX(CASE WHEN VENDOR='H438' THEN bidprice ELSE NULL END) "H438:: Unit Price",
MAX(CASE WHEN VENDOR='H438' THEN bidprice ELSE NULL END) H,
MAX(CASE WHEN VENDOR='U010' THEN bidprice ELSE NULL END) "U010:: Unit Price",
MAX(CASE WHEN VENDOR='U010' THEN bidprice ELSE NULL END) U,
MAX(CASE WHEN VENDOR='G110' THEN bidprice ELSE NULL END) "G110:: Unit Price",
MAX(CASE WHEN VENDOR='G110' THEN bidprice ELSE NULL END) G,
MAX(CASE WHEN VENDOR='H530' THEN bidprice ELSE NULL END) "H530:: Unit Price",
MAX(CASE WHEN VENDOR='H530' THEN bidprice ELSE NULL END) H1
FROM BIDTABS
WHERE LETTING='&letting'
AND CALL='&call'
AND BIDPRICE <> 0
GROUP BY IPLINENO
SELECT BidItemsInformation."Line Number",
BidItemsInformation."Section Number",
BidItemsInformation."Item Number",
BidItemsInformation."Description",
BidItemsInformation."Unit",
BidItemsInformation."Quantity",
BidItemsInformation."Engineers Unit Price",
BidItemsInformation."Engineers Estimate",
BiddersInformation."K020:: Unit Price",
(BidItemsInformation."Quantity" * K) "KGM CONTRACTORS INC",
BiddersInformation."H438:: Unit Price",
(BidItemsInformation."Quantity" * H) "HOFFMAN CONSTRUCTION COMPAN",
BiddersInformation."U010:: Unit Price",
(BidItemsInformation."Quantity" * U) "ULLAND BROTHERS INC",
BiddersInformation."G110:: Unit Price",
(BidItemsInformation."Quantity" * G) "GLADEN CONSTRUCTION INC",
BiddersInformation."H530:: Unit Price",
(BidItemsInformation."Quantity" * H1) "HOOVER CONSTRUCTION CO"
FROM BidItemsInformation,BiddersInformation
WHERE BidItemsInformation."Line Number" = BiddersInformation."BLine Number";
Line Number Section Number Item Number Description Unit Quantity Engineers Unit Price Engineers Estimate K020:: Unit Price
0010 0001 2011601/00003 Construction Surveying LS 1 143,000 143,000 75,000 75,000 67,080 67,080
0013 0001 2013601/00010 Survey Equipment LS 1 25,000 25,000 25,000 25,000 30,000 30,000
0020 0001 2015601/00030 Blast Monitor/Survey LS 1 50,000 50,000 30,000 30,000 35,000 35,000
0030 0001 2021501/00010 Mobilization LS 1 382,250 382,250 809,000 809,000 704,000 704,000
0040 0001 2021602/00010 Well Survey EACH 60 500 30,000 2,150 129,000 1,600 96,000
0050 0001 2031501/00040 Field Office Type D EACH 1 6,367 6,367 4,000 4,000 25,000 25,000
sub total:
1610 0002 2401501/01143 Structural Concrete (1a43) C Y 46 350 16,100 408 18,768 400 18,400
1620 0002 2401501/01362 Structural Concrete (1c62) C Y 68 200 13,600 204 13,872 200 13,600
1630 0002 2401501/03643 Structural Concrete (3y43) C Y 60 600 36,000 592 35,520 580 34,800
1640 0002 2401512/03633 Bridge Slab Concrete (3y33) S F 1,876 24 45,024 28 51,778 27 50,652
1650 0002 2401521/00030 Structure Excavation Class R C Y 17 125 2,125 1,000 17,000 500 8,500
1660 0002 2401541/00010 Reinforcement Bars LB 2,490 2 3,735 1 3,312 1 3,237
1670 0002 2401541/00011 Reinforcement Bars (Epoxy Coated) LB 12,380 2 18,570 1 17,703 1 17,332
1680 0002 2401601/00010 Structure Excavation LS 1 2,500 2,500 2,000 2,000 5,000 5,000
1690 0002 2402583/00020 Ornamental Metal Railing Type Special L F 284 150 42,600 194 55,096 190 53,960
sub total
1820 0003 2401513/00346 Type Curb Railing Concrete (3y46) L F 135 25 3,375 16 2,093 15 2,025
1830 0003 2401513/07447 Type Mod P-4 (Tl-4) Railing Conc (3y46) L F 302 85 25,670 72 21,593 70 21,140
1840 0003 2401541/00010 Reinforcement Bars LB 14,780 1 18,475 1 13,598 1 13,302
1850 0003 2401541/00011 Reinforcement Bars (Epoxy Coated) LB 76,720 1 103,572 1 85,926 1 84,392
1860 0003 2401601/00010 Structure Excavation LS 1 10,000 10,000 116,000 116,000 115,000 115,000
1870 0003 2402583/00020 Ornamental Metal Railing Type Special L F 132 150 19,800 184 24,288 180 23,760
sub total
totalYou can accomplish that using decode with the grouping function. It returns 1 when that column passed as argument was grouped (or is in some total) and 0 otherwise.
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> with t as
2 (select 'New York' city, 'US' country, 1 num from dual
3 union all select 'Los Angeles' city, 'US' country, 2 num from dual
4 union all select 'London' city, 'GB' country, 2 num from dual
5 union all select 'London' city, 'GB' country, 2 num from dual
6 union all select 'London' city, 'GB' country, 7 num from dual)
7 select decode(grouping(country), 0, country, 'GRAND TOTAL') country,
8 decode(grouping(city), 0, city, decode(grouping(country), 0, 'SUBTOTAL')) city,
9 sum(num) num_total
10 from t
11 group by rollup(country, city)
12 /
COUNTRY CITY NUM_TOTAL
GB London 11
GB SUBTOTAL 11
US New York 1
US Los Angeles 2
US SUBTOTAL 3
GRAND TOTAL 14
6 linhas selecionadas.
SQL> -
Calculate totals and sub totals
hi everybody
can u plz suggest me how to write code for getting sub totals and totals
regards
hridhayaHello hridhayanjili
SAP provides us with the ABAP statement <b>COLLECT</b> to summarize totals.
I will give you an example from which you should be able to develop you own solution.
Let's assume we have an itab containing materials. The itab has the following line structure: MANDT, MATNR, QUANTITY. To calculate subtotals we require a second itab that is identical to the first one.
Now here is the coding:
data:
gt_itab TYPE STANDARD TABLE OF <structure>,
gt_itab_collect TYPE STANDARD TABLE OF <structure>,
gt_itab_total TYPE STANDARD TABLE OF <structure>.
gs_entry TYPE <structure>.
* NOTE: <structure> stands for a named DDIC structure or
* a type definition, not a field symbol.
* gt_itab contains our materials
LOOP AT gt_itab INTO gs_entry.
COLLECT gs_entry INTO gt_itab_collect.
ENDLOOP.
* NOTE: Assuming we had 10 entries in gt_itab of
* 3 different materials we end up with 3 entries in
* gt_itab_collect that contain the quantities summarized.
* To calculate the total one could LOOP over
* gt_itab_collect and summarize the values. Another way
* is shown here:
CLEAR: gs_entry-matnr.
MODIFY gt_itab FROM gs_entry
TRANSPORTING matnr
WHERE ( matnr IS NOT INITIAL ).
* We clear the material no.
LOOP AT gt_itab INTO gs_entry.
COLLECT gs_entry INTO gt_itab_total.
ENDLOOP.
* NOTE: because we have the same value for CLIENT and
* MATNR in every line we will end up with a single line
* in gt_itab_total.
Please read the documentation of the COLLECT statement carefully because the structure of your itab (i.e. the order of the fields, especially those that will be summarized) is important.
Regards
Uwe -
Hi all,
I am trying to create a report in Receivables which tracks the Receipts having Pending Quantity i.e, Quantity_Received - Quantity_Accepted = Quantity_not_Inspected.
Can anyone tell me weather any standard oracle report is there for reference.
Thanks in advance.Hi Ketter,
Can u please send me the Query.
I have used this Query....
SELECT A.RECEIPT_NUM, A.ITEM_DESCRIPTION, A.CREATION_DATE, A.TRANSACTION_TYPE, NVL(A.QUANTITY,0) QTY_RECD,
NVL(B.TRANSACTION_TYPE,'IN RECEIVING') TRANSACTION_TYPE,
NVL(B.QUANTITY,0) QTY_ACPTED, ABS(NVL(A.QUANTITY,0)-NVL(B.QUANTITY,0)) QTY_NOT_INSP, A.UNIT_OF_MEASURE, NVL(A.PO_UNIT_PRICE,0) PO_UNIT_PRICE,
A.CURRENCY_CODE, NVL(A.RATE,0) RATE, NVL(A.VALUE,0) VALUE
FROM
(SELECT RSH.RECEIPT_NUM RECEIPT_NUM, RSL.ITEM_DESCRIPTION ITEM_DESCRIPTION, RT.SHIPMENT_LINE_ID SHIPMENT_LINE_ID,
RSH.CREATION_DATE CREATION_DATE,
NVL(RSL.QUANTITY_RECEIVED, 0) QUANTITY, RT.UNIT_OF_MEASURE UNIT_OF_MEASURE, NVL(RT.PO_UNIT_PRICE, 0) PO_UNIT_PRICE,
RT.CURRENCY_CODE CURRENCY_CODE,
NVL(RT.CURRENCY_CONVERSION_RATE,0) RATE, NVL(RSL.QUANTITY_RECEIVED * RT.PO_UNIT_PRICE * RT.CURRENCY_CONVERSION_RATE ,0) VALUE,
RT.TRANSACTION_TYPE TRANSACTION_TYPE
FROM RCV_TRANSACTIONS RT, RCV_SHIPMENT_HEADERS RSH , RCV_SHIPMENT_LINES RSL, RCV_SUPPLY RS
WHERE RSH.SHIPMENT_HEADER_ID = RT.SHIPMENT_HEADER_ID
AND RSH.RECEIPT_NUM IS NOT NULL
AND RSL.SHIPMENT_LINE_ID = RT.SHIPMENT_LINE_ID
AND RS.RCV_TRANSACTION_ID = RT.TRANSACTION_ID
-- AND RSH.RECEIPT_NUM BETWEEN :P_FROM_RECEIPT_NUM AND :P_TO_RECEIPT_NUM
-- AND RSH.CREATION_DATE BETWEEN :P_FROM_DATE AND :P_TO_DATE
&LP_DATE
&LP_RECEIPT_NUM
-- &LP_ORG_ID
AND RT.ORGANIZATION_ID LIKE DECODE( :P_ORG_ID, NULL, '%', :P_ORG_ID)
AND RT.TRANSACTION_TYPE NOT IN ('ACCEPT', 'DELIVER','REJECT' )
ORDER BY 1) A,
(SELECT RSH.RECEIPT_NUM RECEIPT_NUM, RSL.ITEM_DESCRIPTION ITEM_DESCRIPTION, RT.SHIPMENT_LINE_ID SHIPMENT_LINE_ID,
RSH.CREATION_DATE CREATION_DATE, NVL(RSL.QUANTITY_RECEIVED, 0) QUANTITY,
RT.UNIT_OF_MEASURE UNIT_OF_MEASURE, NVL(RT.PO_UNIT_PRICE, 0) PO_UNIT_PRICE, RT.CURRENCY_CODE CURRENCY_CODE,
NVL(RT.CURRENCY_CONVERSION_RATE,0) RATE, NVL(RSL.QUANTITY_RECEIVED * RT.PO_UNIT_PRICE * RT.CURRENCY_CONVERSION_RATE ,0) VALUE,
RT.TRANSACTION_TYPE TRANSACTION_TYPE
FROM RCV_TRANSACTIONS RT, RCV_SHIPMENT_HEADERS RSH , RCV_SHIPMENT_LINES RSL, RCV_SUPPLY RS
WHERE RSH.SHIPMENT_HEADER_ID = RT.SHIPMENT_HEADER_ID
AND RSH.RECEIPT_NUM IS NOT NULL
AND RSL.SHIPMENT_LINE_ID = RT.SHIPMENT_LINE_ID
AND RS.RCV_TRANSACTION_ID = RT.TRANSACTION_ID
-- AND RSH.RECEIPT_NUM BETWEEN :P_FROM_RECEIPT_NUM AND :P_TO_RECEIPT_NUM
-- AND RSH.CREATION_DATE BETWEEN :P_FROM_DATE AND :P_TO_DATE
&LP_DATE
&LP_RECEIPT_NUM
-- &LP_ORG_ID
AND RT.ORGANIZATION_ID LIKE DECODE( :P_ORG_ID, NULL, '%', :P_ORG_ID)
AND RT.TRANSACTION_TYPE NOT IN ('ACCEPT', 'RECEIVE','REJECT','TRANSFER')
ORDER BY 1) B
WHERE A.SHIPMENT_LINE_ID = B.SHIPMENT_LINE_ID(+)
AND ABS(NVL(A.QUANTITY,0)-NVL(B.QUANTITY,0))>0
ORDER BY 1
Regards,
NRK -
Regarding totals and sub totals text in alv
Hi all,
i am displaying Totals and subtotals ......but i want to display the text before the the Totals and Subtotals.
Please help me in regarding this..
Thanks in advance,
S.Gangi reddy.hi,
check this report.
*& Report ZGM_ALV_SUBTOTAL_TEXT *
*& Author :
*& Date :
*& Description :
*& Modification History
REPORT ZGM_ALV_SUBTOTAL_TEXT .
*& Table declaration
TABLES: ekko.
*& Type pool declaration
TYPE-POOLS: slis. " Type pool for ALV
*& Selection screen
SELECT-OPTIONS: s_ebeln FOR ekko-ebeln.
*& Type declaration
Type declaration for internal table to store EKPO data
TYPES: BEGIN OF x_data,
ebeln TYPE char30, " Document no.
ebelp TYPE ebelp, " Item no
matnr TYPE matnr, " Material no
matnr1 TYPE matnr, " Material no
werks TYPE werks_d, " Plant
werks1 TYPE werks_d, " Plant
ntgew TYPE entge, " Net weight
gewe TYPE egewe, " Unit of weight
END OF x_data.
*& Internal table declaration
DATA:
i_ekpo TYPE STANDARD TABLE OF x_data INITIAL SIZE 0,
Internal table for storing field catalog information
i_fieldcat TYPE slis_t_fieldcat_alv,
Internal table for Top of Page info. in ALV Display
i_alv_top_of_page TYPE slis_t_listheader,
Internal table for ALV Display events
i_events TYPE slis_t_event,
Internal table for storing ALV sort information
i_sort TYPE slis_t_sortinfo_alv,
i_event TYPE slis_t_event.
*& Work area declaration
DATA:
wa_ekko TYPE x_data,
wa_layout TYPE slis_layout_alv,
wa_events TYPE slis_alv_event,
wa_sort TYPE slis_sortinfo_alv.
*& Constant declaration
CONSTANTS:
c_header TYPE char1
VALUE 'H', "Header in ALV
c_item TYPE char1
VALUE 'S'.
*& Start-of-selection event
START-OF-SELECTION.
Select data from ekpo
SELECT ebeln " Doc no
ebelp " Item
matnr " Material
matnr " Material
werks " Plant
werks " Plant
ntgew " Quantity
gewei " Unit
FROM ekpo
INTO TABLE i_ekpo
WHERE ebeln IN s_ebeln
AND ntgew NE '0.00'. IF sy-subrc = 0.
SORT i_ekpo BY ebeln ebelp matnr .
ENDIF.
To build the Page header
PERFORM sub_build_header. "* To prepare field catalog
PERFORM sub_field_catalog. "* Perform to populate the layout structure
PERFORM sub_populate_layout."* Perform to populate the sort table.
PERFORM sub_populate_sort."* Perform to populate ALV event
PERFORM sub_get_event.
END-OF-SELECTION.
* Perform to display ALV report
PERFORM sub_alv_report_display.
*& Form sub_build_header
To build the header
No Parameter
FORM sub_build_header .
Local data declaration
DATA: l_system TYPE char10 , "System id
l_r_line TYPE slis_listheader, "Hold list header
l_date TYPE char10, "Date
l_time TYPE char10, "Time
l_success_records TYPE i, "No of success records
l_title(300) TYPE c. " Title
Title Display
l_r_line-typ = c_header. " header
l_title = 'Test report'(001).
l_r_line-info = l_title.
APPEND l_r_line TO i_alv_top_of_page.
CLEAR l_r_line.
* Run date Display
CLEAR l_date.
l_r_line-typ = c_item. " Item
WRITE: sy-datum TO l_date MM/DD/YYYY.
l_r_line-key = 'Run Date :'(002).
l_r_line-info = l_date.
APPEND l_r_line TO i_alv_top_of_page.
CLEAR: l_r_line,
l_date.ENDFORM. " sub_build_header
*& Form sub_field_catalog
Build Field Catalog
No Parameter
FORM sub_field_catalog .
Build Field Catalog
PERFORM sub_fill_alv_field_catalog USING: '01' '01' 'EBELN'
'I_EKPO' 'L'
'Doc No'(003) ' ' ' ' ' ' ' ', '01' '02' 'EBELP' 'I_EKPO' 'L'
'Item No'(004) 'X' 'X' ' ' ' ', '01' '03' 'MATNR' 'I_EKPO' 'L'
'Material No'(005) 'X' 'X' ' ' ' ', '01' '03' 'MATNR1' 'I_EKPO'
'L'
'Material No'(005) ' ' ' ' ' ' ' ',
'01' '04' 'WERKS' 'I_EKPO' 'L'
'Plant'(006) 'X' 'X' ' ' ' ', '01' '04' 'WERKS1' 'I_EKPO' 'L'
'Plant'(006) ' ' ' ' ' ' ' ', '01' '05' 'NTGEW' 'I_EKPO' 'R'
'Net Weight'(007) ' ' ' ' 'GEWE' 'I_EKPO'.ENDFORM.
" sub_field_catalog*&----
*& Form sub_fill_alv_field_catalog
*& For building Field Catalog
*& p_rowpos Row position
*& p_colpos Col position
*& p_fldnam Fldname
*& p_tabnam Tabname
*& p_justif Justification
*& p_seltext Seltext
*& p_out no out
*& p_tech Technical field
*& p_qfield Quantity field
*& p_qtab Quantity table
FORM sub_fill_alv_field_catalog USING p_rowpos TYPE sycurow
p_colpos TYPE sycucol
p_fldnam TYPE fieldname
p_tabnam TYPE tabname
p_justif TYPE char1
p_seltext TYPE dd03p-scrtext_l
p_out TYPE char1
p_tech TYPE char1
p_qfield TYPE slis_fieldname
p_qtab TYPE slis_tabname.
Local declaration for field
catalog
DATA: wa_lfl_fcat TYPE slis_fieldcat_alv.
wa_lfl_fcat-row_pos = p_rowpos. "Row
wa_lfl_fcat-col_pos = p_colpos. "Column
wa_lfl_fcat-fieldname = p_fldnam. "Field Name
wa_lfl_fcat-tabname = p_tabnam. "Internal Table Name
wa_lfl_fcat-just = p_justif. "Screen Justified
wa_lfl_fcat-seltext_l = p_seltext. "Field Text
wa_lfl_fcat-no_out = p_out. "No output
wa_lfl_fcat-tech = p_tech. "Technical field
wa_lfl_fcat-qfieldname = p_qfield. "Quantity unit
wa_lfl_fcat-qtabname = p_qtab .
"Quantity table
IF p_fldnam = 'NTGEW'.
wa_lfl_fcat-do_sum = 'X'.
ENDIF.
APPEND wa_lfl_fcat TO i_fieldcat.
CLEAR wa_lfl_fcat.
ENDFORM.
" sub_fill_alv_field_catalog*&----
*& Form sub_populate_layout
Populate ALV layout
No Parameter
FORM sub_populate_layout . CLEAR wa_layout.
wa_layout-colwidth_optimize = 'X'.
" Optimization of Col width
ENDFORM. " sub_populate_layout*&----
*& Form sub_populate_sort
Populate ALV sort table
No Parameter
FORM sub_populate_sort .
Sort on material
wa_sort-spos = '01' .
wa_sort-fieldname = 'MATNR'.
wa_sort-tabname = 'I_EKPO'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort .
CLEAR wa_sort.
Sort on plant
wa_sort-spos = '02'.
wa_sort-fieldname = 'WERKS'.
wa_sort-tabname = 'I_EKPO'.
wa_sort-up = 'X'.
wa_sort-subtot = 'X'.
APPEND wa_sort TO i_sort .
CLEAR wa_sort.
ENDFORM.
" sub_populate_sort*&----
*& Form sub_get_event
Get ALV grid event and pass the form name to subtotal_text
event
No Parameter
FORM sub_get_event .
CONSTANTS : c_formname_subtotal_text TYPE slis_formname VALUE
'SUBTOTAL_TEXT'. DATA: l_s_event TYPE slis_alv_event.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 4
IMPORTING
et_events = i_event
EXCEPTIONS
list_type_wrong = 0
OTHERS = 0.
Subtotal
READ TABLE i_event INTO l_s_event
WITH KEY name = slis_ev_subtotal_text.
IF sy-subrc = 0.
MOVE c_formname_subtotal_text TO l_s_event-form.
MODIFY i_event FROM l_s_event INDEX sy-tabix.
ENDIF.ENDFORM.
" sub_get_event*&----
*& Form sub_alv_report_display
For ALV Report Display
No Parameter
FORM sub_alv_report_display .
DATA: l_repid TYPE syrepid .
l_repid = sy-repid .
This function module for displaying the ALV
report
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = l_repid
i_callback_top_of_page = 'SUB_ALV_TOP_OF_PAGE'
is_layout = wa_layout
it_fieldcat = i_fieldcat
it_sort = i_sort
it_events = i_event
i_default = 'X'
i_save = 'A'
TABLES
t_outtab = i_ekpo
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE i000 WITH 'Error in ALV report display'(055).
ENDIF.
ENDFORM.
" sub_alv_report_display*&----
FORM sub_alv_top_of_page
Call ALV top of page
No parameter
FORM sub_alv_top_of_page. "#EC CALLED*
*To write header for the ALV
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_alv_top_of_page.
ENDFORM.
"alv_top_of_page*&----
*& Form subtotal_text
Build subtotal text
P_total Total
p_subtot_text Subtotal text info
FORM subtotal_text CHANGING
p_total TYPE any
p_subtot_text TYPE slis_subtot_text.
Material level sub total
IF p_subtot_text-criteria = 'MATNR'.
p_subtot_text-display_text_for_subtotal
= 'Material level total'(009).
ENDIF.
Plant level sub total
IF p_subtot_text-criteria = 'WERKS'.
p_subtot_text-display_text_for_subtotal = 'Plant level total'(010).
ENDIF.
ENDFORM. "subtotal_textSelection screen:
\[removed by moderator\]
Edited by: Jan Stallkamp on Sep 3, 2008 6:17 PM -
Query generator used to make general total and row total
Dear experts/gurus,
I have a problem how to create general total and total field in row by using query generator. In inventory in warehouse report of SBO 2004A SP 00 PL 41, there are total row of price x quantity / warehouse (if selection criteria is warehouse) and general total. I have made query report that quite similar with inventory in warehouse report using query generator and put selection criteria and item but I still can't find out the solution. is it possible using query generator to do that or if I use query analyzer, what is the code that I have to put ? is it compute sum(qty x price) by itemcode or there is stil another ? i appreciate your answer. TIA
Rgds,Hi Jimmy,
Here's one approach to solve your problem:
= = = = = = =
select oitm.itemcode, oitm.itemname, whs.whscode, whs.quantity
from oitm inner join
(select itemcode, sum(onhand) as quantity, whscode from oitw group by itemcode, whscode) whs
on oitm.itemcode=whs.itemcode
= = = = = = =
...the main query refers to the subquery as it was another table. The subquery calculates quantity per warehouse from the oitw table.
Of course you could create a view in SQL Server instead of a subquery. That would make the query inside B1 query generator more simple and would also make it faster to execute.
Henry
Maybe you are looking for
-
IDoc Acknowledgement Issue in SAP PI 7.3
We have configured IDoc to IDoc scenario between two ECC system using IDOC_AAE adapter. When we run the RBDSTATE program to trigger ALEAUD IDoc it is getting failed in SM58 in ECC system. But when we configure a separate scenario to transfer ALEAUD I
-
Video files not in camera roll
So I re did all my photo and video files and deleted everything fro My camera roll. All photos and videos were moved into folders on my pc and then synced back to my phone. All my videos did not sync back. The videos were Placed in folders with pictu
-
My 2009 IMac is incredibly slow after upgrading to Yosemite. Here is the
I'm a reasonably competent computer user I upgraded to Yosemite recently and the computer is so slow I can't stand it. Below is my Etre report. I'd appreciate any advice. I may need techie talk dumbed down EtreCheck version: 2.0.11 (98) Report genera
-
I am trying to access the Payment Types screen from HRMS Localization Seed Data Entry responsibility and getting the following error APP-PAY-07050: You cannot enter this form in USER mode. what does this mean? and how to fix it?
-
Hi All, We are getting login issue on our UAT server. AD users are not able to login into share point,it again prompting login box after entering correct username and password. When we add that user to local admin group then it works.