Ref Cursor - How to append records into ref cursor?
Hi,
Is it possible to append ref cursor?
Iam having a procedure which accepts 1 string as input
parameter. That string will have list of ID delimited by comma.
I want to extract & match every ID with some tables.
My problem is for first ID i would get 10 records
and for 2nd ID i 'l get other 20 records. But while returning
i need to send the same(10 + 20 records) as ref cursor(OUT parameter).
But in below given code i could send only last 20 records. first
10 records are not append/updated into ref cursor.
How to append 2nd 20 records with 1st 10 records? so that i can
send all the 30 records.
Here goes my code...
CREATE OR REPLACE PROCEDURE getCRMGroupsAndRollups_PRC
in_groupId IN VARCHAR2,
out_getCRMGroups OUT TYPES.DATASET
IS
v_temp VARCHAR2(500) := in_groupId ||',';
v_temp_split VARCHAR2(500);
v_pos1 NUMBER := 0;
v_pos2 NUMBER := 1;
v_pos3 NUMBER := 0;
v_extract_char VARCHAR(1) := NULL;
v_comma_cnt NUMBER := 0;
BEGIN
-- check in for null input parameters
IF ( in_groupId IS NOT NULL ) THEN
-- loop to count no of in_groupId
FOR j IN 1..LENGTH(v_temp)
LOOP
v_extract_char := SUBSTR(v_temp,j,1);
IF (v_extract_char = ',') THEN
v_comma_cnt := v_comma_cnt + 1;
END IF;
END LOOP;
-- loop to extract in_group Id
FOR i IN 1..v_comma_cnt
LOOP
v_pos1 := instr(v_temp,',',(v_pos1 + 1));
v_pos3 := ((v_pos1-1) - v_pos2 )+ 1;
v_temp_split := SUBSTR(v_temp,v_pos2,v_pos3);
v_pos2 := v_pos1 + 1;
-- query to return dataset filled BY list of all the current
-- CRM groups and the associated rollup groups
OPEN out_getCRMGroups FOR
SELECT
DISTINCT
gcs.crm_st_id_cd,
gcs.lgcy_roll_up_grp_num,
gcs.lgcy_roll_up_grp_name,
gcs.grp_xwalk_complt_dt,
gcs.crm_grp_num,
gcs.facets_gnat_id,
gcs.crm_grp_name
FROM
grp_convsn_stat gcs
--lgcy_xref_elem lxe
WHERE
( gcs.mbrshp_convsn_aprvl_dt = NULL )
OR ( gcs.mbrshp_convsn_aprvl_dt < (SYSDATE - 7 ) )
AND ( gcs.facets_grp_stat_actv_ind = 'Y' )
AND ( gcs.lgcy_roll_up_grp_num = v_temp_split );
END LOOP;
END IF;
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('INTERNAL ERROR');
END getCRMGroupsAndRollups_PRC;
in this v_temp_split will have extracted id & iam opening
ref cursor for each & every ID extracted from list.
2) How to handle no_data_found exception for this ref cursor?
Please help me....
-thiyagarajan.
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:110612348061
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:210612357425
Message was edited by:
Kamal Kishore
Similar Messages
-
How to display records into a non table base block..
Hi,
Can anybody help me how to display records into a non table base block....
Find below is my coding but it only display the last record in the first line
in the block.
PROCEDURE CREATE_CARTON_QUESTION IS
CURSOR car_c IS
select /*+ rule */ question_id, question_description
from WHOP.QADB_QUESTIONS
where question_category = 'Carton'
and question_active_flag = 'Y';
v_found VARCHAR2(10);
v_status boolean;
v_error varchar2(150);
v_count number;
car_r car_c%rowtype;
begin
begin
select count(*) into v_count
from WHOP.QADB_QUESTIONS
where question_category = 'Carton'
and question_active_flag = 'Y';
exception
when no_data_found then
v_count := 0;
end;
if v_count > 0 then
for car_r in car_c loop
---populating carton questions
:la_carton.carton_question_id := car_r.question_id;
:la_carton.carton_question_answer := 'N';
:la_carton.carton_error_details := null;
:la_carton.attribute2 := car_r.question_description;
end loop;
end if;
end;
Thanks in advance.
Regards,
JunHi SNatapov,
Thanks for you reply but still I get this error...
FRM-40737 Illegal restricted procedure GO_BLOCK in WHEN-VALIDATE-ITEM trigger.
Please note that I call that program unit in the last field of my control block inside when-validate-item trigger the questions should be display in la_carton block which is my non-base table block.
Find below is the code....
begin
go_block('la_carton');
first_record;
for car_r in car_c loop
---populating carton questions
:la_carton.carton_question_id := car_r.question_id;
:la_carton.carton_question_answer := 'N';
:la_carton.carton_error_details := null;
:la_carton.attribute2 := car_r.question_description;
next_record;
end loop;
end;
Hoping you can help me this problem...
Thanks in advance.
Regards,
Jun -
How to append records in a file, through file adapter.
Hi All,
How to append records in a file, through file adapter.
I have to read data from database and need to append all records in a file.
Thanks in Advance.Hi,
I think you have a while loop to hit the DB in your Process (As you said you have to fetch data from DB 10 times if 1000 rec are there)
First sopy your DB O/P to one var
and from second time append to previous data.(Otherwise you can directly use append from starting instead of copy and append)
When loop completes you can transform to File adapter Var.
Otherwise you can configure yourFileadapter such that it will aapend current records to previous records.
You can use 'Append= true' in your file adapter wsdl.
It will append previous records to current records in the same file.
Regards
PavanKumar.M -
How to upload records into Infotype 382(Awards)
Hi,
Could anyone suggest me how to upload records into infotype 382(Awards) of an Employee.
For solutions points rewarded.
Regards,
RadhuHi
you can develop a <b>BDC</b> for transaction <b>PA30</b>
using infotype 382.
(or)
can upload using batch input recording in <b>LSMW</b>.
regards,
Thangesh -
Cursor c1 parameter valve (PAR_SPRIDEN_PIDM) into the cursor c2
hi,
I am using 10g. I am new to oracle.
My task is:
I have to pass cursor c1 parameter valve (PAR_SPRIDEN_PIDM) into the cursor c2
and get the output FULL_NAME which Concatenate the first_name and last_name
Please find the code:
========================================
CREATE TABLE spriden
( SPRIDEN_PIDM NUMBER(8
,SPRIDEN_ID VARCHAR2(9)
,SPRIDEN_LAST_NAME VARCHAR2(60)
,SPRIDEN_FIRST_NAME VARCHAR2(60 CHAR)
,SPRIDEN_CHANGE_IND VARCHAR2(1)
==================================================
create or replace procedure multiple_cursors_proc is
cursor c1 (PAR_SPRIDEN_PIDM in SPRIDEN.SPRIDEN_PIDM%type) is
select SPRIDEN_ID
from SPRIDEN
where SPRIDEN_CHANGE_IND IS NULL
and SPRIDEN_PIDM = PAR_SPRIDEN_PIDM;
cursor c2 is select (SPRIDEN_FIRST_NAME || ' ' || SPRIDEN_LAST_NAME) FULL_NAME
from SPRIDEN
where SPRIDEN_CHANGE_IND IS NULL
and SPRIDEN_PIDM = PAR_SPRIDEN_PIDM;
BEGIN
FOR cr1 in c1
loop
for cr2 in c2
loop
DBMS_OUTPUT.PUT_LINE('START TIME : ' ||
to_char(sysdate, 'HH24:MI:SS'));
dbms_output.put_line('SPRIDEN_PIDM: ' || PAR_SPRIDEN_PIDM || ' ' ||
'FULL_NAME: ' || cr2.FULL_NAME);
DBMS_OUTPUT.PUT_LINE('END TIME : ' ||
to_char(sysdate, 'HH24:MI:SS'));
end loop;
end loop;
end multiple_cursors_proc;
=========================================================
Thanks in advance
Edited by: user10285804 on Apr 14, 2011 5:57 PMHi,
Your code has to change this way (untested):
create or replace procedure multiple_cursors_proc is
cursor c1 (PAR_SPRIDEN_PIDM in SPRIDEN.SPRIDEN_PIDM%type) is
select SPRIDEN_ID
from SPRIDEN
where SPRIDEN_CHANGE_IND IS NULL
and SPRIDEN_PIDM = PAR_SPRIDEN_PIDM;
cursor c2(PAR_SPRIDEN_ID SPRIDEN.SPRIDEN_ID%type)
is
select (SPRIDEN_FIRST_NAME || ' ' || SPRIDEN_LAST_NAME) FULL_NAME
from SPRIDEN
where SPRIDEN_CHANGE_IND IS NULL
and SPRIDEN_PIDM = PAR_SPRIDEN_ID;
BEGIN
FOR cr1 in c1
loop
for cr2 in c2(cr1.SPRIDEN_ID)
loop
DBMS_OUTPUT.PUT_LINE('START TIME : ' ||to_char(sysdate, 'HH24:MI:SS'));
dbms_output.put_line('SPRIDEN_PIDM: ' || PAR_SPRIDEN_PIDM || ' ' ||'FULL_NAME: ' || cr2.FULL_NAME);
DBMS_OUTPUT.PUT_LINE('END TIME : ' ||to_char(sysdate, 'HH24:MI:SS'));
end loop;
end loop;
end multiple_cursors_proc;Herald ten Dam
http://htendam.wordpress.com -
How to insert records into an Excel file
i was wondering if anyone knows how to insert records from a pl/sql block straight into an excel file
try with spool or UTL_FILE...
Re: CSV into Oracle and Oracle into CSV
SQL> spool c:\test1.csv
SQL> select substr(str,2,length(str)-3) from (select regexp_replace(column_value,'\s*<[^>]*>[^>]*>',',') str from table(xmlsequence(cursor(select * from test_emp))));
SUBSTR(STR,2,LENGTH(STR)-3)
9999,fredi's,CLERK,2345,10-OCT-06,1250,123,20
4567,STEWART,ANALYST,3456,02-APR-07,3200,215,30
2345,Cockrel,CLERK,7566,23-JAN-82,800,30
3 rows selected.
SQL> spool off; -
How to append records in MSAccess through Java using JDBC:ODBC
Hello,
I was able to retrieve records from MSAccess database through JAVA over the JDBC-ODBC bridge.
If I want to append records to a table (for eg. photo1 table containing photono., length, breadth, area as
columns) I could not able to do so through JAVA.
I am using JTable with the above fields. The user is displayed with the JTable and he has to enter
data inside the JTable and press a button titled "Append". Then the JAVA program should append
whatever the user has entered in the JTable as a single record inside the MSAccess database.
Can anyone help me please?hi i too am having similar problem. i am able to create a table in ms access through java but when i insert values i get a msg that it has inserted the values but when i check the table by opening ms-access there are no values in the table.
the insert statement i am using is
" insert into tk1 values(3,'tarun')"
further i tried using the methods commit, setAutoCommit etc with the connection object. -NO GO.
can you help me ? -
How to append records to a field symbols?
Hi all,
is there a way to append records from an internal table fto a field symbol of type table.Hi Daphne,
Changing internal table to which field symbol is pointing will automatically change data accessed by field-symbol as it is only pointer to internal table..
Regards,
Mohaiyuddin.. -
How to append records to final table with conditions
Hi
I am working on a report using tables vbrp vbrk glpca & konv to fetch the amount of billing document based on condition type (kschl)
Below is my query & records are fetching fine. But now I need to append my final display table.
Question 1.... which table I should loop into & which tables should be read ?
Question 2.... I want 4 coulumn in my alv to display amount from konv based on condition type (VPRS, ZK03,Z004, EK02)
EX: vbeln refdocnr fkdat ............ VPRS-KBETR ZK03-KBETR Z004-KBETR EK02-KBETR
000001 000001 1.1.14 ............ 14.00 -12.00 5.00 0.02
000002 000002 2.02.14 ......... 18.00 -10.00 0.00 0.00
It may be possible that for particular record there would be on ZK03 & VPRS VALUES BUT NO Z004 & EK02 so it will display 0 in that cell.
WITH ABOVE mentioned output how should I put my condition to read it_konv table based on condition types but append it in different colums for display ???
Is there a solution available or not please guide me through this.*declare output itab
DATA: BEGIN OF it_output,
vbeln type....
refdocnr...
fkdat...
vprs_kbetr...
zk03_kbetr..
z004_kbetr...
ek02_kbetr...
end of it_output.
LOOP AT it_join INTO wa_join.
MOVE vbeln fkdat from wa_join into wa_output.
LOOP AT it_konv INTO wa_konv
with key.....
CASE wa_konv-kschl.
WHEN 'VPRS'.
MOVE wa_konv-kbetr TO wa_output-vprs_kbetr.
etc....
ENDCASE.
READ TABLE it_glpca WITH KEY.... into wa_glpca.
IF sy-subrc = 0.
MOVE wa_glpca-refdocnr TO wa_output-refdocnr.
ENDIF.
APPEND wa_output TO it_output.
ENDLOOP.
ENDLOOP. -
How to append records filtered be vbrp-pstyv & konv-kschl
Hi,
I am working on requirement for pricing report .
I have to fetch records from vbrp & pass it in konv to get the konv-kbetr.
My condition would be :
if vbrp-pstyv = 'TAN' or 'zts1' or 'ren' -----> then pick konv-kbetr which has kschl = 'vprs'
" " 'ZTAC' or 'ztab' " " 'EK02'
" 'TAX' or 'ztad' or 'ztax' " " 'Z004'
I am trying to fetch records based on conditions but the problem is my records from konv table are overwritten & only last record is displayed.
Below is query :
Is there any other way to do this report as I have no idea how SD PRICING works ?? Please advice.Hi,
In Second Loop U have used into Corresponding fields,So After a loop completion Ur IT_konv will have only Single Record,Every Time It Gets Refreshed , U may Use Appending Table instead of Corresponding.
Also U are using Same Loop Two times + Fetching Records from Konv Multiple Times, It Will be time consuming.
Inplace of loop FOR SELECTION RECORDS FROM KONV
Simply Use Select Statement as
SElect knumv kposn kschl kbetr into table it_konv from konv for all enteries in It_join where
knumv eq It_join-knumv and
Kposn eq it_join-posnr and
Kschl in ('VPRS', 'EK02'.........).
In last Loop
use case statement for pstyv and individual read statement FOR EACH PSTYV
CASE WA_JOIN-PSTYV.
WHEN 'ZTAC'.
READ TABLE IT_KONV INTO WA_KONV WITH KEY KNUMV = WA_JOIN-KNUMV
KPOSN = WA_JOIN-POSNR
KSCHL = <UR CONDITION TYPE>
IF SY-SUBRC EQ 0.
<ADD KPOSN,KNUMV , KBETR>
ENDIF.
WHEN 'ZTAN'.
READ TABLE IT_KONV INTO WA_KONV WITH KEY KNUMV = WA_JOIN-KNUMV
KPOSN = WA_JOIN-POSNR
KSCHL = <UR CONDITION TYPE>
IF SY-SUBRC EQ 0.
<ADD KPOSN,KNUMV , KBETR>
ENDIF.
Regards: -
Is there any sql command that can append some or all records from one table to another table?
Or it has to use cursor to select data then insert into the distination table?Can you explain why you are looking for another way? What's wrong with using an INSERT INTO ... SELECT ... FROM? This is certainly the most straightforward method.
-
How to insert records into the Table?
Dear Sir,
I'm new to JDeveloper. Now I managed to create a Frame in JDeveloper with many Text fields and a button. In the back end, I have a procedure to insert records to a table, to which I pass the values of the fields as parameters. Now I'm not getting the steps to call the PL/SQL Stored procedure when I click on the button. I'm using Oracle 9i JDeveloper version 9.0.3.1. and Oracle 9i Database.
Please give me the complete steps to achieve my task - it is quite urgent.
Thanking You in advance.
Regards,
Senthil .A. Perumal.The JDBC tutorial will show you how to call a stored procedure from Java:
http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96654/basic.htm
One more thing, why are you using such an old version of JDeveloper? any reason not to upgrade to the 10.1.3 version of JDeveloper?
Also you might want to look into ADF and how it makes these type of database interactions easier.
See this demo:
http://www.oracle.com/technology/obe/obe1013jdev/adf_swing/master_detail_page_adfswing_bc.htm -
How to append records between two internal tables
hi all,
im trying to append from an internal table to another internal table with same structure. i tried the following but it overwrites previous contents of i_dest:
move i_src to i_dest
thanks,
sidhey u try to move it record by record
<b>itab2 = itab.
append itab2.</b>
This should work I guess
just check the code below, if u want to move the whole itab into itab2 then use <b>itab2[] = itab.</b>
<b>loop at it_pgm.
read table itab with key obj_name = it_pgm-pgm_name.
if sy-subrc = 0.
itab_final-obj_name = itab-obj_name.
itab_final-func_spec = itab-func_spec.
itab_final-func_area = itab-func_area.
itab_final-dev_class = itab-dev_class.
append itab_final.
else.
itab_alt-pgm_name = it_pgm-pgm_name.
append itab_alt.
endif.</b>
please reward points if found helpful -
How to append recorded files.
Two questions.
I am using adobe dvrcast to record my live streams. the problem I am having is when I stop the encode during a live stream, a new file is not created, the existing stream is written over. How can I preventive this from occuring.
Is there a way to have all vod files that are in one folder to roll over to the next file during play back.Thanks for the quick response. I am using FMLE 3 and FMS 3.5. I have changed the code per your suggestion. However, the file still does not append when i press the stop button in FMLE. After pressing stop, when I press start button in FMLE again, the file size starts at zero.
here is my code: ExDVRStream.asc
/*----------------------------------------------------------------------------+
| ___ _ _ |
| / | | | | | |
| / /| | __| | ___ | |__ ___ |
| / /_| |/ _ |/ _ \| _ \ / _ \ |
| / ___ | (_| | (_) | |_) | __/ |
| /_/ |_|\__,_|\___/|____/ \___| |
| |
| |
| ADOBE CONFIDENTIAL |
| __________________ |
| |
| Copyright (c) 2008, Adobe Systems Incorporated. All rights reserved. |
| |
| NOTICE: All information contained herein is, and remains the property |
| of Adobe Systems Incorporated and its suppliers, if any. The intellectual |
| and technical concepts contained herein are proprietary to Adobe Systems |
| Incorporated and its suppliers and may be covered by U.S. and Foreign |
| Patents, patents in process, and are protected by trade secret or |
| copyright law. Dissemination of this information or reproduction of this |
| material is strictly forbidden unless prior written permission is |
| obtained from Adobe Systems Incorporated. |
| |
| Adobe Systems Incorporated 415.832.2000 |
| 601 Townsend Street 415.832.2020 fax |
| San Francisco, CA 94103 |
| |
+----------------------------------------------------------------------------*/
load("ExUtil.asc");
* An example dvr stream class that handlings requests initiated from the
* publisher and subscribers.
* @param name live streams name as visible to the client subscribers
* @param numsubscriber number of subscribers
* @param subscribers a map of subscribing client based on the client id
* @param publisher publishing client
* @param streamInfo holds default DVR stream info or stream info provided
* by the publisher
* @param startRecTimer Id returned by the scheduler to start recording
* @param stopRecTimer Id returned by the scheduler to stop recording
* @param broadcastTimer Id returned by the scheduler to broadcast stream info
* to down stream servers
* @param broadcastInterval how often to broadcast stream info
function ExDVRStream( name ) {
this.name = name; // clients subscribe to this stream name
this.numsubscriber = null; // number of subscribers
this.subscribers = new Object(); // map of current subscribers
this.publisher = null; // client publisher, this is only set in the origin
this.streamInfo = null; // streamInfo provided by the publisher
this.startRecTimer = null; // scheduler id to start recording
this.stopRecTimer = null; // scheduler id to stop recording
this.broadcastTimer = null; // scheduler id for broadcasting
this.broadcastInterval = 5000; // set the interval to 5 sec by default
this.isRecording = false; // flag to indicate if the stream is recording
// Public interface
* This function gets call when a client is added as a subcriber of the stream.
* If the client is already a subscriber, it will be a no-op.
ExDVRStream.prototype.addSubscriber = function( client )
if (this.subscribers[client.id] == null)
this.subscribers[client.id] = client;
this.numsubscriber++;
* Removes a client from the subscriber list.
ExDVRStream.prototype.removeSubscriber = function( client )
if (this.subscribers[client.id])
this.subscribers[client.id] = null;
delete this.subscribers[client.id];
this.numsubscriber--;
* This function broadcast streamInfo to all the subscriber which
* is acting as a server
ExDVRStream.prototype.broadcastStreamInfo = function()
debug("Inside ExDVRStream.broadcastStreamInfo - stream name: " +
this.name);
for (i in this.subscribers)
subscriber = this.subscribers[i];
if (subscriber.isProxyServer)
subscriber.call("DVRSetStreamInfo", null, this.getStreamInfo());
* Set the publishing client
ExDVRStream.prototype.publish = function( client )
this.publisher = client;
* Clear the publishing client
ExDVRStream.prototype.unpublish = function()
this.publisher = null;
* This function returns a boolean to indicate whether the stream is in use
ExDVRStream.prototype.isInUse = function()
if (this.numsubscriber > 0 || this.publisher)
return true;
return false;
* This function cleans up all the resources used by this stream
ExDVRStream.prototype.shutdown = function()
debug("Inside ExDVRStream.shutdown");
clearInterval(this.startRecTimer);
clearInterval(this.stopRecTimer);
clearInterval(this.broadcastTimer);
this.startRecTimer = null;
this.stopRecTimer = null;
this.broadcastTimer = null;
* Returns the default streamInfo if no streamInfo has been
* set by the publisher
ExDVRStream.prototype.getDefaultStreamInfo = function( DVRStreamInfo )
//If server restarts and no publisher is coming in, we check
//the length of the recorded stream and see if we should make
//the dvr content available. However, user can customize this
//function and make an external call.
streamLen = Stream.length(this.name);
if (streamLen || this.publisher)
//found a dvr stream, so return it
DVRStreamInfo.code = "NetStream.DVRStreamInfo.Success";
this.streamInfo = new Object();
//setup default value
this.streamInfo.streamName = this.name;
this.streamInfo.callTime = new Date();
this.streamInfo.startRec = new Date();
this.streamInfo.stopRec = new Date();
this.streamInfo.maxLen = Stream.length(this.name);
this.streamInfo.begOffset = 0;
this.streamInfo.endOffset = 0;
this.streamInfo.append = false;
this.streamInfo.offline = false;
this.streamInfo.currLen = Stream.length(this.name);
this.streamInfo.isRec = false;
DVRStreamInfo.data = this.streamInfo;
else
DVRStreamInfo.code = "NetStream.DVRStreamInfo.Failed";
DVRStreamInfo.data = null;
* Get streamInfo and create a default one if no streamInfo
* has been set.
ExDVRStream.prototype.getStreamInfo = function()
debug("Inside ExDVRStream.getStreamInfo");
DVRStreamInfo = new Object();
if (this.streamInfo == null)
this.getDefaultStreamInfo(DVRStreamInfo);
else if (this.streamInfo.offline)
DVRStreamInfo.code = "NetStream.DVRStreamInfo.Failed";
DVRStreamInfo.data = null;
else
DVRStreamInfo.code = "NetStream.DVRStreamInfo.Success";
DVRStreamInfo.data = this.streamInfo;
DVRStreamInfo.data.isRec = this.isRecording;
DVRStreamInfo.data.currLen = Stream.length(this.name);
return DVRStreamInfo;
* Set streamInfo, also handleStreamInfo to start/stop a recording
ExDVRStream.prototype.setStreamInfo = function( streamInfo )
debug("Inside ExDVRStream.setStreamInfo");
//Right now, this only get called from the FMLE when
//the publisher start/stop a recording
currDate = new Date();
currTime = currDate.getTime();
this.streamInfo = streamInfo;
this.streamInfo.lastUpdate = currDate;
startRecTime = 0;
stopRecTime = 0;
if (streamInfo.startRec == -1 || streamInfo.startRec == undefined)
startRecTime = -1000;
else if (streamInfo.startRec instanceof Date)
startRecTime = streamInfo.startRec.getTime();
else
//invalid startRec format
return;
if (streamInfo.stopRec == -1 || streamInfo.stopRec == undefined)
stopRecTime = -1000;
else if (streamInfo.stopRec instanceof Date)
stopRecTime = streamInfo.stopRec.getTime();
else
//invalid stopRec format
return;
if ( startRecTime == -1000 && stopRecTime == -1000 )
//broadcast the change to all the downstream server
this.broadcastStreamInfo(streamInfo);
return;
if (stopRecTime != -1000)
//We are about to stop a recording, so clear the timer
clearInterval(this.stopRecTimer);
this.stopRecTimer = null;
if (currTime < stopRecTime)
timeDiff = stopRecTime - currTime;
//we will broadcast the streamInfo to all the downstream server
//when we actually stop the recording inside onStopRecord
this.stopRecTimer = setInterval(this, "onStopRecord", timeDiff);
else
//stop recording immediately
this.onStopRecord();
if (startRecTime != -1000)
//We are about to start a recording, so clear the timer
clearInterval(this.startRecTimer);
this.startRecTimer = null;
if (currTime < startRecTime)
timeDiff = startRecTime - currTime;
//we will broadcast the streamInfo to all the downstream server
//when we actually start the recording inside onStartRecord
this.startRecTimer = setInterval(this, "onStartRecord", timeDiff);
else
//start recording immediately
this.onStartRecord();
* This is called when we are about to stop a recording
ExDVRStream.prototype.onStopRecord = function()
this.isRecording = false;
clearInterval(this.stopRecTimer);
this.stopRecTimer = null;
s = Stream.get(this.name);
s.record(false);
//notify the downstream server immediately
this.broadcastStreamInfo(this.streamInfo);
//also stop the periodic broadcast because the stream is not growing
this.stopStreamInfoBroadcast();
* This is called when we are about to start a recording
ExDVRStream.prototype.onStartRecord = function()
debug("Inside ExDVRStream.onStartRecord");
this.isRecording = true;
clearInterval(this.startRecTimer);
this.startRecTimer = null;
s = Stream.get(this.name);
if (this.streamInfo.append)
s.record("append");
else
s.record("append");
//notify the downstream server immediately
this.broadcastStreamInfo(this.streamInfo);
//also start the periodic broadcast because the stream is growing
this.startStreamInfoBroadcast();
* Stop the timer to broadcast streamInfo to downstream servers
ExDVRStream.prototype.stopStreamInfoBroadcast = function()
clearInterval(this.broadcastTimer);
this.broadcastTimer = null;
* Start the timer to broadcast streamInfo to downstream servers
ExDVRStream.prototype.startStreamInfoBroadcast = function()
debug("ExDVRStream.Inside startStreamInfoBroadcast");
this.stopStreamInfoBroadcast();
this.broadcastTimer = setInterval( this, "onStreamInfoBroadcast",
this.broadcastInterval)
* This is called by scheduler to broadcast streamInfo to the
* downstream servers
ExDVRStream.prototype.onStreamInfoBroadcast = function()
debug("Inside ExDVRStream.onStreamInfoBroadcast");
this.broadcastStreamInfo(); -
How to get records into two internal tables from 1 internal table?
VERME LGPLA
252.000 EA 300 0149A 410 0149
276.000 EA 300 0149A 410 0107
516.000 EA 300 0149A 400 3013
528.000 EA 300 0149A 400 3013
528.000 EA 300 0149A 400 3013
528.000 EA 300 0149A 400 3013
528.000 EA 300 0149A 400 3013
528.000 EA 300 0149A 400 3013
528.000 EA 300 0149A 400 3013
I have above records in my one internal table ITAB.
I want to divide these records in to two internal tables ITAB1 and ITAB2. and this is based on LGPLA and VERME.
If there is same LGPLA (last column) and different VERME (1st column) available, then it should append ITAB1
Otherwise it should append ITAB2.
ITAB1 should contain ,
516.000 EA 300 0149A 400 3013
ITAB2 should contain ,
252.000 EA 300 0149A 410 0149
276.000 EA 300 0149A 410 0107
528.000 EA 300 0149A 400 3013
528.000 EA 300 0149A 400 3013
528.000 EA 300 0149A 400 3013
528.000 EA 300 0149A 400 3013
528.000 EA 300 0149A 400 3013
528.000 EA 300 0149A 400 3013
I have tried with this code
Loop at itab .
IF lv_prev_lgpla = wa-lgpla and lv_prev_verme <> wa-verme.
APPEND wa TO itab1.
else.
APPEND wa TO itab2.
endif.
lv_prev_lgpla = wa-vlpla.
lv_prev_verme = wa-anfme.
Endloop.
But it contains,
516.000 EA 300 0149A 400 3013
in table ITAB2 which I dont want.
Points rewarded soon.
Regards,
RonnDear Ronny,
i am gining the solution below.But would request you to change your ITAB STRUCTURE LIKE THIS BEFORE USING THE CODE
VERME LGPLA
252.000 EA 300 0149A 0149 410
276.000 EA 300 0149A 0107 410
516.000 EA 300 0149A 3013 400
528.000 EA 300 0149A 3013 400
528.000 EA 300 0149A 3013 400
528.000 EA 300 0149A 3013 400
528.000 EA 300 0149A 3013 400
528.000 EA 300 0149A 3013 400
528.000 EA 300 0149A 3013 400
then do as follows.
SORT ITAB BY LGPLA VERME.
LOOP AT ITAB INTO WITAB.
W_INDEX = SY-TABIX.
here take all the abOve fields in temp fieds.
LW_VERME = WITAB-VERME..AND SO ON.
AT END OF LGPLA.
MOVE: all LW fields to work area of ITAB1
APPEND work area of ITAB1 TO ITAB1.
DELETE ITAB INDEX W_INDEX
ENDAT.
ENDLOOP.
Basically what u r doing here is thet u r using processing event.
So whenerv VERME changes this event will be triggered.
Just try this out...something like this only will be he logic.
Please let me know further
Maybe you are looking for
-
Missing Fonts in Photoshop CS4
I opened an existing CS2 photoshop file in CS4 and I get a missing font error. The font that it can't find is on my system. How do I "add" this font so PS can see it? Thanks.
-
How can I addChild outside the frame of images loader function? When I try to addChild on the other frame of the same loader, I get an error. I need to download all my 10 images only ONE TIME and place it on the screen in the other frames (to the sam
-
ERROR!!! ~JSP CODES~
Any problem with the following jsp code? <%@ page import=" java.io.*, java.util.*" %> <% boolean login_ok = false; Boolean result_obj = new Boolean(login_ok); result_obj = (Boolean)request.getAttribute("result"); login_ok = result_obj.booleanValue();
-
Is there any other way to reset my ipod touch? I am asking because my home button is broken.
-
How to delete users from my shared list
I have users in my shared tab in the finder. Some of these computers/users i dont know or dont what to have the risk of being to access my data. How do i remove them?