Testing the SD data from R/3 in BW
Hi All,
I am extracting the sales data into Bw. I want to test the data extracted with the data in R/3. I do not know the SD transactions in R/3 to test the data. Can someone please provide me the transaction codes to see the following in R/3.
Sales Order Header Data
Sales Order Item Data
Delivery Header Data
Delivery item Data
Billing Header Data
Billing Item Data
Also, I would be grateful if someone can let me know how to see the backlogs and cancelled orders in R/3.
Thanks,
RPK.
Hi RPK,
If you don't know the transaction codes use <b>SE93</b>, press F4, goto Information System and look on description, e.g. Sales Order.
Furthermore header & item data are maintained in 1 and the same transaction, e.g. VA02 to change Sales orders (VA01 = create, VA03 = display).
For deliveries SAP has Outbound (VL01, VL02(n), VL03(n)) & Inbound ones (VL31(n), VL32(n), VL33(n))
Billing tcodes you might be looking for are VF01, VF02, VF03.
Hope this helps!
Grtx,
Marco
Message was edited by:
Marco Verbaan
Similar Messages
-
Not able to get the Qualification data from BAPI
Hi all,
I am using a BAPI (BAPI_JOBREQUIRE_GETLIST) to get the qualifiaction data for requirement profile. It's working fine earlier but I did not get the qualification data from this BAPI, although the data is there in DB against this requirement profile.
Can someone suggest me why I am getting this issue. I have looked into SDN and in BAPI documentation and found as below:
"You require authorization (structural authorization) to read the Requirements subprofile."
I am having the same User ID as I had before (when I getting back the correct data), so I don't think it should be authorization issue.
Can someone help me out in this issue please.
Thanks,
Sanket SethiHi Shiva,
It does not going to these includes at all. Message comes out with successfully done. The BApi is calling RHPP_COMMON_QUALI_READ inside, but this will not return any data. But if will call any qualification object ID, this BAPI will come up with data.
So the QP type LO profile will not come up with any kind of data, but if we pass the OTYPE as Q and pass any Qualification object ID then the data will be returned.
Is there any relationship or some other thing is missing? Any idea.
Thanks,
Sanket Sethi -
How to get the complete data from Webdynpro using a RFC
hi guys,
A form is created in the webdynpro, when that pdf form is called the user have to provide the key field ie the employee number in the form and then when he press the 'go' button a rfc is called and it gives all the details of the employee in the form. Then the user have to input some fields in the form and he have press the submit button. My problem is here, when the user is going to press the submit button that form will be converted to a stream (binary) of data and it is sent to one of the import parameter used in the RFC.
I have created a RFC and created a import parameter of data type XSTRING, since i want to see what exactly R3 is receiving from web dynpro i am writing this contant in the sever as a text file. When i saw that text file i cant see the complete data.
And when i searched in R3 the capacity of xstring is 1024 CHAR, so i dont know how to capture the entire data from webdynpro into my R3.
I give the code what i worte please tell me am i missing anything in my code, or is there any data type which can hold more than 500kb of data which is coming from webdynpro.
FUNCTION ZSEND_MAIL_ATTACHMENT.
""Local Interface:
*" IMPORTING
*" VALUE(OUT_PLACE_LEVEL) TYPE XSTRING OPTIONAL
*" VALUE(BIN_DATA) TYPE INDX_CLUST OPTIONAL
*" TABLES
*" IT_MESSAGE STRUCTURE SOLISTI1
Data Declaration
DATA: gd_cnt TYPE i,
gd_sent_all(1) TYPE c,
gd_error TYPE sy-subrc,
tab_lines LIKE sy-tabix.
Structure Declaration
DATA : BEGIN OF it_file OCCURS 0,
row(255),
END OF it_file.
DATA : BEGIN OF i_split OCCURS 0,
row(50),
END OF i_split.
Internal Table Declaration
data : it_receivers like table of SOMLRECI1 with header line."occurs 0.
DATA : objbin LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE. "sOLIX
DATA : it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
data : wa_receiver like table of SOMLRECI1 with header line.
data : it_receiver like table of SOMLRECI1 with header line.
data : v_bin_data like SOLISTI1 occurs 0 with header line.
DATA : gd_doc_data LIKE sodocchgi1 OCCURS 0 WITH HEADER LINE.
*data bin_data1 like table of solix with header line.
REFRESH : objbin, it_packing_list, it_receivers, wa_receiver.
CLEAR : objbin, it_packing_list, wa_receiver, it_receivers.
DATA V_SUBJECT(255) VALUE 'HI'.
gd_doc_data-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( it_message ).
gd_doc_data-obj_langu = sy-langu.
gd_doc_data-obj_name = 'SENDFILE'.
gd_doc_data-obj_descr = v_subject.
gd_doc_data-sensitivty = 'O'.
APPEND GD_DOC_DATA.
Appending The Internal Table it_packing_list
it_packing_list-head_start = 1.
it_packing_list-head_num = 0.
it_packing_list-body_start = 1.
it_packing_list-doc_type = 'RAW'.
it_packing_list-body_num = tab_lines.
APPEND it_packing_list.
*CALL FUNCTION 'GUI_UPLOAD'
*EXPORTING
*filename = V_FILE_PATH
*filetype = 'BIN'
*TABLES
*data_tab = BIN_DATA.
move bin_data to v_bin_data.
append v_bin_data.
*move soli to bin_data.
LOOP AT V_BIN_DATA into objbin.
MOVE v_bin_data TO objbin-line.
APPEND objbin.
ENDLOOP.
CLEAR it_packing_list.
DESCRIBE TABLE objbin LINES tab_lines.
it_packing_list-transf_bin = 'X'.
it_packing_list-head_start = 1.
it_packing_list-head_num = 1.
it_packing_list-body_start = 1.
it_packing_list-doc_type = 'PDF'.
it_packing_list-body_num = tab_lines.
it_packing_list-doc_size = tab_lines * 255.
APPEND it_packing_list.
data file(255) value '/tmp/bali.txt'.
*Appending The Internal Table it_receivers
close dataset '/tmp/bali.txt'.
open dataset '/tmp/bali.txt' for output in text mode encoding default.
if sy-subrc = 0.
loop at objbin.
transfer objbin to '/tmp/bali.txt'.
endloop.
else.
write 'hi'.
close dataset '/tmp/bali.txt'.
endif.
it_receiver-receiver = '[email protected]'.
it_receiver-rec_type = 'U'.
it_receiver-com_type = 'INT'.
APPEND wa_receiver.
move wa_receiver[] to it_receiver[].
append it_receiver.
*Move wa_receiver[] to it_receivers[].
Clear it_receivers.
if i_OUT_PLACE_LEVEL NE 0.
loop at it_receivers into wa_receiver.
loop at it_receivers into wa_receiver.
**Function Module To Post The Message To Externa Mail
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = gd_doc_data
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = it_packing_list
CONTENTS_TXT = objbin
receivers = it_receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
clear wa_receiver.
ENDFUNCTION.You have to convert your long string to a table of shorter strings.
There may be other ways, but one possibility is to use a loop to process you string.
while (there is something left)
put the next e.g. 1024 characters in a new row of your table
endwhile
If you need to reconstruct your string from the table, don't use simple concatenation since it will remove blanks at the end of lines. Believe me (from experience) sooner or later this will happen.
Instead you need to either set the subsections of your long string, or insert from the end of your table and keep shifting the contents (probably less efficient) right -
How can I restore the game data from an old ipod touch to a new one?
How can I restore the game data from an old ipod touch to a new one?
Restore it from the backup of the old ipod.
-
I use since 1 year iTunes match. Do I get a mail from apple to renew my subscription or do I have to renew my subscription for my own? I don't know the exactly date from the end of lifetime?
Kind best regards - sunshine34778The subscription will renew automatically (unless you have disabled that) and you will get an email approximately one month before renewal.
-
Multiple reads of the same data from Multiprovider by Query (Bex)
Hello, guys!
We're having issue with performance of a query built on Multiprivider. During our investigation, we've found out that within one run of a Query, it several times refers to InfoProvider for the same data (see image attached).
Do you have ideas what can be a reason for multiply reads of the same data from Multipvovider?Hello Nikita,
By "copy of a query" i meant something like this as shown below :
*Kindly click on the screenshot for a better view.
1) See the highlighted portions below in the screenshot . See Query 2 highlighted and name of the BEx query highlighted.
2) See the highlighted portions . See Query 3 highlighted and name of the BEx query highlighted.
As you can see from the above screenshots i have used the same BEx query 2 times by the name of Query 2 & Query 3 . Infact i have not attached the complete screenhsot . In that i have used it 6 times.
I have to analyze this a bit in detail but what i am guessing is that when this WEBi is called the single BEx is also called multiple times. And hence it hits the Info Provider multiple times resulting in a decreased performance.
But this does not mean that this is wrong approach. There are various areas where you can improve for example :
1) Either improve your BEx query if possible or use aggregates or something like that .
2) Use the Query stripping setting in WEBi so that unused dimensions and measures are not pulled resulting in an improved performance. It's switched on by default.
Thanks!!
Regards,
Ashutosh Singh -
How to delete the duplicate data from PSA Table
Dear All,
How to delete the duplicate data from PSA Table, I have the purchase cube and I am getting the data from Item data source.
In PSA table, I found the some cancellation records for that particular records quantity would be negative for the same record value would be positive.
Due to this reason the quantity is updated to target but the values would summarized and got the summarized value of all normal and cancellation .
Please let me know the solution how to delete the data while updating to the target.
Thanks
Regards,
SaiHi,
in deleting the records in PSA table difficult and how many you will the delete.
you can achieve the different ways.
1. creating the DSO maintain the some key fields it will overwrite the based on key fields.
2. you can write the ABAP logic deleting the duplicate records at info package level check with the your ABAPer.
3.you can restrict the cancellation records at query level.
Thanks,
Phani. -
I had set up Firefox sync on my Windows 7 Laptop which crashed and I had to reinstall windows. I used to be able to share content with my Firefox synced Android too. Is there a way i can retrieve the synced data from the Mozilla servers? I tried to set up sync on my new installation on a Mac 10.6 but when i click on Set-up Sync it asks me:
# Set-up new sync account (i already have one)
# I already have a sync account
When i select the second option it tells me to Add a device. I went in the "Sync Options" and tried the replace all data on this computer with my sync data, but nothing happened. When i try to connect from my Android it also asks me to add a device with the 3 boxes with letters in them.
So in both the cases it is asking me to "Add a device" but i cannot connect to my sync account in either case to sync data from therePlease search the forums. This has been covered here extensively.
-
How to get the forecast data from SCM into BW
Hello,
Is there a table or Function module in SCM F&R that can be used to transfer the forecast data from SCM F&R into BW? I dont see any Business content datasources that has the forecast data.
I would like to get the future forecast data. For ex, if there is a forecast for a material and Site for the next 52 weeks, I would like to retrieve
the same from SCM. I dont see any business content. The closest would be 0FRE_ANA_WEEKLY_1. But it has only the past data, not the future data.
Thanks,
SBS.Hi,
You would follow the same process as you would for getting data from a R3 system to BW, i.e generate datsources on the APO side and then set the extraction to flow from APO to BW. On the BW side, you'll need a source system for the APO, replicate datsources, set up update and transfer rules in the infosource and then load data to the data targets.
Cheers,
Kedar -
How to delete the Hierarchy data from Infoobjects.
How to delete the Hierarchy data from Infoobjects. In my case I had 300 records in the corresponding table of info object.
When i was trying to delete the hierarchy data, I am getting error message. "Some master data not deleted". Can any one tell me to delete all these records by using a program.Hi
Go to SE11 and enter the hierarchy table name.
/BIC/H....(infoobject name)...and execute the table and select table entry and delete all....
Thanks
TG -
How to display the updated data from db to user interface in sruts framewor
A beginner in this area, I have been able to read a record from a
MySQL database and populate in jsp form . Now, my goal is to
allow the user to edit the contents of the form and then update the
record in MySQL and then display the same in jsp. page
The scenario in detail
1)the data is fetched from db and displayed in non-editable format
2)Next button is clicked
3)Now in the same jsp page I view the same data from db in editable format
4)The user is allowed to change the information
5)Now update button is clicked
6)the records are updated in the db -Finished doing till this step
7)But the updated info in non - editable format to be displayed in jsp page is left pending.
Here is my code for jsp,i want know how to write an action for this,tried doing the same in java and I'm successful.but what I need is how to fetch the updated information in the user interface.
I've made both editable as well as non editable info in the same page with different actions.
pl help me,I'm a newbie
<%@ taglib uri="/WEB-INF/struts-bean" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic" prefix="logic" %>
<%@ page language="java" %>
<%@ page import="java.util.ArrayList,java.util.Iterator" %>
<%@ page import="com.finocus.common.container.CustomerDetailsTest;" %>
<html:html>
<head>
<title>CUSTOMER DISPLAY</title>
</head>
<body>
<table width="100%" bgcolor="darkkhaki">
<tr>
<td><table width="100%" bgcolor="indigo">
<tr>
<td><font color="white">Display</font></td>
<td><font color="white">Update</font></td>
<td><font color="white">Verify</font></td>
<td><font color="white">Confirm</font></td>
</tr>
</table>
</td>
</tr>
<%
//Container for holding data
ArrayList list = (ArrayList)session.getAttribute("CUSTOMERDETAILS");
Iterator itr=list.iterator();
while(itr.hasNext())
CustomerDetailsTest cust = (CustomerDetailsTest) itr.next();
System.out.println("testGetCustomerDetails()-successed. retrieved CustomerDetailsTest="+cust.toString());
%>
<%
//Session for checking whether edit or non-edit mode
String pageMode = (String)session.getAttribute("CUSTOMER_PAGE_MODE");
session.removeAttribute("CUSTOMER_PAGE_MODE");
if(null==pageMode)
pageMode = "EDIT";
if(pageMode.equals("EDIT"))
//display data in the form
System.out.println("Editable mode");
%>
<html:form action="/nonedit">
<tr>
<td><table width="100%" bgcolor="darkkhaki">
<tr>
<td><b><bean:message key="label.id"/></b></td>
<td><font color="red"><%=cust.getCusId()%></font></td>
</tr><br>
<td>
<font color="brown" face="Courier New"><b>
<bean:message key="label.Company"/></b>
</td><br>
<tr>
<td><bean:message key="label.cname"/></td>
<td><font color="blue"><html:text property="name" value="<%=cust.getCname()%>"/></font></td>
<td><bean:message key="label.cphone"/></td>
<td><font color="blue"><html:text property="phone" value="<%=cust.getCphone()%>"/></font></td>
</tr><br>
<tr>
<td><bean:message key="label.caddr1"/></td>
<td><font color="blue"><html:text property="address1" value="<%=cust.getCaddress1()%>"/></font></td>
<td><bean:message key="label.cemail"/></td>
<td><font color="blue"><html:text property="email" value="<%=cust.getCemail()%>"/></font></td>
</tr><br>
<tr>
<td><bean:message key="label.caddr2"/></td>
<td><font color="blue"><html:text property="address2" value="<%=cust.getCaddress2()%>"/></font></td>
<td><bean:message key="label.cfax"/></td>
<td><font color="blue"><html:text property="fax" value="<%=cust.getCfax()%>"/></font></td>
</tr><br>
<tr>
<td><bean:message key="label.ccity"/></td>
<td><font color="blue"><html:text property="city" value="<%=cust.getCcity()%>"/></font></td>
<td><bean:message key="label.czip"/></td>
<td><font color="blue"><html:text property="zip" value="<%=cust.getZip()%>"/></font></td>
</tr><br>
<tr>
<td><b><bean:message key="label.cstate"/></b></td>
<td><font color="red"><html:text property="state" value="<%=cust.getCstate()%>"/></font></td>
</tr><br>
<td>
<font color="brown" face="Courier New"><b>
<bean:message key="label.Admin"/></b>
</td><br>
<tr>
<td><b><bean:message key="label.AAname"/></b></td>
<td><font color="red"><html:text property="adminname" value="<%=cust.getAname()%>"/></font></td>
</tr><br>
<tr>
<td><b><bean:message key="label.AAemail"/></b></td>
<td><font color="red"><html:text property="adminemail" value="<%=cust.getAemail()%>"/></font></td>
</tr><br>
<tr>
<td><b><bean:message key="label.AAphone"/></b></td>
<td><font color="red"><html:text property="adminphone" value="<%=cust.getAphone()%>"/></font></td>
</tr><br>
<td>
<font color="brown" face="Courier New"><b>
<bean:message key="label.User"/></b>
</td><br>
<tr>
<td><b><bean:message key="label.AUname"/></b></td>
<td><font color="red"><html:text property="adminusername" value="<%=cust.getUname()%>"/></font></td>
</tr><br>
<tr>
<td><b><bean:message key="label.AUemail"/></b></td>
<td><font color="red"><html:text property="adminuseremail" value="<%=cust.getUemail()%>"/></font></td>
</tr><br>
<tr align="center">
<td><html:cancel value="Cancel"/>
<html:submit value="Next"/></td>
</tr>
</html:form>
<%
}else
//display data in the text
System.out.println("Non-Editable mode");
%>
<html:form action="/edit">
<tr>
<td><table width="100%" bgcolor="darkkhaki">
<tr>
<td><b><bean:message key="label.id"/></b></td>
<td><font color="red"><%=cust.getCusId()%></font></td>
<td><b><bean:message key="label.status"/></b></td>
<td><font color="red"><%=cust.getStatus() %></font></td>
</tr><br>
<td>
<font color="brown" face="Courier New"><b>
<bean:message key="label.Company"/></b>
</td><br>
<tr>
<td><bean:message key="label.cname"/></td>
<td><font color="blue"><%=cust.getCname()%></font></td>
<td><bean:message key="label.cphone"/></td>
<td><font color="blue"><%=cust.getCphone()%></font></td>
</tr><br>
<tr>
<td><bean:message key="label.caddr1"/></td>
<td><font color="blue"><%=cust.getCaddress1()%></font></td>
<td><bean:message key="label.cemail"/></td>
<td><font color="blue"><%=cust.getCemail()%></font></td>
</tr><br>
<tr>
<td><bean:message key="label.caddr2"/></td>
<td><font color="blue"><%=cust.getCaddress2()%></font></td>
<td><bean:message key="label.cfax"/></td>
<td><font color="blue"><%=cust.getCfax()%></font></td>
</tr><br>
<tr>
<td><bean:message key="label.ccity"/></td>
<td><font color="blue"><%=cust.getCcity()%></font></td>
<td><bean:message key="label.czip"/></td>
<td><font color="blue"><%=cust.getZip()%></font></td>
</tr><br>
<tr>
<td><b><bean:message key="label.cstate"/></b></td>
<td><font color="red"><%=cust.getCstate()%></font></td>
</tr><br>
<td>
<font color="brown" face="Courier New"><b>
<bean:message key="label.Admin"/></b>
</td><br>
<tr>
<td><b><bean:message key="label.AAname"/></b></td>
<td><font color="red"><%=cust.getAname()%></font></td>
</tr><br>
<tr>
<td><b><bean:message key="label.AAemail"/></b></td>
<td><font color="red"><%=cust.getAemail()%></font></td>
</tr><br>
<tr>
<td><b><bean:message key="label.AAphone"/></b></td>
<td><font color="red"><%=cust.getAphone()%></font></td>
</tr><br>
<td>
<font color="brown" face="Courier New"><b>
<bean:message key="label.User"/></b>
</td><br>
<tr>
<td><b><bean:message key="label.AUname"/></b></td>
<td><font color="red"><%=cust.getUname()%></font></td>
</tr><br>
<tr>
<td><b><bean:message key="label.AUemail"/></b></td>
<td><font color="red"><%=cust.getUemail()%></font></td>
</tr><br>
<tr align="center">
<td><html:submit value="Update"/></td>
</tr>
</html:form>
<%
%>
<%
%>
</table>
</td>
</tr>
</table>
</body>
</html:html>u r using action classes. so after calling the insert method in Action Class to a dao... the next statement should be retrieve statement. so at the time of updating first it will get updated.. the next statement it will execute is retrieve and then set these details in VO or FORM and show it on JSP
Message was edited by:
leo_michael -
Need to know the sqluery to find the disabled date from OIM 9.1.0.1
Hi Experts,
Need very urgent inputs from you all for the preparation of our audit.
We are using OIM9.1.0.1
We need to know the sqlquery for finding the Disabled date in OIM given the user ids, as currently we are unable to get the exact data from Historical Reports Option in OIM.
I need to give in this format:
select usr_login, usr_disabled from schemaname.tablename where usr_login in
('aaa','bbb'..... etc)
We have three attributes :USR_DISABLED_BY_PARENT,USR_DISABLED,USR_DEPROVISIONING_DATE,but none of them give the exact date,
USR_DISABLED gives just a flag as 1 or 0.
Also there are no other fields in the corresponding usr table.
So how to fetch the exact Disabled date from OIM system when I input the user ids.
Your immediate response is appreciated.
Thanks
SSIn the entire thread many experts have given nice queries in different formats...
The best approach would be to open up the SQL Developer, connect with the OIM Database and experiment with all sorts of SQL queries provided by all the experts..
Learn some SQL techniques, like Inner Join etc...
Then you yourself will be able to figure out what you need, in exactly which format, for which users and for whom you have to restrict
Then not only this question, you would be able to solve dozens of similar such issues yourself...
And trust me, nothing can match that...
Just in case, you are not familiar with SQL Developer,
http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html
Oracle SQL Developer 3.2.1 (3.2.10.09.57)
September 24, 2012
The Disabled DATE will be the creation date of that entry in the UPA_FIELDS table when Users.Status changed to Disabled.
SELECT USR.USR_LOGIN, UPA_FIELDS.CREATE_DATE
FROM UPA_FIELDS
WHERE UPA_FIELDS.FIELD_NAME='Users.Status'
AND UPA_FIELDS.FIELD_NEW_VALUE='Disabled'
AND UPA_FIELDS.UPA_USR_KEY=USR.USR_KEY
AND USR.USR_LOGIN NOT IN ('XELSYSADM', 'XELOPERATOR', 'WEBLOGIC'); -
I have error while testing the system created from a sap business objects template in SAP portal
I have error while testing the system created from a sap business objects template in SAP portal. Error text:
com.sapportals.connector.connection.ConnectionFailedException: Connection Failed: A nested exception occurred. Could not initialize physical connection. Connection Failed: A nested exception occurred. Could not initialize physical connection. Connection Failed: A nested exception occurred. Could not create JCO connection. 'mshost' missing
I configure integration SAP portal and SAP BW system. All system requirements are complied.
Environment
SAP Business Objects 4.0
SAP BW 7.31
1. I configure SSSO between SAP BW and SAP Business Objects Enterprise 4.0
2. Next I setting integration SAP PORTAL with SAP BW system
3. I download certificate from portal. Select Certificates and key (http://sapserver:port/nwa) – See scren_
4. In next window selected Ticketkeystore and Saplogonticketpair-cert( near part window form)
5. Select Export entry button and binary format file certificate for download. Press download.
6. Save certificate file in local PC folder
In next step need export certificate file to SAP system. Sequence of step:
1. Run STRUSTSS02 transaction .
2. Chose certificate ->import.
3. Select downloaded certificate file
4. Select Add to certificate list button and Add to ACL button
5. Inter System ID and Client(000)
6. In next I download iview sap business objects template into sap portal: System administration->transport->Import. And select and download sap business Objects iview template in .epa format into sap portal.
7. Result – downloaded iview.
8. In next step I create system from template. System administration->system landscape.
9. In next step I input parameters for my system in Connector category, Sap business objects and user management categories: See screen _2
10. When I created the system and test the connection error occurred: See screen_3
This issue is important enough. I would be grateful for opinions and ideas. Thanks in advance.Did you find a solution?
-
How to upload the master data from legacy to SAP
Hi Frends,
how to upload the master data from legacy system to SAP System once the configuration is over.how to carry forward the open items of vendors and customers while uploading.who will upload functional consultantsor ABAPER.
please clarify me
Regards
Sap GuruHi ,
use LSMW or BDC for uploading Master & transaction data.
This work is done by the Respective Functional team.
Chandra -
To retrieve the Maximum Date from the record
Hi All,
I am using the bleow query to retrieve the max date from the record list:
select w.wr_no,w.customer_id,w.place_id, w.entry_Date, max(app.appointment_date) as appointment_date
from work_request w , wr_appointment app
where w.wr_no=app.wr_no
and w.customer_id = '020167001'
and w.place_id = '1151667'
group by w.wr_no, w.customer_id,w.place_id, w.entry_Date;
However i am getting the as many as three rows even after using the max function. The max date comes as the last record out the three rows retrieved.
Thanks,
MarkMark Andrew wrote:
And for Sven for the above customer id and place id, i receive the below result:
WR_NO CUSTOMER_ID PLACE_ID ENTRY_DATE APPOINTMENT_DATE
1306782233 020167001 1151667 26/07/2010 29/07/2010
1387090103 020167001 1151667 26/02/2010 16/03/2010
1393896673 020167001 1151667 23/01/2011 25/01/2011
After using the rank function i will be receiving:
WR_NO CUSTOMER_ID PLACE_ID ENTRY_DATE APPOINTMENT_DATE RK
1393896673 020167001 1151667 23/01/2011 25/01/2011 1Now I get it.
In fact you want to group only on the customer (and place_id?) and get all the information from the line with the last appointment date.
Analytic functions such as RANK or ROW_NUMBER are good for this.
The select can look like this.
select * from (
select w.wr_no,w.customer_id,w.place_id, w.entry_Date, app.appointment_date,
row_number() over (partition by w.customer_id, w.place_id order by app.appointment_date desc, w.wr_no desc) rn
from work_request w , wr_appointment app
where w.wr_no=app.wr_no
--and w.customer_id = '020167001'
--and w.place_id = '1151667'
where rn = 1
;In fact I think you can do the same operation in EXCEL directly.
FIrst you need to sort the data by customer (asc), place (asc) and appointment date (desc).
Then add a column in excel that give you the line where you have a new customer id.
Assuming this new column is column H and the customerid is in column A then the function in Cell H2 would look like this.
A function like ("=A2=A1"). Copy this formular to all the other H cells.
Then add a auto filter on it and only select all the rows where the result is FALSE.
Same logic as in SQL, but done in Excel.
Maybe you are looking for
-
While trying to integrate another company's applet into our system, I realized I was going to have to write my own TransferHandler to handle pasting content from Microsoft Word. Soon after, I realized that you must also override other methods of Tran
-
How to retrieve unique records with more than one column
I have a table sps_prod as described below - POGNAME VARCHAR2(1500) INDEX#VERSION VARCHAR2(200) POG_MODEL_STATUS VARCHAR2(100) POG_LAYOUT_TYPE VARCHAR2(500) POG_MARKET_SPECIFIC VARCHAR2(500) POG_CONTACT_NUMBER VARCHAR2(100) AREA_SUPPORTED VARCHAR2(50
-
Changing the nextval of a sequence using alter sequence
Hello experts, Is there any option to modify the nextval of a sequence using alter sequece command? Thanks in advance. J.Prakash
-
ROGUES containing or friendly ap
Hello, I've got a huge wireless network enviroment and I need to filter a lot of warnings in Cisco PRIME Infrastructure (PI) / WLC related to "Rogue Alarms" My network is in an urban enviroment and there's lot of residential buldings surround my netw
-
Problem with Desktop Manager Synchronisation
I have version 4.7.0.25 running on Vista. When synchronising it reads the calender etc on the device OK but as soon as it reads the desktop calender it freezes with message 'Desktop Manager Stopped Working'. I have reloaded the software several times