Query For Sale Register
Hi Expert I am trying a query in this query i got these feild - TransType,Docdate,Docnum,CardName,Tinno,Impoexp,Exportsale,Outward Transfer/Central Sale,form No,Total sale,Local sale,Taxcode, output tax amount total Sale including Tax,Receiver Location . Through This Query----
select tmp1.form as [TRANS TYPE],tmp1.Docdate,tmp1.DocNum,tmp1.CardName,tmp1.TaxId11 as [TIN NO.],tmp1.IMPOREXP ,tmp1.Import as [EXPORT SALE],tmp1.INVTRANS as 'OutWard Transfer/Central Sale',tmp1.FormNo ,tmp1.Import+tmp1.INVTRANS 'TotalSale',tmp1.B4Tax as [LOCAL SALE],tmp1.TaxCode AS [TAX CODE],tmp1.VatSum as [OUTPUT TAX AMOUNT] ,tmp1.DocTotal 'TOTAL SALE INCLUDING TAX' ,tmp1.Location AS [RECEIVER LOCATION] from ( SELECT 1 'Order1','Sales-N' 'Form', T0.Docdate,T0.DocNum ,T0.CardName,T2.TaxId11 ,(case when t3.TfcId=1 then T0.DocTotal else 0 end)DocTotal ,(case when t3.TfcId=2 then T0.DocTotal else 0 end) 'INVTRANS' ,'' 'FormNo' , (case when t3.TfcId=1 then T1.TaxCode else null end)TaxCode ,(case when t3.TfcId=1 then T0.VatSum else 0 end)VatSum, (case when t3.TfcId=1 then (T0.Doctotal-T0.VatSum-t0.totalexpns) else 0 end) 'B4Tax' ,T2.IMPOREXP, 0 'Import' ,T5.Location FROM [dbo].[OINV] T0 Left Outer Join INV1 T1 ON T0.DocEntry = T1.DocEntry left outer join INV12 T2 on T0.DocEntry = T2.DocEntry left outer join OSTC T3 on T1.TaxCode = T3.Code left Outer join owhs T4 on T4.whsCode = T1.WhsCode left OUTER Join OLCT T5 on T5.Code = T4.Location where T1.LineNum = (select Top 1 linenum from INV1 where INV1.DocEntry = T0.DocEntry ) and T3.TfcId in('1','2') and T2.IMPOREXP 'Y' and T0.DocType = 'I' and t0.docdate>='[%0]' and t0.docdate<='[%1]' Union SELECT 2 'Order1','Sales-Y' 'Form',T0.Docdate,T0.DocNum ,T0.CardName,T2.TaxId11 ,0 ,0,'','', 0,0 ,T2.IMPOREXP,T0.DocTotal 'Import' ,T5.Location FROM [dbo].[OINV] T0 Left Outer Join INV1 T1 ON T0.DocEntry = T1.DocEntry left outer join INV12 T2 on T0.DocEntry = T2.DocEntry left outer join OSTC T3 on T1.TaxCode = T3.Code left Outer join owhs T4 on T4.whsCode = T1.WhsCode left OUTER Join OLCT T5 on T5.Code = T4.Location where T1.LineNum = (select Top 1 linenum from INV1 where INV1.DocEntry = T0.DocEntry ) --and T3.TfcId = 1 and T2.IMPOREXP = 'Y' and T0.DocType = 'I' and t0.docdate>='[%0]' and t0.docdate<='[%1]' union select tmp3.Order1,'INV' 'Form', tmp3.DocDate,tmp3.DocNum,tmp3.[CardName], tmp3.TaxId11,0,sum(tmp3.DocTotal) 'INVTRANS',isnull(tmp3.FormNo,'') 'FormNo' ,'' 'TaxCode', 0 'VatSum', 0 'B4Tax', '' 'IMPOREXP' , 0 'Import', tmp3.fromloc from (SELECT 3 'Order1',T4.Location 'fromloc',T0.[DocNum], T0.[DocDate],T0.U_INV_Transferor, T0.[CardName] ,T6.Transcat,(t10.credit)DocTotal ,T0.U_TIN_NO, T9.TaxId11,T6.FormNo FROM OWTR T0 INNER JOIN WTR1 T1 ON T0.DocEntry = T1.DocEntry AND T1.LINENUM = 0 AND Substring(T0.Filler,1,3) <> Substring(T1.WhsCode,1,3) INNER JOIN WTR12 T6 ON T0.DocEntry = T6.DocEntry INNER JOIN OJDT T7 ON T0.TransId = T7.TransId and T0.objtype = T7.transtype inner join jdt1 t10 on t7.transid=t10.transid left outer join owhs T2 on T2.whsCode = T0.filler left Outer join owhs T3 on T3.whsCode = T1.WhsCode left OUTER Join OLCT T4 on T4.Code = T2.Location left OUTER Join OLCT T5 on T5.Code = T3.Location left outer join OCRD T8 on T0.CardCode = T8.CardCode left outer join (select * from crd7 where crd7.addrtype = 'S') T9 on T8.CardCode = T9.CardCode and isnull(T9.Address,'') '' where T0.Jrnlmemo 'Cancelled' and isnull(T0.Comments,'') not like 'Inventory transfer no. % has been cancelled' --and T4.Location = 'MUMBAI' and t0.docdate>='[%0]' and t0.docdate<='[%1]' ) tmp3 group by tmp3.Order1, tmp3.DocDate,tmp3.DocNum,tmp3.U_INV_Transferor, tmp3.TaxId11,tmp3.[CardName], tmp3.U_TIN_NO,tmp3.FormNo, tmp3.fromloc union SELECT 4 'Order1','AR Credit-N' 'Form', T0.Docdate,T0.DocNum ,T0.CardName,T2.TaxId11 ,(case when t3.TfcId=1 then -T0.DocTotal else 0 end)DocTotal ,0 'INVTRANS','' 'FormNo' , (case when t3.TfcId=1 then T1.TaxCode else null end)TaxCode ,(case when t3.TfcId=1 then -T0.VatSum else 0 end)VatSum, (case when t3.TfcId=1 then -(T0.Doctotal-T0.VatSum-t0.totalexpns) else 0 end) 'B4Tax' ,T2.IMPOREXP, 0 'Import' ,T5.Location FROM [dbo].[ORIN] T0 Left Outer Join RIN1 T1 ON T0.DocEntry = T1.DocEntry left outer join RIN12 T2 on T0.DocEntry = T2.DocEntry left outer join OSTC T3 on T1.TaxCode = T3.Code left Outer join owhs T4 on T4.whsCode = T1.WhsCode left OUTER Join OLCT T5 on T5.Code = T4.Location where T1.LineNum = (select Top 1 linenum from RIN1 where RIN1.DocEntry = T0.DocEntry ) and T0.DocType = 'I' and T3.TfcId = 1 and T2.IMPOREXP <> 'Y' and t0.docdate>='[%0]' and t0.docdate<='[%1]' union SELECT 5 'Order1','AR Credit-Y' 'Form',T0.Docdate,T0.DocNum ,T0.CardName,T2.TaxId11 ,0 ,0,'','', 0,0 ,T2.IMPOREXP,-T0.DocTotal 'Import' ,T5.Location FROM [dbo].[ORIN] T0 Left Outer Join RIN1 T1 ON T0.DocEntry = T1.DocEntry left outer join RIN12 T2 on T0.DocEntry = T2.DocEntry left outer join OSTC T3 on T1.TaxCode = T3.Code left Outer join owhs T4 on T4.whsCode = T1.WhsCode left OUTER Join OLCT T5 on T5.Code = T4.Location where T1.LineNum = (select Top 1 linenum from RIN1 where RIN1.DocEntry = T0.DocEntry ) --and T3.TfcId = 1 and T2.IMPOREXP = 'Y' and T0.DocType = 'I' and t0.docdate>='[%0]' and t0.docdate<='[%1]' )tmp1 --where Tmp1.Location = 'SAHIBABAD' order by docdate, order1
Now i want modifiy this report like TransType,Docdate,Docnum,CardName,Tinno,Impoexp,Exportsale,Central Sale,TAx Code of central Tax,TAx Amount of central Tax,form No,Total sale,Local sale,Taxcode, output tax amount total Sale including Tax,Inventory Transfer Doctotal,Receiver Location .
Thanks in Advance & regard Khan
Hi Khan,
Can you share your solved Sales Register query with us?
Regards,
Vincent
Similar Messages
-
Query for Sales Order Analysis
Dear Experts
I have written a Query for Sales Order Analysis and would like to have help on this.
The query is used for generating daily report for Sales Order on number of documents (Sales Order), total amount of sales orders and total GP of Sales Order. The query is written as below:
SELECT T0.[DocNum], SUM(T0.DocTotal) AS 'Total', SUM(T0.U_Total_GP) AS 'Total GP'
FROM ORDR T0 WHERE T0.[DocDate] =[%0] GROUP BY T0.[DocNum] ORDER BY T0.[DocNum]
where U_Total_GP is a UDF for storing the GP of each order.
After executing the query, a selection criteria of date appears and after a date is selected, the report shown information required. However, the query does not calculate column total for total amount and total GP. Although I know the total for each column can be displayed by pressing "Ctrl" + Click on the column title, it would have to be done from time to time.
Therefore, I would like to modify my query in order to calculate the column totals when executed. Are there any suggestions for this?
Thank you
Regards
EltonHi Elton,
Try this:
SELECT T0.[DocNum], SUM(T0.DocTotal) AS 'Total', SUM(T0.U_Total_GP) AS 'Total GP'
FROM ORDR T0 WHERE T0.[DocDate] =[%0] GROUP BY T0.[DocNum]
Union ALL
SELECT '', SUM(T0.DocTotal) AS 'Total', SUM(T0.U_Total_GP) AS 'Total GP'
FROM ORDR T0 WHERE T0.[DocDate] =[%0]
ORDER BY T0.[DocNum]
Thanks,
Gordon -
Customized Query for purchase register
Hi All,
I need a query for purchase register which gives excise information with biferication.
OPCH, PCH1, ORPC, RPC1 and IEI4
In excel reporter we get the purchase register report But excise amount does not come in that report.
So, I need Customised report for that.
Regards
Shashihi shashi,
SELECT M.DocNum AS 'AP Inv. #', M.DocDate as 'Date', M.CardName as 'Vendor Name',M.NumAtCard as 'Bill No. & Dt.',
(Select Sum(LineTotal) FROM PCH1 L Where L.DocEntry=M.DocEntry) as 'Base Amt.(Rs.)',
(SELECT Sum(TaxSum) FROM PCH4 where statype=-90 and DocEntry=M.DocEntry) as 'ED (Rs.)',
(SELECT Sum(TaxSum) FROM PCH4 where statype=-60 and DocEntry=M.DocEntry) as 'EDCS (Rs.)',
(SELECT Sum(TaxSum) FROM PCH4 where statype=7 and DocEntry=M.DocEntry) as 'HECS (Rs.)',
(SELECT Sum(TaxSum) FROM PCH4 where statype=1 and DocEntry=M.DocEntry) as ' VAT (Rs.) ',
(SELECT Sum(TaxSum) FROM PCH4 where statype=4 and DocEntry=M.DocEntry) as ' CST (Rs.) ',
(SELECT Sum(TaxSum) FROM PCH4 where statype=10 and DocEntry=M.DocEntry) as ' CVD (Rs.) ',
(SELECT Sum(TaxSum) FROM PCH4 where statype=5 and DocEntry=M.DocEntry) as ' Ser.Tax (Rs.) ',
(SELECT Sum(TaxSum) FROM PCH4 where statype=6 and DocEntry=M.DocEntry) as 'CS on Ser.Tax (Rs.)',
(SELECT Sum(TaxSum) FROM PCH4 where statype=8 and DocEntry=M.DocEntry) as 'HECS_ST (Rs.)',
(Select Sum(LineTotal) From PCH3 Q Where Q.DocEntry=M.DocEntry) AS 'Freight (Rs.)',
M.WTSum AS 'TDS (Rs.)',
M.DocTotal as 'Total (Rs.)'
FROM OPCH M LEFT OUTER JOIN PCH1 L on L.DocEntry=M.DocEntry
LEFT OUTER JOIN PCH4 T on T.DocEntry=L.DocEntry and L.LineNum=T.LineNum
LEFT OUTER JOIN PCH5 J ON M.DocEntry = J.AbsEntry
LEFT OUTER JOIN PCH3 Q ON M.DocEntry = Q.DocEntry
WHERE (M.DocDate >= '[%0]' AND M.DocDate <= '[%1]') AND (T.TrgetEntry = ' ')
GROUP BY
M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.[DiscSum],M.WTSum,M.DocTotal
ORDER BY
M.DocNum,M.DocDate,M.CardName,M.NumAtCard,M.DocEntry,M.[DiscSum],M.WTSum,M.DocTotal
Jeyakanthan -
Hi,
I want to create Sales register for all the taxes like BED, VAT etc... What are the tables from which the data need to picked?
KalliHi Kalli,
I have this which uses OINV (invoice as a base for sale register).
DECLARE @FromDate DateTime
DECLARE @ToDate DateTime
/* SELECT T0.DocDate FROM OINV T0 where T0.DocDate >=[%0] */
SET @FromDate = [%0]
/* SELECT T0.DocDate FROM OINV T0 where T0.DocDate <=[%0] */
SET @ToDate = [%1]
SELECT DISTINCT T0.Docentry, T0.[DocNum], T1.[Dscription],T1.[ItemCode], CONVERT(VARCHAR(10), T0.[DOCDATE], 3) AS DOCDATE, T1.[Quantity], T1.[Price], T1.[TaxCode],( T1.LineTotal ) as 'Basic' , T1.[VatSum]as 'Total Tax',
( T1.LineTotal +T1.[VatSum]) as 'INCLUDING TAX', T0.[CardCode] as 'Customer Code',T0.[CardName] as 'Customer Name' ,
(Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=-90 and INV4.docentry=T0.Docentry and INV4.linenum = T1.Linenum )BED,
(Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=-60 and INV4.docentry=T0.Docentry and INV4.linenum = T1.Linenum)Cess,
(Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=8 and INV4.docentry=T0.Docentry and INV4.linenum = T1.Linenum)HCess,
(Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=10 and INV4.docentry=T0.Docentry and INV4.linenum = T1.Linenum )SAD,
(Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=4 and INV4.docentry=T0.Docentry and INV4.linenum = T1.linenum)CST,
(Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=1 and INV4.docentry=T0.Docentry and INV4.linenum = T1.linenum)VAT,
(Select distinct isnull(Sum(INV4.taxsum),0) from INV4 where INV4.statype=8 and INV4.docentry=T0.Docentry and INV4.linenum = T1.linenum)SURCHARGE,
Discsum, T0.[Comments] FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry --INNER JOIN OITM T2 ON T1.ItemCode = T2.ItemCode inner join INV4 T3 on T1.Docentry =T3.docentry and T1.LineNum=T3.LineNum inner join CRD7 T4 on T0.cardcode = T4.Cardcode
Thanks,
Joseph -
URGENT : REPORT for sales register
Hi Guys,
Anybody is having the report on sales register? logic follows like this:-
The logic which needs to be developed is, as per input criteria given by user, which will be sales organization, plant & date range.Program needs to pick all the billing document which will satisfy the above criteria.
Except for document cateroty N i.e. invoice cancellation (VBRK -VBTYP not equal to N) and which are marked for cancellation (VBRK-FKSTO not equal to
X)
From the VBRK table pick up the document condition number (VBRk-KNUMV) and then go to KONV table you will find all condition with value over their. Pick up the values as per condition type and print it. (Condition types are already mentioned in format attached).
Their are 3 different format they have asked for, the format types will depend on the plant i.e. if plant start with 21 then it is RMC plant and accordingly appropriate format needs to be picked. Please check config for plant descrption.
By looking at format, i feel that some changes needs to be done into it like their is no material number or descprtion mentioned in format but qty & base rate fields their. Now whether register needs to printed for every line item in invoice or ony one line item for every invoice i.e.
consoliadted per invoice number. If it is consolidated then what about base rate which can be different for each line item. In this case what rate needs to be print.
Always print the invoice values line item by line item, giving each line item quantity, base price, and other pricing conditions but should have facility to sum up fields like Quantity, Base price, all pricing conditions each customer wise.
I have to get this report in ALV format.
I will reward points for useful answers.
My mail id is [email protected]
Waiting for reply...
Thanks,
Sundeep.Hi
If you are using sales and operation planning in make to stock scenario its simple . As You input target sale plan and target production plan for whole one year (MC84) . So this data can be pulled out from the tables .
For Action Need to be taken and revision you may need to have new table .
Neal -
Req:validtion query for sales quotation
Hi,
I would like to put validation for sales quotation when Freight1 Tax Code at line level is not empty
My query is:
if @object_type ='23' and @transaction_type in ('A','U')
begin
if exists(SELECT * FROM [dbo].[OQUT] T0 INNER JOIN QUT2 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN QUT1 T2 ON T0.DocEntry = T2.DocEntry
WHERE T1.TaxCode is not null and T0 .DocEntry = @list_of_cols_val_tab_del and
T2 .DocEntry =@list_of_cols_val_tab_del )
select @error=N'001'
select @error_message =N'Freight1 Tax code should be empty.'
end
but didnot get the result.Plz give the solution.Hi Md Zak,
Try dis..
IF (@object_type = '23' and (@transaction_type IN ('A','U')))
BEGIN
If Exists (SELECT T0.DocEntry FROM OQUT T0 INNER JOIN QUT2 T1 ON T0.DocEntry = T1.DocEntry
INNER JOIN QUT1 T2 ON T0.DocEntry = T2.DocEntry
WHERE T1.TaxCode is not null and T0 .DocEntry = @list_of_cols_val_tab_del)
Begin
set @error = N'001'
set @error_message = N'Freight1 Tax code should be empty.'
End
END
Hope Helpfull
Regards::::
Atul Chakraborty -
Query for Sales order and corr.AR Invoice Info
Hi,
I need to write a query which gives the flollowing sales order info along with the coressponding AR invoices info
Sales Order columns reqd:
OPERATING_UNIT
ORDER_NUMBER
CUSTOMER_NUM
CUSTOMER_NAME
ORDERED_DATE
FLOW_STATUS_CODE
TOTAL_ORDER_AMOUNT
AR invoice columns reqd for the sales orders:
Invoice number,
Invoice date,
Invoice Total.
Can anyone help me out with this?
Thanks,
AshHi Ash,
There are some issues that must be defined before you have the exact query.
Do you have freight charges or non-inclusive tax? If you have, freight charges and tax amounts must be included?
Depending on you grouping rule, you can have lines from more than one order in a single invoice. In this case, as invoice amount you want the sum of all lines, or only the lines from that order?
Below is an example using two views. It assumes that grouping rules split lines from different order into different invoices.
Hope it helps,
Ketter Ohnes
create or replace view order_summary as
select oh.org_id,
oh.ORDER_NUMBER,
oh.header_id,
ott.name tt_name,
ca.account_number,
p.party_name,
oh.ordered_date,
oh.flow_status_code,
sum(ol.ordered_quantity*ol.unit_selling_price) total,
sum(ol.tax_value) tax,
(select sum(operand)
from OE_PRICE_ADJUSTMENTS_v x
where x.header_id = oh.header_id
and x.adjustment_type_code='FREIGHT_CHARGE') freight_charge
from oe_order_headers_all oh,
oe_order_lines_all ol,
hz_cust_accounts ca,
hz_parties p,
oe_transaction_types_tl ott
where ol.header_id=oh.header_id
and oh.sold_to_org_id = ca.cust_account_id
and ca.party_id = p.party_id
and oh.order_type_id = ott.transaction_type_id
and ott.language =
(select language_code
from fnd_languages
where installed_flag = 'B')
group by oh.org_id,
oh.header_id,
oh.ORDER_NUMBER ,
ott.name,
ca.account_number,
p.party_name,
oh.ordered_date,
oh.flow_status_code;
create or replace view invoice_summary as
select a.interface_header_context,
a.trx_date,
a.trx_number,
b.interface_line_attribute1,
b.interface_line_attribute2 tt_name,
a.customer_trx_id,
sum(b.extended_amount) invoice_total
from ra_customer_trx_all a,
ra_customer_trx_lines_all b
where a.customer_trx_id = b.customer_trx_id
and b.interface_line_context = 'ORDER ENTRY'
and b.line_type in ('LINE','FREIGHT')
group by a.interface_header_context,
a.trx_date, a.trx_number,
b.interface_line_attribute1,
b.interface_line_attribute2,
a.customer_trx_id;
select *
from order_summary o,
invoice_summary i
where o.order_number between :1 and :2
and o.order_number = i.interface_line_attribute1
and o.tt_name = i.tt_name; -
Query for Sales Order and AR Invoice Information
Hi,
I need to write a query which gives the flollowing sales order info along with the coressponding AR invoices info
Sales Order columns reqd:
OPERATING_UNIT
ORDER_NUMBER
CUSTOMER_NUM
CUSTOMER_NAME
ORDERED_DATE
FLOW_STATUS_CODE
TOTAL_ORDER_AMOUNT
AR invoice columns reqd for the sales orders:
Invoice number,
Invoice date,
Invoice Total.
Can anyone help me out with this?
Thanks,
AshHi Ash,
Table RA_CUSTOMER_TRX_ALL can be joined to RA_CUSTOMER_TRX_LINES_ALL table through CUSTOMER_TRX_ID column. The table RA_CUSTOMER_TRX_LINES_ALL.INTERFACE_LINE_ATTRIBUTE6 = OE_ORDER_LINES_ALL.LINE_ID. And from the LineId, you can get the HeaderId os the OE_ORDER_HEADERS_ALL table.
You must have visualized the query by now.
Thanks
Sumit -
How to Create Specific SAP Query for Sales BOM
Dear All Salute !!
How I can create a SAP Query which provide information from the Sales Order-Line Item, this specific material is having any BOM or not?
Suppose, user want Input,
Sales Order No., Product Category, Duration of Sales Order Release.
want Output,
Sales Order No., Customer No., Customer Description, Sales Order Line Item, Material No., Material Description, Delivery Date, Quantity, Sales Order release Date
Users requirement is, List of All Line Items for which BOM is yet to be Uploaded in the System.
Please provide complete detail with Table & field by using SAP Query.
Rgds
Srivastav
+91-9973504950If I am correct, in table KDST, you can see the details of Sales BOM with sale order. Since right now, I dont have access to SAP, I am unable to confirm this. You have to consider this table and develop on your own logic with the help of ABAPer.
thanks
G. Lakshmipathi -
Warranty related query for sales item
hi I need a report for checking an sales item is under warranty or not & also I want to know the status of the products which comes under warranty is in open state or closed state Regards, K.Ramasamy
Hi,
Try this query:
SELECT T0.[ItemCode], T0.[ItemName], T1.[TmpltName], T1.[Deleted] FROM OITM T0 inner join OCTT T1 on T0.[WarrntTmpl] = T1.[TmpltName] WHERE T0.[SellItem] = 'y'
Thanks. -
Query For Sales Order Amendments
Hi,
Does anyone have a query that lists the amendments to a Sales Order?
I basically want to create an alert that runs this query once a day and shows me the sales orders that have been amended that particular day.
Any help on this would be gratefully received.
Regards
DavidHi..
Try These Query in Alert you will get your req. fulfill
SELECT T0.[DocNum], T0.[DocStatus], T0.[DocDate], T0.[DocDueDate], T0.[CardCode], T0.[CardName] FROM ADOC T0 WHERE T0.[ObjType] = 17 AND T0.[UpdateDate] = GETDATE()
Regards,
Bhavank
Edited by: Bhavank on Sep 28, 2010 5:50 PM -
Hello,
Can SAP 8.8 deal with sales invoices to spain, specifically with something call a 'pharmacy scheme'. I'm informed that there are two elements to the VAT under this scheme. 1) Value added Tax. (18%) 2) Equivelance VAT (4%). Does SAP deal with this at all and if so, Is it possible to report on this for VAT purposes ?
Regards,
JuanHave contacted SAP directly.
-
i have problems with a query, i need that have the follows fields.
SELECT T0.[DocNum] AS #Doc, T0.[NumAtCard] AS Referencia, T0.[docDate] AS Fecha, T0.[LicTradNum] AS RFC, T0.[CardName] AS 'Nombre del Cliente', T0.[DocTotalFC] AS TotME, T0.[DocRate] AS 'TC Fact', T0.[DocTotal] AS TotMS, T0.[VatSumFC] AS 'IVA ME', T0.[VatSum] FROM [dbo].[OINV] T0
But i need to know if this invoices have a PR, RF, RC,etc.
I saw that ORIN(RIN1) is for -> RC, OINV(INV9) -> RF, ORCT -> PR but i dont know how make a correctly INNER JOIN. When the invoice have a PR giveme Num of PR, if the invoice have a RC giveme the number of document destination.
So, how can i join these tables for get that information.
Thank you for you help.SELECT * FROM ORDR T0
INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
This is a basic inner join created from the SAP Query Generator
Template would be
Select <field names> FROM <base table name>
Inner join <table you want to join> on <<condition you want to two tables to joins>>
or
Simply you can write it
SELECT * FROM ORDR T0, RDR1 T1 WHERE T0.DocEntry = T1.DocEntry
it will do the same thing and you can simply join more tables.
Hope this will help...
Sanjaya -
Approval Query for Sale Delivery Problem
Hello,
I have to set approval procedure of Sale Delivery in following condition
If i add sale order for Specific item for 10 Qty for example C01 customer & after that i add sale order for same item qty 10 for another customer ie C02 & i have stock for that item 50 but user give delivery first to C02 in staid of C01 but C01 give me first order
on this condition i have to set approval user can't deliver second sale order first he have to take approval from manager to do this & he deliver first order first then then don't have to need approval.
Can any one help me?Hi,
Row level approval is not possible in SBO.
You may check this for your reference: http://www.beonesolutions.com/ip/Solutions/ap.html
Thanks,
Joseph -
Select query for sales order for particular customer oder text and storage
Hi All,
I am trying to retriev customer order text and customer storage bin from the following select query, but it's giving huge number of records, I want to restrict the number of records.
Select customer order text, customer storage bin
Select STXHTDOBJECT, STXHTDID
Where TDOBJECT = VBBP
TDID = Y001
TDID = Y007
Please let me know how to restirct the number of records.
Thanks,
RanjanTry using the FM 'READ_TEXT'.
NAME will be the order number concatenated with the item number.
And you have the ID and OBJECT. You may also need to use the LANGUAGE.
Message was edited by:
Matt Nagel
Maybe you are looking for
-
Removing "recent words" suggestions from Kotoeri
I'm using the Japanese Kotoeri input and accidentally entered a gibberish word combination. Now, Kotoeri keeps suggesting this gibberish combination in its "recent words" window whenever I start typing a similar combination of characters. It's really
-
Comment and uncomment in the new SE38 editor: Doing it the old way
Prerequisites: Front-end Editor (New) The Front-End Editor is available with SAP GUI for Windows 6.40 Patch level 10 or higher. Steps: 1) Open SE38(or SE24,SE37,SE80) and click on the icon below the scroll bar (the last one on the right-bottom) this
-
Dear all, I have just buy a Sony NEX 6 camera, but I can't upload any pictures into my aperture 3.4.2 Could someone help me to do it? Thank you very much n advance. Vincenzo
-
I purchased a multi-computer license of Lightroom 5. The first computer was no problem. I am unable to figure out how to get it onto a second computer. I have an Adobe account and can sign in. It shows my license. How do I get it for my laptop?
-
Hi, I forgot my restriction passcode...please help to recal or restore. Thanks