Problem in Sales Order Query
Hi All,
I have problem....This is query which ic combination of Sales Order, Return, Delivery and AR Invoice.....Please tell me why this query is not working ......I want Document No, Quantity, Doc Date from Sales Order, Return, Delivery and AR Invoice and Tax bifergation also.....I per my view this query there should not be any problem but it is not working...please tell me where I am wrong....Just copy and paste this query and check in ur system.......
SELECT b.Doc_Num1 as 'SO. No.',
b.DocDate as 'SO. Date',
b.Doc_Num2 AS 'Del.Doc.No.',
b.DocDate AS 'Delivery Date',
b.Doc_Num3 as 'A/R Invoice No.',
b.DocDate as 'Inv. Date',
b.Doc_Num4 AS 'RETURN Doc.No.',
b.DocDate as 'Ret.Date',
b.CardName as 'Vendor Name',
b.NumAtCard as 'Bill No. & Date',
b.ItemCode as 'Item Code',
b.Dscription as 'Dscription',
b.Quantity1 as 'AR Invoice Quantity',
b.Quantity2 as 'Sales Order Quantity',
b.Quantity3 as 'Delivery Quantity',
b.Quantity4 as 'Return Quantity',
b.LineTotal as 'Base Amt.(Rs.)',
b.WTSum AS 'TDS (Rs.)',
b.DocTotal as 'Total (Rs.)',
sum(b.BED) as 'Bed Value',
sum(b.EDCS) as 'EDCS Value',
sum(b.HECS) as 'HECS Value',
sum(b.VAT) as 'VAT Value',
sum(b.CST) as 'CST Value',
sum(b.CVD) as 'CVD Value',
sum(b.SerTax) as 'SERTAX Value',
sum(b.CSonSerTax) as 'CS Value',
sum(b.HECS_ST) as 'HESC Value'
from (
select *,( a.Bed + a.EDCS + a.HECS + a.VAT + a.CST +a.CVD + a.SerTax + a.CSonSerTax + a.HECS_ST ) as Filter from (SELECT distinct
T0.DocNum,
T0.DocDate,
T2.DocNum,
T2.DocDate,
M.DocNum,
M.DocDate,
M.CardName,
M.NumAtCard,
L.ItemCode,
L.Dscription,
L.Quantity,
T1.Quantity,
T3.Quantity,
S.DocNum,
S.DocDate,
X.Quantity,
L.LineTotal,
M.DocEntry,
M.[DiscSum],
M.WTSum,
M.DocTotal,
M.WTSum,
M.DocTotal,
Hi Sonal,
Try this,
SELECT T0.DocNum as 'SO. No.',
T0.DocDate as 'SO. Date',
T2.DocNum AS 'Del.Doc.No.',
T2.DocDate AS 'Delivery Date',
M.DocNum as 'A/R Invoice No.',
M.DocDate as 'Inv. Date',
T4.DocNum AS 'Return No.',
T4.DocDate AS 'Return Date',
M.CardName as 'Vendor Name',
M.NumAtCard as 'Bill No. & Date',
ISNULL(L.ItemCode,'Service Item') as 'Item Code',
L.Dscription,
L.Quantity,
(Select Sum(LineTotal) FROM INV1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)',
(SELECT Sum(TaxSum) FROM INV4 where statype=-90 and DocEntry=M.DocEntry) as 'ED (Rs.)',
(SELECT Sum(TaxSum) FROM INV4 where statype=-60 and DocEntry=M.DocEntry) as 'EDCS (Rs.)',
(SELECT Sum(TaxSum) FROM INV4 where statype=7 and DocEntry=M.DocEntry) as 'HECS (Rs.)',
(SELECT Sum(TaxSum) FROM INV4 where statype=1 and DocEntry=M.DocEntry) as ' VAT (Rs.) ',
(SELECT Sum(TaxSum) FROM INV4 where statype=4 and DocEntry=M.DocEntry) as ' CST (Rs.) ',
(SELECT Sum(TaxSum) FROM INV4 where statype=10 and DocEntry=M.DocEntry) as ' CVD (Rs.) ',
(SELECT Sum(TaxSum) FROM INV4 where statype=5 and DocEntry=M.DocEntry) as ' Ser.Tax (Rs.) ',
(SELECT Sum(TaxSum) FROM INV4 where statype=6 and DocEntry=M.DocEntry) as 'CS on Ser.Tax (Rs.)',
(SELECT Sum(TaxSum) FROM INV4 where statype=8 and DocEntry=M.DocEntry) as 'HECS_ST (Rs.)',
(Select Sum(LineTotal) From INV3 Q Where Q.DocEntry=M.DocEntry) AS 'Freight (Rs.)',
M.WTSum AS 'TDS (Rs.)',
M.DocTotal as 'Total (Rs.)'
FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN ODLN T2 ON T2.DocEntry = T1.TrgetEntry
INNER JOIN DLN1 T3 on T3.DocEntry = T2.Docentry
INNER JOIN OINV M ON M.DocEntry = T3.TrgetEntry
LEFT OUTER JOIN INV1 L on L.DocEntry=M.DocEntry
LEFT JOIN ORDN T4 ON T4.DocEntry = L.TrgetEntry
LEFT JOIN RDN1 T5 ON T5.DocEntry = T4.DocEntry
LEFT OUTER JOIN INV4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum
LEFT OUTER JOIN INV5 J ON M.DocEntry = J.AbsEntry
LEFT OUTER JOIN INV3 Q ON M.DocEntry = Q.DocEntry
WHERE M.DocDate >= '[%0]' AND M.DocDate <= '[%1]'
GROUP BY
T0.DocNum,T0.DocDate,T2.DocNum,T2.DocDate, M.DocNum,M.DocDate,T4.DocNum, T4.DocDate, M.CardName,M.NumAtCard,L.ItemCode,L.Dscription,L.Quantity,
M.DocEntry,M.[DiscSum],M.WTSum,M.DocTotal
ORDER BY
T0.DocNum,T0.DocDate,T2.DocNum,T2.DocDate, M.DocNum,M.DocDate,T4.DocNum,T4.DocDate, M.CardName,M.NumAtCard,L.ItemCode,L.Dscription,L.Quantity,
M.DocEntry,M.[DiscSum],M.WTSum,M.DocTotal
Regards,
Madhan.
Similar Messages
-
Monthly Sales Order query Doc Status problem
Hi Experts,
I am having an problem while making a total monthly sales order query in which I am not getting the document status which are Open - Printed. Also note that these document which are open printed are not having any target document.
SELECT T0.[DocStatus],T1.[TargetType],T0.[CANCELED],T0.[CardCode], T0.[CardName], T0.[NumAtCard], T5.[SeriesName], T0.[DocNum], T0.[DocDate], T0.[DocDueDate], T0.[DocTotal],T0.[Max1099]'Total Before Discount',T0.[TotalExpns],T4.[descript]'Territory',T2.[SlpName]'Employee Name'
,T0.[discsum] FROM ORDR T0 ,RDR1 T1,OSLP T2,OCRD T3,OTER T4,NNM1 T5 where T0.DocEntry = T1.DocEntry AND T0.SlpCode = T2.SlpCode AND T0.CardCode = T3.CardCode
AND T3.Territory = T4.territryID AND T0.Series = T5.Series and T0.[CANCELED]='N' and T1.[TargetType] is not null
My mission for the above query is to have Total Monthly Sales Orders with value exluding the cancelled and closed sales sales ( close here means - which are manually done by right click on sales order screen and selecting Close )
Please guied how to solve this issue because in the back end for Sales Order which have turned to deleivery are showing doc status as closed and the sales order which are manually closed are also showing doc status as closed. How to diffrentiate between them.
Waiting for a positve feedback.
Regards,
RahulTry this one:
SELECT DISTINCT T0.[DocStatus],T0.[CardCode], T0.[CardName], T0.[NumAtCard], T5.[SeriesName],
T0.[DocNum], T0.[DocDate], T0.[DocDueDate], T0.[DocTotal],T0.[Max1099]'Total Before Discount',
T0.[TotalExpns],T4.[descript]'Territory',T2.[SlpName]'Employee Name',T0.[discsum]
FROM DBO.ORDR T0
INNER JOIN DBO.RDR1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN DBO.OSLP T2 ON T0.SlpCode = T2.SlpCode
INNER JOIN DBO.OCRD T3 ON T0.CardCode = T3.CardCode
INNER JOIN DBO.OTER T4 ON T3.Territory = T4.territryID
INNER JOIN DBO.NNM1 T5 ON T0.Series = T5.Series
where T0.[CANCELED]='N' and T1.[TargetType] != -1
Thanks,
Gordon -
Combined Purchase Order and Sales Order Query. (Including Stand Alone Docs)
Hi,
I need some help please!
I am looking for a query that will show all the Purchase Orders with all their base document Sales Orders. However I also need to show those stand alone Purchase orders and Sales Orders.
What I have is two queries, one for the PO fields en one for The SO fields. I would like a way to combine these two so I have one query with the relevant PO and SO info next to each other.
The final query will have a top heading structure like this:
Status,Purchase No.,Supplier No.,Supplier Name,Week,Month,Del Method,Country,Method,Rep.|Status,Rep.,Sales No.,Customer No.,Customer Name,Customer Order no.,Cust. Del date,Doc total,Del Method
+(The first part is for the purchase order section, the second part starting at the second 'Status' is the sales order section)
+Purchase Order Query:
SELECT
T0.DocStatus 'Status',
T0.DocNum'Purchase Order No.',
T0.CardCode 'Supplier No.',
T0.CardName'Supplier Name',
DATEPART(ww,T0.DocDuedate)'Week',
DATEPART(mm,T0.DocDuedate) 'Month',
T1.TrnspName 'Delivery Method',
T2.Country 'Country',
T0.JrnlMemo 'Method',
T3.SlpName 'Rep.'
FROM OPOR T0
INNER JOIN OSHP T1 ON T0.TrnspCode = T1.TrnspCode
INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode
INNER JOIN OSLP T3 ON T0.SlpCode = T3.SlpCode
Sales Order Query:
SELECT
T0.DocStatus 'Status',
T2.SlpName 'Rep.',
T0.DocNum 'Sales Order No.',
T0.CardCode 'Customer No.',
T0.CardName 'Customer Name',
T0.NumAtCard 'Customer Order no.',
T0.DocDueDate 'Cust. Delivery date',
T0.DocTotal ' Doc total',
T1.TrnspName ' Delivery Method'
FROM ORDR T0
INNER JOIN OSHP T1 ON T0.TrnspCode = T1.TrnspCode
INNER JOIN OSLP T2 ON T0.SlpCode = T2.SlpCode
The problem I am having is that if I combine these queries it excludes all those records with blank/empty data fields.
I do not mind having to go to crystal reports to get what I want.
Any suggestions?
Thanks!Hi thanks GordonDu,
I have tried a union before, and yours works great. However my problem is to display the PO en SO columns next to each other and not underneath each other.
Something like this:
Po No Supplier SO No Customer
1234 Sup 1 9876 Cust 1
1235 Sup 2 no SO Cust 2
1236 Sup 3 9877 Cust 3
1237 Sup 4 9878 Cust 4
1238 Sup 5 no SO Cust 4
I have this query, but with this it drops all those Purchase Orders made Stand Alone and without a SO number.
SELECT
T2.DocNum AS 'Purchase Order No.',
T0.DocNum AS 'Sales Order No.',
T2.CardCode AS 'Supplier No.',
T2.CardName AS 'Supplier Name'
FROM ORDR T0
INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN OPOR T2 ON T2.DocEntry = T1.PoTrgEntry
Though using your Union gives me all the information I want and the ability to expand on that, my problem is the "Display" part. I am sure I am doing something stupid somwhere
Edited by: Desmond Moll on Mar 7, 2012 8:03 AM -
I have a problem regarding sales order line item with confimed quanity
Hi Experts,
I have a problem regarding sales order line item with confimed quanity with '0' with delivery block but confirming the sales order quantity once the order is released from credit check.
The situation arises as per the below scenarios.
Scenario - 1 - When the sales order has two line item - one line item with confirmed qunaity in the schedule line and for the 2nd line item there is no available stock for the Material xxxxxx.
Initially the sales order is created for the line item 2 with confirmed quantity = 0, and having the delivery block = 01 for the Material xxxxxx and the order is set with credit check. Once the order is relased from the credit check. The quanity for the item 2 where the confirmed quantity will be = 0 ( Where it is not changing the confirmed quantity)
Scenario -2- Updating the order qunaity for the line item 2 as (9Pcs) it will goes to credit check and save the order.
Maintain the stock for the line item 2 ( 5 Pcs).
Once the order is released from the credit check. Then for the line item 2 the confirm quanity will be seting to 5 Pcs with Delivery blcok 01.
This should not happen, When the credit check is released even though if it has stock based on the delivery blockl it should set the confirmed quanity to Zero.
Can you please help me how to solve this issue.
Looking forward for your reply.
Thanks and Regards,Hi,
I agree with your point. In the sales order When the complete delivery check box is enabled where the confimed qty is set to zero, it is fine but when we save the orderr it goes to credit check. Once we release the order using VKM3 where in the sales order the confimed quantity is setting to 5, But it should set to Zero quantity. Quatity should not be get confirmed it should be Zero Quantity.
Further in SPRO - customizing in the deliveries blocking reasons - It has a tick mark in the confirmation blcok. But we dont want to remove the - Confirmation Block tick mark
Please any one can help me if you have any solution to solve this problem.
Thanks and Regards. -
Condition Period Problem in Sales order - Need help
Hi Gurus
I am testing Sales Order back dated
Condition period Problem in Sales order
example for you to understand
Sales Order where PO date is 17.12.2007
Del Date & Price date is 13.02.2008
Then it is not calculating IN: A/R BED %IN A/R BED totalN A/R CESS [1621]
But if i do it after 14 feb 2008 then it is calculating IN: A/R BED %IN A/R BED totalN A/R CESS [1621]
When I do it with current date it is calculating IN: A/R BED %IN A/R BED totalN A/R CESS [1621] say date is 9-5-2008
I am not able to trace out problem, kindly help me from where I do I check and why this is happening.
Rajesh ChalkeHi,
I am not sure if this solves your problem, but I am suspecting that this might be due to the 'valid on date' of the condition records created for the relevant duty condition types.
Since it was a recent regulation and VK11 usually defaults current date as the valid date, that condition record may have been valid only from the recent date on which it was created.
Check the date in VK12 (To find the exact selection parameters, check the pricing analysis in the sales order which will display the exact condition record which is being selected as of current date.) Check for the same parameters; change the date to relevant date in the past and recreate the sales order. Hopefully this should solve the issue.
Cheers,
KC -
BAPI - Problem in Sales order creation
Hi Friends,
I have problem in Sales order creation using BAPI ,I am getting a messsage - Error in creating document ,I have sent the code along with this mail ,can you help it out.
Code:
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
PARAMETERS: p_auart TYPE auart OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Sales organization
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Distribution channel
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Division.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
PARAMETERS: p_spart TYPE spart OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SKIP 1.
Sold-to
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
PARAMETERS: p_sold TYPE kunnr OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Ship-to
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
PARAMETERS: p_ship TYPE kunnr OBLIGATORY.
SELECTION-SCREEN END OF LINE.
SKIP 1.
Material
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
PARAMETERS: p_matnr TYPE matnr OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Quantity.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
PARAMETERS: p_menge TYPE kwmeng OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Plant
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
SELECTION-SCREEN END OF LINE.
Data declarations.
DATA: v_vbeln LIKE vbak-vbeln.
DATA: header LIKE bapisdhead1.
DATA: headerx LIKE bapisdhead1x.
DATA: item LIKE bapisditem OCCURS 0 WITH HEADER LINE.
DATA: itemx LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
DATA: partner LIKE bapipartnr OCCURS 0 WITH HEADER LINE.
DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
DATA: lt_schedules_inx TYPE STANDARD TABLE OF bapischdlx
WITH HEADER LINE.
DATA: lt_schedules_in TYPE STANDARD TABLE OF bapischdl
WITH HEADER LINE.
Initialization.
INITIALIZATION.
v_text = 'Order type'.
v_text1 = 'Sales Org'.
v_text2 = 'Distribution channel'.
v_text3 = 'Division'.
v_text4 = 'Sold-to'.
v_text5 = 'Ship-to'.
v_text6 = 'Material'.
v_text7 = 'Quantity'.
v_text9 = 'Plant'.
Start-of-selection.
START-OF-SELECTION.
Header data
Sales document type
header-doc_type = p_auart.
headerx-doc_type = 'X'.
Sales organization
header-sales_org = p_vkorg.
headerx-sales_org = 'X'.
Distribution channel
header-distr_chan = p_vtweg.
headerx-distr_chan = 'X'.
Division
header-division = p_spart.
headerx-division = 'X'.
headerx-updateflag = 'I'.
Partner data
Sold to
partner-partn_role = 'AG'.
partner-partn_numb = p_sold.
APPEND partner.
Ship to
partner-partn_role = 'WE'.
partner-partn_numb = p_ship.
APPEND partner.
ITEM DATA
itemx-updateflag = 'I'.
Line item number.
item-itm_number = '000010'.
itemx-itm_number = 'X'.
Material
item-material = p_matnr.
itemx-material = 'X'.
Plant
item-plant = p_plant.
itemx-plant = 'X'.
Quantity
item-target_qty = p_menge.
itemx-target_qty = 'X'.
APPEND item.
APPEND itemx.
Fill schedule lines
lt_schedules_in-itm_number = '000010'.
lt_schedules_in-sched_line = '0001'.
lt_schedules_in-req_qty = p_menge.
APPEND lt_schedules_in.
Fill schedule line flags
lt_schedules_inx-itm_number = '000010'.
lt_schedules_inx-sched_line = '0001'.
lt_schedules_inx-updateflag = 'X'.
lt_schedules_inx-req_qty = 'X'.
APPEND lt_schedules_inx.
Call the BAPI to create the sales order.
CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
EXPORTING
sales_header_in = header
sales_header_inx = headerx
IMPORTING
salesdocument_ex = v_vbeln
TABLES
return = return
sales_items_in = item
sales_items_inx = itemx
sales_schedules_in = lt_schedules_in
sales_schedules_inx = lt_schedules_inx
sales_partners = partner.
Check the return table.
LOOP AT return WHERE type = 'E' OR type = 'A'.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
WRITE: / 'Error in creating document'.
ELSE.
Commit the work.
COMMIT WORK AND WAIT.
WRITE: / 'Document ', v_vbeln, ' created'.
ENDIF.
Regards,
Dineshwhat messages u are gettting in RETURN ? Please check the RETURN tables data.
[code]CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
EXPORTING
sales_header_in = header
sales_header_inx = headerx
IMPORTING
salesdocument_ex = v_vbeln
TABLES
return = return
sales_items_in = item
sales_items_inx = itemx
sales_schedules_in = lt_schedules_in
sales_schedules_inx = lt_schedules_inx
sales_partners = partner.
Regards
Prabhu -
Problem in Sales Order with specific condition type.
Hello Experts,
I'm facing a problem in sales order creation for a specific condition type.
the actual scenario is as below,
We have created a new condition type for special discount.This condtion type is applicable only for specific sales channels.Also the discount percentage has to fetched from a custom table.
To achieve this I've written a user exit "RV64A999"
In the FM, i've calculated the subtotal and fetched the discount percentage and calculated the discount amount. After implementing this, the SO were been created properly. for all the line items the discount amount was getting calculated properly.
But then I added a condition at the top of code in exit that the calculation for the new condition type should happen only for selected sales channels.
But after adding this condition in code, i'm facing problem. Now when I create/ change any SO, the discount amounts are getting calculated incorrectly. I'm getting discount amount even if the line item subtotal amount is zero (0).
Any help or pointers reagrding this issue will be very helpful and highly appreciated.Hi ..
Check your config. again or debug the routine code with your ABAPer and find the problem area.
-Maharshi -
Rounding off value problem in sales order
Hi All,
This is related to a rounding off value problem in sales order.
The problem is described by an example which is as follows -
Selling Price of Material A = Rs. 176.76
Excise charged = Rs. 21.80
Total Price = Rs.176.76 + Rs.21.80 = Rs. 198.56
On this total Trade Discount (ZDTD) having access sequence,is calculated at the rate of 4% = Rs. 7.94
But the condition base value after the discount is showing Rs.198.60 instead of Rs.198.56
I want the system to reflect the value as Rs.198.56 intact and it should not round up to the nearest value i.e. Rs. 198.60
Why is this happening? Is it possible to reflect the exact value? If yes what is needed to be done?
The commercial round off is activated for the DIFF Condition Type.
Looking forward to some valuable suggestions.
Thanks & Regards
Priyanka MitraHi Ramesh,
Thanks for your suggestion but the problem has been solved by me.
Regards
Priyanka Mitra -
Problem about sales order stock stock transfer and batch determination
Hi, experts, I get a problem about sales order stock stock transfer and batch determination.The following is the current situation of my system:
In OMCG I assigned search procedure ME0001 to both 311 and 311 E and ticked check batch. After that, I found that if iI need to tranfer unrestricted-use material from storage location 1000 to 2000 with movement type 311, I just need to input * at the field batch, then the system will display all of the available batches. But for the transferring of sales order stock with movement type 311 E, after I input * at the batch field, no batch is displayed and there is also no message from the system.
Can anybody help me? Is there anything else I need to do? Thanks very much.I think my question is not clear, actually I tried 562 E , 411 E and 413 already. all the transaction looking for the sales order but unfortunatly the sales order is deleted from SAP.
-
Problem with sales order and Service order
Dear Guru's
We have a real problem with sales orders and service orders and how we treat these. For a project that uses a WBS, it's not a problem to manipulate SAP to give us a list of shortages (orders with no or limited supply) for each order, but for some reason our after sales orders and our service orders do not work this way.
Thanks and Regards,
Deethya.CLOSED
-
The problem for sales order ra settlement
dear friends
i encounter a problem in sales order settlement
1 we use rev based result analyse ,and with profit realization
2 when the so status is rel ,the valuation base is Q,when the status is TECO and finl ,the valuation base is J
3 when we partially do the billing and run the ra settlement ,the poc = cumulate act rev/plan rev * actual cost in current period(i think this should be the cumulate actual cost ),and it lead to the error calcuation of the COGS,i do not know where the confirguation is error ,is in valuation base ?
can you help me
thank youdear friends
i encounter a problem in sales order settlement
1 we use rev based result analyse ,and with profit realization
2 when the so status is rel ,the valuation base is Q,when the status is TECO and finl ,the valuation base is J
3 when we partially do the billing and run the ra settlement ,the poc = cumulate act rev/plan rev * actual cost in current period(i think this should be the cumulate actual cost ),and it lead to the error calcuation of the COGS,i do not know where the confirguation is error ,is in valuation base ?
can you help me
thank you -
Hi All,
This is Sales order with return, delivery, AR invoice query.....Query is working but it shows repetative records..pls check the query below......and just copy and paste it and give AR Invoice document no ...plz check query for minimum two item Nos...then you will understand it shows 8 records instead of 2 records(line items)........pls tell me what to do to show only 2 line items........
And one more doubt..if AR invoice does not have sales order or return or delivery then also it should show AR invoice details or other respective details........query is below
SELECT b.Doc_Num1 as 'SO. No.',
b.DocDate1 as 'SO. Date',
b.Doc_Num2 AS 'Del.Doc.No.',
b.DocDate2 AS 'Delivery Date',
b.Doc_Num3 as 'A/R Invoice No.',
b.DocDate3 as 'Inv. Date',
b.Doc_Num4 AS 'RETURN Doc.No.',
b.DocDate4 as 'Ret.Date',
b.CardName as 'Vendor Name',
b.NumAtCard as 'Bill No. & Date',
b.ItemCode as 'Item Code',
b.Dscription as 'Dscription',
b.Quantity1 as 'AR Invoice Quantity',
b.Quantity2 as 'Sales Order Quantity',
b.Quantity3 as 'Delivery Quantity',
b.Quantity4 as 'Return Quantity',
b.LineTotal as 'Base Amt.(Rs.)',
b.WTSum AS 'TDS (Rs.)',
b.DocTotal as 'Total (Rs.)',
sum(b.BED) as 'Bed Value',
sum(b.EDCS) as 'EDCS Value',
sum(b.HECS) as 'HECS Value',
sum(b.VAT) as 'VAT Value',
sum(b.CST) as 'CST Value',
sum(b.CVD) as 'CVD Value',
sum(b.SerTax) as 'SERTAX Value',
sum(b.CSonSerTax) as 'CS Value',
sum(b.HECS_ST) as 'HESC Value'Hi Sonal,
Try this,
SELECT b.Doc_Num1 as 'SO. No.',
b.DocDate1 as 'SO. Date',
b.Doc_Num2 AS 'Del.Doc.No.',
b.DocDate2 AS 'Delivery Date',
b.Doc_Num3 as 'A/R Invoice No.',
b.DocDate3 as 'Inv. Date',
b.Doc_Num4 AS 'RETURN Doc.No.',
b.DocDate4 as 'Ret.Date',
b.CardName as 'Vendor Name',
b.NumAtCard as 'Bill No. & Date',
b.ItemCode as 'Item Code',
b.Dscription as 'Dscription',
b.Quantity1 as 'SO_Qty',
b.Quantity2 as 'DLN_Qty',
b.Quantity3 as 'A/R Inv_Qty',
b.Quantity4 as 'Return_Qty',
b.LineTotal as 'Base Amt.(Rs.)',
b.WTSum AS 'TDS (Rs.)',
b.DocTotal as 'Total (Rs.)',
sum(b.BED) as 'Bed Value',
sum(b.EDCS) as 'EDCS Value',
sum(b.HECS) as 'HECS Value',
sum(b.VAT) as 'VAT Value',
sum(b.CST) as 'CST Value',
sum(b.CVD) as 'CVD Value',
sum(b.SerTax) as 'SERTAX Value',
sum(b.CSonSerTax) as 'CS Value',
sum(b.HECS_ST) as 'HESC Value'
from (
select *,( a.Bed + a.EDCS + a.HECS + a.VAT + a.CST +a.CVD + a.SerTax + a.CSonSerTax + a.HECS_ST ) as Filter from (SELECT distinct
T0.DocNum as 'Doc_Num1',
T0.DocDate as 'DocDate1',
T2.DocNum as 'Doc_Num2',
T2.DocDate as 'DocDate2',
M.DocNum as 'Doc_Num3',
M.DocDate as 'DocDate3',
M.CardName,
M.NumAtCard,
L.ItemCode,
L.Dscription,
T1.Quantity as 'Quantity1',
T3.Quantity as 'Quantity2',
L.Quantity as 'Quantity3',
X.Quantity as 'Quantity4',
S.DocNum 'Doc_Num4',
S.DocDate as 'DocDate4',
L.LineTotal ,
M.DocEntry,
M.[DiscSum],
M.WTSum,
M.DocTotal,
Regards,
Madhan.
Edited by: Madhan Babu C on Aug 28, 2009 2:12 PM -
Problem in Sales order - Dmp file is created
Hello,
I have created User defined Tab and i put matrix in User defined Tab in Sales Order Form.
I fill matrix successfully from my tables.
But problem is occuer when i clicked in checkbox in Matrix.
The Problem is as below.
C:\Documents and Settings\dvlp105\Local Settings\Application Data\SAP\SAP Business One\SAP Business One_20110722113943.dmp
Application has a problem.
Diagnostic file C:\Documents and Settings\dvlp105\Local Settings\Application Data\SAP\SAP Business One\SAP Business One_20110722113943.dmp was created.
Please contact support and attach diagnostic file
OK
Can anyone help me for this ?
Thanks & Regards,
Leena
skype:leena_trivediOk.
Here I am sending you my code.
oNewItem = oOrderForm.Items.Add("UserFolder", SAPbouiCOM.BoFormItemTypes.it_FOLDER)
oItem = oOrderForm.Items.Add("matGarFile", SAPbouiCOM.BoFormItemTypes.it_MATRIX)
oOrderForm.DataSources.DataTables.Item("oMatrixDT").ExecuteQuery(Query)
oColumn = oColumns.Add("#", SAPbouiCOM.BoFormItemTypes.it_EDIT)
oColumn.TitleObject.Caption = "#"
oColumn.Width = 40
oColumn.Editable = True
Edited by: leenatrivedi on Jul 22, 2011 1:49 PM -
SELECT T0.[DocNum], T1.[Project], T2.[PrjName], T1.[CogsOcrCod] as Region, T1.[CogsOcrCo2] as Branch,T1.[WhsCode], T1.[Dscription],T1.[LineStatus],T1.[Quantity], T1.[OpenQty],T0.[DocCur], T1.[Price], T0.[U_OrderStatus], T3.[DocNum],T3.[cardname],T3.[DocStatus] FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OPRJ T2 ON T1.Project = T2.PrjCode,OPOR T3 INNER JOIN POR1 T4 ON T3.DocEntry = T4.DocEntry
WHERE T4.BaseRef = T0.DocNum and T0.[DocStatus] = 'O'
i have this query it is working fine but there is problem. that is it is showing only that sale order wich purchase order is posted my client want all sale order if his purchase order is poted or notHi Ajit,
See if this one works. A few fields were removed as they don't exist in my db, you should be able to add them again.
SELECT
T0.DocNum, T1.Project, T2.PrjName, T1.CogsOcrCod as Region,
T1.WhsCode, T1.Dscription,T1.LineStatus,T1.Quantity, T1.OpenQty,T0.DocCur,
T1.Price, 'No Purchase Order','No Purchase Order','No Purchase Order'
FROM
ORDR T0 INNER JOIN
RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN
OPRJ T2 ON T1.Project = T2.PrjCode
WHERE T0.DocStatus = 'O'
Union
SELECT
T0.DocNum, T1.Project, T2.PrjName, T1.CogsOcrCod as Region,
T1.WhsCode, T1.Dscription,T1.LineStatus,T1.Quantity, T1.OpenQty,T0.DocCur,
T1.Price, cast(t3.docnum as varchar),
T3.cardname,T3.DocStatus
FROM
ORDR T0 INNER JOIN
RDR1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN
OPRJ T2 ON T1.Project = T2.PrjCode, OPOR T3 INNER JOIN
POR1 T4 ON T3.DocEntry = T4.DocEntry
WHERE T4.BaseRef = T0.DocNum and T0.DocStatus = 'O'
Hope it helps,
Jesper -
Hi I have a query which returns the sum of linetotals from sales orders related to a specific Business Partner and also related to a specific Item Code.
The problem which I'm having is that when I am testing the reports I am finding out that some of the amounts are being multiplied for a number of times.
I think that it is a join problem.
The query is the below:
select distinct
t0.cardcode
, t0.cardname
, sum(t2.linetotal) as 'Total'
, sum(t3.linetotal) as 'GATEWAY - IPLCS'
, sum(t4.linetotal) as 'GATEWAY - IP TERMINATING CHRGS & LINKS'
, sum(t5.linetotal) as 'Dedicated Symmetric International IP Bandwidth'
, sum(t6.linetotal) as 'Dedicated Symmetric International IP Bandwidth Daily'
, sum(t7.linetotal) as 'Shared IP Transit'
, sum(t8.linetotal) as 'Premium IP'
, sum(t9.linetotal) as 'IP Addresses'
, sum(t10.linetotal) as 'DDos Service'
, sum(t11.linetotal) as 'MIX'
, sum(t12.linetotal) as 'PVC'
, sum(t13.linetotal) as 'Short term IP Transit'
, sum(t14.linetotal) as 'Shared Premium IP'
, sum(t15.linetotal) as 'Shared Rack Co-Location - Setup And Installation Charge'
, sum(t16.linetotal) as 'Shared Rack Co-Location'
, sum(t17.linetotal) as 'Remote Hands / Engineering Support'
, sum(t18.linetotal) as 'Rack Co-Location- Setup & Installation Charge'
, sum(t19.linetotal) as 'Rack Co-Location Space'
, sum(t20.linetotal) as 'Power'
, sum(t21.linetotal) as 'Wireless Ip Microwave Link - Single-Homed Setup & Installation Charge'
, sum(t22.linetotal) as 'Wireless Ip Microwave Link - Dual-Homed Setup & Installation Charge'
, sum(t23.linetotal) as 'Wireless Ip Microwave Link - Recurring Charge Including Mca Fees'
, sum(t24.linetotal) as 'Local Connectivity - Vlan'
, sum(t25.linetotal) as 'Local Connectivity - Bandwidth Access Cost (Traffic)'
, sum(t26.linetotal) as 'Local Connectivity - Activation And Installation Charges For Fibre-Based Ethernet Business Plus'
, sum(t27.linetotal) as 'Local Connectivity - Ethernet Over Fibre'
, sum(t28.linetotal) as 'International Private Leased Circuit'
, sum(t29.linetotal) as 'International Private Leased Circuit Setup Fee'
, sum(t30.linetotal) as 'Wireless link operating on the Unlicensed Band - Setup fee'
, sum(t31.linetotal) as 'Wireless link operating on the Unlicensed Band - Recurring Charge'
, sum(t32.linetotal) as 'GIGE LX SFP Module'
, sum(t33.linetotal) as 'PSAX 1000 Fan/Alarm Module'
, sum(t34.linetotal) as '-48 VDC PS PSAX 2300 4500'
, sum(t35.linetotal) as 'Stratum/-48VDC PS PSAX 1000'
, sum(t36.linetotal) as 'Alcatel Equipment TNEs FOR INVOICE POSTING ONLY'
, sum(t37.linetotal) as 'Tower Site Works'
from
ocrd t0 left outer join ordr t1 on t0.cardcode = t1.cardcode
left outer join rdr1 t2 on t2.docentry = t1.docentry
left outer join rdr1 t3 on t3.docentry = t1.docentry and t3.itemcode = 'DSC000001'
left outer join rdr1 t4 on t4.docentry = t1.docentry and t4.itemcode = 'FLC000001'
left outer join rdr1 t5 on t5.docentry = t1.docentry and t5.itemcode = 'RVL000001'
left outer join rdr1 t6 on t6.docentry = t1.docentry and t6.itemcode = 'RVL000002'
left outer join rdr1 t7 on t7.docentry = t1.docentry and t7.itemcode = 'RVL000003'
left outer join rdr1 t8 on t8.docentry = t1.docentry and t8.itemcode = 'RVL000004'
left outer join rdr1 t9 on t9.docentry = t1.docentry and t9.itemcode = 'RVL000005'
left outer join rdr1 t10 on t10.docentry = t1.docentry and t10.itemcode = 'RVL000006'
left outer join rdr1 t11 on t11.docentry = t1.docentry and t11.itemcode = 'RVL000007'
left outer join rdr1 t12 on t12.docentry = t1.docentry and t12.itemcode = 'RVL000008'
left outer join rdr1 t13 on t13.docentry = t1.docentry and t13.itemcode = 'RVL000009'
left outer join rdr1 t14 on t14.docentry = t1.docentry and t14.itemcode = 'RVL0000010'
left outer join rdr1 t15 on t15.docentry = t1.docentry and t15.itemcode = 'RVM000001'
left outer join rdr1 t16 on t16.docentry = t1.docentry and t16.itemcode = 'RVM000002'
left outer join rdr1 t17 on t17.docentry = t1.docentry and t17.itemcode = 'RVM000003'
left outer join rdr1 t18 on t18.docentry = t1.docentry and t18.itemcode = 'RVM000004'
left outer join rdr1 t19 on t19.docentry = t1.docentry and t19.itemcode = 'RVM000005'
left outer join rdr1 t20 on t20.docentry = t1.docentry and t20.itemcode = 'RVM000006'
left outer join rdr1 t21 on t21.docentry = t1.docentry and t21.itemcode = 'RVN000001'
left outer join rdr1 t22 on t22.docentry = t1.docentry and t22.itemcode = 'RVN000002'
left outer join rdr1 t23 on t23.docentry = t1.docentry and t23.itemcode = 'RVN000003'
left outer join rdr1 t24 on t24.docentry = t1.docentry and t24.itemcode = 'RVN000004'
left outer join rdr1 t25 on t25.docentry = t1.docentry and t25.itemcode = 'RVN000005'
left outer join rdr1 t26 on t26.docentry = t1.docentry and t26.itemcode = 'RVN000006'
left outer join rdr1 t27 on t27.docentry = t1.docentry and t27.itemcode = 'RVN000007'
left outer join rdr1 t28 on t28.docentry = t1.docentry and t28.itemcode = 'RVN000008'
left outer join rdr1 t29 on t29.docentry = t1.docentry and t29.itemcode = 'RVN000009'
left outer join rdr1 t30 on t30.docentry = t1.docentry and t30.itemcode = 'RVN0000010'
left outer join rdr1 t31 on t31.docentry = t1.docentry and t31.itemcode = 'RVN0000011'
left outer join rdr1 t32 on t32.docentry = t1.docentry and t32.itemcode = 'TNE000001'
left outer join rdr1 t33 on t33.docentry = t1.docentry and t33.itemcode = 'TNE000002'
left outer join rdr1 t34 on t34.docentry = t1.docentry and t34.itemcode = 'TNE000003'
left outer join rdr1 t35 on t35.docentry = t1.docentry and t35.itemcode = 'TNE000004'
left outer join rdr1 t36 on t36.docentry = t1.docentry and t36.itemcode = 'TNE000005'
left outer join rdr1 t37 on t37.docentry = t1.docentry and t37.itemcode = 'TNE000006'
where
t0.groupcode in (100,114)
group by
t0.cardcode
, t0.cardname
Can you help please?
Thanks,
vankri
Edited by: vankri on Nov 10, 2009 1:02 PMTry something like this with all your required items:
Select t0.cardcode , t0.cardname , sum(t2.linetotal) as 'Total'
,(select sum(r.linetotal) from rdr1 r join ordr o on r.docentry=o.docentry
where o.cardcode=t0.Cardcode and r.ItemCode= u2019DSC000001')
as 'GATEWAY - IPLCS'
,(select sum(r.linetotal) from rdr1 r join ordr o on r.docentry=o.docentry
where o.cardcode=t0.Cardcode and r.ItemCode= u2019FLC000001u2019)
as 'GATEWAY - IP TERMINATING CHRGS & LINKS'
From ocrd t0 left outer join ordr t1 on t0.cardcode = t1.cardcode
left outer join rdr1 t2 on t2.docentry = t1.docentry
group by t0.cardcode ,t0.cardname
Maybe you are looking for
-
How can i pair my bose soundlink I to my macbook pro on windows 7
Hi everybody I'm looking for solution for pairing my bose soundlink I with my macbook pro on windows 7, 64bit. PS: I used bootcamp correctly Thank you help and sorry for my english, I'm from french speaking country
-
Internet Expenses and HR setups
Hi, Could you please advise me as to what setups need to be done in HR shared install (we haven't installed HR and won't use it) inorder for iExpenses and Payables invoices approval to be setup using workflow or AME. Additionaly, which is more recomm
-
HP TouchPad does not appear as USB drive on mac os x lion
Hi. Before the last update I was on 3.0.4 version of the webOS and my HP TouchPad would appear as a USB drive on my mac (running OSX Lion). But since the 3.0.5 update when I plug in the TouchPad and select to mount it as a USB drive it complains tha
-
Fuzzy noisy colors in ps windows background
Hello, I haven't fully tested all the combinations regarding this issue yet, but I had some strange behavior by PS apparently when opening RAW images in 16bits. All works ok a part for a very annoying and weird pattern of fuzzy noisy colors in the gr
-
Creating a New Email address policy for users in another Domain with Exchange 2013 powershell?
Hi Everyone Is it possible to create a new-emailaddress policy with Exchange 2013 Powershell, for users within OU´s located on another different domain/forest than where Exchange 2013 is installed? There is a Transitive, two way trust between the dom