How to get Most current record in the reporting
Hi All,
I have reporting requiremnt like to get the most recent record.
Please see the below example we have 3 records but with 2 different sales represtentatives assigened to the same document.but i need to get most recently assigned sales representative record that is number 2(10726056 and status open).
Now i am geeting the 2 open records .Need to get only one.we do not have any other difference in the records to keep track of the sales representatives assignment to get the new sales rep id other than request id.
Can any one tell me most rcurrent data varibles under the request id do.Will it solves my issues o r any other ideas please welcome.
Customer No Sales rep Doc number Status Request id
0000613086 10726056 9000783660 C REQU_1
0000613086 10726056 9000783660 O REQU_1
0000613086 10182679 9000783660 O REQU_2
Hi Sirisha,
it seems to be a problem of the kind "exception aggregation" , but let me say it can result in a very complex solution.
What about using a Virtual Infoprovider with servicecs to solve the issue?
You should create an additional InfoCube that reads form the basic one (where you have data) and then you should "delete" invalid records considering the request number.
By the way time stamp seems to be the easier solution.
Hope it helps
GFV
Similar Messages
-
How to get first 10 records from the database using JSP
i want ot get first 10 records from the database and then after clicking the next button in the page,it must show the next precceding 10 records from the database.i am getting the first 10 records .but how to post to the same page to get another preceeding 10 record.
Search the forums - this has been asked a lot. I usually recommend experimenting with tops and order bys until you're satisfied.
Kind regards,
Levi -
How to Get Most Current User View Before Checking In.
Hi,
We have several custom workflows which users can start from end-user menu and have some resource accounts created/modified after approvals.
User view is checked out once at the beginning of each workflow, then some user attributes are modified through forms and user view is checked in with new attributes at the end.
If any user starts a workflow (say W2) before completion of another workflow (say W1) he started before, and W1 is completed when W2 is waiting for approvals or etc., W2 completely discards changes made to user view through W1 since it has already checked out the user view before.
If I checkout the user once more just before checkin, I'm able to get a current user view but this time changes made through forms used in the current workflow are lost.
What's the best way, to get an updated user view of the user without overwriting any changes made out of the running workflow and losing form data?
Regards,
Mehtap.In a situation like this, you should probably change the front end to store the changes in workflow variables instead of using the view directly. Then, post approval, you checkout the view and apply the changes. I've used this approach to perform changes on large numbers of users (kind of like a bulk action, only more reliable).
Alternatively, you can checkout the user object at the beginning of the workflow, and this will prevent your race condition by putting a lock on it. This will obviously cause problems (for you) if your users expect to be able to do multiple changes simultaneously. Don't try this approach if an angry mob will storm your cubicle -- IDM coders are hard to come by.
Jason -
How to get USERID system parameter in the report
I can pass the user id, password and connect string through the USERID parameter, but how do I get it in the report? (I need to pass the USERID to a different report, I got a error when I use :USERID). Thanks.
WJThere are two steps I used with which to get USERID into the report.
1) Create a user parameter, P_USER, datatype CHARACTER, width 20
2) in Report Trigger AFTER PARAMETER FORM (could also be BEFORE REPORT), insert the following line of code:
:P_USER := USER;
Now you can create an F_USER variable with P_USER as its source and place it in the report as you would with any other user parameter.
Regards,
Steve -
How to get a field value in the report
hi all :-
i need to get the field value in the formate trigger inside a specified field in the report?please post your request in the report category forum
-
Urgent help(getting lastest date records in the report)
Hi
I have records like this for a particular '0Material'.
0MATERIAL STATUS UDATE
M1 I0068 2/11/2007
M1 I0070 10/11/2007
M1 I0072 22/11/2007
My Client enters the 'UDATE' value in the selection screen. And My Client wants latest records with corresponding 'UDATE'.
1)Suppose my client enter the 'UDATE' as 1/11/2007 - 15/11/2007 then he need to gets
M1 I0070 10/11/2007
2)Suppose my client enter the 'UDATE' as 1/11/2007 - 30/11/2007 then he need to gets
M1 I0072 22/11/2007
3)Suppose my client enter the 'UDATE' as 1/11/2007 - 3/11/2007 then he need to gets
M1 I0068 2/11/2007
So how can do like this for the user. please tell me im unable to solve this problem since three days.
Regards
kumarHI,
You can achive this by creating a variable on Udate processing type as customer exit. you have to write some code in RSR00001 Enhancement. Just tell the logic to ur ABAPer they will provide u the code. Or search in forum u will get the code. It will be a very simple one.
Khaja -
Get three previous records of the current record
Hi,
I need to get three previous records of the current record in an Oracle Form
Sorry for the lengthy explanation:
I have a table name: ARCHIVE_DATA with column name: coll_time and its data type DATE.
SQL> SELECT COLL_TIME FROM ARCHIVE_DATA;
COLL_TIME
12-AUG-05
12-AUG-05
12-AUG-05
12-AUG-05
12-AUG-05
12-AUG-05
12-AUG-05
12-AUG-05
12-AUG-05
12-AUG-05
10 rows selected.
SQL> select to_char(coll_time,'dd-mon-yyyy:HH:MI:SS') from ARCHIVE_DATA;
TO_CHAR(COLL_TIME)
12-aug-2005:02:42:00
12-aug-2005:02:43:00
12-aug-2005:02:44:00
12-aug-2005:02:45:00
12-aug-2005:02:46:00
12-aug-2005:02:47:00
12-aug-2005:02:48:00
12-aug-2005:02:49:00
12-aug-2005:02:50:00
12-aug-2005:02:51:00
10 rows selected.
This is the Requirement:
In a Form's Block(BLK1), for example: the current_record is the fifth record from the top
(i.e. 12-aug-2005:02:46:00)
When the fifth record is the current_record and When I click a button, three previous records of the
current_record should be populated on the screen.
See what I did:
I created another table same as the first table(ARCHIVE_DATA) and its name is: THREE_RECS.
I am inserting three records from the first table(ARCHIVE_DATA) into the second table: THREE_RECS
which are less than the current record and ORDER BY DESC.
CANVAS:
Two blocks (BLK1, BLK2) based on ARCHIVE_DATA and THREE_RECS are on the same CANVAS.
But the first block (BLK1) which is based on the first table:ARCHIVE_DATA is populated with one record and the
second block (BLK2) is empty.
So when I click a particular button (ex: prev_recs), the second block(BLK2) should be populated with
three previous records of the current record( :BLK1.COLL_TIME)
(off course :BLK2 populates with one record and use arrows or scrollbar to get the other two records)
This is the code I wrote in the trigger and followed by the error:
1 BEGIN
2 DECLARE
3 cursor c1 IS
4 SELECT MONITOR_ID,
5 SAMPLE_ID,
6 COLL_TIME,
7 DEW_POINT
8 FROM ARCHIVE_DATA;
9 cursor c2(passing_date IN date) IS
10 SELECT MONITOR_ID,
11 SAMPLE_ID,
12 COLL_TIME,
13 DEW_POINT
14 FROM (SELECT MONITOR_ID,
15 SAMPLE_ID,
16 COLL_TIME,
17 DEW_POINT
18 FROM ARCHIVE_DATA
19 ORDER BY COLL_TIME desc)
20 WHERE COLL_TIME < passing_date;
21 BEGIN
22 FOR cur_rec in c1
23 LOOP
24 IF (cur_rec.COLL_TIME = to_date(:BLK.COLL_TIME,'dd-mon-yyyy:HH24:mi:ss')) then
25 FOR second_cur_rec in c2(second_cur_rec.COLL_TIME)
26 LOOP
27 IF c2%rowcount < 4 then
28 BEGIN
29 INSERT INTO THREE_RECS
30 values(second_cur_rec.MONITOR_ID,
31 second_cur_rec.SAMPLE_ID,
32 second_cur_rec.COLL_TIME,
33 second_cur_rec.DEW_POINT);
34 COMMIT;
35 END IF;
36 END LOOP;
37 END IF;
38 END LOOP;
39 END;
40 END;
This is the error I am getting:
Error 103 at line 14
Encountered the symbol "(" when expecting one of the following
a PL/SQL variable or double quoted string
an expanded name
an expanded name link
a table reference __expression
a key word
Resuming parse at line 126, column 46
Thanks in advanceWhy not just a simple select that doesn't involve a second table and PL/SQL?
sql>select * from t1 order by dt;
DT
08/12/2005 02:42:00am
08/12/2005 02:43:00am
08/12/2005 02:44:00am
08/12/2005 02:45:00am
08/12/2005 02:46:00am
08/12/2005 02:47:00am
08/12/2005 02:48:00am
08/12/2005 02:49:00am
08/12/2005 02:50:00am
08/12/2005 02:51:00am
10 rows selected.
sql>select dt
2 from (select dt, row_number() over (order by dt desc) rn
3 from t1
4 where dt < to_date('12-aug-2005:02:46:00', 'dd-mon-yyyy:hh:mi:ss'))
5 where rn <= 3
6 order by dt;
DT
08/12/2005 02:43:00am
08/12/2005 02:44:00am
08/12/2005 02:45:00am
3 rows selected.If the use of an analytical function (row_number()) is a problem with Forms, then the query can also be done as:
sql>select dt
2 from (select dt
3 from (select dt
4 from t1
5 where dt < to_date('12-aug-2005:02:46:00', 'dd-mon-yyyy:hh:mi:ss')
6 order by dt desc)
7 where rownum <= 3)
8 order by dt;
DT
08/12/2005 02:43:00am
08/12/2005 02:44:00am
08/12/2005 02:45:00am
3 rows selected. -
Get three previous records of the current record in an Oracle Form
Hi,
I need to get three previous records of the current record in an Oracle Form
Sorry for the lengthy explanation:
I have a table name: ARCHIVE_DATA with column name: coll_time and its data type DATE.
SQL> SELECT COLL_TIME FROM ARCHIVE_DATA;
COLL_TIME
12-AUG-05
12-AUG-05
12-AUG-05
12-AUG-05
12-AUG-05
12-AUG-05
12-AUG-05
12-AUG-05
12-AUG-05
12-AUG-05
10 rows selected.
SQL> select to_char(coll_time,'dd-mon-yyyy:HH:MI:SS') from ARCHIVE_DATA;
TO_CHAR(COLL_TIME)
12-aug-2005:02:42:00
12-aug-2005:02:43:00
12-aug-2005:02:44:00
12-aug-2005:02:45:00
12-aug-2005:02:46:00
12-aug-2005:02:47:00
12-aug-2005:02:48:00
12-aug-2005:02:49:00
12-aug-2005:02:50:00
12-aug-2005:02:51:00
10 rows selected.
This is the Requirement:
In a Form's Block(BLK1), for example: the current_record is the fifth record from the top
(i.e. 12-aug-2005:02:46:00)
When the fifth record is the current_record and When I click a button, three previous records of the
current_record should be populated on the screen.
See what I did:
I created another table same as the first table(ARCHIVE_DATA) and its name is: THREE_RECS.
I am inserting three records from the first table(ARCHIVE_DATA) into the second table: THREE_RECS
which are less than the current record and ORDER BY DESC.
CANVAS:
Two blocks (BLK1, BLK2) based on ARCHIVE_DATA and THREE_RECS are on the same CANVAS.
But the first block (BLK1) which is based on the first table:ARCHIVE_DATA is populated with one record and the
second block (BLK2) is empty.
So when I click a particular button (ex: prev_recs), the second block(BLK2) should be populated with
three previous records of the current record( :BLK1.COLL_TIME)
(off course :BLK2 populates with one record and use arrows or scrollbar to get the other two records)
This is the code I wrote in the trigger and followed by the error:
1 BEGIN
2 DECLARE
3 cursor c1 IS
4 SELECT MONITOR_ID,
5 SAMPLE_ID,
6 COLL_TIME,
7 DEW_POINT
8 FROM ARCHIVE_DATA;
9 cursor c2(passing_date IN date) IS
10 SELECT MONITOR_ID,
11 SAMPLE_ID,
12 COLL_TIME,
13 DEW_POINT
14 FROM (SELECT MONITOR_ID,
15 SAMPLE_ID,
16 COLL_TIME,
17 DEW_POINT
18 FROM ARCHIVE_DATA
19 ORDER BY COLL_TIME desc)
20 WHERE COLL_TIME < passing_date;
21 BEGIN
22 FOR cur_rec in c1
23 LOOP
24 IF (cur_rec.COLL_TIME = to_date(:BLK.COLL_TIME,'dd-mon-yyyy:HH24:mi:ss')) then
25 FOR second_cur_rec in c2(second_cur_rec.COLL_TIME)
26 LOOP
27 IF c2%rowcount < 4 then
28 BEGIN
29 INSERT INTO THREE_RECS
30 values(second_cur_rec.MONITOR_ID,
31 second_cur_rec.SAMPLE_ID,
32 second_cur_rec.COLL_TIME,
33 second_cur_rec.DEW_POINT);
34 COMMIT;
35 END IF;
36 END LOOP;
37 END IF;
38 END LOOP;
39 END;
40 END;
This is the error I am getting:
Error 103 at line 14
Encountered the symbol "(" when expecting one of the following
a PL/SQL variable or double quoted string
an expanded name
an expanded name link
a table reference __expression
a key word
Resuming parse at line 126, column 46
Thanks in advanceChange C2 to:
cursor c2(passing_date IN date) IS
SELECT MONITOR_ID, SAMPLE_ID,
COLL_TIME, DEW_POINT
FROM ARCHIVE_DATA
WHERE COLL_TIME < passing_date
ORDER BY COLL_TIME desc;And rather than populating a table with the three records, you could just select the three records using: where COLL_TIME between Prev3_time and Prev1_time -
How to get only current exception message from tables
Hi
In my sceanario , I want to have the list of Current MRP exception messages list from table
I understand that MRP detailed lists, including all exception messages, are stored in transparent table MDKP and cluster table MDTC.
I can tell ABAPer to write a report for me , to read the data from these tables , but I guess these tables contain old exception message also , which are not currently appearing in MRP list
How to get only current exception message
Rgds,
sandeepSandeep,
MDTC contains only data from the most recent MRP run. So, all messages you see are those which are currently valid.
The messages might have first appeared during a previous run, but they still need to be addressed.
Before you invest a lot of time and effort into writing and debugging a custom report, you should probably try to use the standard SAP functionality found in MD06. On the Processing indicator tab, you can select "Only with new exceptions". Here you can tag a material/plant as 'processed', and thereafter, the exceptions that existed there before you tagged the part will not be re-displayed.
Best Regards,
DB49 -
Anyone know how to get a free upgrade on the OSx 10.6
I've been searching all night, and cant seemtofigure out how to get a free upgrade of the OS X 10.6! Anyone know where or how?
There is no free upgrade.
Do you currently have the 10.5.8 Combo update loaded? (if not download and apply the Mac OS X 10.5.8 Combo Update )
Then, check that your machine is suitable for Snow Leopard. It needs to be a Mac computer with an Intel Core 2 Duo processor. Check by reading the specs.
Mac OS X v10.6 Snow Leopard -Read the Technical Specifications
Snow Leopard is a paid upgrade by DVD not a download. To buy the DVD, if you are from the USA go to … http://store.apple.com/us/product/MC573/mac-os-x-106-snow-leopard.
In Europe or otherwise substitute your national code in place of /us above.
In UK go to Apple Store UK Mac OS X 10.6 Snow Leopard - Apple Store (UK)
Before you start upgrading, back up your files. If you are unsure how best to do this, the following link is hugely informative. Most commonly used backup methods: Apple Support Communities.
Once you have upgraded to Snow Leopard, if your upgrade took you to 10.6.3 you will need to download and apply the Combo updater. Mac OS X 10.6.8 Update Combo v1.1 and follow with software updates to pick up the most recent security and iTunes updates. -
DATA TRANSFER - How to get a SINGLE SPACE in the downloaded file from UNIX?
Hi Experts,
Am sending data from SAP to UNIX/ Application server and text file on desk top as well.
So, I am keeping a single character just SPACE at the END of each record.
Then, When I see the downloaded text file, I found a SINGLE SPACE at the end of each record, fine.
Then, by using CG3Y t code, I downloaded the UNIX file to my desk top.
But, When I see this UNIX downloaded file from UNIX, I did NOT find any SPACE at the end of each record!!!
Am doing every thing same in both cases.
So,
1 - Why its happening in case of UNIX file?
2 - How to get a SINGLE SPACE at the END in the downloaded file from UNIX?
thanqHi,
I don't know if this works:
perform SET_TRAIL_BLANKS(saplgrap) using 'X'.
perform SET_FIXLEN(saplgrap) using '0' '060'. "put length of your line from-to
... download ...
It will put space at the end of your line, according to the length.
Hope it works,
Chang -
How to get values/data stored in the database into a list-item.
how to get values/data stored in the database into a list-item.
i tried to make a list item without any values assigned to it...but i got the below error.
FRM-30191: No list items defined for required poplist.
or
FRM-32082: Invalid value for given item type.
List EMPNO
Item: EMPNO
Block: EMP
Form: MODULE5
FRM-30085: Unable to adjust form for output.
then according to some docs, i tried the the following for the trigger
when-new-form-instance
declare
rg_name varchar2(40) := 'emp_rec';
status number;
groupid recordgroup;
it_id item;
begin
it_id := Find_Item('empno');
groupid := create_group_from_query(rg_name, 'select empno from emp');
status := populate_group(groupid);
populate_list(it_id, groupid);
end;
but yet didnt work... :(
so how the heck do i get values fetched from the database table into the list item?for list items you need to values in the record group, one is the shown value and one is the returned value.
Check out the online help for the populate_list built-in.
You'll need something like select ename,ename from emp as the record group query. -
How to get master data records that do not have transaction data in a query
Hi,
How to get master data records that do not have transaction data in a query output. Can we create a query or any other way to get the master data records that do not have transaction data?Hi,
Create a multiprovider which includes transactional data target and master data info object. Make sure that identification for this master data info object is ticked on both the provider.
Create report on this multiprovider , keep the master data info object in rows , and now you should able to see all the values which are there in master data info object irrespective of transaction happened or not .
Next you may create condition showing only zero keyfigure values , ie. master data without any transaction.
Hope that helps.
Regards
Mr Kapadia -
How i get number of record in repet frame?
Hi,
How i get number of record in repet frame?
Regards
JomarJomar,
you can use Summary Columns in the Data Modell. Create them on group higher that your wished group (so on the pane for an first group of a query), use as Source the primary column and as reset at the group, where the summary column is located.
If you hide some instances via format triggers, that you could use a counter inside the format triggers to count the rows.
Regards
Rainer -
Update once only most current record that meets conditions
Want to only allow the most current date with the stateID of 1 to update once and not update after the intial update when running sql code over again.
changeTypeID containerID stateID dateEntered note
UPDATE 900172-0800 5 2014-09-23 04:38:29.313 Pallet #71809
UPDATE 900172-0800 1 2014-11-20 09:17:51.017
UPDATE 900172-0800 10 2014-11-24 15:03:32.177 900172-0800->Destroyed
UPDATE 900172-0800 10 2014-11-24 15:04:00.777 900172-0800->Destroyed
UPDATE 900172-0800 10 2014-11-24 15:05:44.763 900172-0800->Destroyed
SELECT containerID
INTO #Temp
ContainerHistory
WHERE dateEntered >= DATEADD(DAY, DATEDIFF(DAY, 0, CURRENT_TIMESTAMP) -1, 0)
AND dateEntered < DATEADD(DAY, DATEDIFF(DAY, 0, CURRENT_TIMESTAMP), 0)
AND stateID = 1 ORDER BY dateEntered DESC ????
UPDATE ContainerStates
SET stateID = 10,
dateEntered = getdate(),
note = containerID + '->Destroyed'
WHERE containerID IN (
SELECT barCode AS containerID FROM #Temp WHERE containerExpired = 1>> Want to only allow the most current date with the state_id of 1 to update once and not update after the initial update when running SQL code over again. <<
Please follow basic Netiquette and post the DDL we need to answer this. Do you know how to follow industry and ANSI/ISO standards? You should follow ISO-11179 rules for naming data elements. You hjave noi idea what that means. Avoid dialect in favor of
ANSI/ISO Standard SQL.
There is no such attribute as a “change_type_id” in RDBMS. You can have a “<something>_id” “<something>_type” but not a weird mix of attribute proprieties. Likewise, “state_id” makes no sense. If you meant a status, then you need two dates to show
when that state of being applied to the entity.
To track the history of, say, Foobars we need to see time as a continuum and model it as (begin_date, end_date) pairs that define when a foobar had a particular value. Here is the skeleton.
CREATE TABLE Foobar_History
(foo_id CHAR(9) NOT NULL,
start_date DATE NOT NULL,
end_date DATE, --null means current
CHECK (start_date <= end_date),
foo_status INTEGER NOT NULL,
PRIMARY KEY (foo_id, start_date));
When the end_date is NULL, that state of being is still current. You use a simple query for the status on any particular date;
SELECT *
FROM Foobar
WHERE @in_cal_date
BETWEEN start_date
AND COALESCE (end_date, CURRENT_TIMESTAMP);
There are more tricks in the DDL to prevent gaps, etc
CREATE TABLE Events
(event_id CHAR(10) NOT NULL,
previous_event_end_date DATE NOT NULL
CONSTRAINT Chained_Dates
REFERENCES Events (event_end_date),
event_start_date DATE NOT NULL,
event_end_date DATE UNIQUE, -- null means event in progress
PRIMARY KEY (event_id, event_start_date),
CONSTRAINT Event_Order_Valid
CHECK (event_start_date <= event_end_date),
CONSTRAINT Chained_Dates
CHECK (DATEADD(DAY, 1, previous_event_end_date) = event_start_date)
-- CHECK (previous_event_end_date + INTERVAL '01' DAYS) = event_start_date)
-- disable the Chained_Dates constraint
ALTER TABLE Events NOCHECK CONSTRAINT Chained_Dates;
GO
-- insert a starter row
INSERT INTO Events(event_id, previous_event_end_date, event_start_date, event_end_date)
VALUES ('Foo Fest', '2010-01-01', '2010-01-02', '2010-01-05');
GO
-- enable the constraint in the table
ALTER TABLE Events CHECK CONSTRAINT Chained_Dates;
GO
-- this works
INSERT INTO Events(event_id, previous_event_end_date, event_start_date, event_end_date)
VALUES ('Glob Week', '2010-01-05', '2010-01-06', '2010-01-10');
-- this fails
INSERT INTO Events(event_id, previous_event_end_date, event_start_date, event_end_date)
VALUES ('Snoob', '2010-01-09', '2010-01-11', '2010-01-15');
What you did post is awful. Why did you append “->Destroyed” to an identifier? This is redundant AND destroys the integrity of the original encoding. Why do you use a local temp table? This mimics a 1950's scratch tape and no SQL programmer would use
it. Why would a note repeat another column?
Please read this and try again.
https://www.simple-talk.com/sql/t-sql-programming/state-transition-constraints/
--CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
in Sets / Trees and Hierarchies in SQL
Maybe you are looking for
-
FrameMaker 8.0p277 Generated PDF-to-PDF Links Don't Work On Solaris
Currently I create a PDF of a book index pointing to several guides. The company logo in each guide's PDF provides a link back to the index. All the links worked on Solaris & Windows OSs. Now they do not work on Solaris. I get an error saying, "There
-
Photo count on itunes library won't go down HELP?!
Whenever I sync my phone, the photo count won't change. It's keeps showing I have 764 when I only have 615 in my camera roll and I don't have any photos synced from my iPhoto onto my phone either. I have no idea how to fix it or what is going on.
-
Integrating windows AD with cisco ACS
hi all i am looking for the requirements and any documents in setting up the acs with windows AD for user authentication. i am basically testing this. i am having a cisco switch a switch acs serevr 4.1 and windows xp host and windows 2003 server. can
-
Robohelp 9 WebHelp - Searching doesn't produce any results.
Hi, I upgraded to RoboHelp 9 last week and now searching in Webhelp doesn't produce any results. I've created a new project, used the sample project, tried generating it to a new folder and results remain the same. When I select the search tab, the s
-
I do not want this message: Found trusted certificates from your previous version of Adobe Reader.Do you want to import them? The certificates are not imported in this step is not available in this version of Adobe Reader. How can I turn it off using