Query Issue(Very Urgent)
Hi,
I have issue with select statement to pull the records from two tables. Here I have two tables one is with Billing Document Items and Service Order Operations.
I have service order as unique field in both tables, When I execute select statement with one service order I got 10 records like
S Ord Oper Billing Document Items
Oper Repair Code Item Oper Repair Code
10 AD01 1 10 AD01
20 AD01 2 20 AD01
30 OT01 3 10 AD01
40 RE01 4 20 AD01
50 RP01 5 20 AD01
6 20 AD01
7 30 OT01
8 40 RE01
9 50 RP01
10 50 RP01
This are the records with same Service order number, and my select statement giving data like
O/P
Service Order = 60001212
OPER ITEM REPAIR TYPE
10 1 AD01
20 1 AD01
10 2 AD01
20 2 AD01
10 3 AD01
20 3 AD01
10 4 AD01
20 4 AD01
10 5 AD01
20 5 AD01
10 6 AD01
20 6 AD01
30 7 OT01
40 8 RE01
50 9 RP01
50 10 RP01
But I need output like this
Item Oper Rep Code
1 10 AD01
2 20 AD01
3 10 AD01
4 20 AD01
5 20 AD01
6 20 AD01
7 30 AD01
8 40 RE01
9 50 RP01
10 50 RP01
Please give me the select statement which gives the above output. I need very urgent please....
Thanks
Robbie
hi robert,
The ouput u want is just a little away from the one u r actually getting. it is the two fields OPER and ITEM interchangeably..
U just have to use GROUP BY ITEM..........if u want the desired output with ITEM as first field.
<group-by-clause> → GROUP BY [<column-ref>,*]<column-ref>
if it helps please reward points.
thanks
Similar Messages
-
CATS Issue VERY Urgent..
HI ALL,
BiW PROD is placing CATS data for 2007 in to week 52 2006. Can advise why?
Please advise what would be the error.
Cheers,
SriHi All,
We have a problem for 0CALWEEK in CATS.
FOR 0CALQUARTER
20061 means 1st quarter
20062 means 2ND quarter
20063 means 3RD quarter
20064 means 4TH quarter
FOR 0calweeK:
20061 means 1st WEEK
20062 means 2ND WEEK
20063 means 3RD WEEK
20064 means 4TH WEEK
0CALWEEK is giving problem IN CUBE.
It shows wrongly.
0CALQUARTER 0CAL WEEk
2007 1 2006 52 ( 52 week)
2007 1 2006 52
<b>0CAL WEEk should show 2007 1 instead of 2006 52.</b>
It should show :
0CALQUARTER 0CAL WEEk
2007 1 2007 1 (ist week in 2007)
2007 1 2007 1
we have a routine on 0CAL_week
=====
PROGRAM UPDATE_ROUTINE.
$$ begin of global - insert your declaration only below this line -
TABLES: ...
DATA: ...
data: employee_md like /bi0/memployee,
employee_wa like /bi0/memployee,
person_md like /bi0/mperson,
PERSON_WA LIKE /BI0/MPERSON.
DATA: G_RECORD_NO LIKE SY-TABIX.
INCLUDE RS_BCT_HR_UPDATE_RULES_GENERAL.
INCLUDE RS_BCT_HR_PAPA_UPDATE_RULES.
$$ end of global - insert your declaration only before this line -
FORM compute_characteristics
TABLES MONITOR STRUCTURE RSMONITOR "user defined monitoring
USING COMM_STRUCTURE LIKE /BIC/CS0CATS_IS_1
RECORD_NO LIKE SY-TABIX
RECORD_ALL LIKE SY-TABIX
SOURCE_SYSTEM LIKE RSUPDSIMULH-LOGSYS
CHANGING RESULT LIKE /BIC/VZCATST-CALWEEK
RETURNCODE LIKE SY-SUBRC
ABORT LIKE SY-SUBRC. "set ABORT <> 0 to cancel update
$$ begin of routine - insert your code only below this line -
fill the internal table "MONITOR", to make monitor entries
data: w_date type d.
data: w_date_check type d.
data: w_numberofdays type p decimals 2.
data: w_numberofweeks type i.
data: w_dayofweek type p.
data: w_first_day_of_sap_calendar type d value '19790101'.
data: check type i.
data: w_year(4) type c.
data: w_weekno(2) type c.
w_date_check = COMM_STRUCTURE-CALDAY.
w_date = w_date_check.
w_date+04(04) = '0101'. " beginning of the year
do.
w_dayofweek = ( ( w_date - w_first_day_of_sap_calendar ) mod 7 ) + 1.
if w_dayofweek = 7. " First sunday(7) of the Current year
exit.
endif.
add 01 to w_date+07(01).
enddo.
w_numberofdays = ( w_date_check - w_date ) + 1.
w_numberofweeks = ceil( w_numberofdays / 7 ).
w_year = w_date_check+0(4).
if w_numberofweeks = 53.
w_numberofweeks = 1.
w_year = w_date_check+0(4) + 1.
endif.
if w_numberofweeks = 0.
w_numberofweeks = 52.
w_year = w_date_check+0(4) - 1.
endif.
w_weekno = w_numberofweeks.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
exporting
input = w_weekno
importing
output = w_weekno.
concatenate w_year w_weekno into RESULT.
result value of the routine
RESULT = .
if the returncode is not equal zero, the result will not be updated
RETURNCODE = 0.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
$$ end of routine - insert your code only before this line -
ENDFORM.
========
This is giving problem from 2007 year only.
We need to check with FI or HR teams , Is there any configuration settings in R/3 side for 0Calweek?
This is production ISSUE. Help me on very Urgent BASIS!!
Thanks & Regards,
Sri. -
Attachment issue --very urgent help required
Hello friends,
1)i have create page and deatal page . requirement is that we have to load required attachments in table region, if not loading required attachments exception will raise. this validation is working fine in create page.
2)same in detail page i loaded required attachments also excepiton is raising.
waht would be cause. i am very new to ADF technology.
very urgent to fix this issue. any one help me out.
Thanks,
vamshi.
Edited by: Krishna Vamshi on Jul 1, 2010 6:14 PMKirshna,
Unfortunately your question is very unclear.
Let me say that if you are asking about OA Framework, you should ask on the OA Framework forum, not here.
also excepiton is raising.It will help if you say what the exception is.
John -
Beloq query is taking time to execute and cost is 934.
The db in which it is run has lesser volume of data compared to that of prod.
There is a full table scan on psd
inspite of a pk present on table psd columns (psd_id,psd_serial_no)
also a pk present on table ltc_iss_rec columns(ltc_iss_rec_id,psd_serial_num)
Pl help to optimize the query.
select a.psd_id,a.psd_serial_no,a.sys_id,a.cosmos_ref_no,a.src_sys_asgn_ref_no,
a.bank_id,b.lc_expr_dt
from psd a,ltc_iss_rec b
where ((b.ltc_iss_rec_id >= 'T200203140731163') and (b.ltc_iss_rec_id <= 'T200606224485207'))
and a.psd_id = b.ltc_iss_rec_id
and a.psd_serial_no = b.psd_serial_num
and a.psd_typ_cod = 'ISS'
and b.lc_expr_dt <= '13-Mar-07'
and a.psd_serial_no =
select nvl(max(link_psd_ser_no),'000') from psd_link c,psd_lcs d
where c.psd_id = d.psd_id
and c.psd_serial_no = d.psd_serial_num
and c.link_psd_id = a.psd_id
and c.link_psd_id >= 'T200203140731163' and c.link_psd_id <= 'T200606224485207'
and d.update_serial_num = (
select max(update_serial_num) from psd_lcs e
where e.psd_id = d.psd_id
order by a.psd_id
Explain plan for the query :
Operation Object Name Rows Bytes Cost Object Node In/Out PStart PStop
SELECT STATEMENT Optimizer Mode=CHOOSE 1 934
SORT ORDER BY 1 96 900
FILTER
NESTED LOOPS 1 96 898
PARTITION RANGE ALL 1 2
TABLE ACCESS FULL IWH_OWNER.PSD 61 4 K 837 1 2
TABLE ACCESS BY GLOBAL INDEX ROWID IWH_OWNER.LTC_ISS_REC 1 26 1 1 1
INDEX UNIQUE SCAN IWH_OWNER.XPKLTC_ISS_REC 1
SORT AGGREGATE 1 112
HASH JOIN 1 112 34
TABLE ACCESS BY GLOBAL INDEX ROWID IWH_OWNER.PSD_LCS 1 40 2 ROWID ROW L
NESTED LOOPS 1 82 5
TABLE ACCESS BY GLOBAL INDEX ROWID IWH_OWNER.PSD_LINK 1 42 3 ROWID ROW L
INDEX RANGE SCAN IWH_OWNER.XIE1PSD_LINK 1 2
INDEX RANGE SCAN IWH_OWNER.XIE1PSD_LCS 2 1
VIEW SYS.VW_SQ_1 134 K 3 M 26
SORT GROUP BY 134 K 4 M 26
INDEX FULL SCAN IWH_OWNER.XIE1PSD_LCS 217 K 7 M 26Read this link.
When your query takes too long ...
If you really need help from any of the forum members then you should avoid using the word "urgent" and give more useful information (check the above link what I meant by useful information) rather than simply saying it's very urgent please help me. It's of no use to anybody.
Regards
Raj -
Urgent Sql Query Problem - -Very Urgent
Hi Guys,
I need a urgent solution for a problem.I am
using the following query
select ename from emp where deptno =10
Now I will declare a bind variable and if user passes 'A'
then the query will run as it is and if he passes B
then it should run the above query with this additional clause -> birthdate - hiredate >15.
Please can any one help its very urgentAssuming that you have a birthdate column in your emp table, the following will do what you are asking for:
VARIABLE bind_var VARCHAR2(1)
EXECUTE :bind_var := '&bind_variable'
SELECT ename FROM
(SELECT 'A' AS selection, ename FROM emp WHERE deptno = 10
UNION ALL
SELECT 'B' AS selection, ename FROM emp WHERE deptno = 10 AND birthdate - hiredate > 15)
WHERE selection = :bind_var
However, the clause "birthdate - hiredate > 15" will only retrieve rows for employees who were born more than 15 days after they were hired. I doubt that this is what you really want, since this is impossible. -
Insert in oracle database issue (very urgent)
Hello
I am new to this forum and also new to oracle .... I am woking in a C# 3.5 desktop application
I am Leasing data from socket (1 message per 10 millisecond) and save in queue<T> and then i have a background thread which dequeu the data and perform some calculation and create “insert sql query “ on run time NO STORE PROCEDURE just simple insert query
For example
insert into Product values(0,computer , 125.35);
I pass that insert query to my datalayer which create oracle connection and insert in to a data base. see the code below
using System.Data.OracleClient
class db
OracleConnection conns = null
public static void conn(string dbalias, string userid, string password){
try
string connString = @"server =" + dbalias + ";uid =" + userid + ";password =" + password + ";";
conns = new OracleConnection(connString);
conns.Open();
catch (OracleException e){
Console.WriteLine("Error: " + e);}}
public static void ExecuteCommand(string sqlquery)
try
OracleCommand cmd = new OracleCommand(sqlquery,conns);
cmd.ExecuteNonQuery();
NOW the problem is that inseration in oracle database is very slow please tell me how to solve this issueusing System.Data.OracleClient ????
This is the ODP.NET forum.
using Oracle.DataAccess.Client;
and reference something like: C:\Oracle\product\11.1.0\client_1\ODP.NET\bin\2.x\Oracle.DataAccess.dll
Assuming your "insert thread" is simply waiting on the next queue entry, why don't you just turn pooling off, open the connection and keep that one connection open?
I am fairly certain the speed issue has nothing to do w/the insert statement vs. stored procedure.
r,
dennis -
Reporting issue (very urgent)
Sr.No Flt.NO ORI- DES Total Flts TS OFF FC KC TS Util FC
1 IT101 BOM-BLR 20 2,680 400 2,280 2,165 230
2 IT103 BOM-BLR 20 3,216 480 2,736 2,322 245
5 IT111 BOM-BLR 24 3,216 480 2,736 2,396 159
Result BOM-BLR 64 9,200 1,360 7,800 6,900 615
6 IT102 BLR-BOM 20 2,680 400 2,280 2,222 140
9 IT110 BLR-BOM 20 3,216 480 2,736 2,543 257
10 IT112 BLR-BOM 24 3,216 480 2,736 2,257 168
Result BLR-BOM 64 9,200 1,360 7,800 7,100 530
Overall Result BOM-BLR-BOM 128 18,400 2,720 15,600
Hi all,
I have the above issue like am working on BI7 reporting and i want a monthly report and the report should be like above.The user want to see the result of each segment in the next row.And after two result rows, one over all result of the two.
When I put a filter in the report then i can see the subresult of single segment but am not able to see the rest of the Segments.It is just showing the filtered segment with the subresult. I want to see all the segments with the subresult and overall result rows.
Can it possible in the report if it is then Plz tell me how to do that.Its urgent
Ensuring points
ThankingI guess ORI-DES is a characteristic. if yes then, Ori-des should come before Flt. NO. and in properties->display, result rows should be 'Always display' to get desire result
-
Modal dialog issue - very urgent
Hi everyone,
i'm working with indesign application under asp.net. I'm using Interop.InDesign.dll. I'm able to open Indesign, but when i try to change UserInteractionLevel, then application returns error "Cannot handle the request because a modal dialog or alert is active." I can't see what modal dialog is opened because, i can't see Indesign window. It is runing in asp.net context.
When i'm opening manually Indesign then none of the modal dialogs is active.
My code:
Type indAppType = Type.GetTypeFromProgID("InDesign.Application");
objInDesign = (InDesign.Application)Activator.CreateInstance(indAppType, true);
objInDesign.ScriptPreferences.UserInteractionLevel = idUserInteractionLevels.idNeverInteract;
Do you have any solutuion for it ?
Thanks.
RegardsI have similar issues.
Initially this was caused by the splash dialog that appears the first time a user launches InDesign. Logging in with the credientals used to launch InDesign, and checking the "Dont show again" checkbox cleared it up for me.
Later, I ran into the problem again when InDesign was trying to recover some autosaved files.
This was cleared up by deleting the recovered file information from the accounts AppData folder.
I'm now getting this error again, but so far I dont know why. I have no Idea what modal dialog InDesign is trying to display. How can I tell?
I've got to say, I'm very disapointed with this behavior.
If a programmer sets ScriptPreferences.UserInteractionLevel to InDesign.idUserInteractionLevels.idNeverInteract; this should inform InDesign that its launch is part of an automated process; there is no user available to press anything, and there is likely not a desktop to display anything.
It is far more important for InDesign to respect the ScriptPreferences.UserInteractionLevel than to try and recover documents or display a welcome dialog.
But since we are stuck with this exception, I have the following questions:
Is there a way to programmatically dismiss the splash "Welcome" dialog via script command?
Is there a way to programmatically respond to the dialog that is displayed when InDesign has recovered documents?
Is there a way to programmatically determine what modal dialog is causing the exception? (app.Dialogs is empty)
Thanks! -
Error During Business Content Query Activation- Very Urgent
Hi All,
I am trying to install few queries in business cube 0pur_c01, which is already in production and already lot many queries are running.
As per requirement i have to install New quries in the 0Pur_C01
0PUR_C01_Q0012 : Ordering Activities
0PUR_C01_Q0015 : Purchase Order Values
0PUR_C01_Q0013 : Vendor Comparison re Purchase Values
0PUR_C01_Q0004 : Values Purchase Order Delivery Invoice
0PUR_C01_Q0023 : Total and Average Order Value
Out of these five quries i am unable to install 0PUR_C01_Q0012 : Ordering Activities and geeting error message during simulate install rest queries has been installed already without any issue once i have unselected the already transported
element.
I am doing the same for query 0PUR_C01_Q0012 : Ordering Activities but getting error message
Error when activating element 9W6JIW7YMO04XVOZ5ATLLFLPB
BEx transport request 'SBDK900497' is not available or not suitable
Regards
Premanshu GuptaHi,
To rectify this error,
<i>BEx transport request 'SBDK900497' is not available or not suitable</i>
Go to Transport Connection, there click on "BEX" "Create tranport request for BEX", there insert a new row, and create a new request. This is the default request for BEX queries.
While transporting , dont tranport this request, collect the objects which you want to tranport and create a new request.
<i>Error when activating element 9W6JIW7YMO04XVOZ5ATLLFLPB</i>
For this error, check the object in meta data repository, whether the object is in active version or not.I think this object is not in Active version thats why you are getting this error.
Assign points if it helps.... -
Authorisation issue(very urgent)
Hii all,
My client has asked to create a new user-id and to give a few authorisation of reports to it.Could anyone help me regarding this ASAP.
Till now I have identified the required reports & the data targets connected to it.Just help me to proceed further.
Thanks buddies.Hi,
These transaction code willbe helpful SU01,PFCG. Once you have created a role through PFGC , then goto Authorization tab of the role and need to carry out the following.
Role Name
|
>Manually Basis : Administration
>Manually Authorization Role check
>Manually Authorization :Role Check
>Activity < 03, 22 >
> Role Name < ur role name>
< > are value to be specified
And also on the menu tab please create a folder , here you can save your BEX Query as Workbooks. when you assign this role to the new User-ID , on the SAP Easy access page the user will be able to access these queries/ Workbook.
Hope this help.
cheers,
Balaji -
Hi Experts,
I knew to WF
We get the approval issue . In Ebuy of China, we have the approval workflow as go to the highest approver if the approval limit is over the default approver manager. That is User A have mgr B with limit 40,000 and mgr B have mgr C with limit 80,000. If raise a Shopping cart to 50,000, the shopping cart will go to Mgr C. User A need to add the mgr B as the first approver. But after all mgrs are added, and ordered, and back to Check status, the first 2 mgrs are disappeared. can u help on this issue?
Thanks & Regards
VijayHi Nazeer,
The value of Tan(45) is beng wrongly calculated by ABAP because internally the data type for all the Trignometric functions are represented as Floating point numbers.
Please refer to this:
The results of the following functions have the data type f:
 Trigonometric functions: cos, acos, sin, asin, tan, atan
 Hyperbolic functions: tanh, sinh, cosh
 Exponential functions (base e): exp
 Natural logarithms (base e): log
 Logarithms (base 10): log10
 Square root: sqrt
In case you have any further clarifications,do let me know.
Regards,
Puneet Jhari. -
My client is having the following issue:
In one of the plants, they set up a production order incorrectly so they want to close it, theyve settled everything off and they are trying to close it but they get an error when trying to close
"There are still unsettled Variances for the order ....(order number)"
But the order is zero and when you try to settle it, it says there is nothing to settle
Thanks,
NiviDear Nivi,
Kindly check whether all the month end process for the process order has been complete.
Overhead calcualtion
WIP calculation
Variance calculation
Settlement
Regards
Kaarthik.D -
Process chains issue:very urgent
Hi All,
This issue is related to process chains.Last weekend our Basis team changed the BW PRD from BWBPRD to BWBPRD1.The process chains were schedlued previously on BWBPRD, so after the server change none of the process chains were triggered.
We have rescheduled our process chains in the new server yesterday, but no success.
We could not find any log in the SM37 also.
Kindly suggest how to overcome this issue
Thanks,
ManjulaHi,
Check do you have connection with this new system( BWBPRD1) to your source system (R/3), and check the changed server is reflecting in SM66 or SM50. try to execute the job immediate and check chain is running or not. at the time of execution you can assign the new server to run this particular chain.
as for as your problem concerned i think your application is not active. -
2 Company Codes - Same Report --- Issue Very Urgent
Hello Guys,
I have following questions w.r.to BI implementation.
We have 40 SAP BI reports developed for our company.
Now we have moved to other New implementation for the same company but in other country. ( Germany - Company Code - DE / France - Company Code - FR ).
Both Implementation : EN Language.
We have 2 different Dev clients(ECC) for diff country implementations.But when we move to QAS they (ECC) will be integrating the data into one client,
we are using only one BI client for both implementations.
I Just have few questions ...
I need to Load all the master data for 2nd implementation all over again.
Firstly we have all the process chains and DTP and Transformations in place from !st implementation.
1.Can we use those same PC to load master data for our second implmentation with different ECC client.
2. How can we differentiate which master data belongs to which implementation when we integrate into one ECC client from BI system point of View.
3. Also they (2nd implementation) want to use the above BI reports developed from 1st implementations, with their data specific to thier company.
How can we handle above issues.
Also could you suggest the points to keep in mind when displaying the same report but with different data based on company code.
thanks,
Shekar.Hi Shekar,
1.Can we use those same PC to load master data for our second implmentation with different ECC client.
--> If source system and client is same you can use same process chains, or neet to create new one to include new infopackage for new source and client.
2. How can we differentiate which master data belongs to which implementation when we integrate into one ECC client from BI system point of View.
--> If same data(material and customer) maintained differently in different systems(ex: same technical name but description is different)... then its better to make master data objects compounding with source system to differentiate data.
http://help.sap.com/saphelp_nw04/helpdata/en/80/1a6399e07211d2acb80000e829fbfe/frameset.htm
3. Also they (2nd implementation) want to use the above BI reports developed from 1st implementations, with their data specific to thier company.
--> Create authorization variable on company and use..
How can we handle above issues.
Also could you suggest the points to keep in mind when displaying the same report but with different data based on company code.
--> Create authorization variable on company and use.. -
Internal table Issue ( very urgent)
Hi,
There are two internal tables A and B.
Product is one of the fields of both A and B and is the key.
A has say say 10 products and B has 4 products.
I want to delete those products from A which are not there in B.
( It is somewhat like using 'FOR ALL ENTERIES IN ' with Select Statement)
Is this possible in internal tables without 'Loop at'. The actual table would have over 1 million records and and looping is a major concern.
I am new to abap and any help from you guys would be appreciated.....Advait,
I think you will need atleast one loop. This loop can be on the table B.
If product is the <b>left most field</b> of table B try this:
The last field for table A must be a flag for don't delete
SORT IT_B by product.
LOOP AT IT_B INTO WA_B.
AT NEW product.
WA_A-dont_delete = 'X'.
MODIFY IT_A FROM WA_A TRANSPORTING dont_delete WHERE product = wa_b-product.
ENDAT.
ENDLOOP.
DELETE IT_A WHERE dont_delete <> 'X'.
Maybe you are looking for
-
Copy&paste formatted text from the web
Hello, I'm from IT department. Employees graphic gave me a difficult task. They need to copy text from the web browser which is underlined, into Illustrator. The problem is that while pasting the text loses it's formatting. I found the solution about
-
PsCC asking for serial number. Don't have one.
I ppayed 980yen/manth in Japan. But Photshop CC requesut enter Sirial No. I don't knomy sirial No. Why not ? Can't use PsCC. Where is my payment?
-
What is Catalog Crawler in OBIEE?
I would like to know what is catalog crawler in obiee 11g. The reason I am looking for the details is there are couple of core dumps created by catalog crawler in obiee. Thanks, Anil
-
RG23A ,RG23C register updation
Hi all, We are doin all excise entries like J1iiIN, J1iEX etc etc But our tables are not updated. Now we require to maintain RG23A and RG23C registers Can anyone help me with y this happening and how can i update the tables so that we can maintain an
-
APO jobs cancelled due to error- Time limit Exceed.
Dear All, Three jobs are scheduled daily to transfer data from R/3 to APO, These are cancelled due to error -"Time limit exceed".