Query help - Group by range of program set
Need help in developing query with the following set of data.
Program
req_id
parent_id
runtime
A
1
-1
30
A1
2
1
20
A2
3
-1
1
A3
4
3
5
A4
5
-1
7
A5
6
-1
4
A6
7
-1
3
A1
8
1
10
A2
9
-1
1
A3
10
9
2
A4
11
-1
3
A5
12
-1
2
A6
13
-1
2
The results I am looking for is in the following format.
Set
G1
G1_time
G2
G2_time
G3
G3_time
Set1
G1
6
G2
11
G3
3
Set2
G1
3
G2
5
G3
2
Can you please tell if this can be achieved using sql in Oracle 11g?
Thanks very much.
Hi,
Depending on your requirements:
WITH got_grp AS
SELECT program
, LAST_VALUE ( CASE
WHEN program = 'A1'
THEN req_id
END
IGNORE NULLS
) OVER ( ORDER BY req_id ) AS grp
, req_id
, runtime
FROM a
, got_c_num AS
SELECT DENSE_RANK () OVER (ORDER BY grp) AS grp_num
, runtime
, CEIL ( ROW_NUMBER () OVER ( PARTITION BY grp
ORDER BY req_id
/ 2
) AS c_num
FROM got_grp
WHERE program NOT IN ('A', 'A1')
SELECT 'SET' || grp_num AS "SET"
, 'G1' AS g1
, g1_time
, 'G2' AS g2
, g2_time
, 'G3' AS g3
, g3_time
FROM got_c_num
PIVOT ( SUM (runtime)
FOR c_num IN ( 1 AS g1_time
, 2 AS g2_time
, 3 AS g3_time
ORDER BY grp_num
Output:
SET G1 G1_TIME G2 G2_TIME G3 G3_TIME
SET1 G1 6 G2 11 G3 3
SET2 G1 3 G2 5 G3 2
Similar Messages
-
Hi all,
I need to get the sum(sal) and sum(comm) using select query..
I am using group by..but unable to get the result..
For example..if the table is
eno ename job sal comm deptno
1234 john manager 2000 1 10
1235 andrew salesman 1000 2 20
1236 steven manager 2000 3 20
1237 robert clerk 600 4 10
1238 laura manager 2000 5 20
1239 dan salesman 500 6 30
1240 james clerk 500 7 10
I need to display all the columns by select query and the result should be as follows:
eno ename job sal comm deptno sum(sal) sum(comm)
1234 john manager 2000 1 10 6000 9
1235 andrew salesman 1000 2 20 1500 8
1236 steven manager 2000 3 20 6000 9
1237 robert clerk 600 4 10 1100 11
1238 laura manager 2000 5 20 6000 9
1239 dan salesman 500 6 30 1500 8
1240 james clerk 500 7 10 1100 11
I appreciate your help...thanks !Use anaytic SUM:
SQL> select empno,
2 ename,
3 job,
4 sal,
5 comm,
6 deptno,
7 sum(sal) over(partition by deptno) sum_sal,
8 sum(comm) over(partition by deptno) sum_comm
9 from emp
10 /
EMPNO ENAME JOB SAL COMM DEPTNO SUM_SAL SUM_COMM
7782 CLARK MANAGER 2450 10 8750
7839 KING PRESIDENT 5000 10 8750
7934 MILLER CLERK 1300 10 8750
7566 JONES MANAGER 2975 20 10875
7902 FORD ANALYST 3000 20 10875
7876 ADAMS CLERK 1100 20 10875
7369 SMITH CLERK 800 20 10875
7788 SCOTT ANALYST 3000 20 10875
7521 WARD SALESMAN 1250 500 30 9400 2200
7844 TURNER SALESMAN 1500 0 30 9400 2200
7499 ALLEN SALESMAN 1600 300 30 9400 2200
EMPNO ENAME JOB SAL COMM DEPTNO SUM_SAL SUM_COMM
7900 JAMES CLERK 950 30 9400 2200
7698 BLAKE MANAGER 2850 30 9400 2200
7654 MARTIN SALESMAN 1250 1400 30 9400 2200
14 rows selected.
SQL> SY. -
Crosstab Query re Grouping Data into Value Ranges
Hi
I am trying to analyse some data in a Crosstab & have a query re grouping.
The data contains sales transaction info such as selling price, quantity etc. I would like to create a grouping in the Crosstab based on a sale price range (eg £0 - £10, £10 - £20 etc) so that I can show the total quantity sold in each price range.
To date my method has been to create a formula with Select Case which identifies each transaction into a price range. I would then use this formula in my Crosstab. The main issue with this method is that there will be a large number of Cases & the possibility this will need to be added to / modified going forward.
Whilst I think this will work I am hoping there is better method to follow?
Thanks
JonHi Jamie,
Thank you for your help.
I'm looking to group in increments of 10 so it looks like the Floor function will do the trick, thank you.
I'll probably use an If statement to do a "block" of prices at either end of the scale (ie < 100 then 100, > 1000 then 1000+ else Floor ({Sales Field},10). Hopefully this way I'll reduce the overall no of rows.
Thanks again for your help.
Jon -
Automatic payment program setting
Hi sir,
Could you resolve my below query :
What is the cycle for Automatic payment program setting ?Hi,
Running AUTOMATIC PAYMENT PROGRAMME:
T Code F110 process,
Enter the following things,
Rundate : Can be today's date
Indentification : Anything (eg. app, app1, aap2)
and press enter, and go to parameters tab,
Posting Date : Can be today's date (Payment entry posting date)
Docs entered up to : Can be today's date (here specify the date till that date dues will be considered)
Company code - Your company Code
Payment method - Your PM
Next P/Date - Enter next payment run date (dues will be selected one day before that date)
Customer / Vendor : enter the customer / vendor or its ranges
GO to free selection tab,
Field Name : Select any option if you wanted to restricted to it (It looks like non-seletable means grayed out but you can select it) you can select Business area to make payment only to that BA or click on Exclude values to exclude that BA alone
Values - give the values of your selection. If it is multiple selection, use "," (commas) to understand it.
Go to additional Log tab,
X - Due date Check
X - Payment Method selection in all cases
_ - Payment method selection if not sucessful
X - Line item of the payment documents
and again give the vendor or customer or its ranges here also.
Goto Printout / data medium,
Against your program - Give some varient name (eg. APP) and click on maintain Varient tab on the top it will take you to the next screen,
There you can select Individual selection and your Co Cd
and it will take u to one more screen, there give
Program run date : Rundate entered at very first
Identification feature : give your identification
Paying company code : Your company code
Payment method : Your payment method
House bank : Your HB
Account ID : Your HB ID for payment
Check lot number : Give check lot number Maintained in FCHI
Print check - Printer name
and select and give the information where ever you feel it is required. And go back it will ask u to save the varient, do the it.
Now click on Status, now again it will ask you to save, do it. Now click no proposal tab, it will pop-up one window, there
X - Start Immediately; X-Create payment medium and tick
Keep refresh it till you get the message "Payment proposal has been created" in the status.
Now you can check the proposal log,
If the proposal Log is OK then, click on Pmnt Run tab,
it will pop-up one window, there
X - Start Immediately; X-Create payment medium and tick
Keep refresh it till you get the message "Payment run has been carried out" in the status.
Now you can check the payment log also, to check the same
Now you can click on Printout tab,
X - Start Immediately; Job name - Delete ? and give some reference like APP1 etc., and tick
Now goto your own job to see the whether it is completed or not and from there you can goto your spool request to print the check.
Bank configuration:
To set up Electronic Bank Statements (EBS)
1. Create House Bank and Account ID (FI12)
2. Setup EDI Partner Profile for FINSTA Message Type (WE20)
3. Configure Global Settings for EBS (IMG)
- Create Account Symbols
- Assign Accounts to Account Symbols
- Create Keys for Posting Rules
- Define Posting Rules
- Create Transaction Types
- Assign External Transaction Types to Posting Rules
- Assign Bank Accounts to Transaction Types
4. Define Search String for EBS(Optional)
- Search String Definition
- Search String Use
5. Define Program and Variant Selection
Additional information is also available in the SAP Library under:
Financial Accounting > Bank Accounting (FI-BL) > Electronic Bank Statement >
Electronic Account Statement Customizing.
Bank Reconcilliation Statement
The following are the steps for BRS:
Create Bank Master Data - This can be created through T.Code FI01 or you can also create the house bank through IMG/FA/Bank accounting/Bank account
2. Define House Bank
3. Set up Bank selection payment programe- IMG/FA/ARAP/BT/AUTOIP/PM/Bank selection for payment prg.
a. setup all co codes for payment transaction - Customer and vendors
b.setup paying co codes for payment transactions
c.setup payment method per country
d.setup payment method per co code for payment transaction
e.setup bank determination for payment transaction
Please go for Cheque mangement using T code FCHI (IMG/FA/ARAP/BT/OP/AutoOp/PaymentMedia/CheckManagement) and for void reasons FCHV. You can create Bank Reconcilliation statement by TC FF67 (SAP/AC/Treasury/CashManagement/Incomings/ManualBankStatement) . Don't forget to keep the opening Balance as zero. Use FBEA for post process.
All the steps together will lead to (FF67) Bank reconciliation statement.
Thanks,
Prithwiraj. -
How to Automate modify of program setting for each package to run only on Win xp.
Hi Guys,
We have SCCM 2012 environment and currently migration form XP to win 7 is going on. We have around 3000+ packages with program setting to run on any platform.
Now we are in need to change program settings of each package and application to only to run on win xp.
Please help how we can achieve this...in automatic way....
Please help....
Regards
Ankur
[email protected]You have to write a powershell script in order to achieve what you want. Given code below without warranty...
$ErrorActionPreference ="Stop"
$cmSiteCode = "" # your SCCM primary site code
$cmServer = "" # your SCCM primary site server
$programs = Get-WmiObject -Namespace "root\sms\site_$($cmSiteCode)" -ComputerName "$($cmServer)" -Query "SELECT * FROM SMS_Program"
foreach ($program in $programs) {
$program.psbase.Get
$programOSDetails = $program.SMS_OS_Details
$supportedPlatforms = Get-WmiObject -Namespace "root\sms\site_$($cmSiteCode)" -ComputerName "$($cmServer)" -Query "SELECT * FROM SMS_SupportedPlatforms WHERE OSName like '%Windows XP%'"
foreach ($supportedPlatform in $supportedPlatforms) {
$osDetail = ([wmiclass] "\\$($cmServer)\root\sms\site_$($cmSiteCode):SMS_OS_Details").CreateInstance()
$osDetail.psbase.Properties["MaxVersion"].value = $supportedPlatform.OSMaxVersion
$osDetail.psbase.Properties["MinVersion"].value = $supportedPlatform.OSMinVersion
$osDetail.psbase.Properties["Name"].value = $supportedPlatform.OSName
$osDetail.psbase.Properties["Platform"].value = $supportedPlatform.OSPlatform
[System.Management.ManagementBaseObject[]]$programOSDetails += $osDetail
$program.SMS_OS_Details = $programOSDetails
$program.psbase.Put()
Pay attention: SMS_OS_Details property in WMI class SMS_Program is a lazy one. -
Help required - running a Java program from the command line
Hi,
I have a small non-graphical Java application, packaged into a Jar file. My program relies on classes in another (external) Jar file.
When I run the application from the IDE, everything works fine. However, when I try to run the application from the command line, I keep getting a NoClassDefFoundError for classes in the external jar.
Both the application jar file and the external jar file are in my root directory (C:\).
My command line call is as follows:
java -cp c:MyExternalLib.jar -jar MyApp.jar
Any help greatly appreciated.
Thanks,
Walterhi,
set classpath=%classpath%;c:\myjar.jar;
here i have specified myjar.jar file as an example u give ur location.after setting the classpath run ur java application.
java mypgm
this will solve ur problem
regards,
Ganesh -
How I check in group by query the group change
How I check in group by query the group change
Hi master
Sir I have master detail table
This is my query
select rownum,chartofacc.accid,title,nvl(drbal,0),nvl(crbal,0),
(select case when nvl(sum(debit),0)-nvl(sum(credit),0)>0 then
nvl(sum(debit),0)-nvl(sum(credit),0)
else
0
end mfadrttt
from voudetail where voudetail.accid=chartofacc.accid) as mfadr,
(select case when nvl(sum(credit),0)-nvl(sum(debit),0)>0 then
nvl(sum(credit),0)-nvl(sum(debit),0)
else
0
end mfacrttt
from voudetail where voudetail.accid=chartofacc.accid) as mfacr
,nvl(debit,0),nvl(credit,0),voumaster.entdate,voumaster.vno from chartofacc ,accbal,voudetail,voumaster where chartofacc.accid=accbal.accid(+) and chartofacc.accid=voudetail.accid(+) and voumaster.vno=voudetail.vno order by chartofacc.accid,voumaster.entdate,voudetail.VNO;
Sir I need add opbal from master section to debit in detail section when new group start only after adding I use that column for accumulative total or running balance
If I get any method when group change system give me any key or indication then I use
Please give me idea in both field oracle sql and oracle report 6i
Thank
aamirHi,
Please send tables structures and sample data from that tables. And, of course what should be the output. :) Just sending your query won't help us to find a solution.
Peter D. -
Customer Account Group Number Range
Hi Guru's,
The Customer Account Group Number Range has currently taking 10 digits. But my client wants to be 12 digits.
Could you please guide me, to do the necessary setting for the same.
Kindly suggest.
thanking you,
regards,
SreeniDear Sreeni,
You can't change standard customer no range flied width.
You can create a new ZTABLE with 12digits.
regards
natraj -
Urgent : can help me in my search program( mofication of my program)
Requirements:
<u>Selection-Screen</u>:
Parameter: String field to enter a text
Select-option: to enter program names (value help shall be available)
<u>Program</u>:
The user shall enter a text and select one or serveral program names. (Search help for the pro-gram names.)
The coding of the selected programs than are searched for the entered string (text).
(nice to have, but not necessary: if the user makes a double click on a line of the result list (see below) it is jump into the ABAP editor an the coding is displayed in display mode).
Output:
Display in a ABAP list OR in a ALV list the program name, the line number and the coding / text auf the line, where the search term as found.
<u>My Program coding</u>
TABLES: trdir,rs38m.
PARAMETER : pa_text(30) type c.
SELECT-OPTIONS : so_name FOR trdir-name MATCHCODE OBJECT ZSH_EXAMPLE.
data: begin of jtab occurs 0,
line(300),
end of jtab.
data : wa like jtab.
DATA : rata LIKE trdir OCCURS 0 WITH HEADER LINE.
DATA : repid type sy-repid.
DATA : fval type trdir-name.
DATA : cnt type n.
DATA : off type n.
SELECT name FROM trdir INTO rata WHERE name IN so_name.
append rata.
ENDSELECT.
WRITE: /02 'PrgName', 53 'Text',95 'Line No'.
uline.
LOOP AT rata.
read report rata-name into jtab.
jtab-line = rata-name.
append jtab.
search jtab for pa_text.
if sy-subrc = 0.
WRITE : /02 rata-name, 50 pa_text,90 sy-tabix.
endif.
ENDLOOP.
*LOOP AT jtab.
*ENDLOOP.
AT LINE-SELECTION ******************
AT LINE-SELECTION.
get cursor value fval.
Set parameter id 'RID' field rata-name.
EDITOR-CALL FOR REPORT fval DISPLAY-MODE.
*read
*find
*search
The problem is that i can display the list of program which contains the given string....
but when I double click on the program name... its not displaying the code of particular particular program .
so anyone help me to modify my program or send me a new codeREPORT ZSEARCH_HELP
DATADEKLARATION *****
TYPE-POOLS: slis.
TABLES: tadir.
Tables
DATA: gt_output TYPE TABLE OF zstruct_output. (here create a search help in se11)
Structures
DATA: gs_output TYPE zstruct_output.
Fields
DATA: gv_mess TYPE text60.
Constants
CONSTANTS: gc_s TYPE msgty VALUE 'S',
gc_r3tr TYPE pgmid VALUE 'R3TR',
gc_prog TYPE trobjtype VALUE 'PROG'.
SELECTION SCREEN *****
SELECTION-SCREEN: BEGIN OF BLOCK sel WITH FRAME TITLE sel_txt.
SELECT-OPTIONS: s_repid FOR tadir-obj_name.
PARAMETERS: p_seatxt TYPE string.
SELECTION-SCREEN: END OF BLOCK sel.
SELECTION SCREEN VALUE HELP *****
REPID_LOW
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_repid-low.
call search help
PERFORM prog_search_help CHANGING s_repid-low.
REPID_HIGH
AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_repid-high.
call search help
PERFORM prog_search_help CHANGING s_repid-high.
AT LINE-SELECTION *****
AT LINE-SELECTION.
line selection -> double click functionality
PERFORM jump_into_coding USING gs_output-prog gs_output-line.
INITIALIZATION ******
INITIALIZATION.
sel_txt = 'Date selection'(001).
s_repid-sign = 'I'.
s_repid-option = 'CP'.
s_repid-low = 'Z*'.
APPEND s_repid.
START-OF-SELECTION ******
START-OF-SELECTION.
CLEAR: gt_output[],
gs_output,
gv_mess.
select data and determine where search string is used
PERFORM select_progs CHANGING gt_output.
END-OF-SELECTION.
IF NOT gt_output[] IS INITIAL. "found data
display the found data
PERFORM display_data CHANGING gt_output.
ELSE. "no data was found
gv_mess = 'No data was found'(003).
MESSAGE gv_mess TYPE gc_s.
ENDIF.
SUB-ROUTINES *****
*& Form select_progs
Determine programs where the search string is used
--> pt_output Output data
FORM select_progs CHANGING pt_output LIKE gt_output.
DATA: BEGIN OF ls_progs,
prog TYPE programm,
END OF ls_progs.
DATA: lt_progs LIKE TABLE OF ls_progs.
select all progams into a internal table
SELECT obj_name
FROM tadir
INTO TABLE lt_progs
WHERE pgmid = gc_r3tr AND
object = gc_prog AND
obj_name IN s_repid.
IF sy-subrc = 0. "selection was successful
LOOP AT lt_progs INTO ls_progs.
search coding of the programms for the search string
PERFORM search_coding USING ls_progs-prog
CHANGING pt_output.
ENDLOOP.
ELSE. "selection was not successful -> error message
gv_mess = 'Search string not found in selected programs'(002).
MESSAGE gv_mess TYPE gc_s.
ENDIF.
ENDFORM. " select_progs
*& Form search_coding
search every selected program for the search string
-->PS_PROGS Program name
<--PT_OUTPUT output data
FORM search_coding USING pv_prog TYPE any
CHANGING pt_output LIKE gt_output.
DATA: lt_coding TYPE TABLE OF string,
lv_coding TYPE string.
CLEAR gs_output.
read coding into internal table
READ REPORT pv_prog INTO lt_coding.
IF sy-subrc = 0. "Coding was read
move program name
gs_output-prog = pv_prog.
search for search text
LOOP AT lt_coding INTO lv_coding.
SEARCH lv_coding FOR p_seatxt.
IF sy-subrc = 0.
move found line
gs_output-line = sy-tabix.
gs_output-text = lv_coding.
APPEND gs_output TO pt_output.
ENDIF.
ENDLOOP.
ENDIF.
ENDFORM. " search_coding
*& Form display_data
display the result data
<--PT_OUTPUT result data
FORM display_data CHANGING pt_output LIKE gt_output.
LOOP AT pt_output INTO gs_output.
WRITE: / gs_output-prog LEFT-JUSTIFIED NO-GAP,
gs_output-line,
gs_output-text.
HIDE: gs_output-prog, gs_output-line.
ENDLOOP.
DATA: lt_fieldcat TYPE TABLE OF slis_fieldcat_alv.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'GT_OUTPUT'
I_STRUCTURE_NAME = 'ZSTMP_SEARCH_PROG'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME =
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = lt_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = sy-repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
it_fieldcat = lt_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = pt_output
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " display_data
*& Form prog_search_help
search help for program field
--> pv_repid program name
<-- p2 text
FORM prog_search_help CHANGING pv_repid TYPE any.
use standard function module
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
object_type = 'PROG'
object_name = pv_repid
ENCLOSING_OBJECT =
SUPPRESS_SELECTION = 'X'
VARIANT = ' '
LIST_VARIANT = ' '
DISPLAY_FIELD =
MULTIPLE_SELECTION =
SELECT_ALL_FIELDS = ' '
WITHOUT_PERSONAL_LIST = ' '
PACKAGE = ' '
use_alv_grid = ' '
IMPORTING
object_name_selected = pv_repid
ENCLOSING_OBJECT_SELECTED =
STRUCINF =
TABLES
OBJECTS_SELECTED =
RECORD_TAB =
EXCEPTIONS
cancel = 1
wrong_type = 2
OTHERS = 3
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " prog_search_help
*& Form jump_into_coding
jump into the coding
-->P_GS_OUTPUT_PROG text
-->P_GS_OUTPUT_LINE text
FORM jump_into_coding USING pv_prog TYPE program
pv_line TYPE any.
EDITOR-CALL FOR REPORT pv_prog DISPLAY-MODE.
ENDFORM. " jump_into_coding -
Hierarchical Tree Data Query/Record Group Question
I need help with Hierarchical Forms right now. I'm currently trying to implement a hierarchical tree to display the different items in different categories. I have been reading up on it for the past few days, and i do not understand a few things.
What is the difference between a data query and record group? they seem the same to me.
How does the XX = prior XXX work? i understand that this is what connects the parent to the child.
How do you determine what depth the node is? its done in the record group/data query, but how do i decide what level it is dynamically?
Thanks a lot in advance!Thanks! I am unable to create a table specifically for the tree because i am using tables that have been ported live and are in use. My question about levels is how do I know which depth the node is. For example, i have a category called Information Technology and a category item called Business Informatics. I want to know how to decide that the Category(information technology) is on level 1 and the Item(business informatics) is on level 2.
Information Technology
|_
Business Informatics
And i do know how the Connect By XX = prior XXX works in the data query/record group.
Thanks for your help! -
No entries in Define conversion group and external function module setting.
Hi all,
After active bussiness function SAP Oil & Gas, my system have a problem in SPRO.
SPRO --> IMG --> Industry solution Oil & Gas (Downstream) --> HPM --> QCI configuration --> Define conversion group and external function module setting.
Problem appear: Has no entries in there!
Please, help me! Thank you so much!
Tks & best regards,
DatHTDat,
There are few entries normally delivered by SAP and which are good for a regular implementation. It is possible that those are not copied over from the reference client. Second option is to check the BC set (if) available for this activity and pull those in. Check the SAP reference client first, most likely that has entries which you can copy over to your regular client.
Regards, -
Sqlserver query using Group by and Order by
SUM(BILL_DETAIL.x_bill_quantity) as BILL_QUANTITY,
MIN(BILL_DETAIL.x_billable_to) as BILLABLE_TO,
MIN(BILL_DETAIL.x_billable_yn) as BILLABLE_YN,
AVG(BILL_DETAIL.x_bill_rate) as BILL_RATE,
MIN(BILL_DETAIL.x_cost_rate) as COST_RATE,
MIN(BILL_DETAIL.x_cost_total) as COST_TYPE,
LISTAGG(BILL_DETAIL.objid, ',') WITHIN GROUP(ORDER BY BILL_DETAIL.objid) as ID_LIST
FROM table_x_gsa_bill_detail BILL_DETAIL
WHERE (1=1)
GROUP BY (DECODE(BILLABLE_YN, 1, 'Billable', 'Non-Billable') || ',' || BILLABLE_TO || ',' || DETAIL_CLASS || ',' || COST_TYPE || ',' || BILL_RATE)
ORDER BY DECODE(BILLABLE_YN, 1, 'Billable', 'Non-Billable') || ',' || BILLABLE_TO || ',' || DETAIL_CLASS ||
) dt WHERE rn BETWEEN 0 AND 1
Can any one pls help me using of Case Condition keyword instead of Decode in the above query ??? iam not able to convert above query for group by and order by..
Actually i need to do group by the aggragate values which i got the values from the fields of BILLABLE_YN,BILLABLE_TO,DETAIL_CLASS, COST_TYPE, BILL_RATE.
where as in oracle i can run above query using decode keyword where as in sqlserver iam not able to use BILLABLE_YN field alias of above query in group by .
i tried like by using following way but it is wrong because here iam not using aggragate values of fields in group by funtion please help me in converting query in sqlserver. GROUP BY (case BILLABLE_YN when 1 then 'Billable' when 0 then 'Non-Billable' else
'Non-Billable' End BILLABLE_YN + ',' + BILLABLE_TO + ',' + DETAIL_CLASS + ',' + COST_TYPE + ',' + BILL_RATE)
KrishnaCREATE TABLE DETAIL
([objid] int,[x_billable_to] varchar(19), [x_bill_quantity] int,
[x_billable_yn] int, [x_bill_rate] int, [COST_TYPE] varchar(19) )
INSERT INTO
DETAIL
([objid], [x_billable_to], [x_bill_quantity], [x_billable_yn], [x_bill_rate],[COST_TYPE])
VALUES
(1, 'Customer', 3, 1, 20,'Parking'),
(2, 'Customer', 1, 1, 25,'Toll'),
(3, 'Customer', 2, 1, 20,'Parking')
Pls convert following query for executing query in sqlserver ..for the column ID_List it should return data like 1,2,3
SELECT * FROM (SELECT 1 rn,
SUM(BILL_DETAIL.x_bill_quantity) as BILL_QUANTITY,
MIN(BILL_DETAIL.x_billable_to) as BILLABLE_TO,
MIN(BILL_DETAIL.x_billable_yn) as BILLABLE_YN,
AVG(BILL_DETAIL.x_bill_rate) as BILL_RATE,
LISTAGG(BILL_DETAIL.objid, ',') WITHIN GROUP(ORDER BY BILL_DETAIL.objid) as ID_LIST
FROM BILL_DETAIL
WHERE (1=1)
GROUP BY (DECODE(x_billable_yn, 1, 'Billable', 'Non-Billable') + ',' + x_billable_to + ',' + COST_TYPE + ',' + x_bill_rate)
ORDER BY DECODE(x_billable_yn, 1, 'Billable', 'Non-Billable') + ',' + x_billable_to + ',' + COST_TYPE + ',' + x_bill_rate
)dt
WHERE rn BETWEEN 0 AND 1
Krishna
sounds like this
SELECT *
FROM
SELECT 1 rn,
SUM(BILL_DETAIL.x_bill_quantity) as BILL_QUANTITY,
MIN(BILL_DETAIL.x_billable_to) as BILLABLE_TO,
MIN(BILL_DETAIL.x_billable_yn) as BILLABLE_YN,
AVG(BILL_DETAIL.x_bill_rate) as BILL_RATE,
LEFT(bd1.ID_LIST,LEN(bd1.ID_LIST)-1) AS ID_Listing
FROM BILL_DETAIL bd
CROSS APPLY (
SELECT BILL_DETAIL.objid + ',' AS [text()]
FROM BILL_DETAIL
WHERE objid = bd.objid
FOR XML PATH('')
)bd1(ID_LIST)
WHERE (1=1)
GROUP BY (CASE WHEN x_billable_yn = 1 THEN 'Billable' ELSE 'Non-Billable'END + ',' + x_billable_to + ',' + COST_TYPE + ',' + x_bill_rate),
LEFT(bd1.ID_LIST,LEN(bd1.ID_LIST)-1)
ORDER BY (CASE WHEN x_billable_yn = 1 THEN 'Billable' ELSE 'Non-Billable'END + ',' + x_billable_to + ',' + COST_TYPE + ',' + x_bill_rate),
LEFT(bd1.ID_LIST,LEN(bd1.ID_LIST)-1)
)dt
WHERE rn BETWEEN 0 AND 1
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page -
Query Help:
http://forum.java.sun.com/thread.jsp?forum=45&thread=471180&tstart=15&trange=15
It seems I have confused enough people with my improper presentation of query. Sorry guys. I will restate my question with different table names.
The above was my previous posting, which was not clear..so Iam restating my problem as follows....
I have the following tables
Customer(custID, Name, Address)
Order(custID, OrderID, orderDate)
CreditCard(custID, creditCard#, creditCardType)
Now if I have 3 records in Order with custID 100 and 2 records in CreditCard as
Order:
100,A001,11/22/03
100,A002,11/24/03
100,A003,12/02/03
CreditCard:
100,42323232..., VISA
100,5234234...., MASTER
Now how can I get
custID, Name, Address, OrderID, orderDate, creditCard#, creditCarType
data in minimum no. of records....
I think I have made my query clear..
now please help me guys...
thanks so much for your help.You are right.
But frankly the actual tables on my database are not customer,orders and creditcards..but I just tried to reproduce the problem with these tables, please ignore that user needs a refund etc situtaion. If the tables were actually order,creditcards etc..it would have been a problem to be considered.
Can you please help me with the query
if I have m rows in Order and n rows in CreditCard. I will get m*n records, I looking for max(m,n).
With the following fields in my query result,
custID, Name, Address, OrderID, orderDate, creditCard#, creditCarType
from Customer, Order, CreditCard tables
Thanks so much for your htlp -
Please help!
It would be tremendously helpful to be able to access, set restrictions, and make changes from the parents device, to all devices under the same iTunes account, so that I could make changes to my kids devices without physical access.
I understand that I can set up a different Apple ID for the kids devices, or take physical control of the device and make the changes myself. However, my teenage son is technically savvy enough to have a job in Silicon Valley, as are most young people these days. However, in order to access his devices the current way, I first have to bypass the four digit pass code. This starts a fight of why I need in the device and continues to escalate. The argument that I am the parent will gain access but the fight is simply exhausting, and quite frankly shouldn't have to happen at all. He is not yet an adult, he did not pay for his iPad or iPhone and I, as a parent, should have not only have the right to change options at will, and from anywhere, but look at history or current activity when I feel like it.
I currently have the settings where app and in-app purchases require my password to be put in, and he must come to me to type it in, but I need more control and would like, and should be able to access any of our six devices and make individual changes simply by logging in to my account, with my password.
If I can see all my devices on the "Lost My iPhone" app, this technology should be easy to make happen.
C'mon parents! I have a pretty good kid, given all things that they can get into, but I am not stupid. For everything I see has been done, there is much more I haven't seen. I want my children to be kept safe and be able to know what they are looking at or listening to. We parents are the only ones who know our beliefs and what our kids can handle and when.
Thanks for any support or information that I may be missing in order to fulfill my request.There are mobile device management solutions that can do this, including in Apple's OS X Server system, but most parents generally find that setting this up is more work than it's worth. If you're interested, though, there are a couple that at least purport to be free (I don't know if there are any hidden "gotchas"):
http://www.unwireddevicelink.com/features/
https://meraki.cisco.com/products/systems-manager
and Apple's system:
http://www.apple.com/osx/server/features/#profile-manager
I don't think any, however, allow you to see current activity or browser history. iOS doesn't expose those to access from MDM solutions, to the best of my knowledge.
Regards. -
SQL Query (updateable report) Region - Conditionally Hide and Set Values
SQL Query (updateable report) Region - Conditionally Hide and Set Values
Outline of requirement :-
Master / Detail page with Detail updated on same page using SQL Query (updateable report).
The detail region has the following source
SELECT item_id,
contract_id,
CASE WHEN hardware_id IS NOT NULL THEN
'HA'
WHEN backup_dev_id IS NOT NULL THEN
'BD'
WHEN hardware_os_id IS NOT NULL THEN
'HS'
END item_type,
hardware_id,
backup_dev_id,
hardware_os_id
FROM "#OWNER#".support_items
WHERE contract_id = :P26_CONTRACT_IDThe table support_items implements arced relationships and has the following columns
CREATE TABLE SUPPORT_ITEMS
ITEM_ID NUMBER NOT NULL,
CONTRACT_ID NUMBER NOT NULL,
HARDWARE_ID NUMBER,
BACKUP_DEV_ID NUMBER,
HARDWARE_OS_ID NUMBER
)A check type constaint on support_items ensures that only one of the fk's is present.
( hardware_id IS NOT NULL
AND backup_dev_id IS NULL
AND hardware_os_id IS NULL
OR ( hardware_id IS NULL
AND backup_dev_id IS NOT NULL
AND hardware_os_id IS NULL
OR ( hardware_id IS NULL
AND backup_dev_id IS NULL
AND hardware_os_id IS NOT NULL
) Hardware_Id is a FK to Hardware_Assets
Backup_dev_id is a FK to Backup_Devices
Hardware_os_id is a FK to Hardware_op_systems
The Tabular Form Element based on item_type column of SQL query is Displayed As Select List (based on LOV) referencing a named list of values which have the following properties
Display Value Return Value
Hardware Asset HA
Backup Device BD
Computer System HSThe Tabular Form Elements for the report attributes for hardware_id, backup_dev_id and hardware_os_id are all Displayed As Select List (Based on LOV).
What I want to do is only display the Select List for the FK depending on the value of the Select List on Item Type, e.g.
Item_Type is 'HA' then display Select List for hardware_id, do not display and set to NULL the Select Lists for backup_dev_id and hardware_os_id.
Item_Type is 'BB' then display Select List for backup_dev_id, do not display and set to NULL the Select Lists for hardware_id and hardware_os_id.
Item_Type is 'HS' then display Select List for hardware_os_id, do not display and set to NULL the Select Lists backup_dev_id and hardware_id.
There are properties on elements to conditionally display it but how do we reference the values of the SQL query Updateable region? they are not given a page item name?
Also on the Tabular For Elements there is an Edit tick against a report item - however when you go to the Column Attributes there is not a property with which you can control the Edit setting.
What's the best way of implementing this requirement in APEX 3.1?
Thanks.>
Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "user13515136".
When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
<li>Full APEX version
<li>Full DB/version/edition/host OS
<li>Web server architecture (EPG, OHS or APEX listener/host OS)
<li>Browser(s) and version(s) used
<li>Theme
<li>Template(s)
<li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
I have a multi-row region that displays values and allows entries in a number of fields.Provide exact details of how this has been implemented. (An example on apex.oracle.com is always a good way to do this.)
I should like the fields to be conditional in that they do not permit entry, but still display, if certain conditions apply (e.g. older rows greyed out). Can this be done? Almost anything can be done, often in multiple ways. Which are appropriate may be dependent on a particular implementation, the skills available to implement it, and the effort you're willing to expend on it. Hence it's necessary to provide full details of what you've done so far...
Maybe you are looking for
-
Berkeley DB Java Edition and Java 1.4
As a Berkeley DB Java Edition user we place a very high value on your input. We need your feedback regarding a product requirement for Java 1.5. As time goes on we find ourselves implementing more and more performance enhancements based on facilities
-
My search box disappeared...how do I get it back?
I moved my search box to a new custom made toolbar. It was there for a while but now it is gone. I opened every toolbar and it is not on any of them. I looked in the toolbar customization thingy (where you get new buttons) and it is not in there eith
-
EEWB field is not appearing in web ui
Hi All, I added a new field to orderadm_h using EEWB based on the transaction type(service order) . Now i am able to see the newly added field in the CRMD_ORDERADM_H table .eventhough the bol structure also enhanced. the new field is available under
-
Installing a program with ARD that is not a PKG file
I have about 200 ibooks that need to have a sofware package installed on. I was hoping to this by scheduling the installs to run on off hours using ARD 2.2. My problem is that the program that i need to install uses a VISE installer, rather than a .p
-
Modify Default Workspace in LiveCycle Workbench
Hi All, I need to modify default workspace(Applications are stored in Local Environment viz, C:\Users\username\Workbench ES2) instead want to store all the files in some other location, sounds the issue is silly but i am not able to find the option c