SAP Query for Appriasal Report
Hello Experts,
Can we use SAP Query (SQ03, SQ02, SQ01) based on Appriasal tables ( HRHAP*) to fetch records similar to tcode phap_search_pa?
I tried building an infoset making a direct read of table HRHAP and then joining tables like - HRHAP_T, HRHAP_APPEE, HRHAP_APPER, HRHAP_OTHERS and HRHAP_ACT_LOG.
Finally, created a query based on this infoset, however, it does not retreive any results. Seems, it requires more details as app templates...
Can anyone give inputs on this?
Regards,
Sarvesh Hasija
Hi Sarvesh
SAP Query may not work here. Because more than often, the data available in PHAP tables need to be first brought into temporary tables using a match condition and then shown on screen. There are a lot of sub queries required between PHAP and HRPnnnn tables to see some meaningful results. Imagine how many Table joins the End User needs to do.
SAP Query are ideal if we are pooling data from one or two tables using a match condition. I am not dening that InfoSet is not possible. Getting desired output from such InfoSet will be challenging.
You mentioned you supplied Doc ID/Number to PHAP_Search_PA, which is incorrect. It is a report which works on Template not Document. I hope you know the difference between Template and Document in PMS/OSA. I cannot stress enough on how much important is PHAP_Search_PA. What this standard report can do, custom designed report will take huge time to get close to it.
I am sorry, I am also going to recommend Z Reports in case desired output is not possible in PHAP_Search_PA. In one of my recent assignments we had "Trainer's Feedback Report for any training programme/programmes between any two dates" requirement, and we opted for a Z Report.
Regards
Yash
Similar Messages
-
Urgent ; SAP Query for generating report from BLNR ,DOCNR and oth in NEWGL
We are posting document to 5 ledgers.There is a leading ledger and 4 non leadING ledgers. One Ledger contains the detailed information , and I need to add all the fields information when I create that report.
We want BLNR field to be the reference for creating report.
we have to create a report clubbing BLNR field from BKPF , and DOCNR from FLEXA Table.
Thanks,
YGBSorry it is BELNR not BLNR
-
Hi,
Can you all help me?
Is there any area or a table or query in SAP, which can create a list with the purchase order number (Field name EBELN),supplier(Field name SUPERFIELD) and header text(Field name EDITOR).
Please tell the table name that fetches all values from the same table.
Regards,
SmithaHi,
Try to Combine EKKO, EKPO & T166P tables and take common fields like:
EKKO:
EKKO-BSTYP
EKKO-BSART
EKKO-EBELN
EKKO-LIFNR
EKPO:
EKPO-EBELN
T166K
BSTYP
ESART
TDID = F01
You can use this for your customization.
regards,
Maia
Edited by: Maia on Jul 23, 2008 5:22 PM -
SAP query for asset report with retirement and depreciation retirement
Hi Expert,
Can anyone tell me in table ADA which filed is holding the figure of retirement and retirement depreciation?
Thank oyuHi,
Max.
For your question you can check the tables ANEP for asset transactions line items and for asset value fields you can check out ANLC.
I hope this may help you.
If you have any doubts feel free to ask.
Regards,
Pankaj A Bhalerao. -
Hello Gurus-
I am trying to build a query for Aging report, and would like to include something like this:
Customer-Reference-Payment terms-Due date-Current-31-60days-61-90days-91-120days-over120days-toatal amount.
I have an infoset which includes BSID, KNA1, KNB1. I have maintained local fields:
Due Date = Baseline date + cash discount days
Statement Date = My input date.
Current = Condition (DUEDTE >= STATDTE - 30) formula (Amount)
31 - 60 Days = Condition (DUEDTE >= STATDTE - 60 AND DUEDTE < STATDTE - 30) formula (Amount)
61 - 90 Days = similar to above
91 - 120 Days = similar to above
Amount = - 1 * (If Debit credit indicator = "H" then "Amount in local currency") otherwise "Amt in Loc.Cur"
Over 120 Days = similar to above
When I enter a statement date of today it works hunky dory...it all looks good...my current column looks good and do the rest. When i want to run this query as of couple of months ago (if today is 12/19/08 and i wanted to run my aging report for 10/31/08) it should give me aging as of my statement date 10/31/08 but it does not. It calculates the total amount as of today. I know because of local field "Amount" where i gave amount in local currency, but how would I tell that it should pick up amount in local currency till the statement date?
Any input in this regards is highly helpful.
Thanks,
RNarayanHi Ram,
On your aging report you want to see invoices which are still not paid (or still open) as of a certain date. This date is "key date". You need to define a variable for key date (which is normally system date if you run today) but it could be a past date.
So key date is let us say Oct 31st (X) and the system date is Dec 19th. When you run the report as of Oct 31st all invoices that are posted prior to Oct 31st (posting date less than X) and are still in BSID will show on your report. There is no issue here.
Let us say an invoice was created on Oct 25th (Y) and was paid on Nov 15th (Z). The clearing date is Z. That means if you run the aging report today this invoice will not show.
But you want to run the report on Oct 31st. This means X is greater than Y but is less than Z.
Clearing date and posting date are part of BSAD. Report run date is the user input and is a variable.
With the above concept and with the help of an ABAP programmer you should be able to solve the problem.
Regards
Sharabh -
Need to find SAP query for corresponding ABAP program.
Hello SAP Experts,
I have an ABAP program "AQDESYSTQV000001ORDERDETAILS==" in ECC 4.7. We had a client copy recently from ECC 4.7 to ECC 6.0. Now in ECC 6.0 I am unable to find this program in SE38.
Can you please tell me how to create this program in ECC 6.0 ? Also, by the name of this program it is clearly seen that this program is automatically created by using SAP query.
I tried to generate the program using SQ01, but system asks me for the SAP query.
Can you please tell me how to find the SAP Query for the corresponding abap program ? Also, the steps as in how to generate the program in ECC 6.0.
Thanks.Hi Danish,
In the program name, the query name is always attached.
For example : The program name is , AQ10SD==========Z10SD_INVPRODL=
Here the query name is Z10SD_INVPRODL and if you go to transaction SQ01 and enter the query name
then you can find the infoset.
And also you can gernate the program with the help of query name.
Please try the same and let me know if any details are required.
Regards,
Darshana -
Improving a query for a report in b1
Dear All,
We have a query for a report. this report display all invoices with it´s Dscription in the system just have 3 descriptions so i need the the report display the this description in column not in row and then have the sum by description. i dont know how can i put a picture for showing the example.
Some one knows how can i do? down the code.
Regards
NANCY
SELECT distinct T1.visorder as 'No. Linea',
T0.DocNum as 'No. Factura',
T0.DocDate as 'Fecha',
T0.CardName as 'Cliente',
T1.U_CANTIDAD as 'Tonelaje',
T0.U_OPERACION as 'No. Operación',
T0.DocCur as 'Moneda',
T0.GrosProfit as 'Ingreso total de factura',
T1.ItemCode as 'Código',
T1.Dscription,
T1.Quantity*T1.Price as 'Importe por Servicio',
T1.LineVat as 'IVA por servicio',
T0.VatSum as 'IVA por factura',
T2.PlngGroup as 'Cuenta SUN'
FROM OINV T0 LEFT JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
inner join OCRD T2 ON T0.CardCode = T2.CardCode
WHERE T0.Series = 49 and
T0.DocDate BETWEEN [%0] AND [%1]Hi Nancy,
I'm not sure that I understand your requirement 100% but assuming you only have 3 descriptions then the following would give you totals for your different descriptions...
Simply replace the text ' etc in the code below with the descriptions values.
SELECT distinct
T1.visorder as 'No. Linea',
T0.DocNum as 'No. Factura',
T0.DocDate as 'Fecha',
T0.CardName as 'Cliente',
T1.U_CANTIDAD as 'Tonelaje',
T0.U_OPERACION as 'No. Operación',
T0.DocCur as 'Moneda',
T0.GrosProfit as 'Ingreso total de factura',
T1.ItemCode as 'Código',
CASE
WHEN T1.Dscription = '<description1>'
THEN T1.Quantity*T1.Price
ELSE 0
END as '<description1>',
CASE
WHEN T1.Dscription = '<description2>'
THEN T1.Quantity*T1.Price
ELSE 0
END as '<description2>',
CASE
WHEN T1.Dscription = '<description3>'
THEN T1.Quantity*T1.Price
ELSE 0
END as '<description3>',
T1.LineVat as 'IVA por servicio',
T0.VatSum as 'IVA por factura',
T2.PlngGroup as 'Cuenta SUN'
FROM OINV T0 LEFT JOIN INV1 T1 ON T0.DocEntry = T1.DocEntry
inner join OCRD T2 ON T0.CardCode = T2.CardCode
WHERE T0.Series = 49 and
T0.DocDate BETWEEN [%0] AND [%1]
Hope this helps.
Regards,
Sean -
I've created the below crosstab query for a report.
Select Grouping_Condition,Warehouse,Max(Value) Over (Partition By Grouping_Condition,Warehouse) As Total,
Sum(Value) Over (Partition By Warehouse) As Total_Containers_Per_Warehouse,
Sum(Vat1Ue) Over () As Total_Containers,
(Max(Vat1Ue) Over (Partition By Grouping_Condition,Warehouse))
/(Sum(Vat1Ue) Over (Partition By Warehouse))*100 As Total_Pct
From
Seleect Grouping_Condition,Warehouse,Count(*) As Value
From
Set1Ect
T1.Warehouse,Shipped_Weight As Shipped_Tons,T1.Max_Weight As Maxtonnes,
Case When (Shipped_Weight)< (T1.Max_Weight*0.001)*0.95 Then 'containers_under_95'
When (Shipped_Weight*0.001) Between (T1.Max_Weight*0.001)*0.95 And (T1.Max_Weight*0.001) Then 'containers_95_100'
Et1Se 'containers_above_weight'
End Grouping_Condition
From
Tabt1E1 T1
,Tabt1E2 T2
,Tabt1E3 C
Where
T1.Co11 = T2.Col1
And T1.Col2=C.Col2
And More Conditions
Where Warehouse In ('W1','W2','W3','W4','W5')
Group By (Grouping_Condition,Warehouse)
The Above Query Gives Me Output Something Like Below:
Grouping_Condition Warehouse Total Total_Containers_Per_Warehouse Total_Containers Total_Pct
Containers_95_100 W1 5 10 60 50
Containers_Under_95 W1 5 10 60 50
Containers_95_100 W2 10 20 60 50
I've Got Report In The Below Format
W1 W2 W3 W4 W5 Total
Total_Containers 10 20 60
Containers_95_100 5 10 15
Containes_95_100_% 50 50 ????
I Need To Calculate The Total Percentage In The Above Table With ????
Any Help Is Much Appreciated..It appears as though you already have your groupings and counts per grouping, but require a ratio of each groupings count against all other counts. Is that correct ?
If so, try the new 11g analytic function, something like this:
select Grouping_Condition
,Warehouse
,ratio_to_report(Value) over () as Count_Ratio_over_Report
.. -
Need a query for monthly Report
Hello All,
I need a query for monthly report,
comp_code
emp_id
dept_id
work_day
100
A100
MECH
01/01/2013
100
A100
MECH
02/01/2013
100
A100
MECH
03/01/2013
100
A100
MECH
04/01/2013
100
A100
MECH
05/02/2013
100
A100
MECH
08/02/2013
100
A100
MECH
09/02/2013
100
A100
MECH
10/02/2013
100
A100
MECH
12/05/2013
100
A100
MECH
13/05/2013
100
A101
CIV
01/04/2013
100
A101
CIV
02/04/2013
100
A101
CIV
03/04/2013
100
A101
CIV
04/04/2013
100
A101
CIV
06/04/2013
100
A101
CIV
06/06/2013
100
A101
CIV
07/06/2013
100
A101
CIV
08/06/2013
100
A101
CIV
09/06/2013
100
A101
CIV
10/06/2013
100
A101
CIV
11/12/2013
100
A101
CIV
12/12/2013
100
A101
CIV
13/12/2013
100
A101
CIV
14/12/2013
Dear friends this the sample table of my report.In which table has contain list of employees with their working days(actual table has contain almost 5laks of records).
suppose user choose the date between 01/01/2013 and 31/12/2013 then the result should be like this.
comp_code
emp_id
dept_id
month
Total_work
100
A100
MECH
JANUARY
4
100
A100
MECH
FEBRUARY
2
100
A100
MECH
MARCH
0
100
A100
MECH
APRIL
0
100
A100
MECH
MAY
2
100
A100
MECH
JUNE
0
100
A100
MECH
JULY
0
100
A100
MECH
AUGUST
0
100
A100
MECH
SEPTEMBER
0
100
A100
MECH
OCTOBER
0
100
A100
MECH
NOVEMBER
0
100
A100
MECH
DECEMBER
0
100
A101
CIV
JANUARY
0
100
A101
CIV
FEBRUARY
0
100
A101
CIV
MARCH
0
100
A101
CIV
APRIL
5
100
A101
CIV
MAY
0
100
A101
CIV
JUNE
5
100
A101
CIV
JULY
0
100
A101
CIV
AUGUST
0
100
A101
CIV
SEPTEMBER
0
100
A101
CIV
OCTOBER
0
100
A101
CIV
NOVEMBER
0
100
A101
CIV
DECEMBER
4Hi,
If you want the output to include months where no work was done (with 0 in the total_work column) then you need to outer-join a "table" that has one row per month, and make it a partitioned outer join:
WITH got_end_points AS
SELECT TRUNC (MIN (work_day), 'MONTH') AS first_month
, TRUNC (MAX (work_day), 'MONTH') AS last_month
FROM table_x
, all_months AS
SELECT ADD_MONTHS (first_month, LEVEL - 1) AS a_month
, ADD_MONTHS (first_month, LEVEL) AS next_month
FROM got_end_points
CONNECT BY LEVEL <= 1 + MONTHS_BETWEEN (last_month, first_month)
SELECT t.comp_code
, t.emp_id
, t.dept_id
, m.a_month
, COUNT (t.work_day) AS total_work
FROM all_months m
LEFT OUTER JOIN table_x t PARTITION BY (t.comp_code, t.emp_id, t.ept_id)
ON t.work_day >= a.a_month
AND t.work_day < a.next_month
GROUP BY t.comp_code
, t.emp_id
, t.dept_id
, m.a_month
ORDER BY t.comp_code
, t.emp_id
, t.dept_id
, m.a_month
As posted, this include every month that is actually in the table. You can change the first sub-query if you want to enter first and last months.
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
Point out where the query above is giving the wrong results, and explain, using specific examples, how you get the correct results from the given data in those places. If you changed the query at all, post your code.
Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002 -
Hi! Anybody who has a sample sql query for aging report? basically this is the table structure and sample data
bill_no B1-01 B1-02 B1-03
bill_date 01-JAN 01-FEB 01-MAR
previous_balance 100 600 800
current_charges 500 200 400
total_due 600 800 1200
As of march 1, total due is 1200. how can i get the breakdown of 1200 as to the number of days it has been due. ex. 500 (60 days old 01-JAN to 01-MAR), 200 (30 days old), 400 (current)
please help. thanks!
nullSELECT CEIL((SELECT MAX(Bill_Date) FROM Bill)- Bill_Date) Days , Previous_Balance, Current_Charges FROM Bill ORDER BY Days ASC
Then create a matrix reprot. -
Transaction code thro' SAP Query for customer spefific report
hi experts,
how to create transaction code (using SE43-) for the sap query created on own??
I have created the following required for a customer specific report
1.Infoset thro sq02
2.user group thro sq03 and assigned it to infoset
3.query thro sq01 and saved it with text
earlier i have used logical database PNPCE ( relevant for PA and payroll modules reports)
using sq01 , go to basic list , selected required infotypes and fields and
then selected, SAP List viewer for viewing and i get the report.
Now my question is how to create a separate transaction code for this sap query which i created
should i use SE43( area menu maintenance and area class???_)
should i create a variant and go to SE43??
advice solicited
snrHello
when you excecute the query in right han side corner you can get the program name
go to se80 select program & type this name and then you can create a tcode for that prog in SE80
reward points if helpful.
the prog name will be something like : AQZZ/SAPQUERY/* " ur query name
you can search for the name also in this manner -
SAP Query-for Reporting how to create and use it
Hi SAP Gurus,
i need your help. in my project, client is asking to create queries to generate reports, i am not familiar with queries, so would appreciate it if any one can guide me and tell me the procedure for writing and creating queries soon.
also if you have any study material on steps on How to write and create queries for PP module
thank you very muchHi
Please refer below document
http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_Introduction.asp
Also refer below
How to Create Infoset Query (SAP Query)
Steps on how to proceed to create a Query:
ADHOC QUERY
A query can be created to extract information from master records i.e Infotypes. For example, by creating a query , the data relating to an employee contained in various Infotypes can be extracted.
Proceedure :
Decide on the various Infotypes we want to make the query. Decide on the area where we want to query i.e Global area or Standard area. Standard area is client specific and globel area will include all clients.
Menu : HR PM Admn - Information System - Adhoc Query
Select area standard and select the user group already created
Creation of new query :
TC SQ03 - Select Environment Select Standard Area - Enter -- If new user group is to be created, enter name of the user group, click on create and enter necessary information and exit after saving
TC SQ02 - Enter name of the Infoset Create enter name of Infoset - Data source -- > Table join by basis table give name of table e.g pa0000 - Enter - Click on insert table if we want to include more tables give name of table one by one and after finishing, place cursor on the joining lines and right click to delete unwanted relationships - check - and go back - field groups - include all table fields - click on generate button - go out
TC SQ03 - Select user group - eg. Payroll
Infoset - Enter name of newly created Infoset
Assign users and Infosets - Assign infosets - put tick on payroll - save and go back
TC PAAH - Expand the nodes and put tick on relevant fields depending upon necessity
Save the query by giving the same name as infoset for easyness..
For executing a query which is already created
1. Go to SQ01 transaction
2. Go to Environment menu->query areas->std areas
3. Then choose the user group where the query is created
4. It will display all the queries created for the group.choose the query you want to executeand click execute.
5. will take to the initial screen
6. Enter the required parameters and execute
Regards
Ranga
Message was edited by:
Ranganathan Srinivasamurthy -
Assign Report Category to a SAP Query for PNP LDB
Hello Folks,
How to Assign a Report Category to a SAP Query which is using LDB PNP.
Regards,
Nishanth KumarHi,
SE38 -> Report name -> attributes -> HR Report category
Regards,
Dilek -
HI experts, Im about to create a Sap query using SQVI tcode. I want to have listing of certain master data created in customizing(SPRO) like the catalogs and list of code groups and task codes in Service Notification. What is the best data source or the table should I use to capture this data? Or is this possible? If not, can you give me some ways how to have listing report for those information.
Hi,
Have you checked with t-code QS42 ?
Tables - QPGR, TQ15.
Regards,
Vivek -
Hi,
Our requirement is to show all the changes made in all RE contracts for one business entity. We are trying to achieve this by creating SAP Query. Is this possible? And yes, what are the tables i should select or i should join to be able to create the correct report.
Thank you so much.
RachelleHi Rachel,
Please be more specific on what changes you require.
Have a look at the tables. These contain basic details of the contract
VICNCN Real Estate Contract
VICDCOND Condition
VICDCONDCALC Conditions - Calculation Factors and Condition Amounts
Regards
Maybe you are looking for
-
I am working in Windows and every time I open an attachment, Firefox asks what program to use to open files of this type. I always select the proper program and then check the box that says use this program for all future files of this type. In spite
-
Trying to install google toolbar and it keeps bringing up Explorer instead
I have just picked up a new HP dm4 (and already regretting it but thats neither here nor there) and immediately installed Firefox. I tried to download google toolbar and it downloaded fine. When I go to install the toolbar it automatically brings up
-
SAP object enhancement using abap objects
Hi I am enhancing a standard SAP object using ABAP objects. I need to add 2 more fields to the struct in that object. My qn is : how to redefine the parameter type of a method in standard class? the code is DATA: lt_list TYPE RCF_T_LIST_MASS_PROC_ACT
-
Portal "falls over" every 11 days!!
Approx every 11 days our website falls over. None of the services seem to have stopped and nothing unusual is happening on the server. The web pages just become unavailable. A reboot fixes the problem. I believe the problem lies with webcache. Are th
-
Hi There, I got error when I try to use SmartView in Excel, right click my Cube database, then Ad-hoc analysis: "Unalbe to get all drill through report information from essbase studio, export model name: XXX, exception: Runtime error. Line = 622" I r