Query Help for SO Alert
Dear Experts,
I have a scenario where our user would like to be reminded of action items pertaining to a specific BP when entering a new SO.
I have the following query but would like it to alert only once. What syntax do I need to configure for this query to send an internal alert once within a few minutes of adding?
SELECT T0.[DocNum], T0.[DocDate], T0.[CardCode], T0.[CardName], 'Reminder: <<Insert Reminder Here>>.' as "Important Message"
FROM ORDR T0
WHERE T0.[CardCode] IN ('ABC01')
Thanks,
Richard
Hi
You may create an alert by:
SELECT T0.DocNum, T0.DocDate, T0.CardCode, T0.CardName, 'Reminder: <<Insert Reminder Here>>.' as "Important Message"
FROM ORDR T0
WHERE T0.CardCode IN ('ABC01') AND DateDiff(D,T0.DocDate,GetDate())=0
However, there is no switch to turn it off.
Thanks,
Gordon
Similar Messages
-
SQ01 Query Help for (MKPF and MSEG)
Is their anyway to have the field MSEG-ERFMG show up on the query results as postive or negative color or use a "-" or "+". Need to try and show whether is was a negative or postive movement.
F1 help for MSEG-SHKZG
Debit/credit indicator in revaluation
This indicator is used for internal program control.
Please do not change the entry in this field.
Any changes made could lead to program errors or terminations.
I guess the "sign" is defined trough this field ("S" - sollen (debit), "H" - haben (credit)). If my assumption is true, you won't be able to see + / - in MSEG-ERFMG simply because this field contains no information on the sign.
Using ABAP code you can solve it (or in SQ01 you can use calculated field in your query...I'm not sure you can define that calculated field to cover your requirement...).
Regards,
Csaba
Edited by: Csaba Szommer on May 12, 2009 11:20 PM -
Query Help for reporting on last receipt qty
SBO Version: 8.82 PL11
Hello Forum,
I am looking for some help devising a command behind a crystal report. We are hoping to achieve the last receipt quantity. To arrive at this we would like it to get the last GRPO for an item and total the quantity on that particular GRPO. In addition to this, we want to consider all the lines on the document and SUM them.
At present, the query I have is as follows:
Select SUM(c0.Quantity) from PDN1 c0 WHERE c0.ItemCode = T1.ItemCode AND Shipdate = (select Max(ShipDate) from PDN1 C0 INNER JOIN OPDN c1 ON c0.DocEntry = c1.DocEntry where C0.Itemcode =T1.ItemCode AND c1.DocStatus <> 'C'))
Any assistance would be greatly received.
Thanks
SarahHi Sarah,
Please repost to the SAP Business One Application space.
-Abhilash -
Query help for sales employee sales
Hi....
How can we have a query for
Name of sales employee
Item group
Item name
Total selling amount
Total sales order
Total delivery
Total AR invoice
Please help
Thanks a lotHi,
What Total selling amount do you need? Invoice - Credit Memo?
How about the other Total, total count or total amount?
Thanks,
Gordon -
Select query help for Sales order
Hi Experts,
I have to write a select query to fetch sales orders which are open along with the quantities which are open ( not delivered). What would the best approach for this?
Any help is appreciated. Expecting code samples....Thanks
Thanks
Rickyhi,
do like this,
write a select query for vbak and vbuk as follows.
delivery status field is <b>lfstk</b> from <b>vbuk</b>,
and relation field is <b>vbeln</b> from the both the tables.
reward points if useful,
regards,
seshu. -
Query help for archive log generation details
Hi All,
Do you have a query to know the archive log generation details for today.
Best regards,
Rafi.Dear user13311731,
You may use below query and i hope you will find it helpful;
SELECT * FROM (
SELECT * FROM (
SELECT TO_CHAR(FIRST_TIME, 'DD/MM') AS "DAY"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '00', 1, 0)), '999') "00:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '01', 1, 0)), '999') "01:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '02', 1, 0)), '999') "02:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '03', 1, 0)), '999') "03:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '04', 1, 0)), '999') "04:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '05', 1, 0)), '999') "05:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '06', 1, 0)), '999') "06:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '07', 1, 0)), '999') "07:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '08', 1, 0)), '999') "08:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '09', 1, 0)), '999') "09:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '10', 1, 0)), '999') "10:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '11', 1, 0)), '999') "11:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '12', 1, 0)), '999') "12:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '13', 1, 0)), '999') "13:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '14', 1, 0)), '999') "14:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '15', 1, 0)), '999') "15:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '16', 1, 0)), '999') "16:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '17', 1, 0)), '999') "17:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '18', 1, 0)), '999') "18:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '19', 1, 0)), '999') "19:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '20', 1, 0)), '999') "20:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '21', 1, 0)), '999') "21:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '22', 1, 0)), '999') "22:00"
, TO_NUMBER(SUM(DECODE(TO_CHAR(FIRST_TIME, 'HH24'), '23', 1, 0)), '999') "23:00"
FROM V$LOG_HISTORY
WHERE extract(year FROM FIRST_TIME) = extract(year FROM sysdate)
GROUP BY TO_CHAR(FIRST_TIME, 'DD/MM')
) ORDER BY TO_DATE(extract(year FROM sysdate) || DAY, 'YYYY DD/MM') DESC
) WHERE ROWNUM < 8;Hope That Helps.
Ogan -
Query help for where condition
Hi ,
I have String value in table now I require to check that value is valid or not .
I have below Query .
SELECT *
FROM Table TCI
WHERE (ISDATE(SUBSTRING(SUBSTRING(Data,82,6),1,4)+'-'+SUBSTRING(SUBSTRING(Data,82,6),5,2)+'-'+'01')<>1 OR LEN(LTRIM(RTRIM(SUBSTRING(Data,82,6)))) < 0 OR SUBSTRING(Data,82,6)='000000')
AND (LEN(LTRIM(RTRIM(SUBSTRING(Data,88,6)))) < 0 OR SUBSTRING(Data,88,6)= '000000' OR ISDATE(SUBSTRING(SUBSTRING(Data,88,6),1,4)+'-'+SUBSTRING(SUBSTRING(Data,88,6),5,2)+'-'+'01')<>1)
AND (LEN(LTRIM(RTRIM(SUBSTRING(Data,173,6)))) < 0 OR ISDATE(SUBSTRING(SUBSTRING(Data,173,6),1,4)+'-'+SUBSTRING(SUBSTRING(Data,173,6),5,2)+'-'+'01')<>1)
AND (LEN(LTRIM(RTRIM(SUBSTRING(Data,195,6)))) < 0 OR ISDATE(SUBSTRING(SUBSTRING(Data,195,6),1,4)+'-'+SUBSTRING(SUBSTRING(Data,195,6),5,2)+'-'+'01') <>1)
AND (LEN(LTRIM(RTRIM(SUBSTRING(Data,217,7))))<0 OR ISNUMERIC(LTRIM(RTRIM(SUBSTRING(Data,217,7)))) <> 1)
AND ISNUMERIC(REPLACE(SUBSTRING(Data,334,10),'-','0'))<>1
AND ISNUMERIC(SUBSTRING(Data,345,10))<>1
AND ISNUMERIC( SUBSTRING(Data,355,10))<>1
AND ISNUMERIC(SUBSTRING(Data,416,8))<>1
AND (LEN(LTRIM(RTRIM(SUBSTRING(Data,104,6))))<0 OR ISNUMERIC(SUBSTRING(Data,104,6))<>1)
AND (LEN(LTRIM(RTRIM(SUBSTRING(Data,145,7))))<0 OR ISNUMERIC(SUBSTRING(Data,145,7))<>1)
AND (LEN(LTRIM(RTRIM(SUBSTRING(Data,152,7))))<0 OR ISNUMERIC(SUBSTRING(Data,152,7))<>1)
AND (LEN(LTRIM(RTRIM(SUBSTRING(Data,159,7))))<0 OR ISNUMERIC(SUBSTRING(Data,159,7))<>1)
AND (LEN(LTRIM(RTRIM(SUBSTRING(Data,166,7))))<0 OR ISNUMERIC(SUBSTRING(Data,166,7))<>1)
AND (LEN(LTRIM(RTRIM(SUBSTRING(Data,179,3))))<0 OR ISNUMERIC(SUBSTRING(Data,179,3))<>1)
AND (LEN(LTRIM(RTRIM(SUBSTRING(Data,201,3))))<0 OR ISNUMERIC(SUBSTRING(Data,201,3))<>1)
AND (ISNUMERIC(REPLACE(SUBSTRING(Data,365,10),'-','0'))<>1 OR ISNUMERIC( REPLACE(SUBSTRING(Data,365,10),'-','0'))<>1)
AND (ISNUMERIC(REPLACE(SUBSTRING(Data,375,10),'-','0'))<>1 OR ISNUMERIC( REPLACE(SUBSTRING(Data,375,10),'-','0'))<>1)
AND (ISNUMERIC(REPLACE(SUBSTRING(Data,385,10),'-','0'))<>1 OR ISNUMERIC(REPLACE(SUBSTRING(Data,385,10),'-','0'))<>1)
AND (ISNUMERIC(REPLACE(SUBSTRING(Data,395,10),'-','0'))<>1 OR ISNUMERIC(REPLACE(SUBSTRING(Data,395,10),'-','0'))<>1)
AND (ISNUMERIC(REPLACE(SUBSTRING(Data,405,10),'-','0'))<>1 OR ISNUMERIC(REPLACE(SUBSTRING(Data,405,10),'-','0'))<>1)
I need only invalid record set from below Query ;
like; If it is not isdate and is_numeric type for particular row then it return only that row.
currently i'm facing issue like whole string is invalid in that case it gives row .
should I use case statement in where clause ?
Thanks
Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.comI need only invalid record set from below Query ;
like; If it is not isdate and is_numeric type for particular row then it return only that row.
currently i'm facing issue like whole string is invalid in that case it gives row .
should I use case statement in where clause ?
Hi PrajapatiNeha,
Your requirement is confusing. Judging from the query, the column data
seems to be a string which consists of fixed length date or numberic format substrings, so you are verifying each substring is valid and need to select the invalid substrings?
If that is your requirement, why not just extract the substrings into a derived table and filter based on the derived table? The substrings in the derived table will give a more directly overview of your long data string.
If you have any question, feel free to let me know.
Eric Zhang
TechNet Community Support -
Query Help (For Election Purpose)
Hello,
Oracle Version: 10G
OS: Windows XP SP-3
create table election (areacode number(2),boothno number(3),Smith number(4),John number(4),tot number(5));
insert into election values (1,1, 5,2,7);
insert into election values (1,2,10,0,10);
insert into election values (2,9,1,2,3);
insert into election values (2,6,8,1,9);
required output:
Candidate Area1 Area2 Tot
Smith 15 9 24 << 15=5+10 i.e. Sum of Smith for areacode=1, 9=1+8 i.e. Sum of Smith for areacode=2
John 2 3 5 << 2=2+0 i.e. Sum of John for areacode=1, 3=2+1 i.e. Sum of John for areacode=2
Total 17 12 29Thanks & Regards
Girish SharmaSalim,
First off, i wish to thanks for your working query. Now if i wish to get following output then ?
Candidate Area1 Tot
Smith 15 15 << 15 Sum of Smith for areacode=1
John 9 9 << 2=2+0 i.e. Sum of John for areacode=1
Total 24 24
Candidate Area1 Tot
Smith 15 15 << 15 Sum of Smith for areacode=1
John 9 9 << 9 Sum of John for areacode=1
Candidate Area1
Smith 15
John 9
Candidate Area1 Tot
John 9 9 << 9 Sum of John for areacode=1
Total 9 9
Candidate Area1 Tot
John 9 9 << 2=2+0 i.e. Sum of John for areacode=1means, if there are difference in rows and columns by above query please; means there may be more candidates in an area and/or more/less number of areas in comparision of number of candidates.
Once again thanks for giving learning and working query....!!!
Thanks & Regards
Girish Sharma
Edited by: Girish Sharma on May 17, 2009 11:25 PM
Rechecked the output -
hi i have table with data like below
CREATE TABLE Table1
ID int
,GroupID int
insert into Table1 values(1,1)
insert into Table1 values(2,2)
insert into Table1 values(3,2)
insert into Table1 values(4,1)
insert into Table1 values(5,1)
insert into Table1 values(6,3)
insert into Table1 values(7,3)
insert into Table1 values(7,3)
insert into Table1 values(8,2)
insert into Table1 values(9,4)
insert into Table1 values(10,5)
Here i need the out put with GroupID and the count. The expected output like below
GroupID
Count
1
1
2
2
1
1
3
3
2
1
4
1
5 1
I think you got my scenario. For each groupID i need to put the count but with adjusents same GroupIDHi Akhil,
It looks like your expected is wrong, Try the below:
CREATE TABLE Table1
ID int
,GroupID int
insert into Table1 values(1,1)
insert into Table1 values(2,2)
insert into Table1 values(3,2)
insert into Table1 values(4,1)
insert into Table1 values(5,1)
insert into Table1 values(6,3)
insert into Table1 values(7,3)
insert into Table1 values(7,3)
insert into Table1 values(8,2)
insert into Table1 values(9,4)
insert into Table1 values(10,5)
;WITH FirstCte AS (
SELECT GroupID,id,
ROW_NUMBER() OVER(ORDER BY id) AS rnComplete,
ROW_NUMBER() OVER(PARTITION BY GroupID ORDER BY id) AS rnGroupID
FROM Table1)
, SecondCte AS (
SELECT id,GroupID, count(GroupID) Over(partition by GroupID, rnComplete - rnGroupID) as GroupCnt
FROM FirstCte )
SELECT m.GroupID, GroupCnt
FROM SecondCte AS m
GROUP BY m.GroupID, GroupCnt
Order by MAX(m.ID)
Drop table Table1
GroupID
Count
1
1
2
2
1
2
3
3
2
1
4
1
5 1 -
Hi Experts,
I have a table like:
Id item1 item2
1 a b
2 x b
3 b a
4 x a
i need take count exact item1,item2 combination should be (a,b) or (b,a).
Is there any way to get the combinations counts.
Regs,
Hwith xx as
(select 1 id,'a' item1,'b' item2 from dual union all
select 2 id,'x' item1,'b' item2 from dual union all
select 3 id,'b' item1,'a' item2 from dual union all
select 4 id,'x' item1,'a' item2 from dual union all
select 5 id,'x' item1,'b' item2 from dual union all
select 6 id,'a' item1,'b' item2 from dual union all
select 7 id,'b' item1,'a' item2 from dual
select count(*) from xx
where (item1 = 'a' and item2 ='b') OR (item1 = 'b' and item2 ='a'); -
Query for an ALERT to give items that haven't sold in 60 days
To the Experts.
Can someone help me with a query for an ALERT. I need items that haven't sold in the last 60 days?Try this query.
select max(t1.docdate) as [Last Inv Date], t0.itemcode, t0.dscription
from inv1 t0 inner join oinv t1 on t0.docentry = t1.docentry
where t1.doctype = 'I'
group by t0.itemcode, t0.dscription
having max(t1.docdate) <= getdate() - 60
order by t0.itemcode
The value getdate() is today, so getdate() - 60 will move the filter date back 60 days. This looks at A/R Invoices and only Items type documents.
I hope this helps.
Ross Unger - Third Wave Business Systems -
Hi All....
Required help for one more query.
I have a table with data like this:
Cust_id Transaction_no
111 1
111 2
111 3
111 4
111 5
111 6
222 7
222 8
333 9
333 10
333 11
333 12
I wrote the following query :
select cust_id, ntile(3) over (order by cust_id) "Bucket" from trans_detls
The output is like this :
Cust_id Bucket
111 1
111 1
111 1
111 1
111 2
111 2
222 2
222 2
333 3
333 3
333 3
333 3
The problem is that I dont want the cust_id to overlap in buckets. That is one cust_id should be present in only one bucket.
Is this possible?
Thanks in advance.
AmeyaOr Something like..
SQL> select * from test;
ID NO
111 1
111 2
111 3
111 4
111 5
111 6
222 7
222 8
333 9
333 10
333 11
333 12
12 rows selected.
SQL> select id, ntile(3) over (order by rn) "Bucket"
2 from(
3 select id,row_number() over(partition by id order by no) rn
4 from test);
ID Bucket
111 1
222 1
333 1
111 1
222 2
333 2
111 2
333 2
111 3
333 3
111 3
111 3
12 rows selected. -
Search help for OBJECT ID with Text Description for a query
I need to create search help for the field object text in HRP1000 - P1000-STEXT table in an infoset based on LDB PCH. Can anyone help me? I want it to appear on the adhoc query screen.
Thanks,look at search help FC_RFCDEST. that problem has already been solved with this search help.
-
Please Help for the Query
Hi frds please help me for the below query.What I want to do is to pull out the data from below table :-
date ticker indicator
03/13/2008 3IINFOTECH -8
03/18/2008 3IINFOTECH -4
03/25/2008 3IINFOTECH -5
03/27/2008 3IINFOTECH -3
as such :-
date ticker indicator
03/13/2008 3IINFOTECH -8
03/25/2008 3IINFOTECH -5
03/27/2008 3IINFOTECH -3
Here I want to find the Trend i.e either asc or desc order from the lowest indicator.
In the above sample data -8, -4, -5, -3 out of which I want the asc order data -8, -5, -3 and exclude -4 data.Because the asc order -8, -5, -3 will not follow.
So I want the data
date ticker indicator
03/13/2008 3IINFOTECH -8
03/25/2008 3IINFOTECH -5
03/27/2008 3IINFOTECH -3SQL> CREATE TABLE BORRAME(FECHA DATE, INDICA VARCHAR2(100));
Tabla creada.
SQL> INSERT INTO BORRAME VALUES(TO_DATE('03/13/2008','MM/DD/YYYY'), '3IINFOTECH -8');
1 fila creada.
SQL> INSERT INTO BORRAME VALUES(TO_DATE('03/18/2008','MM/DD/YYYY'), '3IINFOTECH -4');
1 fila creada.
SQL> INSERT INTO BORRAME VALUES(TO_DATE('03/25/2008','MM/DD/YYYY'), '3IINFOTECH -5');
1 fila creada.
SQL> INSERT INTO BORRAME VALUES(TO_DATE('03/27/2008','MM/DD/YYYY'), '3IINFOTECH -3');
1 fila creada.
SQL> COMMIT;
Validación terminada.
SQL>
SQL> SELECT FECHA, INDICA
2 FROM BORRAME
3 WHERE SUBSTR(INDICA,INSTR(INDICA,'-',1)+1,LENGTH(INDICA)) <> '4'
4 ORDER BY SUBSTR(INDICA,INSTR(INDICA,'-',1)+1,LENGTH(INDICA)) DESC;
FECHA
INDICA
13/03/08
3IINFOTECH -8
25/03/08
3IINFOTECH -5
27/03/08
3IINFOTECH -3
-
Hi,
I am trying to create an alert system in SAP Business One wherein once a users put the AR Invoice an automatic alert goes to the sales employee linked to that particular AR invoice.
The query for the alert is as under :
SELECT T0.DocNum, T0.DocDate,T0.CardCode, T0.CardName, T0.OwnerCode, T0.SlpCode,T1.lastName' 'T1.firstName as Creater
FROM OINV T0 INNER JOIN OHEM T1 ON T0.OwnerCode = T1.empID
WHERE T0.SlpCode = 1 and Datediff(yy,T0.DocDate,getdate()) = 0
Now the problem is that this alert seems to work fine but it is giving the sales Employee all the AR invoices which are made from Jan 2009 till date.
My requirement is that in the alert pop up message box it should only show the current and latest AR invoices and not from Jan 2009. Also in the alert pop up screen of sales employee how to remove the AR invoices which the sales employee has seen from the alert.
In the alert setup I have selected Alert frequency as every 1 minute and unticked Save History. My requirement is that as soon as the user enters the AR invoices at that time itself alert should go to the sales employee.
IS my query wrong please suggest or what have i done wrong.
Regards,
KamleshHi Kamlesh,
To obtain each time the last invoice for SlpCode=1, try that query :
SELECT T0.DocNum, T0.DocDate,T0.CardCode, T0.CardName, T0.OwnerCode, T0.SlpCode,T1.lastName' 'T1.firstName as Creater
FROM OINV T0 INNER JOIN OHEM T1 ON T0.OwnerCode = T1.empID
WHERE T0.DocEntry = (select MAX(DocEntry) from OINV where T0.SlpCode = 1 and Datediff(yy,T0.DocDate,getdate()) = 0)
But if you have 2 invoices on the same minute, only the last one will appears in the alert.
BR
Alan.
Maybe you are looking for
-
Re: Usage monitor not updating.
All I get is a message saying it's down for maintenance. All this is very interesting, as my allocation should have been topped up on the 1st. It wasn't topped up until the 2nd, after which it showed 3 days worth of usage, at my typical rate, accompa
-
Updating Sybase from Oracle trigger
Hi I have 2 databases: Oracle 8i and Sybase, both with a identical schema (same tables). An app will be updating the Oracle database, and I would like that automatically the Sybase database be updated accordingly, to keep them synchronized. I am thin
-
Enterprise Learning Management for External Learners
I need to roll-out enterprise learning management to 300k users who need self service access to create and access their account. Does anyone have experience doing so with Enterprise Learning Management? What did you use to enable the user to create t
-
Using an UMTS stick with airport extreme
Hallo, my internet access is actually working only via an umts stick. Can i put this stick into airport express or extreme in order to have a kind of airport wlan for two macs or do i have to connect one of theme and get access via internet sharing?
-
HT204136 Restoring from iCloud and iTunes backup used together
How would I restore my iPhone if I'm doing iCloud and iTunes backup together? The articles lists that as an option, but when it comes time to restore, can't you only pick one to restore from?