Aging query for an approval procedure
I need to include the customer accounts receivable aging in a approval procedure. Is there any way that I could have the query that is used in the report that SBO has.?
Hi,
The aging is not store in the certain table. I am not sure you could do that. The aging is vary and it is also difficult to include it. Although it seems that you could use terms based on user queries but it will take a lot of work. So, I suggest just use account balance of the customer.
Rgds,
Similar Messages
-
Dear Sir / Madam;
Please Help, We try to made Query for PO Approval with condition if PO Type "ITEM" have to approve by Purchasing Manager, but for PO Type "SERVICE" have to approve by General Affair Manager.
We Create Query for this condition " SELECT * FROM OPOR WHERE T0.[DOCTYPE]='I'
We already create the stage, and this query is not work. But if try to set the total Doc greater than 1000000, it is work.
Dear Sir / Madam, please help me to send me the right query ?
Thanks for your help
Regards
PetrusHi,
I suggest to add select distinct 'true' or select 'true' for in your query like previous answer.
Here are the solutions for your problem:
A. for doc type is not as same as service :
SELECT distinct 'true' FROM OPOR T0
where $[OPOR.doctype] = N'S'
B. For doctype is not as same as item:
SELECT distinct 'true' FROM OPOR T0
where $[OPOR.doctype] = N'I'
Both have been tested and work well.
Rgds, -
Query for MM Pricing Procedure & tax Procedure
Hello,
Can someone advice me on following.
I need one Condition in MM Pricing Procedure : Discount should be reduced after Calculation of Excise duty and Taxes on PO.
Discount should not be calculated for Excise Base amont & or Tax (CST /VAT) base amount.
Calculation
Basic : 100
Freight 20
Subtotal 120 (Excise Base)
Excise duty: 30
Subtotal: 150 ( Tax Base)
Tax @4% 6
Subtotal 156
Discount 10
Total Price 146
My Requirement is how to add Discount at the Place shown above.
Regards,
ManishDear Manish,
After subtotal 120 put in subtotal column 7 and after subtotal 156 put 1.
Truly, I was bit surprised to see your first post, now I got the reason what kept you held.
I tell you why this happens.
I believe you are using tax procedure TAXINN. The routine 362 (in tax procedure) has the program which fetches the data from your pricing procedure and on what amount the taxes have to calculated is the value passed into BASB condition type of tax procedure. One should always read the routine 362 in tax procedure with the help of ABAP consultant. This will give you clarity on the concept of calculation. the subtotal field i.e is KZWI plays important role in calculation.
Currently I do not have access to any test system. If you put the subtotal what I have mentioned the result will come.
Another layman tip I am giving you for tax procedure calculation. where ever you are calculating subtotal just give value from 1 to 7 in subtotal column with different combination one by one and see the results, you will have good idea how the system behaves. Say if you put subtotal as 1, the system response will be different from if you give subtotal 4.
Why this is important to understand is when in future if you are going to add any new condition type you will know how the system response is towards the tax calculation.
That is why I suggested you to read the routine 362.
Moreover, if I see your procedure, excise duty, CST and LST should not be calculated on freight charges. Legally this is not correct. Freight charges are in the preview of service tax. In many implementations I came across the similar scenario where the client insisted on the similar procedure. This all happens due to ignorance of client. We have shown the client the official documents as well we also arranged the official meetings with excise commissioners to clear there doubt.
This scenario is usually insisted in the case of freight billed what client says. this is not correct.
Regards
Rajesh -
Hi Everyone I am trying to create a Query for an approval procedure. I have created a user defined table that has a value with a certain budget. Each time a PO is about to get added it checks the budget table to make sure it has not exceeded the budget amount
Example:
Budget table has value of $1000 dollars
1) A PO of $500 hundred dollars is about to get added the query runs and checks against the budget table , the amount is not exceeded and the document gets added.
2) A PO of $300 hundred dollars is about to get added the query runs and checks against the budget table , the amount is not exceeded and the document gets added.
3) A PO with the amount of $400 is about to get added the query runs and checks against the budget table, the amount has been exceeded(total of $1100) the query triggers the approval procedure and the document becomes a draft and waits for approval.
Here is what I have so far for the query:
SELECT CASE WHEN SUM(T0.DocTotal)>T1.U_POBUDGET THEN 'TRUE' ELSE 'FALSE' END
FROM [dbo].[OPOR] T0 INNER JOIN OSLP T1 ON T0.SlpCode=T1.SlpCode
WHERE T0.TaxDate BETWEEN '4/1/08' AND '4/30/08' AND T0.CardCode=T0.CardCode AND T0.SlpCode=9
GROUP BY T1.U_POBUDGET
I also need the query to be within the range of the current month. Can someone please help me with this thanksI do not see that you are referencing the Budget value from your UDT. Are you saying UDF which is created in the OSLP table?
Check this
SELECT 'TRUE' FROM [DBO\].[OPOR\] T0 INNER JOIN [DBO\].[OSLP\] T1 ON T1.SLPCODE = T0.SLPCODE
WHERE T0.SLPCODE = $\[OPOR.SLPCODE] AND T0.TAXDATE BETWEEN '04/01/2008' AND '04/30/2008'
GROUP BY T1.MEMO
HAVING SUM(T0.DOCTOTAL)+$\[$29.0.NUMBER] > T1.U_POBUDGET
Hard coding the dates might not be a good way to setup the Approval. for testing purpose it is OK.
You could try something like MONTH(T0.TaxDate) = MONTH($\[OPOR.TaxDate]) -
Approval procedure vs Transaction Notification
Hello dear experts,
I have an issue with the approval procedures and the validations I have to do using the Transaction Notificacion Stored procedure.
this is the scenario and conditions to consider:
1.A purchase order (Doctotal) that are between 0 and 25,000 USD needs an approval.
2. A purchase order needs to have all the project column filled in before the approval procedure. this column is in the detail of a document, so all the rows have to be filled in with the right project code otherwise when your request have been submmited and your receive the approval you are not allowed to do any changes in the Detail Document.
I realized that the approval procedure is launched before the Transaction Notification SP.
So I decided to add a query for the approval procedure considering the validations in the project column:
SELECT distinct 'true'
FROM OPOR
WHERE $[OPOR.DocTotalSy.number] Between 0 and 24999.99 ---This part works perfeclty!!!
AND LEN(isnull($[POR1.Project.0],''))>0 and $[POR1.U_SubJob.0]>0 ) --This part does not work
As you see in the query, I am trying to validate that all the rows have the project code (Project) and a UDF (U_SubJob) filled in.
Have anybody been done this before? How can I access to the detail values of the document? It is easy to acces values on the header.
I appreciate any help on this. Thank you very much
Regards,
MaryHi,
You must use both in approval procedure or use both in SBO store procedure transaction notification.
To request approval for a project, you this following approval query:
if (SELECT $[$38.31.0]) > ' '
select 'true'
the other query is for doctotal approval as follows:
if ($[opor.doctotalsys.number]) between 0 and 24999.99
SELECT 'true'
or
select distinct 'true' FROM OPOR
WHERE $[OPOR.DocTotalSy.number] Between 0 and 24999.99
Both are able to use and work simultanously.
JimM -
Query base multiple levels PO approval procedure
Hi,
My customer is having following requirement for PO approval procedure and would like to seek for solution.
The suppliers are either CAPEX or OTHERS supplier which I think of using UDF U_CAPEXSUPPLIER=Y or N in BP master setup.
OTHERS supplier PO
<RM2000 approved by local accounts
>RM2000 approved by CFO or one of directors
CAPEX supplier PO
<RM5000 approved by CFO
>RM5000 approved by one of Board of Directors
The 2000 and 5000 figures are applicable to both local and foreign purchase. ie if it USD suppliers then limit is USD2000
Thanks and regards
ThomasThomas,
Open Query Generator....Click Execute.....With the Red message at the bottom..you will see the SELECT *
click on the Pencil icon and copy over each of my queries and save it using a different name.
Then Add an Approval Stage for each Approver..
Using the Approval Template..Give a Name...Make Sure Active check box is CHECKED next to the Name
Select the Originators (users whose document should go through the approval process)..In the document tab select the documents for which this approval applies..Stages Tab..select the associated Approval Stage defined earlier..
Term tab: Select When the following Applies
In the lower window...double click onn the first row under Query Name..Select your query and ADD.
Make Sure Active check box is CHECKED next to the Name
Suda -
APPROVAL PROCEDURE THROUGH QUERY
Dear Suda,
Now i am telling wat i have actually done and wat is its result. Please try to understand it.
First of all I have made the querry below-
SELECT DISTINCT 'True', T1.DiscPrcnt AS 'Discount % per Row', T0.SlpName AS 'Sales Employee Name' FROM [dbo].[OSLP] T0 INNER JOIN [dbo].[RDR1] T1 ON T1.SlpCode = T0.SlpCode WHERE (T1.DiscPrcnt > 25 )
In this querry i have typped DISTINCT 'TRUE' manually but keeping the SELECT table as it is.In this case the system is not asking me for any kind of discount (not greater than 25% or not less than 25%)
After that i have modified above querry as below-
SELECT DISTINCT 'TRUE' FROM [dbo].[OSLP] T0 INNER JOIN [dbo].[RDR1] T1 ON T1.SlpCode = T0.SlpCode WHERE (T1.DiscPrcnt > 25 )
In this qurry i have typped DISTINCT 'TRUE' manually. When i executed this qurry i jst get the true in first row first column place.When i have attached this querry to approval, and after that when i have started for creating purchase order with the originators log in then in this case the system is asking approval for every discount from 0% to 100%.
Wat shud i do now...Please reply ASAP.
SwapnilHi, Swapnil!
You are on the right path, but I'm not sure if you can run this approval procedure at the line level.
The queries you had are against the wrong table (RDR1 is a Sales Order table) and are missing the link to the active document. You have to add the reference to the active document or else you are pretty much querying against the entire RDR1 table.
You need something like this:
SELECT CASE WHEN ($[$38.15.Number] > 25) THEN 'True' ELSE 'False' END
38 is the grid and 15 is the column for the discount.
I tried a basic case and it didn't work. I think you need to loop through all the lines, but I'm not sure how to do this.
You might have to create a header level UDF that changes automatically when the discount column changes, and has some logic to keep the highest discount you have on all the lines (something like: if discount greater than already stored value, update stored value) In the end, monitor this UDF for your approval procedure.
Hope this helps!
Liviu -
Approval procedure only for the check payments
Hi All,
Is it possible to intiate the approval procedure only for the check payments in the Outgoing payments ?Hi Anand........
Welcome to SAP Business One Forum.......
Yes it is absolutely possible to create Approval Procedure for Check Payment.
Please refer the following Query for Check Approval
Select Distinct 'True' From OVPM T0 Where T0.CheckAct is Not Null and T0.CheckSum>0
Apply above Query to Approval Procedure and assign it to proper User. and then check.......
Regards,
Rahul -
Creating a Query for Purchase Order Approval
I need to develop a query to check if any of the line totals in a new purchase order exceeds $500. I have to attach this query to the approval procedure (under 'Terms' in 'Define Approval templates'). When the 'Add' button on the purchase order is clicked, the values on the form are still not available in the database. This means, my query has to pick the data from the new purchase order form. Is there any way to build such a query? Thanks.
Satish, Alerts just notify the appropriate parties. They do not stop a document from being posted. This means, it is not capable to recognize the situation unless it's already stored in the DB.
Alexey. what about creating a Development Request about this topic?
Regards,
Felipe -
Approval Procedure to change the price of items
Hi!
i 'm trying to create a query to an Approval Procedure to change the unit price in the Purchase Order i create this query:
SELECT DISTINCT 'True' FROM POR1 T0 INNER JOIN OITM T1 ON T0.[ItemCode] = T1.[ItemCode] WHERE T1.[ItemCode] = $[$38.1.0] AND T1.[LastPurPrc] <> $[$38.14.0]
as you see this query compare is the Last Purchase Price is different than the actual unit price, and these for each line of item.
I think this is correct, and i configure the Approval Procedure, but when i check the AP in the Purchase Order changing the Unit Price, it gets me an error that says
1) [Microsoft][SQL Native Client][SQL Server] Error converting data type nvarchar to numeric.
What happend?
Am i doing something wrong ?
In easy term, i just want to execute an approval procedure when the user change the unit price in the purchase order.
Hope you can help me !
Thanks in Advance
Best Regards !Xavier,
maybe you are with a problem thar you dont' know, i can to expain this point,
1. if you want one approval at level line (comparing prices), not possible to make this way the approval, because you don't have control at level line while the document isn't in database.
2. i bealeve that the better way is to make a store procedure for to insert each record into temp table while to add line in purchase order without (formatead seaches), now, when you create a purchase orden you need create a query for to search record in the temporal table with the condicion that you needed.
3. now, if you want to call a value on the screen (money), the better way is $[$38.1.number]
Good look,
OSCAR KLENNER
> Hi!
> i 'm trying to create a query to an Approval
> Procedure to change the unit price in the Purchase
> Order i create this query:
> SELECT DISTINCT 'True' FROM POR1 T0 INNER JOIN OITM
> T1 ON T0.[ItemCode] = T1.[ItemCode] WHERE
> T1.[ItemCode] = $[$38.1.0] AND T1.[LastPurPrc] <>
> $[$38.14.0]
> as you see this query compare is the Last Purchase
> Price is different than the actual unit price, and
> these for each line of item.
>
> I think this is correct, and i configure the Approval
> Procedure, but when i check the AP in the Purchase
> Order changing the Unit Price, it gets me an error
> that says
> 1) [Microsoft][SQL Native Client][SQL Server] Error
> converting data type nvarchar to numeric.
>
> What happend?
> Am i doing something wrong ?
>
> In easy term, i just want to execute an approval
> procedure when the user change the unit price in the
> purchase order.
>
> Hope you can help me !
> Thanks in Advance
> Best Regards ! -
Query Based Approval Procedure for Sales order .
Hi
I have created query for SO which results above 5000 d 50,000 .
By using this each query i created two seperate Approval Procedures which So is >5000 d >50000.
If So>5000 Approval Procedure wants to activate same thing for >50,000., Bur approval Procedure is not working wat will be the cause. i have linked this query In Terms as when the following applies.
If SO >5000 approved by user A.
If SO>50,000approved by User A & B.
Regards
GiridharanHi Giri
Your query for the first should be as follows:
SELECT DISTINCT TRUE
WHERE $[$29.0.NUMBER] > 5000 AND $[$29.0.NUMBER] < 50000
For the second query:
SELECT DISTINCT TRUE
WHERE $[$29.0.NUMBER] > 50000
The query you were trying to use is looking at the table which will only apply to documents already posted, and as that query is not being filtered specifically it is bringing back all the records and getting confused. You must reference to the runtime value of the document being posted.
Kind regards
Peter Juby -
Query for approval procedure - A/R invoice and A/R credit memo
Dear all,
Need one help regarding approval procedure.
Query :- If we do A/R credit memo and days from A/R invoice to A/R credit memo are geter than 180 then A/R credit memo
shoild go to the approval. (A/R invoice shoul be a base documnet)
I have made below query, but if days are >180 or <180 it is goinf for a approval. Can any one suggest for this.
SELECT distinct 'TRUE'
FROM OINV T0 INNER JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
inner join RIN1 T2 on t2.BaseEntry=T0.DocEntry
inner join ORIN T3 on T2.DocEntry = T3.DocEntry
where DATEDIFF(day,T0.[DocDate],T3.DocDate) > 180
<a href="http://megaupload2.name/">megaupload</a>, <a href="http://www.btjunkie.name/">btjunkie</a>, <a href="http://www.freedownloadgames.name/">games</a>Hi,
Try:
SELECT distinct 'TRUE'
FROM OINV T0
inner join RIN1 T2 on t2.BaseEntry=T0.DocEntry AND T2.BaseType = 13
inner join ORIN T3 on T2.DocEntry = T3.DocEntry
where DATEDIFF(day,T0.DocDate,T3.DocDate) > 180 AND T3.DocEntry=$[ORIN.DocEntry.number\]
Thanks,
Gordon -
Query for terms in approval template of approval procedure
dears
i need to write a user query for approval template terms that chek for any price zero in invoice items .
i tried the true query
select 'true' from inv1 where $[inv1.price]=0
however the invoice executed without asking for approval procedurs.
any help will be appreciated!!
talalHi,
Its not possible on row level Price.
Try to Document total procedure, it will work.
SELECT Distinct 'True' FROM OINV T0 WHERE $[OINV.DocTotal]='0.00'
Thanks,
Madhan. -
Query for Credit Limit Approval Procedure
Hi experts,
Need your help with an approval procedure query. There is already the option to launch when the BP's balance exceeds the credit limit by a set dollar amount. What we would like is for the procedure to launch when the balance exceeds an additional 10% of their credit limit.
Ex: Customer's credit limit = $1,000. We want the approval procedure to kick in when the sales document causes their balance to be >= $1,100. Thanks.Adding this to the WHERE clause will include the DocTotal
T0.Balance + $[$29.0.Number]
SELECT distinct 'true' FROM OCRD T0 WHERE T0.CardCode = $[OINV.CardCode] AND
(T0.Balance + $[$29.0.Number]) >= T0.[CreditLine] * 1.1 -
Hi all,
I set up an approval procedure for sales orders, the term is based in this user query:
SELECT DISTINCT 'TRUE' WHERE $[$38.14.Number]<$[$38.U_PrecMin.Number]
We need that query working for every single row of the sales order, because it only works when it's true on row one, but when a unit price is less than the value of that UDF on row two or above, the procedure does not work.
Any suggestion?
ThanksHi......
Try this in SP Transnotification.......
If @Object_type='17' and (@transaction_type ='A' or @transaction_type ='U')
BEGIN
declare @Item1 as varchar(100)
declare @minline1 int
declare @maxline1 int
declare @Price1 float
declare @Price2 float
set @minline1 = (select min(T0.linenum) from RDR1 T0 where T0.docentry=@list_of_cols_val_tab_del)
set @maxline1 = (select max(T0.linenum) from RDR1 T0 where T0.docentry=@list_of_cols_val_tab_del)
while @minline1<=@maxline1
begin
select @Item1=T0.itemcode from RDR1 T0 where T0.docentry=@list_of_cols_val_tab_del and T0.linenum=@minline1
select @Price1=T0.Price from RDR1 T0 where T0.docentry=@list_of_cols_val_tab_del and T0.linenum=@minline1
select @Price2=T0.U_PrecMin from RDR1 T0 where T0.docentry=@list_of_cols_val_tab_del and T0.linenum=@minline1
if @Price1<@Price2
begin
set @error=-1
set @error_message = 'Price is Less ' + @Item1
End
set @minline1=@minline1+1
end
End
Regards,
Rahul
Maybe you are looking for
-
Oracle Reports 10g Error Codes Details
Hi, I would like to know which documentation will give me the details for the description and category (Warning/Fatal Error/User Error) for all the possible error codes that can be reported by Oracle 10g while the excution/scheduling of reports. The
-
Remote Function Module problem
Hi Experts, I have written a Se38 progarm to execute a remote function module, so as to send some data out of the system. The receiving system is an XI system. Pls see below the code and the load at the XI end, I donno why and what mistake am I doing
-
Storing iPhoto 8 Library on an External Drive
I have some data on storing (moving) iPhoto 2 to an external HD. Does this apply to iPhoto 8? Can there be more than one Library stored? Any practical suggestions on doing this? Thanks Mike
-
Problem with Prepared Statement & MS Access
Hi I have tried to find some info about this but can't see anything specific to what I think the problem may be. Hopefully someone can point me in the right direction.I am trying to get information out of an MS Access database using a Prepared Statem
-
LCM filesystem import error?
Hi, I have exported the Planning application into a file system and the same file system again imported into same application in same environment as part of restoring process using shared servcies. Here everything was successfully imported except few