Query Manager Problem
Here's an interesting problem a client is having. I have a simple query for them that retrieves some information from the primary B1 database, along with a UDT. The query works just fine inside SQL Server Management Studio. When we implement it into the query manager, before saving it, it worked just fine. We then saved it then tried running it again. One of the columns is not visibil. When click the edit button and try running it, it still doesn't work. But when we add or delete whitespace while in edit mode the query works just fine. I haven't been able to find anything on the notes yet and the customer is on 2007A PL 10 but they are planning on upgrading to 8.8+.
Any ideas on why the query manager is behaving this way? Is it a bug thats been fixed in a later patch for 2007A or is it something else entirely?
You may add index to U_slsm column.
Update your query as:
Select T0.U_slsm as 'Slsm',
LEFT(T0.Code,9) as 'PC No',
T0.U_date,
T3.CardCode,
T1.DocNum as 'Shop',
T2.DocNum as 'Quote',
T0.U_amount,
T0.U_dm,
T0.U_comment
From [dbo].[@ORDERLOG T0]
Left Join dbo.ORDR T1 on T0.U_DocNum = T1.DocNum
Left Join dbo.OQUT T2 on T0.U_quote = T2.DocNum
Left Join dbo.OCRD T3 on T0.U_CardCode = T3.CardCode
Where T0.U_slsm = '[%0]'
Order By T0.U_date Desc, T0.U_amount
I have doubt regarding your links to those 3 system tables. Are those documents having internal links?
Similar Messages
-
Query Manager SQL DateDiff and Parameter Problem
Im having trouble with a date calculation in the Query Manager. Im wondering if anyone has run into something similar.
I am trying to write a query that returns records that are X days old, where X is a parameter input by the user.
Heres an example you can paste this into your system and duplicate the issue:
<b>SELECT T0.DocNum, T0.DocDueDate FROM ORDR T0 where datediff(dd, T0.DocDueDate, getdate()) <= [%0]</b>
Returns a date error code if you try to input an integer (e.g. the "Define Survey Variables" dialog is looking only for date values)
However
<b>SELECT T0.DocNum, T0.DocDueDate FROM ORDR T0 where datediff(dd, T0.DocDueDate, getdate()) <= 30</b>
Works just fine.
Any ideas?> I tried your query and it's working perfection for
> me. I'm using SBO B1 2005 A.
>
> The [%0] in your case is looking for the type of the
> critary and because it sees T0.DocDueDate it thinks
> you should give the query with a date and not a
> numeric. Maybe you cshould try to add a casting
> function to return a numeric ?
Merci Daniel,
I too am using SBO B1 2005 A (PL 22)
I should have expanded on my original problem. I have tried using CAST and CONVERT in the following ways:
<b>SELECT T0.DocNum, T0.DocDueDate FROM ORDR T0 where datediff(dd, T0.DocDueDate, getdate()) <= CAST([%0] as Integer)
SELECT T0.DocNum, T0.DocDueDate FROM ORDR T0 where cast(datediff(dd, T0.DocDueDate, getdate())as Integer) <= [%0]
</b>
also
<b>SELECT T0.DocNum, T0.DocDueDate, cast(datediff(dd, T0.DocDueDate, getdate())as Integer) as Date FROM ORDR T0 where Date <= [%1]</b>
Nothing seems to work (although I could be getting the syntax wrong) -
Query Manager Input Date Problem
Dear expert,
When i paste the following code in query manager,
error is encountered.
What is the problem.
Regards,
Kit
Code:
declare @type int
declare @opening DateTime
declare @closing DateTime
declate @tmp DateTime
select @type = T0.ItmsGrpCod from [dbo].[oitb] T0 where T0.ItmsGrpNam = '[%0]'
select distinct @opening = T1.DocDate from [dbo].[oinm] T1 where T1.DocDate ='[%1]'
select distinct @closing = T2.DocDate from [dbo].[oinm] T2 where T2.DocDate = '[%2]'
/* swap date */
if @opening > @clsoing
begin
set @tmp = @opening
set @opeing = @closing
set @closing = @tmp
end
select ItemCode , BatchNum,
sum(Opening) as 'Opening',
sum(InQty) as 'InQty',
sum(OutQty) as 'OutQty',
sum(Closing) as 'Closing',
UnitCost ,
sum(TotalClosingStock) as 'TotalClosingStock',
sum(TotalOut) as 'TotalOut'
from (
select * from GetMovementReport(@type,@opening,@closing)
union
select * from GetSTMovementReport(@type,@opening,@closing)
) result
group by ItemCode , BatchNum, UnitCostHi Chun,
I can see couple of spelling errors:
1. declate @tmp DateTime must be: decla<b>r</b>e @tmp DateTime
2. if @opening > @clsoing should be if @opening > @cl<b>os</b>ing
3. set @opeing = @closing should be set @ope<b>n</b>ing = @closing
Hope it helps,
Adele -
Query Manager Condition Problem
Dear expert,
In B1 query manager, i found a report called 'Production Order Report' and there is a searching condition which i don't understand.
Code:
T3.CardName= '[%9]' or '[%9]' = ''
If user dose not input this parameter, how the query manager handle the query??Hi Kit,
The query code you mentioned basically says that if the [%9] variable is blank, don't filter on it, else filter on it. You can test it with this query
declare @Code varchar(15)
set @Code= ''
--set @Code = 'C1000'
select * from ocrd where (Cardcode= @Code or @Code = '')
If you run it as is, all records in OCRD will be returned, if you run it with the commented line uncommented it will return only C1000.
Hope it helps,
Adele
<i>PS: I have seen that every post you make you set as answered/solved problem already. Please make sure which problems are solved and which not. People tend to not look at solved posts that often. Every question you asked have been marked as solved before anyone replied. Were they solved?</i> -
Not able to save / update SQL Query in Query manager
Hi,
I am using SBO 2005 B PL 25, facing unique problem in Query Manager.
There are various queries saved in Query manager, tried updating & creating / saving new query but not able to do so.
System displays messaged as operation completed successfully, but the query is not updated.
Kindly let me know is there any setting which blocks the updation.
Regards,
Yogesh Jadav
Edited by: YOGESH JADAV on Aug 11, 2008 3:07 PMHi
You cannot Modify or Update query in the 'System' Category.
If you are trying to create/ modify/ update query in some other category, check for the authorizations in
'Administration -> System Initialization -> Authorizations Window' -> Reports ->Query Generator'.
Check if you have authorizations for the following
New Queries
Create/Edit Categories
Saved Queries - Group No. 1
Saved Queries - Group No. 20 -
Descriptor query manager and custom PL/SQL call for the data update
hi all,
in the application, I'm currently working on, the operations for the data INSERT/UPDATE /DELETE are allowed only by means of PL/SQL function. Using the descriptor's query manager I'm trying to modify default behavior of TopLink and execute PL/SQL when there is a request to modify the data.
DescriptorQueryManager entityQueryManager = session.getClassDescriptor(MyEntity.class).getQueryManager();
StoredFunctionCall call = new StoredFunctionCall();
call.setUsesBinding(true);
call.setProcedureName("merge_record");
call.setResult("id", Integer.class);
call.addNamedArgument("cbic_id", "id"); // MyEntity.getId() – works!
call.addNamedArgument("publication_flag", "publicationFlag"); // MyEntity.getPublicationFlag () – works!
call.addNamedArgument("routing_id", "routing"); // MyEntity.getRouring() – works!
call.addNamedArgument("issue_id", "issue"); // MyEntity.getIssue() – works!
call.addNamedArgument("country_id", "country"); // MyEntity.getCountry() – works!
entityQueryManager.setInsertCall(call);
entityQueryManager.setUpdateCall(call);
entityQueryManager.setDeleteCall(call);
the problem:
when I call: MyEntity savedObject = (MyEntity) UnitOfWork.deepMergeClone(entity);
the binding doesn’t happen and I see following logs:
[TopLink Finest]: 2008.02.01 02:51:41.534--UnitOfWork(22937783)--Thread(Thread[AWT-EventQueue-0,6,main])--Merge clone xxx.Entity[id=2000]
[TopLink Warning]: 2008.02.01 02:51:41.550--ClientSession(8454539)--Thread(Thread[AWT-EventQueue-0,6,main])--Missing Query parameter for named argument: id null will be substituted. (There is no English translation for this message.)
[TopLink Warning]: 2008.02.01 02:51:41.550--ClientSession(8454539)--Thread(Thread[AWT-EventQueue-0,6,main])--Missing Query parameter for named argument: publicationFlag null will be substituted. (There is no English translation for this message.)
[TopLink Warning]: 2008.02.01 02:51:41.565--ClientSession(8454539)--Thread(Thread[AWT-EventQueue-0,6,main])--Missing Query parameter for named argument: routing null will be substituted. (There is no English translation for this message.)
[TopLink Warning]: 2008.02.01 02:51:41.565--ClientSession(8454539)--Thread(Thread[AWT-EventQueue-0,6,main])--Missing Query parameter for named argument: issue null will be substituted. (There is no English translation for this message.)
[TopLink Warning]: 2008.02.01 02:51:41.565--ClientSession(8454539)--Thread(Thread[AWT-EventQueue-0,6,main])--Missing Query parameter for named argument: country null will be substituted. (There is no English translation for this message.)
[TopLink Fine]: 2008.02.01 02:51:41.565--ClientSession(8454539)--Connection(6233000)--Thread(Thread[AWT-EventQueue-0,6,main])--BEGIN ? := merge_record(cbic_id=>?, publication_flag=>?, routing=>?, issue=>?, country=>?); END;
bind => [=> id, null, null, null, null, null] – WHY?
Calling straight forward the same PL/SQL block using:
DataModifyQuery updateQuery = new DataModifyQuery();
updateQuery.setCall(call);
updateQuery.shouldBindAllParameters();
and passing parameters as Vector works very well.
Could you please help me to fix the binding problem when I’m using the PL/SQL with Query Manager?
regards,Hello,
This is fairly common. Since the database is case insensitive (mostly) field names passed in don't really matter much. Unfortunately, java string comparisons are case sensitive, so if you db column for the getId() property is defined as uppercase "ID" it will not match to the lower case "id" defined in the
call.addNamedArgument("cbic_id", "id");
This will cause TopLink to get null when it looks for the "id" field in the row it builds from your MyEntity instance.
Matching the case exactly will resolve the issue.
Best Regards,
Chris -
Working with Custom SQL Using Descriptor Query Manager Queries
Hi All,
I am Working on Descriptor Query Manager Queries
Configuring Custom SQL Using Java and Workbench
Using Java I wrote a static method as in the code given below.
public static void insertEmployee(ClassDescriptor descriptor){
descriptor.getQueryManager().setInsertSQLString(
"insert into EMPLOYEE (EMP_ID, EMP_NAME, EMP_JOB, SAL, DEPTNO) values (#EMP_ID, #EMP_NAME, #EMP_JOB, #SAL, #DEPTNO)"
I wrote a insert SQL Query in the custom SQL tab of the Toplink workbench .
Using java and Using Toplink Workbench I had a problem how to call this insert query in the sessionEJBBean .
Can any one suggest me in this regard.
Thanks in advance
regards,
SatishWhat is the problem you are experiencing?
Normally you can just execute the query by calling
'executeQuery(queryName, domainclass) on the session.
See also
http://www.oracle.com/technology/products/ias/toplink/
doc/10131/main/_html/qrybas003.htm#BCFIBGGJ
Just out of curiosity: why do you need a custom SQL
to insert something? Can't you use persist()?
regards,
LonnekeOr even UnitOfWork ? Why go down the route of using custom inserts to insert objects unless you have some business logic that Toplink's UnitOfWork API cannot provide ? -
While Executing the Sp in Query manager Getting Error.
hi.
i need a small information.
I Created a small table in Sql
ccode
varchar
no
250
cname
varchar
no
250
ctype
varchar
no
250
My Stored Procedure at Sql
i am inserting values in to the temporary table by using below one after passing the parameter
i am executing the parameter is
EXEC 'cardcode' ,'cardname' ,'c'
if i execute the stored procedure in sql values are inserting same thing i want to do in sap b1 at query maanger
USE [WCTBRPLDB21-05-2014]
GO
/****** Object: StoredProcedure [dbo].[uspGetAddress1] Script Date: 8/1/2014 4:07:20 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER Procedure [dbo].[uspGetAddress1]
@Cuscode varchar(250),
@customertName VARCHAR(250) ,
@custype varchar(250)
As
Begin
DECLARE @Cur_Product CURSOR
set @Cur_Product= cursor for select CardCode,CardName,CardType from ocrd where CardCode =@Cuscode and CardName= @customertName and cardtype =@custype
open @Cur_Product
fetch next
from @Cur_Product into @Cuscode,@customertName,@custype
while @@FETCH_STATUS = 0
begin
insert into custupdate (ccode,cname,ctype) values (@Cuscode,@customertName,@custype)
fetch next
from @Cur_Product into @Cuscode,@customertName,@custype
end
close @Cur_Product
deallocate @Cur_Product
select * from custupdate
End
@Cuscode varchar(250),
@customertName VARCHAR(250) ,
@custype varchar(250),
select @Cuscode = T0.CARDCODE from OCRD T0 where T0.CARDCODE = '[%01]' AND
select @CARDNAME = T0.CARDNAME from OCRD T0 where T0.CARDNAME = '[%02]' AND
select @CARDTYPE = T0.CARDTYPE from OCRD T0 where T0.CARDTYPE = '[%03]'
uspGetAddress1 @Cuscode ,@CARDNAME ,@CARDTYPE
The above one i pasted at query manager.
if i run it it is asking the parameters
but after execute it
i am getting the error that must declare the Scalar variable like that it is showing.
but i am all ready giving the scalar variable but it is not running.
Any information plz update me
is there any declaration problem in query manager.....................Try below in query generator:
Declare @Cuscode varchar(250),
Declare @customertName VARCHAR(250) ,
Declare @custype varchar(250)
/*SELECT FROM [dbo].[OCRD] T0*/
/* WHERE */
SET @Cuscode = /* T0.CardCode */ '[%0]'
/*SELECT FROM [dbo].[OCRD] T0*/
/* WHERE */
SET @customertName = /* T0.CardName */ '[%1]'
/*SELECT FROM [dbo].[OCRD] T0*/
/* WHERE */
SET @custype = /* T0.CardType */ '[%2]'
EXEC uspGetAddress1 @Cuscode,@customertName,@custype
**Don't remove comments
Thanks
Navneet -
Hello everybody.
I'm having a problem with the Query Manager.
If i put this query on the manager:
Select * from [dbo].[OITM] where itemname = '[%0]'
the variable don't show any imput box, and an error message appear on the StatusBar. The error haven't message.
Thx,
Sergio Alejandro MasoliniThx for the help, but i still having the error.
The real query is:
select * from (SELECT
A.DOCENTRY as NroDocumento,
max(A.DOCDATE) AS FECHA,
max(CASE WHEN A.U_TGV_FLETTER = 'A' AND A.U_TGV_ACC_ORD_FLAC <> 1 THEN '1'
WHEN A.U_TGV_FLETTER = 'B' AND A.U_TGV_ACC_ORD_FLAC <> 1 THEN '6'
WHEN A.U_TGV_FLETTER = 'C' AND A.U_TGV_ACC_ORD_FLAC <> 1 THEN '11'
WHEN A.U_TGV_FLETTER = 'E' AND A.U_TGV_ACC_ORD_FLAC <> 1 THEN '19'
WHEN A.U_TGV_FLETTER = 'M' AND A.U_TGV_ACC_ORD_FLAC <> 1 THEN '51'
WHEN A.U_TGV_FLETTER = 'A' AND A.U_TGV_ACC_ORD_FLAC = 1 THEN '60'
WHEN A.U_TGV_FLETTER = 'B' AND A.U_TGV_ACC_ORD_FLAC = 1 THEN '61'
WHEN A.U_TGV_FLETTER = 'C' AND A.U_TGV_ACC_ORD_FLAC = 1 THEN '62' ELSE 'NA'
END) AS TIPOCOMP,
max(isnull(Convert(varchar,isnull(A.U_TGV_FOLIO_PREFIX,'0')) + '-' + Convert(varchar,A.folionum),'')) AS NUMCOMP,
max(isnull(A.CARDNAME, '')) AS RAZONSOCIAL,
max(Replace(LICTRADNUM,'-','')) AS CUIT,
round(sum(case when a.U_TGV_TVAT_POS_BP = 'EX' then 0 else case when b.vatprcnt = 0 then b.linetotal else 0 end end), 4) as NOGRAVEXCENTO,
round(sum(case when b.vatprcnt <> 0 then b.linetotal else 0 end),4) as IMPGRAVADO,
max(b.vatprcnt) as ALICUOTA,
round(sum(b.vatsum),4) as IVA,
round(sum(case when a.U_TGV_TVAT_POS_BP = 'EX' then b.linetotal else 0 end),4) as OPEXENTA,
max(round(ISNULL(AA.TOTAL, 0),4)) AS PERCIVA,
max(round(ISNULL(BB.TOTAL, 0),4)) AS PERCIIBB,
'1' AS CONSULTA
FROM [dbo].[OPCH] A
INNER JOIN [dbo].[PCH1] B ON A.DOCENTRY = B.DOCENTRY
LEFT JOIN (SELECT A.DOCENTRY, SUM(A.LINETOTAL) AS TOTAL FROM [dbo].[PCH1] A
INNER JOIN [dbo].[OITM] B ON A.ITEMCODE = B.ITEMCODE
INNER JOIN [dbo].[OWHT] C ON B.ITEMCODE = C.U_TGV_CODE_ITEM
WHERE U_TGV_PERCEP_FLAG = 1 AND U_TGV_PERC_TYPE = 1
group by A.DOCENTRY) AA ON AA.DOCENTRY = A.DOCENTRY
LEFT JOIN (SELECT A.DOCENTRY, SUM(A.LINETOTAL) AS TOTAL FROM [dbo].[PCH1] A
INNER JOIN [dbo].[OITM] B ON A.ITEMCODE = B.ITEMCODE
INNER JOIN [dbo].[OWHT] C ON B.ITEMCODE = C.U_TGV_CODE_ITEM
WHERE U_TGV_PERCEP_FLAG = 1 AND U_TGV_PERC_TYPE = 2
group by A.DOCENTRY) BB ON BB.DOCENTRY = A.DOCENTRY
INNER JOIN [dbo].[OITM] I on b.ItemCode = I.ItemCode
Where I.U_TGV_PERCEP_FLAG = 0
group by a.DOCENTRY, b.taxcode
UNION ALL
SELECT
A.DOCENTRY as NroDocumento,
max(A.DOCDATE) AS FECHA,
max(CASE WHEN A.U_TGV_FLETTER = 'A' THEN '3'
WHEN A.U_TGV_FLETTER = 'B' THEN '8'
WHEN A.U_TGV_FLETTER = 'C' THEN '13'
WHEN A.U_TGV_FLETTER = 'M' THEN '53'
ELSE 'NA'
END) AS TIPOCOMP,
max(isnull(Convert(varchar,isnull(A.U_TGV_FOLIO_PREFIX,'0')) + '-' + Convert(varchar,A.folionum),'')) AS NUMCOMP,
max(isnull(A.CARDNAME, '')) AS RAZONSOCIAL,
max(Replace(LICTRADNUM,'-','')) AS CUIT,
round(sum(case when b.vatprcnt = 0 then b.linetotal else 0 end), 4) as NOGRAVEXCENTO,
round(sum(case when b.vatprcnt <> 0 then b.linetotal else 0 end),4) as IMPGRAVADO,
max(b.vatprcnt) as ALICUOTA,
round(sum(b.vatsum),4) as IVA,
round(sum(case when a.U_TGV_TVAT_POS_BP = 'EX' then b.linetotal else 0 end),4) as OPEXENTA,
max(round(ISNULL(AA.TOTAL, 0),4)) AS PERCIVA,
max(round(ISNULL(BB.TOTAL, 0),4)) AS PERCIIBB,
'1' AS CONSULTA
FROM [dbo].[ORPC] A
INNER JOIN [dbo].[RPC1] B ON A.DOCENTRY = B.DOCENTRY
LEFT JOIN (SELECT A.DOCENTRY, SUM(A.LINETOTAL) AS TOTAL FROM [dbo].[PCH1] A
INNER JOIN [dbo].[OITM] B ON A.ITEMCODE = B.ITEMCODE
INNER JOIN [dbo].[OWHT] C ON B.ITEMCODE = C.U_TGV_CODE_ITEM
WHERE U_TGV_PERCEP_FLAG = 1 AND U_TGV_PERC_TYPE = 1
group by A.DOCENTRY) AA ON AA.DOCENTRY = A.DOCENTRY
LEFT JOIN (SELECT A.DOCENTRY, SUM(A.LINETOTAL) AS TOTAL FROM [dbo].[PCH1] A
INNER JOIN [dbo].[OITM] B ON A.ITEMCODE = B.ITEMCODE
INNER JOIN [dbo].[OWHT] C ON B.ITEMCODE = C.U_TGV_CODE_ITEM
WHERE U_TGV_PERCEP_FLAG = 1 AND U_TGV_PERC_TYPE = 2
group by A.DOCENTRY) BB ON BB.DOCENTRY = A.DOCENTRY
INNER JOIN [dbo].[OITM] I on b.ItemCode = I.ItemCode
Where I.U_TGV_PERCEP_FLAG = 0
group by a.DOCENTRY, b.taxcode
UNION ALL
SELECT max(TOT.C1) as NroDocumento,max(TOT.C2) as Fecha, max(TOT.C3), max(TOT.C4), max(TOT.C5),max(TOT.C6),sum(TOT.NOGRAVEXCENTO),sum(TOT.IMPGRAVADO),max(TOT.ALICUOTA),sum(TOT.IVA),sum(TOT.OPEXENTA),max(TOT.PERCIVA),max(TOT.PERCIIBB),max(TOT.CONSULTA) FROM
SELECT
'' AS C1,
'' AS C2,
'' AS C3,
'' AS C4,
'' AS C5,
'' AS C6,
round(sum(case when b.vatprcnt = 0 then b.linetotal else 0 end), 4) as NOGRAVEXCENTO,
round(sum(case when b.vatprcnt <> 0 then b.linetotal else 0 end),4) as IMPGRAVADO,
max(b.vatprcnt) as ALICUOTA,
round(sum(b.vatsum),4) as IVA,
round(sum(case when a.U_TGV_TVAT_POS_BP = 'EX' then b.linetotal else 0 end),4) as OPEXENTA,
max(round(ISNULL(AA.TOTAL, 0),4)) AS PERCIVA,
max(round(ISNULL(BB.TOTAL, 0),4)) AS PERCIIBB,
'2' AS CONSULTA
FROM [dbo].[OPCH] A
INNER JOIN [dbo].[PCH1] B ON A.DOCENTRY = B.DOCENTRY
LEFT JOIN (SELECT A.DOCENTRY, SUM(A.LINETOTAL) AS TOTAL FROM [dbo].[PCH1] A
INNER JOIN [dbo].[OITM] B ON A.ITEMCODE = B.ITEMCODE
INNER JOIN [dbo].[OWHT] C ON B.ITEMCODE = C.U_TGV_CODE_ITEM
WHERE U_TGV_PERCEP_FLAG = 1 AND U_TGV_PERC_TYPE = 1
group by A.DOCENTRY) AA ON AA.DOCENTRY = A.DOCENTRY
LEFT JOIN (SELECT A.DOCENTRY, SUM(A.LINETOTAL) AS TOTAL FROM [dbo].[PCH1] A
INNER JOIN [dbo].[OITM] B ON A.ITEMCODE = B.ITEMCODE
INNER JOIN [dbo].[OWHT] C ON B.ITEMCODE = C.U_TGV_CODE_ITEM
WHERE U_TGV_PERCEP_FLAG = 1 AND U_TGV_PERC_TYPE = 2
group by A.DOCENTRY) BB ON BB.DOCENTRY = A.DOCENTRY
INNER JOIN [dbo].[OITM] I on b.ItemCode = I.ItemCode
Where I.U_TGV_PERCEP_FLAG = 0
group by b.taxcode
UNION ALL
SELECT
'' AS C1,
'' AS C2,
'' AS C3,
'' AS C4,
'' AS C5,
'' AS C6,
round(sum(case when b.vatprcnt = 0 then b.linetotal else 0 end), 4) as NOGRAVEXCENTO,
round(sum(case when b.vatprcnt <> 0 then b.linetotal else 0 end),4) as IMPGRAVADO,
max(b.vatprcnt) as ALICUOTA,
round(sum(b.vatsum),4) as IVA,
round(sum(case when a.U_TGV_TVAT_POS_BP = 'EX' then b.linetotal else 0 end),4) as OPEXENTA,
max(round(ISNULL(AA.TOTAL, 0),4)) AS PERCIVA,
max(round(ISNULL(BB.TOTAL, 0),4)) AS PERCIIBB,
'2' AS CONSULTA
FROM [dbo].[ORPC] A
INNER JOIN RPC1 AS B ON A.DOCENTRY = B.DOCENTRY
LEFT JOIN (SELECT A.DOCENTRY, SUM(A.LINETOTAL) AS TOTAL FROM [dbo].[PCH1] A
INNER JOIN [dbo].[OITM] B ON A.ITEMCODE = B.ITEMCODE
INNER JOIN [dbo].[OWHT] C ON B.ITEMCODE = C.U_TGV_CODE_ITEM
WHERE U_TGV_PERCEP_FLAG = 1 AND U_TGV_PERC_TYPE = 1
group by A.DOCENTRY) AA ON AA.DOCENTRY = A.DOCENTRY
LEFT JOIN (SELECT A.DOCENTRY, SUM(A.LINETOTAL) AS TOTAL FROM [dbo].[PCH1] A
INNER JOIN [dbo].[OITM] B ON A.ITEMCODE = B.ITEMCODE
INNER JOIN [dbo].[OWHT] C ON B.ITEMCODE = C.U_TGV_CODE_ITEM
WHERE U_TGV_PERCEP_FLAG = 1 AND U_TGV_PERC_TYPE = 2
group by A.DOCENTRY) BB ON BB.DOCENTRY = A.DOCENTRY
INNER JOIN [dbo].[OITM] I on b.ItemCode = I.ItemCode
Where I.U_TGV_PERCEP_FLAG = 0
group by b.taxcode
) TOT
group by TOT.ALICUOTA) TOTGEN
where TOTGEN.FECHA between '[%0]' and '[%0]'
order by TOTGEN.consulta, TOTGEN.fecha, TOTGEN.nrodocumento
someone can see the error?
Edited by: Sergio Alejandro Masolini on Oct 22, 2008 8:31 PM -
Just upgrade the customer to the newest upgrade per SAP support request 2007SP01PL09...
The first problem they discovered is that when they want to modify some existing query, they change it and try to save to a exist query. System crashes without warning or message. And keep the user log into the system. So after two time, user can no longer log on system.
1. How to get those user log on off the system, so they can log back in again? Without bounce the license server.
2. Has anyone see something like this before?
Sincerely Yours
Bo PengHello Bo Peng,
I Have the same issue on same patch level.
Workaround i have discovered: Before Updating an existing Query, Open Query Manager, and remove the old version of saved Query,
Regards,
J -
Results table difference when running query from Alert compared to Query Manager
Hello,
I have following query - Aim is to create alert to tell employee which customers to make visit to in next 4 weeks
SELECT DISTINCT T1.CardName, T1.U_VisitDue, T1.U_VisitReason, T1.U_Priority, T1.U_Region as 'Area', T1.U_VNotes
FROM dbo.OCRD T1
WHERE DateDiff(d,T1.U_VisitDue, GETDATE()) <29
Group BY T1.CardName, T1.U_VNotes, T1.U_VisitDue, T1.U_VisitReason, T1.U_Priority, T1.U_Region
FOR BROWSE
My problem is that when I run query through alert the field U_VNotes is displayed differently.
Running the query from Query Manager the contents of this field appear in one field of the result table.
Running the query via Alery the content of this field is split into several fields in results table according to 'new line' in field entry.
This makes the results table from the Query less 'user-friendly' because if you want to sort the table by 'Date' column for example it makes a mess of the table because of the extra rows.
I want results table to look like top version in picture below ... but i want to run from alert.
Is this possible?
How can I achieve it?
Thanks for any assistance
Regards, KarenHi
check this support note:1774628 The SQL SELECT DISTINCT Statement does not work in ALERTS
Kind regards
Agustín Marcos Cividanes -
How to add drop down list for query manager report in sap business one
Hi Every one,
I need drop down list for parameter selection in sap business one Query Manager.I have two Parameters 'Sales Order','Invoice'.
Please suggest.
Thanks and Regards
DEVHi,
you need to use this :
/*select from [dbo].[OINV] T2*/
DECLARE @Invoice varchar(100)
/*where*/
set @Invoice =/* T2.DocNum */N'[%2]'
you can change the tables and the parameter number but you have to write it exactly that way.
when you run the query within the SBO you will get list of objects ( in this case list of invoices)
hope it was helpful
Shachar -
Unable to create new query using query manager
Hi friends,
I have been trying to create a query using query manager for couple of hours but still not able to.I am following the instructions given in oracle Peopletools 8.52 : Peoplesoft query
Chapter - creating new queries.
Below are the steps I am going through to create new query:
Step - I open the component Reporting Tools-> Query->Query Manager , I don't get the tabbed pages one for search an existing query and another for create new query.
Please follow this link to see how the page is displayed in first step:
http://uploadpic.org/v.php?img=EvMvVAXX1E
Step 2 - When I click on create new query link, I am redirected to a page where it asks for record name to add in the query. But, even this page is not displayed as how it supposed to be
http://uploadpic.org/v.php?img=GzHh3f6krU
Step 3 - Following the above step, when I click on Person record to add into my query I am asked to select the fields that I want to display in the output.
But I somehow do not get the proper tabbed pages where individual pages are there to add the attributes to complete the query like adding multiple records, fields, query, expressions, prompt...etc
http://uploadpic.org/v.php?img=Wbbla3Q3jE
I am neither able to select multiple records in my query nor able to customize my query to get the desired results.
Below is the query that I want to create using query manager:
SELECT P.EMPLID,P.BIRTHDATE, N.NAME, A.ADDRESS1, A.ADDRESS2, A.CITY
FROM PS_PERSON P, PS_NAMES N, PS_ADDRESSES A
WHERE P.EMPLID = N.EMPLID AND
N.EMPLID = A.EMPLID AND
P.BIRTHDATE BETWEEN to_date('1990/1/1','yyyy/mm/dd') and to_date('1991/1/1','yyyy/mm/dd');Hi,
As I cannot access your screenshot by the blocking of company firewall rules.
I'm guessing currently you are using PT 8.52.00 version, correct?
This should be a bug, that you need to apply the 8.52.0X patch, not sure which patch fix this, you can apply the latest one to solve this issue for no tab page of query manager. (PT 8.52.06)
Hope this helps.
Thanks,
Saxon SI -
hi ,
we are generate query in 2005b,and procced for execuite query.following problem occure'<b>odbc sql server driver'[sql server] syntax error the converting the nvarchar value' 70302/20307' to column of data type int received alert OAIB</b>
QUERY SHOWN BE AS FOLLOW.
SELECT T5.DocNum as'Po. No. ', T5.DocDate as 'Po Date',T0.CreateDate,T5.NumAtCard as 'Man.PO. No/ Dt.', T0.DocNum as'AP No. ', T0.DocDate as 'AP Date',T0.NumAtCard as 'Vendor Ref. No.', T0.U_vbdt as 'Vendor Ref. Date', T0.CardName as 'Vendor', T1.Dscription as 'Item', T1.Quantity AS 'QTY' , T1.Price as 'Basic Rate', (T1.Price *T1.Quantity) as 'Value',T0.Comments as 'Po No. & Po.Dt.' FROM OPCH T0 INNER JOIN PCH1 T1 ON T0.DocEntry = T1.DocEntry INNER JOIN OCRD T2 ON T0.CardCode = T2.CardCode INNER JOIN OPDN T3 ON T2.CardCode = T3.CardCode INNER JOIN PDN1 T4 ON T3.DocEntry = T4.DocEntry INNER JOIN OPOR T5 ON T2.CardCode = T5.CardCode INNER JOIN POR1 T6 ON T5.DocEntry = T6.DocEntry INNER JOIN OITM T7 ON T1.ItemCode = T7.ItemCode INNER JOIN OITB T8 ON T7.ItmsGrpCod = T8.ItmsGrpCod WHERE ( T1.BaseRef = T3.DocNum ) AND ( T4.BaseRef = T5.DocNum ) AND ( T0.U_vbdt >=[%25]AND T0.U_vbdt <=[%26]) AND ( T4.Dscription =T1.Dscription ) AND ( T4.Dscription = T6.Dscription ) AND (( T1.Dscription=[%0] OR T1.Dscription=[%1] OR T1.Dscription=[%2] OR T1.Dscription=[%3] OR T1.Dscription=[%4] OR T1.Dscription=[%5] OR T1.Dscription=[%6] OR T1.Dscription=[%7] OR T1.Dscription=[%8] ) OR ( T0.CardName=[%10] OR T0.CardName=[%09] OR T0.CardName=[%27] OR T0.CardName=[%28] ) OR (( T8.ItmsGrpNam =[%11] oR T8.ItmsGrpNam =[%12] OR T8.ItmsGrpNam =[%13] OR T8.ItmsGrpNam =[%14] OR T8.ItmsGrpNam =[%15] OR T8.ItmsGrpNam =[%16] OR T8.ItmsGrpNam =[%17] OR T8.ItmsGrpNam =[%18] OR T8.ItmsGrpNam =[%19] ) and ( T7.U_FirmName =[%20] OR T7.U_FirmName =[%21] OR T7.U_FirmName =[%22]
oR T7.U_FirmName =[%23] OR T7.U_FirmName =[%24] )) )Hi Vishal,
the value '70302/20307' is not an whole number so converting it to an int is not possible.
You should check your data for this value an change your query or data.
Regards
Ad -
Pass parameter to sql statement in query manager
Hai to all,
I want to pass the percentage as the parameter into the sql statemnet.i what to execute it in the query manager.
If i execute that statement then cann't found the tablename error is coming.
Other than the data in the table (general data) pass to the parameter in the sql at runtime.
for example:
select [%0] *100
how to pass 10 to that sql statement.
Please help me...
Regards,
Raji.Hi Ramya,
You can create a SP with parameters to accept and then execut this SP from SAP Business One Query Manager by passing the parameter (in your case 10). The result will be as desired.
Ex:
Create this Procedure in SQL Management Studio
create proc Test(@a as int)
as
begin
select (@a*100)
end
To Execute the Query use this Query and pass the desired values with parameters
execute Test 10
Regards,
Reno
Maybe you are looking for
-
I tried resetting my networks and turning my phone on and off with the wifi turned on, but neither of it worked. I don't know what to do and I really need wifi on my phone for tomorrow.
-
No Contact Names or Pics Showing for Incoming Calls?
I just got my phone yesterday. I have clean sync with my MacBook Pro. I thought that contact names should show for all incoming calls if that person and number are in my contacts. I also thought a photo would show if there was a photo in the contact
-
Black image where JPG should be
Hi all, I'm new to video editing, but have been working on a simple video consisting of AVIs and JPGs, and have run into a problem I can't figure out. At various points in the movie, I have multiple images flash by consecutively (6 or so per second).
-
Custom sort pivot table columns with Essbase as the data source
Is it possible to sort columns in a pivot table according to an arbitrary value that I define when the data is coming from Essbase? For example, say I have a dimension called Soda, with values Coke, Diet Coke, Dr. Pepper and Diet Dr. Pepper. I create
-
Why can't i find the airplay button on my new ipad? I've hit the home key twice and scrolled left but it's not there any clues please?