Query for UDF
Hi All
I need some help here , One of our clients doesnot report on vat or can't not claim , but the vendors they deal with some are vat vendors and do claim so it need to be shown on the marketing docs.
So what we've done is on the client side we used a UDF to display the vat amount per line.
So i need a query that will perform task like this.
Scenario.
Supplier is vat vendor then client selects a UDF with YES or No ( Defaults to No) , then based on the selection the Tax Amount UDF must be updated automatically by the query running in the back ground.
something more like this :- if vat udf = 1 ( Yes) then price x 0.14 --- tax amount
then the total must be be combination off the two fields price plus tax amount.
Hope it makes sense.
Bongani
Hi Bongani,
It is better if you can use tax code to deal with this problem. The line total calculation is hard coded by system. If you try to add your calculation to it, you may voliate the support agreement with SAP.
UDF is used to facilate grouping, categorying or something similar. Or if you want some numbers in parall to system value, you can hold them in UDF.
Thanks,
Gordon
Similar Messages
-
Reg. Query for UDFs.
Hello All,
I've created a multiple UDFs Like, Vendor Name,Vendor Address,Vendor Excise Details like ECC No,Range, Division,VAT No,CST No. in Marketing Documents.
I want to write a query, for example if I select the Vendor Name, the vendor address and excise details should pick up automatically from that vendor master record. Please help.
Thanks,
Pratheeviraj.Dear Avijit,
Thanks for your reply.
I can't understand your solution. Can you please explain me in detail?
I'm giving the scenario in detail,
In the marketing document 'Outgoing Excise Invoice', I've created UDFs like vendor name, vendor address, vendor excise number, etc., my requirement is the moment I select the vendor in Vendor Name UDF, the address and excise number should get populated in the respective UDFs.
Thanks,
Pratheeviraj -
NOTIFICATION QUERY FOR UDF COLUMN
Dear experts,
I want notification query for delivery should not be add without fill up the information in machine number column (UDF Column- U_MCnumber)
Please do needful.
Thanks & Regards,
AkshataDear all,
I have got query ...........
If @object_type = '15'and @transaction_type= ('A')
BEGIN
If Exists (Select T0.DocEntry from ODLN T0 Inner Join DLN1 T1
On T0.DocEntry=T1.DocEntry INNER JOIN OITM T3 ON T3.ItemCode = T1.ItemCode
Where (T1.U_MCnumber Is Null and T3.ITMsgrpcod='119')
And T0.DocEntry = @list_of_cols_val_tab_del )
BEGIN
Select @error = -1,
@error_message = 'Please fill up machine number!!!'
End
End
Thanks & Regards,
Akshata -
Query for SP to make a udf field mandatory
Hi,
I got a UDF with name (Received By) in Header of GRPO document if the user does not fill the field the document should not be added. I know this is possible by SP but can any one give me the query for it. I searched i got certain query but i dont Know how to use it Or modify it for my case. Pls help me!
Thanks,
GopalALTER proc [dbo].[SBO_SP_TransactionNotification]
@object_type nvarchar(25),
@transaction_type nchar(1),
@num_of_cols_in_key int,
@list_of_key_cols_tab_del nvarchar(255),
@list_of_cols_val_tab_del nvarchar(255)
AS
begin
-- Return values
declare @error int
declare @error_message nvarchar (200)
select @error = 0
select @error_message = N'Ok'
IF @transaction_type = 'A' AND @object_type = '13'
BEGIN
if exists (Select T0.cardcode from oinv T0 where T0.UDFName is null and T0.DocEntry=@list_of_cols_val_tab_del)
begin
SET @error = 10
SET @error_message = N'UDF is Null'
end
END
select @error, @error_message
end
I have written the above code for AR Invoice Screen.
Replace 'T0.UDFName' in the Select Statement to your UDF Name -
FMS Query for Document Header UDF
Hi,
I have created an UDF in the header level of Marketing Document. I want to add FMS on it. UDF Value will be 4% of DocTotal Value and auto Refresh on DocTotal.
What will be the query for Sales Order.I am saving this query
Select ($[$29.0.number]) * 0.04
and setting this query in the udf by.
now when i am creating an order and pressing shift+f2 on it it's giving an error msg : internal error(3006) occured.
Edited by: Sibasish Sengupta on Dec 8, 2008 1:11 PM -
Query on Stored Procedure for UDF's
Hi guys,
I have created 3 UDF's T0.[U_LR_Receipt], T0.[U_Removal_Time], T0.[U_Removal_Date]
at header level for the marketing documents.I want the invoice to be added only if the above fileds is entered or else it has to show the error message.
to acheive this i have created a stored procedure in SBO_SP_TransactionNotification for U_LR_Receipt.
But i want to know whether we can add two more procedures in the same or else i need a single query for the 3 fields.
Below is the code i used ,
if @object_type = '13' and @transaction_type IN ('A','U')
begin
declare @LRRECEIPT NVARCHAR(10)
set @LRRECEIPT = (select isnull(T0.U_LR_Receipt,0) from OINV T0 where T0.DocEntry = @list_of_cols_val_tab_del)
If (@LRRECEIPT = 0)
begin
select @error = 1
select @error_message = 'You cannot post the INVOICE without LR Receipt No'
End
End
Thanks in advance,
Regards,
Vamsi.Hi Vamsi,
Give this a go.
Kind Regards,
Adrian
if @object_type = '13' and (@transaction_type= 'A' or @transaction_type= 'U')
begin
if (select count(1) from OINV where DocEntry = @list_of_cols_val_tab_del and (U_LR_Receipt IS NULL or U_Removal_Time IS NULL or U_Removal_Date IS NULL)) > 0
begin
select @error = 1
select @error_message = N'You cannot post the Invoice without the LR Receipt No, Removal Time or Removal Date'
end
end -
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 -
QUERY FOR CUSTOMERS FULL DEBIT AND CREDIT WITH CLOSING BALANCE
Hi Friends,
I need query for CUSTOMERS FULL DEBIT AND CREDIT WITH CLOSING BALANCE for selection criteria from date and to date.
I know the Trial Balance Report will sort out this issue... but i need routeday wise report
1. Business Partner Master Data - i created one UDF field called U_Routeday (MONDAY, TUESDAY, WEDNESDAY,THURSDAY,FRIDAY)
2. The query should be like selection criteria
- Routeday [%0]
- Posting Date [%1]
- Posting Date [%2]
CardCode
Debit
Credit
Balance
D10503
25031.50
24711.50
2962.00
D10641
5466.00
7460.00
285.00
D10642
2866.00
142.00
give any helpful query ASAP... Thanks in advanceHi,
Try this query:
Declare
@fromdate as datetime
Declare
@Todate as datetime
Declare
@Code as nvarchar(25)
set
@fromdate = ( select min(Ta.[RefDate]) from OJDT ta where
Ta.[RefDate] >= [%0])
set
@Todate = ( select max(Tb.[RefDate]) from OJDT tb where Tb.[RefDate]
<= [%1])
set
@code = (select max(Tc.[ShortName]) from JDT1 tC where Tc.[ShortName]
= [%2])
SELECT
[Name] as AcctName, [Jan]= sum([1]), [Feb]= sum([2]), [Mar]=
sum([3]), [Apr]= sum([4]), [May]= sum([5]), [June]= sum([6]),
[July]= sum([7]), [Aug]= sum([8]), [Sept]= sum([9]), [Oct]=
sum([10]), [Nov]= sum([11]), [Dec]= sum([12]), total = sum
(isnull([1],0)+ isnull([2],0) + isnull([3],0) + isnull([4],0) +
isnull([5],0) + isnull([6],0) + isnull([7],0) + isnull([8],0) +
isnull([9],0)+ isnull([10],0) + isnull([11],0) + isnull([12],0))
from
(SELECT
T0.[ShortName] as Name, sum(T0.[Debit]-T0.[Credit]) as T,
month(T2.[RefDate]) as month FROM JDT1 T0 INNER JOIN OACT T1 ON
T0.Account = T1.AcctCode INNER JOIN OJDT T2 ON T0.TransId =
T2.TransId WHERE T2.[RefDate] between @fromdate and @todate and
T0.[ShortName] = @code GROUP BY T0.[ShortName],T2.[RefDate] ) S
Pivot
(sum(T)
For Month IN ([1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12])) P
group
by [Name],[1],[2],[3],[4],[5],[6],[7],[8],[9],[10],[11],[12]
Let me know your result.
Thanks & Regards,
Nagarajan -
Hi All,
I have a line UDF called U_PO in the sales order documents that denotes our purchase order number that particular item is ordered on.
I have another line UDF called U_XMill which I want to populate with the corresponding PO document due date.
What would be my query for that?
Basically, it should be something like:
SELECT T0.DocDueDate FROM OPOR T0 WHERE T0.DocNum=$[$38.44.0] FOR BROWSE
However, I am sure that "38.44" is wrong.
It should denote my current document's UDF *.U_PO.
And I am not sure what would be the correct notation for it.
I was wondering if there was a help document I could refer to to figure out the corresponding field numbers for the cases like this.
Thank you for your help.Hello
use FMS on matrix (tables) as
[ItemUID.ColumnUID.Type] or [TableName.FieldName]
where itemUID is 38
ColumnUID is U_XMill
Type is 0 (general).
There is a now-to guide on service.sap.com/smb/sbo where you can find how to us FMS.
Regards
J -
Formatted Search query for Vacation Accrued
Hi Experts,
I have a Client who needs to keep tract on the Vacation Accrued on the Employee Master Data. I have created this UDF on the Master Data, but I could not get the query for the Formatted Search right.
This Formatted search on the UDF ( must look at the OHEM.startDate field and populate the following:
If it is a still within year of the system date, it must populate 0,
If it is > 1 year and < 3 years, it must populate 5,
etc.
Any help would be greatly appreciated.
MarliHi Experts,
Here is what I did for the query mentioned above:
{SELECT
CASE
WHEN (T0.startDate > GETDATE() -356)
THEN 0
WHEN (T0.startDate > GETDATE() - 712)
THEN 5
END
As 'Vacation Accrued'
FROM OHEM T0}
The issue is that if I link this query to the UDF on the EMD, I get a list of 0 and 5 to choose from. I need to populate automatically.
Thanks.
Marli -
Can we write query for fomatted search without from clause
can we write query for fomatted search without from clause as below.
SELECT (($(u_amt)*14)/100)
here U_amt is a UDF .I want to assign this to another field .
Rgds,
RajeevHi Rajeev,
You can write query for FMS without from. That is because you can omit it when you get value from active form by default. The grammar of it is:
Select $[$38.u_amt.0\] * 14/100 in your case if you have item type marketing document @line level.
From View-System Information, you can get the info you need for your FMS query at the left bottom of your screen.
Thanks,
Gordon -
Dear All,
My A/P Invoice entry is as Follows.
A/P Invoice
1) Item code (Multiple Items Possible)
2) Quantity per item
3) Unit Price per item
4) Under frieght I entry 3 freight value
5) Tax Code is selected
The report required is
1) A/P Invoice No
2) A/P Post Date
3) A/P Documnet date
4) A/P Vendor Code
5) A/P Vendor Name
6) Vendor state ( From Vendor Master date Address)
7) Vendor Cst no / Vat no / Tin No ( These all are UDF)
8) A/P Doc total before Discount ( This does not contain frieght value) ( I am able to obtain this from the OPCH-- Max 1099 Amount Field)
9) A/P Doc total After discount
10) A/P Feieght Break up.
11) A/P DOc total + Excise details
12) A/P Tax Code
13) A/P Tax Amount
14) A/P Final Total Value
The main issue is till point number (8) I can get the query after that the query goes wrong.
I need a similar query for A/R Invoice also.
Please advice.hi aslam,
Try this query,
SELECT T0.DocNum as 'AP Invoice No.',
T0.DocDate as 'Posting Date',
T0.TaxDate as 'Doc. Date',
T0.CardCode as 'Vendor Code',
T0.CardName as 'Vendor Name',
T1.State1,
T2.TaxId1 as 'CST No.',
T2.TaxId11 as 'TIN No.',
T0.Max1099, T0.DocTotal,
T0.TotalExpns,
T0.VatSum
FROM [dbo].[OPCH] T0 INNER JOIN [dbo].[OCRD] T1 ON T0.CardCode = T1.CardCode
INNER JOIN [dbo].[PCH12] T2 ON T0.DocEntry = T2.DocEntry
WHERE T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]'
Whether it solves ur requirement ?
Jeyakanthan -
Query for Order recomendation from MRP.
Good evening,
Recommendations are saved for the Production and Purchase Order after MRP is done. New Production and/or Purchase Orders are created in Planned stages. We need a query for the Alert Management to the users for the new Orders created.
Please can anyone guide and help me.
thank you.Hi,
Welcome you post on the forum.
Try this for production order:
SELECT T0.DocNum, T0.ItemCode FROM OWOR T0
WHERE T0.OriginType = 'R' AND DateDiff(dd,T0.DocDate,GetDate())=0
Thanks,
Gordon
Good Morning Sir,
Thanks for your message, guidance and support for the query.
The query for the alert for Production is working fine, we just changed the DocDate to PostDate as the Production Order, Posting date is as PostDate.
We tried to change the OWOR to OPOR and the Origin type to T0.Comments='Origin :MRP' and tried for Purchase Order, but the alert is not visible. Would it be ok, that we create an UDF and try the same?.
thanks and warm regards. -
Approval Query For A/R Delivery
Hi
I have made a query for Approval Procedure, only those Delivery documents will go for approval for which A/R Down payment Request has not been made. But it is not working properly Kindly Correct the query.
SELECT Distinct 'True' where dln1 t0 inner join odln t1 on t0.docentry = t1.docentry inner join ordr t2 on t0.baseentry = t2.docentry and t2.docentry not in (Select distinct t4.baseentry from dpi1 t4) and
t2. docentry = $[DLN1.Baseentry]
Thanks
RashidHi Rashid,
B1 does not support approval queries on document lines. you can query only document header.
you can either try to workaround it with all sorts of aggregate UDFs in the header, or alternatively take a look at:
[http://www.beonesolutions.com/ip/Solutions/ap.html|http://www.beonesolutions.com/ip/Solutions/ap.html]
all details, including the ability to query all document tables, are in:
[http://www.beonesolutions.com/files/Approval_Pro_Brochure.pdf|http://www.beonesolutions.com/files/Approval_Pro_Brochure.pdf]
Gilan -
How to use the same POWL query for multiple users
Hello,
I have defined a POWL query which executes properly. But if I map the same POWL query to 2 portal users and the 2 portal users try to access the same page simultaneously then it gives an error message to one of the users that
"Query 'ABC' is already open in another session."
where 'ABC' is the query name.
Can you please tell me how to use the same POWL query for multiple users ?
A fast reply would be highly appreciated.
Thanks and Regards,
SandhyaBatch processing usually involves using actions you have recorded. In Action you can insert Path that can be used during processing documents. Path have some size so you may want to only process document that have the same size. Look in the Actions Palette fly-out menu for insert path. It inserts|records the current document work path into the action being worked on and when the action is played it inserts the path into the document as the current work path..
Maybe you are looking for
-
Please help with a table issue
At http://www.stlblues.net/default.htm, the mini-calendar I frame at the top right is aligning left. I can't find the reason, please help me align this centered /
-
IPod recognized by comnpuer...SOMETIMES
I just got a refurbished second generation nano from Apple. I plugged it into my computer and...nothing happened. I plugged it in again and it was recognized for about 10-15 seconds and then I got the "Device was improperly removed" message. Somehow
-
How can i reindex my mail accounts (imap)?
i've noticed that i can't seem to search my mails anymore. or just a subset from what's in the accounts. how i can force mail.app to reindex my imap accounts?
-
APEX 3.0.1 and SQL Developer integration - what is it?
Hello In the Apex Release 3.0.1 page, it reads "Supports direct integration with Oracle SQL Developer 1.2.". What does this exactly mean? I looked at the patch notes but could not find any info... I am not a current user of SQL Developer (long way to
-
I have a function which populates a collection, pipe the elements in the collection and throws the piped table object. Its working fine. But when I pass the collection to this function instead of populating them in the function. Its throwing a error