UDF in Query PLD
Hi All,
I have designed query pld for a screen in which i have few user defined fields also.
When i excute a query pld with values in user defined field it is not giving any out put. Same query with out user defined field values is working problem.
Can some one help on this.
Please post your query here so that we get an idea of what you are referring to?
One think to understand about QPLD's..is
If you have a Query in which you select 4 fields and then create a PLD for the same..after this if you add fields to the query they will not reflect in your PLD.
This is because the query is stored in a table and PLD is linked to it. Therefore in such cases you will need to delete the original QPLD and create a new one
Similar Messages
-
Hi All
Iam designing a PLD for Query Report
*In the PLD iam designing the Report for Open Purchase Order Status Report Query run fine but the problem came under designing the Document.My Query as above.
My Client have requirement not repeat the PO No, PO Date,Due Date and Vendor Name that's row level record not repeated.(Under that row level record repeat (For Eg : Item Code,Item Description,Order Qty,PO Amount etc) But it is possible from me in Query PLD.
SELECT
T1.DocNum,T1.CardName as "Vendor Name",t0.[Itemcode],t0.[dscription],T0.[Project] as "Project Name",
T1.[DocDate] as "PO Date",
T0.[ShipDate] as "Due Date",
Sum(T0.[Quantity]) as "Order Qty",
Sum(T0.[LineTotal]) as "PO Amount",
Sum(T0.[OpenQty]) as "Pending Qty",
Sum(((T0.[OpenQty]) * (T0.[Price]))) as "Pending Amount"
FROM
[dbo].[POR1] T0 INNER JOIN [dbo].[OPOR] T1 ON T0.DocEntry = T1.DocEntry left join OPDN T2 ON T2.DocEntry = T0.TrgetEntry
WHERE
T1.[DocDate] >=[%0] and T1.[DocDate] <= [%1] and t1.[Docstatus] = 'O' and t0.[linestatus] = 'O'
Group By
t0.[Itemcode],t0.[dscription],T1.[CardName], T1.[DocNum], T1.[DocDate], T0.[ShipDate],
T0.[Project], T2.[DocDate]
order by
T1.DocDate
Regards
AmolHi Amol,
Note: All SELECT statement fields will be Stored and Display in Repetetive Area1. and
Parameter Fields are in Repetetive Area0 so you can Try to Copy & Paste the Field_ID's to Repetetive Area Header (or) Repetetive Area Footer.
for example.
Try this,
->> Open the QPLD and Goto Field index Window, then
->> Select the Repetetive Area Header & Repetetive Area Footer increase the Height on Properties Window.
->> Create the Formula fields in Repetetive Area Header & Repetetive Area Footer.
->> Which Field you want to print in header or footer. Drag the Field ID(in Repetetive Area) Copy & Paste to Formula Field.
->> Select the Repetetive Area 1 on Field Index Window.
->> Goto the Print Layout Designer on Tool bar.
->> Click Repetetive Area. -> Sort...
->> Open the Sort Widnow and Select the Requrie fields by sort.
ELSE Try this,
->> Click the Repetetive Area Footer 1.
->> then, Right Click in Repetetive Area Footer 1.
->> Choose the GROUP -> 1. then,
->> Create the Formula Fields in Repetetive Area Footer 1 and copy paste field ID's from Repetetive Area 1.
->> Select the Repetetive Area 1 on Field Index Window.
->> Goto the Print Layout Designer on Tool bar.
->> Click Repetetive Area. -> Sort...
->> Open the Sort Widnow and Select the Requrie fields by sort.
Ex.
->> Select Field Name, Sort by, Order, Summary, New Page.
->Select Field Name (Sort by) -> DocNo or CardCode,
Sort Type - Alpha.
Order -> Descending (or) Ascending.
Summary -> Select the Tick Mark.
New Page -> UnCheck the Tick Mark because if you need the second page Print of GROUP BY.
You can select the Tick Mark in New Page.
SAVE IT and see the Print Preview. it will be get exact Print. .
Check the below thread, You will be get some idea or solution.
Re: Two Repetitive areas in one PLD
Regards,
Madhan. -
Distinct count of GRN's in Query PLD
hi all,
We have developed a daily grn report and designed report
using Query PLD.
Report contains
(grn no,date,vendor name,vendor ref no,item code,item
description,quanity & line total)
We want to display no of grn's(distinct count)
@ repetitive area footer.
Is there any function available in formula field to display
distinct count of no. of grn's ? / It should done thru query.
Thanks,
with regards,
A.Jeyakanthanit will be hard from PLD, instead u can have ur query like,
SELECT 'Details', ' ',T0.Docnum, T0.CardName, .... FROM OPDN T0 WHERE Month( T0.DocDate ) = Month ('{%0]')
Union
SELECT 'Counts', count(T0.DocNum) as 'Doc(s) No', ' ', ' ', ... FROM OPDN T0 WHERE Month( T0.DocDate ) = Month ('{%0]')
(Replace { with [ )
Note ' ' is a gap in order to fill the other fields. in first query have given tht ' ' gap purposely so tht the display will not affect ur designing part
union is used b'coz Count() fn is like aggregate, so wont allow further individual fields coming along with it.
the 2nd query will occupy only one row, which by grouping u can separate and can hide from repetitive and take the value via formula field by writing that field's id to it into Footer Area.
Regards,
Dhana.
Edited by: Dhanalakshmi C on Mar 5, 2008 1:31 PM -
Getting default value in query PLD
Hi Experts,
I have made a query PLD.When I preview the pld,I shows me someother value.
For eg
If I want to see preview of vendor let say V0007 but in preview I can see only for V002.V002 is default in pld.If I use any vendor code instead of v0007,it give preview of v0002 only.
So pls help me out in this regard.
Thanks,
Saurabh JainHi
From what I understand, my suggestion would be to create a Customer Exit variable to read from the table RSECVAL for i_step = 1. U can get the user from system variable -.sy-uname.
Could u also check the below document on Dynamic Authorization?
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f0f9f33c-0f17-2d10-d3a2-ae52ccd00780
Regards,
Aparna -
Hi All
We have problem while generating the query pld in SAP B1 2005 PL 34. We have given query for Goods Receipt PO with batch/serial no details. The details of batch no and serial no is working properly. When we execute the query if query pld comes to second page it is not displaying the details of GRN PO no, date, etc...
Our customer require GRN PO details in the suceessive pages. How to achieve this?
Thanks in Advancehi Consultant,
Where did you put the GRN PO No, Date and Details?
Did you Use of Group by method in Repetetive Area (or) Repetetive Area Footer?
Do you want GRN PO No., Date and Other GRN Details in Header Level?
Try this,
1. Select GRN No. in Row Level and Copy (GRN No.) Field ID on Properties Area Window.
2. Create 1 Formula Field in Page Header and Put GRN No. Field ID.
Regards,
Madhan.
Edited by: Madhan Babu C on Aug 3, 2009 1:36 PM -
hello experts,
I dont know how to create normal pld and query pld . Anyone tell me step by step procedure of normal pld and query pldHi Perinba
for query pld you need to create your query and save it and select query manager -->select your query then click on the create report button on the bottom right. A create user report window will appear, click on the base template (User Report (System)) then click ok.
To modify the report double click the report name that you just created and that will give you your designer view.
For Normal pld select the document you want like marketing documents , e.g. PO then select pen icon next to the form settings icon , select the report and click edit report button.
you can also check this link
https://websmp209.sap-ag.de/smb/sbo/pld
Bongani Dlamini -
Hello Experts,
I have done a query pld in which item code , description, is repeating. How to restrict this?
My Current out put is
Itemcode Item Desc Qty Rate Batch No. Batch Qty
001 ABC 10 15000 01 05
001 ABC 10 15000 02 03
001 ABC 10 15000 03 02
My desired out put should be
Itemcode Item Desc Qty Rate Batch No. Batch Qty
001 ABC 10 15000 01 05
02 03
03 02Hi Consultant
For this no need to Create Crystal Report, It can be possible through Group by and Sort by in PLD.
For Using Sort By
Click on the repetative area in field index
Go to Printlayout designer on menu bar - repetative area - sort
It will open another window sort
1.In the field name give item no. and second Item Name
2.sort type alpha numeric
3.Check summary and uncheck new page
All the items with item code 001 will come in series.
Now we have to use group by
For Using Group By
Place Two formula fields in repetative area Above
001 ABC 10 15000 01 05
Put SortValue() for first
and also Sort Value for Second also.
Select two fields then go to Print Layout designer group. Select group 1 over there
Then the out put will be as
001 ABC
001 ABC 10 15000 01 05
001 ABC 10 15000 02 03
001 ABC 10 15000 03 02
Hide the field ItemCode and Name.
We can have
001 ABC
10 15000 01 05
10 15000 02 03
10 15000 03 02
Thanks & Regards
Siva Reddy -
Hi all,
I have prepare a query and generated a PLD for it.
Now I required some changes in Query (say I have selected 2 more fields) and when I executed the PLD, it shows old query only.
Is there any way to update the PLD according to new query ?
Thanks in advance,
Samir GandhiThe query code is stored together with the PLD. There is no way to change it.
But you can copy the design of your old PLD to a new one. So you should:
1. Create report for the modified query
2. From its PLD delete every field definition (after select all . . .)
3. Open the old PLD, copy all field definition from it (after display hidden fields and salact all)
4. Past the field definition to the new PLD.
5. Make the necessary modifications. -
Hi,All
How display header fields in QPLD
By
Firos.CHi Firos,
Try to Create this SAMPLE Query Report PLD.
Copy and Paste the below Query Report in Query Generator
and Save as the Query Manager than Create the QPLD.
for example: Outgoing Payments Detail.
SELECT T0.DocNum, T0.DocDate, T0.CardName, T0.Address,
T1.AcctCode, T1.AcctName,
T1.Descrip, T0.CashAcct, T0.CheckAcct, T0.Comments,T1.SumApplied, T0.DocTotal,
FROM OVPM T0
LEFT JOIN VPM4 T1 ON T0.DocEntry = T1.DocNum
INNER JOIN OPID T2 ON T0.PIndicator = T2.Indicator
WHERE
T0.[DocNum]>='[%0]'
AND
T0.[DocNum]<='[%1]'
AND
T2.[Indicator]='[%2]'
ORDER BY
T0.[DocNum]
Note: All SELECT statement fields will be Stored and Display in Repetetive Area1. and
Parameter Fields are in Repetetive Area0 so you can Try to Copy & Paste the Field_ID's to Repetetive Area Header (or) Repetetive Area Footer.
for example.
Try this,
->> Open the QPLD and Goto Field index Window, then
->> Select the Repetetive Area Header1 increase the Height on Properties Window.
->> Create the Formula fields in Repetetive Area Header1.
->> Which Field you want to print in header. Drag the Field ID(in Repetetive Area) Copy & Paste to Formula Field.
ex.
->> Create 3 Database Fields in Repetetive Area Header1 and Copy/Paste Require Field ID.
1 database field -> DocNum Field ID(Copy/Paste).
2 database field -> CardName Field ID(Copy/Paste).
3 database field -> Address Field ID(Copy/Paste).
-> Hide the 3 Fields in Repetetive Area1.
->> Select the Repetetive Area 1 on Field Index Window.
->> Goto the Print Layout Designer on Tool bar.
->> Click Repetetive Area. -> Sort...
->> Open the Sort Widnow and Select the Requrie fields by sort.
Ex.
->> Select Field Name, Sort by, Order, Summary, New Page.
1st you can Select Field Name (Sort by) -> DocNum
Sort Type - Alpha.
Order -> Descending (or) Ascending.
Summary -> Select the Tick Mark.
New Page -> UnCheck the Tick Mark because if you need the second page Print of GROUP BY.
You can select the Tick Mark in New Page.
SAVE IT and see the Print Preview. it will be get exact Print. .
Regards,
Madhan.
Edited by: Madhan Babu C on Dec 2, 2009 1:26 PM -
Hi all,
I have made query on PLD below :
SELECT T0.DocNum, LTRIM(LEFT(T0.JrnlMemo,17)) AS Tipe, (T0.CardCode' - 'T0.CardName) AS Nama, T0.CashSum, T0.CheckSum, T0.TrsfrSum,(SELECT CreditSum FROM RCT3
WHERE RCT3.DocNum=T0.DocNum AND RCT3.CreditCard=4) AS Debit,(SELECT CreditSum FROM RCT3
WHERE RCT3.DocNum=T0.DocNum AND NOT(RCT3.CreditCard=4)) AS Kredit,(SELECT SUM(CashSum) FROM ORCT T1 WHERE T1.Canceled='Y' AND T1.DocNum=T0.DocNum) As R_Cash,(SELECT SUM(TrsfrSum) FROM ORCT T1 WHERE T1.Canceled='Y' AND T1.DocNum=T0.DocNum) As R_Trans,(SELECT SUM(CreditSum) FROM RCT3 WHERE RCT3.DocNum=T0.DocNum AND (T0.Canceled='Y') AND RCT3.CreditCard=4) AS R_Debit,(SELECT SUM(CreditSum) FROM RCT3
WHERE RCT3.DocNum=T0.DocNum AND (T0.Canceled='Y') AND NOT(RCT3.CreditCard=4)) AS R_Kredit,(SELECT RCT2.DocEntry FROM RCT2
WHERE RCT2.DocNum=T0.DocNum) AS No_Invoice
FROM ORCT T0
WHERE (T0.DocDate >= [%0]) AND (T0.DocDate <= [%1]) AND T0.CashAcct = [%2]
ORDER BY T0.DocNum
We tried that query in Tools --> Query print Layout and the screen msg error after that query run. The message is "Internal Error (8153) occured (message 131-183)".
Why is the message error appeared? How to solve this error? Because the query if we run on SQL enterprise manager did not problem. It can be run normally.
Please help me about this matter.
Thanks a lot,
AgungHi,
Add dbo. infront of the table name in from clause.
As shown below.
SELECT T0.DocNum, LTRIM(LEFT(T0.JrnlMemo,17)) AS Tipe, (T0.CardCode' - 'T0.CardName) AS Nama, T0.CashSum, T0.CheckSum, T0.TrsfrSum,(SELECT CreditSum FROM dbo.RCT3
WHERE RCT3.DocNum=T0.DocNum AND RCT3.CreditCard=4) AS Debit,(SELECT CreditSum FROM dbo.RCT3
WHERE RCT3.DocNum=T0.DocNum AND NOT(RCT3.CreditCard=4)) AS Kredit,(SELECT SUM(CashSum) FROM dbo.ORCT T1 WHERE T1.Canceled='Y' AND T1.DocNum=T0.DocNum) As R_Cash,(SELECT SUM(TrsfrSum) FROM dbo.ORCT T1 WHERE T1.Canceled='Y' AND T1.DocNum=T0.DocNum) As R_Trans,(SELECT SUM(CreditSum) FROM dbo.RCT3 WHERE RCT3.DocNum=T0.DocNum AND (T0.Canceled='Y') AND RCT3.CreditCard=4) AS R_Debit,(SELECT SUM(CreditSum) FROM dbo.RCT3
WHERE RCT3.DocNum=T0.DocNum AND (T0.Canceled='Y') AND NOT(RCT3.CreditCard=4)) AS R_Kredit,(SELECT RCT2.DocEntry FROM dbo.RCT2
WHERE RCT2.DocNum=T0.DocNum) AS No_Invoice
FROM dbo.ORCT T0
WHERE (T0.DocDate >= %0) AND (T0.DocDate <= %1) AND T0.CashAcct = %2
ORDER BY T0.DocNum
This clue was given by suda from the same forum and it worked for me.
Tell me whether this has worked or not for you.
Thanks
Ravi -
I am using CF8 and MS Sql Server. I am getting an error on "select Str, CapFirst(Str) ..." when trying the following:
<cffunction name="CapFirst" returntype="string" output="false">... </cffunction>
<cfquery name="query" dbtype="query">
select Str, CapFirst(Str) as CapStr from SampleTable
</cfquery>
Thanks for your helpYou can't run a UDF like that in any <cfquery> SQL string, be it a QoQ or any other DB's driver.
If one wants to use a UDF in the SQL string, then one needs to call it like one would anywhere else: #myFunctionHere()#. However this won't help you because all the CF calls are resolved before the resultant string is sent to the DB driver.
And the string that goes to the driver needs to be valid SQL.
So you cannot do what you're wanting to do via this approach.
I presume the original data is coming from a DB? Why don't you run an equivalent function on the DB before passing it back to CF, so the results are already how you want them to be?
Adam -
UDF: Mapping query-------Urgent
hi...
I m doing a scenario from File to JDBC. I have the following requirement.
Source:
Field1
Field2
On the target side i should be able to insert into database such that in column FIELD i get:
Field1
Field2
This new line can be incorporated by concatenating Field1 with '|| chr(10) ||'
which is used in Oracle for inserting a new line.
But now i am facing a problem. The database is treating '|| chr(10) ||' as a string and instead of getting Field2 on a new line i am getting the inserted row as:
Field1 || chr(10) || Field2.
Please help me resolve this.Hi,
A simple solution this is to write an UDF.
You can write a code in UDF as below
Pass a as an argument.
String c;
c = a + "\n"
return c;
use this c as variable in query.
Regards,
Akshay Jamgaonkar.
Reward points if find useful. -
PLD report from user defined query
Hello experts,
Is possible to create a new PLD report from a user defined query ?
Thanks in advance.
Best regards
AndreaHi,
It is possible on Query Print Layout Design(QPLD) so Try to create QPLD.
Check this link u can get presentation slide form SAP.
[Query Pld from SAP site]
First you can try to create the Query report with UDF filed.
for example,
SELECT T0.DocNum, T0.DocDate, T0.CardName, T0.CheckSum, T0.U_UDF1, T0.U_UDF2, T0.U_UDF3
FROM OVPM T0 WHERE T0.DocNum>='%0' and T0.DocNum<='%1' ORDER BY T0.DocNum
Steps to Develop a User Report in QPLD:-
If you save your Query in Query Manager. Next you can do this,
->> Choose the Query Manager on Top Menu.
->> Open the Qeury Manager Window.
->> Select the specific Query report. and
->> Click the Create Report button in Bottom on Qeury Manager Window.
->> then, Open the Create User Report Window and Select the User Report(System) in Base Template.
If you Change the QPLD name.
->> Click OK.
->> (or) If your Query Report have parameter. Click OK.
Now your Query report was Created QPLD.
Note: All SELECT statement fields will be Stored and Display in Repetetive Area1. and
Parameter Fields are in Repetetive Area0 so you can Try to Copy & Paste the Field_ID's to Repetetive Area Header (or) Repetetive Area Footer.
Example:
->> Open the QPLD and Goto Field index Window, then
->> Select the Repetetive Area Header & Repetetive Area Footer ncrease the Height on Properties Window.
->> Create the Formula fields in Repetetive Area Header & Repetetive Area Footer.
->> Which Field you want to print in header or footer. Drag the Field ID(in Repetetive Area) Copy & Paste to Formula Field.
Can you see to your Query PLD? do this,
->> Choose the Tools on Top Menu.
->> Click the Queries. -> Query Print Layout...
->> Open the Query Print Layout Window.
->> Click Reports Tab and Double the Template (Requrie QPLD) on QPLD Window.
->> Customize and Save the QPLD.
Can you see your Query PLD Preveiw and Print? do this,
->> Choose the Tools on Top Menu.
->> Click the Queries. -> Query Print Layout...
->> Open the Query Print Layout Window.
->> Select Template in Report Tab on QPLD Window.
->> Click Print Preview on Top menu.
Close this thread if issue solved
Regards,
Madhan. -
New customized report using PLD or QUERY PRINT LAYOUT to show customers onl
I am working with a Software Developing firm as an SAP Consultant.
Please tell me how to create a new customized report displaying various details as required by the client in the report using PLD or Query Print Layout.
Please help me asap.Hi,
You can create queries using the Query Generator or the Query Wizard tools.
After you have created your own queries, you can link them to a required print layout.
for user reports.Look at:
Tools --> Queries --> Query Print Layout
Set there your query reports.
Printing User-Defined Queries
After you had linked a user-defined query to a user report template, you can now print it
according to its linked print layout.
There are two ways for printing your user-defined queries.
1. Using the Query Print Layout window:
Select from the upper menu Tools 􀃆 Queries 􀃆 Query Print Layout.
Click the Reports tab page.
Click to highlight the required query you would like to print.
Click on the printer icon or select from the upper menu File 􀃆 Print.
The user-defined query is printed according to its linked print layout.
2. Using the Queries Manager window:
Click the Queries Manager icon on the upper tool bar.
Click to highlight the required query you would like to print.
Click on the printer icon or select from the upper menu File 􀃆 Print.
The user-defined query is printed according to its linked print layout.
Note! You can also print preview user-defined queries. Do so by selecting the Print
Preview option as described in the methods above for printing your query.
Btw, you could search the manual training files relate to query PLD in http://www.service.sap.com/smb
Rgds, -
Hi,
Is there a way to include the UDF in the items master data into the <<Inventory In Warehouse Report (Detailed)>> PLD?
I checked the default layout and found out all the column source type is "free text" and the content is #Item, how do I know the value of the UDF?
ThanksHi,
Some of the standard reports are hardcoded in sap. Not possible to add UDF field in PLD.
Also refer this thread Variables - Sap business one
Thanks & Regards,
Nagarajan
Maybe you are looking for
-
NX 6125 too much time to complete POST. USB error
I have been having some issues over the last week or two NX 6125 takes too much time to boot. I'm dual booting it , Windows XP and Linux Mint. It takes more time to complete the POST, during POST, LEDs on all the USB devices attached to it will go ON
-
Variable declared in global definition smart form
Hi, We have defined an internal table 'it_table' in the global definition. We are unable to use 'it_table' in 'Page and Windows' loop statement. Kindly suggest. Regards,
-
Well good news for ATI users, ATI is activly seeking people to help beta test linux CATALYST drivers.... Here is a link to find out more info and fill out an app ATI linux Driver Beta tester info forgot here is the link to get the app make sure if yo
-
Got a ipad 1 turn it on and a sign comes up to connect to iTunes. What do I do
Got a ipad 1 when I turn it on the sign comes up to connect it to iTunes. What do I have to do
-
Is there any way i can record a video with 2 audio sources?
I want to be able to record a video with 2 audio sources (1 being a mic and the other being a guitar, both plugged in by usb's) while recording myself playing at the same time. I usually use an aucoustic but the sound is obviously much better when i