Dynamic recordset for a loop

Hi,
I need to loop into a recordset, but I know in which recordset just at the execution time.
I mean, depending on a condition I can loop into different recordset, but executing same code.
And I wouldn't write the same code twice.
Here a little example:
PROCEDURE dynrec IS
cursors rec1 is
select * from tab1;
cursor rec2 is
select * from tab2;
dynamic_rec ????;
BEGIN
IF condition THEN
dynamic_rec := rec1;
ELSE
dynamic_rec := rec2;
END IF;
FOR r IN dynamic_rec LOOP
END LOOP;
END;
Is it possibile to such a stuff?
Thanks in advance!
Samuel

Firstly, what are you actually trying to achieve?
Secondly, if your returned rows are different from the different cursors then you can't really fetch then into a single undefined row type variable. The structure of the variable into which the data is to be returned, must be known at design and compilation time, it can't change at run-time.
Thirdly, what is wrong with simply having a conditional statement that handles each case seperately with their own return variable defined specifically for that query?
If things truly have to be dynamic (very very little reason why this should ever be justified), then you'd have to use the DBMS_SQL package and the procedures provided by that package to describe the results of the query and fetch the data back...
example (from my stock answers)...
As sys user:
CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
/As myuser:
CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                     ,p_dir IN VARCHAR2
                                     ,p_header_file IN VARCHAR2
                                     ,p_data_file IN VARCHAR2 := NULL) IS
  v_finaltxt  VARCHAR2(4000);
  v_v_val     VARCHAR2(4000);
  v_n_val     NUMBER;
  v_d_val     DATE;
  v_ret       NUMBER;
  c           NUMBER;
  d           NUMBER;
  col_cnt     INTEGER;
  f           BOOLEAN;
  rec_tab     DBMS_SQL.DESC_TAB;
  col_num     NUMBER;
  v_fh        UTL_FILE.FILE_TYPE;
  v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
BEGIN
  c := DBMS_SQL.OPEN_CURSOR;
  DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
  d := DBMS_SQL.EXECUTE(c);
  DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
  FOR j in 1..col_cnt
  LOOP
    CASE rec_tab(j).col_type
      WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
      WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
      WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
    ELSE
      DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
    END CASE;
  END LOOP;
  -- This part outputs the HEADER
  v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
  FOR j in 1..col_cnt
  LOOP
    v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
  END LOOP;
  --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
  UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
  IF NOT v_samefile THEN
    UTL_FILE.FCLOSE(v_fh);
  END IF;
  -- This part outputs the DATA
  IF NOT v_samefile THEN
    v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
  END IF;
  LOOP
    v_ret := DBMS_SQL.FETCH_ROWS(c);
    EXIT WHEN v_ret = 0;
    v_finaltxt := NULL;
    FOR j in 1..col_cnt
    LOOP
      CASE rec_tab(j).col_type
        WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                    v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
        WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                    v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
        WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                    v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
      ELSE
        v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
      END CASE;
    END LOOP;
  --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
    UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
  END LOOP;
  UTL_FILE.FCLOSE(v_fh);
  DBMS_SQL.CLOSE_CURSOR(c);
END;This allows for the header row and the data to be written to seperate files if required.
e.g.
SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
PL/SQL procedure successfully completed.Output.txt file contains:
empno,ename,job,mgr,hiredate,sal,comm,deptno
7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10The procedure allows for the header and data to go to seperate files if required. Just specifying the "header" filename will put the header and data in the one file.
Adapt to output different datatypes and styles are required.

Similar Messages

  • For Each Loop Load Dynamic Excel Files

    Hi All,
    SSIS 2005
    I want to load excel file .xls one at a time files that have different names without having to select the file in the connection manager, every time. So a user can easily place the excel file in the folder and right the sql job and it loads the file data.
    The data flow tasks all work when I manually select the excel file, but I am unable to get this to work dynamically.
    I have setup a for each loop with multiples data flow tasks and sql tasks to load my data from file.
    Variables:
    @filename d:\new file\*.xls
    For Each Loop:
    ForEachFile Enumerator
    Folder: d:\new file\
    Files: *.xls
    Retrieve File Name: Fully Qualified
    Variable Mappings:
    User::filename (index 0)
    Connection Managers:
    Excel Connection Manager: Expressions, ConnectionString @[User::filename]
    Error Message: Error at new buyer(package name) the connection string format is not valid. it must consist of one or more components of the form X=Y, seperated by semicolons.
    Can anyone assist thanks.

    You still need the file name variable.
    ExcelFilePath is the fully qualified file name of your Excel file. ie. it contains both the path and file name.
    e.g. D:\inbox\myExcelFile.xls
    All the steps you mentioned are correct, except you need to set the property of ExcelFilePath of the Excel connection to the variable that you map to in the ForEach Loop:
    Connection Managers:
    Excel Connection Manager: Expressions, ExcelFilePath @[User::filename]
    Hope this helps.
    ~ J.

  • Using a recordset in a loop statement

    Hello all,
    I am (still) trying to get an Excel spreadsheet for a dynamically created table. A crucial parameter of the problem is that I do not know the column names for my table at runtime, as it is created by a pivot query.
    I was very excited to find Tom Kyte's post on "Using a recordset in a loop statement:
    http://asktom.oracle.com/pls/ask/f?p=4950:8:4768329722850645393::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:464820324673,
    This is precisely the solution I need. Unfortunately for me, when I create my stored procedure, it doesn't compile. As suggested I systematically renamed EXEC_SQL to DBMS_SQL, then I made some minor tweaks to integrate with HTMLDB:
    create or replace procedure export_tsv as
    connection_id DBMS_SQL.CONNTYPE
    default DBMS_SQL.default_connection;
    cursorID DBMS_SQL.CURSTYPE;
    nIgn number;
    columnValue varchar2(4000);
    ncols number;
    sep varchar2(1);
    colName varchar2(40);
    colLen number;
    coltype number;
    BEGIN
    IF DBMS_SQL.is_connected = FALSE THEN
    Message('No primary connection. Please connect.');
    RETURN;
    END IF;
    -- set up for excel spreadsheet
    htp.init;
    owa_util.mime_header ('application/vnd.ms-excel',false);
    htmldb_application.g_page_text_generated := true;
    htp.p('Content-Disposition: attachment;
    filename=myexport.txt');
    owa_util.http_header_close;
    -- end excel spreadsheet setup
    cursorID := DBMS_SQL.OPEN_CURSOR;
    DBMS_SQL.PARSE(cursorID, 'select * from exp_data', DBMS_SQL.V7);
    nIgn := DBMS_SQL.EXECUTE(cursorID);
    for i in 1 .. 1000 loop
    begin
    DBMS_SQL.describe_column( connection_id, cursorId, i,
    colName, colLen, colType );
    DBMS_SQL.define_column(cursorID, i, columnValue,
    4000 );
    exception
    when DBMS_SQL.invalid_column_number then
    ncols := i-1;
    exit;
    end;
    end loop;
    while (DBMS_SQL.fetch_rows(cursorID) > 0)
    loop
    sep := '';
    for i in 1 .. ncols loop
    DBMS_SQL.COLUMN_VALUE(cursorID, i, columnValue);
    -- print the column value
    htp.p( sep || columnValue);
    sep := chr(9);
    end loop;
    -- print the end of line CRLF
    htp.p(chr(13)|| chr(10));
    END LOOP;
    DBMS_SQL.CLOSE_CURSOR(cursorID);
    DBMS_SQL.CLOSE_CONNECTION;
    END;
    When I try to run this in the HTMLDB SQL Command Processor, I see the following error:
    ERROR at line 2: PLS-00302: component 'CONNTYPE' must be declared
    Can someone provide me with the correct translation of Tom Kyte's approach into the HTMLDB idiom?
    Thanks in advance,
    susan

    Questions about opening multiple worksheets on the web:
    I have this link that submits the page and my process calls a PL/SQL procedure that prints out an excel spreadsheet. When I hit the link again, the spreadsheet does not update. I can make the spreadsheet update from ASP or a java servlet, but never from the PL/SQL procedure. Even if I use the procedure to print out XML in XMLSS format, so that I can change worksheet name, it still does not update on successive calls.
    My code:
    PROCEDURE SQL_TO_EXCEL(p_sql in varchar2)
    as
    l_cursor integer default dbms_sql.open_cursor;
    l_status PLS_INTEGER;
    l_desc dbms_sql.desc_tab;
    l_col_cnt number;
    l_columnValue varchar2(4000);
    l_row varchar2(4000);
    l_frow PLS_INTEGER;
    l_lrow PLS_INTEGER;
    l_cols varchar2(4000);
    l_date date;
    begin
    --set mime type to Excel
    htp.init;
    owa_util.mime_header('application/vnd.ms-excel',true);
    --htp.p('Pragma: no-cache');
    --htp.p('Cache-Control: no-cache');
    --owa_util.http_header_close;
    htmldb_application.g_page_text_generated := true;
    --htp.htmlOpen;
    --htp.headOpen;
    --htp.title('SQL to Excel Export');
    --htp.headCLose;
    --htp.bodyOpen;
    execute immediate 'alter session set nls_date_format=''dd-mon-yyyy'''; -- hh24:mi:ss''';
    DBMS_SQL Calls
    dbms_sql.parse(l_cursor,rtrim(p_sql,';'),dbms_sql.native);
    l_status := dbms_sql.execute(l_cursor);
    dbms_sql.describe_columns(l_cursor,l_col_cnt,l_desc);
    l_frow := l_desc.FIRST;
    l_lrow := l_desc.LAST;
    if l_col_cnt > 0 then
    FOR colind IN l_frow..l_lrow LOOP
    l_cols := l_cols||chr(9)||l_desc(colind).col_name;
    END LOOP;
    htp.p(ltrim(l_cols,chr(9)));
    end if;
    for i in 1 .. l_col_cnt loop
    if l_desc(i).col_type = 12 then
    dbms_sql.define_column(l_cursor,i,l_date);
    else
    dbms_sql.define_column(l_cursor,i,l_columnValue,4000);
    end if;
    end loop;
    --l_status := dbms_sql.execute(l_cursor);
    while (dbms_sql.fetch_rows(l_cursor) > 0) loop
    for i in 1 .. l_col_cnt loop
    if l_desc(i).col_type = 12 then
    dbms_sql.column_value(l_cursor,i,l_date);
    l_row := l_row||chr(9)||to_char(l_date,'DD-MON-YYYY HH24:MI:SS');
    else
    dbms_sql.column_value(l_cursor,i,l_columnValue);
    l_row := l_row||chr(9)||l_columnValue;
    end if;
    end loop;
    htp.p(ltrim(l_row,chr(9)));
    l_row := '';
    end loop;
    --htp.bodyclose;
    --htp.htmlclose;
    dbms_sql.close_cursor(l_cursor);
    exception
    when others then
    dbms_sql.close_cursor(l_cursor);
    htp.p(SQLERRM||chr(10)||p_sql);
    end SQL_TO_EXCEL;
    Any ideas on how I can get the spreadsheet to update from repeated calls to the PL/SQL?

  • Dynamic list and thumb loops

    hello I try to create a dynamique list with thums loops associates (to describe a stuff to sell) and it work fine when I select from a list (URL parametre)
    But I would like to navigate in my detail page (with the loop thumb) whit the next or last link and I cant do it because the thumbs doesnt works
    Some help ? thanks you all and sorry for my french

    Hi Lorie,
    Taking it a step further
    interesting that you´re mentioning this -- because I was just in the middle of finding a workaround for the very same issue ;-)
    I actually did find a pretty easy solution, which basically goes like this:
    1) wrap the whole table *plus* any possibly added hidden fields located below this table in a "Show IF conditional region" behaviour -- but make sure to *not* include the buttons within the "KT_bottombuttons" div in here.
    2) as I assume that your "supplier_name" column holds a numeric value which equals the user´s "kt_login_id" Session Variable (which it should !), define the following conditions for the "Show IF conditional region" behaviour:
    Expression 1: choose "supplier_name" from the tNG recordset
    Condition: ==
    Expression 2: choose Session -> kt_login_id
    3) tick the Has ELSE option
    4) confirm with OK
    5) replace the default "has Else" message with something meaningful like "you can´t edit this record !"
    Switching to Code view and navigating to the very start of your "Show IF conditional region" should display something like this:
    if (@$row_rsqueryname['supplier_name'] == @$_SESSION['kt_login_id']) {
    When viewing the modified Dynamic Form in a browser, you´ll note that this solution will indeed display the form instances for all "authorized" records, whereas those form instances which don´t match the required credentials will be replaced with that "has else" message.
    BUT !! This solution has one major drawback which I haven´t been able to resolve yet :: when the Dynamic Form goes into Insert Record mode
    (means when you click the "add new" link in the Dynamic List), all inner form instances will display that "has else" message.
    The only workaround I currently can come up with is to have the List´s "add new" link point to a separate "add_new.php" page that´s going to insert a single record.
    Cheers,
    Günter Schenk
    Adobe Community Expert, Dreamweaver

  • Loading accdb file using for each loop in to single target table

    I have 3 accdb file as below in single folder, in control flow I have created a for each loop to loop through all the below file.  In dataflow task I have created oledb source using connection manager to point to first file a1.accdb. I am trying
    to load all the file into single below mentioned target table, here It is only loading first file it is not looping through other two file.
    This I have tried to load .txt files and csv files it is working perfectly but similarly when I try to load access db file table it is not working, can any one of you help me?
    1. a1.accdb contains only one table  a1tab ( col1 col2 col3 )  
    2. a2.accdb  contains only one table  a2tab  ( col1 col2 col3 )
    3. a3.accdb  contains only one table  a3tab   ( col1 col2 col3 )
    I have a target table with similar structure as source
    Target table <TargetTable> Col1 Col2 Col3
    aak

    Thanks Arthur, please find below response
    How do you handle the different table names?  Cant we handle it in a similar manner, how we handle the .csv/.txt files with different name and similar structure for sources(multiple files) and target (single table)
    Is it good to drop the idea of for each loop and create a separate task for each accdb file? to be loaded to same target table( performance wise etc.. any justification would be helpful)
    You must handle the connection string dynamically?
    Can you help me with the logic for handling connection string dynamically
    aak

  • Dynamic query in a loop

    Greedings,
    I have the following query which im trying to implement as a dynamic sql. It works fine but my only problem is that the table name will be changing everytime the user runs the query. Accounts will become financial_accounts etc. Is it possible to do that in any way?
    FOR rec IN (SELECT Sum(amount) AS amount,b.acnt_code AS acnt_code
                FROM accounts@db_link a,so_budgets b
                WHERE Trim(b.acnt_code)=Trim(a.accnt_code)
                AND a.period BETWEEN 2011 AND 2012
                GROUP BY b.acnt_code) LOOP
                Dbms_Output.put_line(rec.acnt_code);
                Dbms_Output.put_line(rec.amount)
    END LOOP;Thank you for any help

    794018 wrote:
    the only thing thats going to be changing is the from table. So change FOR cursor loop with:
    declare
        v_cur sys_refcursor;
        v_acnt_code varchar2(100); -- I'll assume acnt_code is a string
        v_amount number;
    begin
        open v_cur for 'SELECT Sum(amount) AS amount,b.acnt_code AS acnt_code FROM ' || from_param || ' WHERE ' || where_param;
        loop
          fetch v_cur
            into  v_amount,
                  v_acnt_code;
          exit when v_cur%notfound;
          dbms_output.put_line('acnt_code = ' || v_acnt_code);
          dbms_output.put_line('amount = ' || v_amount);
        end loop;
        close v_cur;
    end;
    /SY.

  • For Each Loop PL/SQL

    I am slowly learning PL/SQL, I have some programming experience using Visual Basic for Excel, so I am not totally in the dark, but not really sure :-)
    Here is what I am trying to do, am on 10g by the way.
    I have about 10+ Tables in my schema, with pretty much the same structure and I know that I could use plain SQL to do this with, but I want to learn PL/SQL.
    So, I have 10+ tables where I have to add a new field of type varchar2(100), I was wondering if I could employ the FOR LOOP or maybe something better, list all the Tables that I need to ALTER and say:
    For each Table from list
    LOOP
    alter table table_name add KEY varchar2(100);
    END LOOP;
    I have the full list of the Tables, what do you guys think ?

    If you want to practice PL/SQL then this is the wrong task.
    You would need to use dynamic SQL (execute immediate or dbms_sql) for this, but usually you should avoid dynamic SQL for many reasons.
    As you already mentioned this can be easily done with SQL.
    What I do in such cases is to build a select that returns me the 10+ alter table statements.
    The oracle data dictionary (e.g. the view user_tables) has enough information to build such a select based on your requirements.
    Then save the result into a file and run the file as a script in sql*plus.
    example untested
    select 'alter table '||t.table_name||' add KEY varchar2(100);'
    from user_tables t
    where t.table_name like 'XYZ%'
    and t.table_name not in (select c.table_name from user_tab_columns c where column_name = 'KEY');Changes to the data structure in your database should not be done programatically (e.g by pl/sql) but should be entered into your version control system so that you can run the same script against your development database, against your test database and later against your production database.

  • Dynamic fetch for dynamic sql query

    Hi All,
    I want to dynamically create a query and fetch it into a dynamic cursor record...The structure of the record should be the same as that of the query...
    Can you suggest any method to do that.
    eg
    OPEN <dynamic cur> FOR <dynamic stmt>;
    LOOP
    FETCH <dynamic cur> INTO <dynamic rec>;
    END LOOP;
    CLOSE <dynamic cur>;
    How do I declare the dynamic rec here?I would not know the columns in the query beforehand either.
    Thanks,
    Merz
    Edited by: merz on Sep 12, 2011 5:02 PM
    Edited by: merz on Sep 12, 2011 5:03 PM

    merz wrote:
    Hi All,
    I want to dynamically create a query and fetch it into a dynamic cursor record...The structure of the record should be the same as that of the query...
    Can you suggest any method to do that.And how are you expecting to write an application around a dynamic query and dynamic structure that you don't know?
    Saying that, as others have said, there is the DBMS_SQL package which can be used for certain valid reasons such as the following example....
    As sys user:
    CREATE OR REPLACE DIRECTORY TEST_DIR AS '\tmp\myfiles'
    GRANT READ, WRITE ON DIRECTORY TEST_DIR TO myuser
    /As myuser:
    CREATE OR REPLACE PROCEDURE run_query(p_sql IN VARCHAR2
                                         ,p_dir IN VARCHAR2
                                         ,p_header_file IN VARCHAR2
                                         ,p_data_file IN VARCHAR2 := NULL) IS
      v_finaltxt  VARCHAR2(4000);
      v_v_val     VARCHAR2(4000);
      v_n_val     NUMBER;
      v_d_val     DATE;
      v_ret       NUMBER;
      c           NUMBER;
      d           NUMBER;
      col_cnt     INTEGER;
      f           BOOLEAN;
      rec_tab     DBMS_SQL.DESC_TAB;
      col_num     NUMBER;
      v_fh        UTL_FILE.FILE_TYPE;
      v_samefile  BOOLEAN := (NVL(p_data_file,p_header_file) = p_header_file);
    BEGIN
      c := DBMS_SQL.OPEN_CURSOR;
      DBMS_SQL.PARSE(c, p_sql, DBMS_SQL.NATIVE);
      d := DBMS_SQL.EXECUTE(c);
      DBMS_SQL.DESCRIBE_COLUMNS(c, col_cnt, rec_tab);
      FOR j in 1..col_cnt
      LOOP
        CASE rec_tab(j).col_type
          WHEN 1 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
          WHEN 2 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_n_val);
          WHEN 12 THEN DBMS_SQL.DEFINE_COLUMN(c,j,v_d_val);
        ELSE
          DBMS_SQL.DEFINE_COLUMN(c,j,v_v_val,2000);
        END CASE;
      END LOOP;
      -- This part outputs the HEADER
      v_fh := UTL_FILE.FOPEN(upper(p_dir),p_header_file,'w',32767);
      FOR j in 1..col_cnt
      LOOP
        v_finaltxt := ltrim(v_finaltxt||','||lower(rec_tab(j).col_name),',');
      END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
      UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      IF NOT v_samefile THEN
        UTL_FILE.FCLOSE(v_fh);
      END IF;
      -- This part outputs the DATA
      IF NOT v_samefile THEN
        v_fh := UTL_FILE.FOPEN(upper(p_dir),p_data_file,'w',32767);
      END IF;
      LOOP
        v_ret := DBMS_SQL.FETCH_ROWS(c);
        EXIT WHEN v_ret = 0;
        v_finaltxt := NULL;
        FOR j in 1..col_cnt
        LOOP
          CASE rec_tab(j).col_type
            WHEN 1 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_v_val);
                        v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
            WHEN 2 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_n_val);
                        v_finaltxt := ltrim(v_finaltxt||','||v_n_val,',');
            WHEN 12 THEN DBMS_SQL.COLUMN_VALUE(c,j,v_d_val);
                        v_finaltxt := ltrim(v_finaltxt||','||to_char(v_d_val,'DD/MM/YYYY HH24:MI:SS'),',');
          ELSE
            v_finaltxt := ltrim(v_finaltxt||',"'||v_v_val||'"',',');
          END CASE;
        END LOOP;
      --  DBMS_OUTPUT.PUT_LINE(v_finaltxt);
        UTL_FILE.PUT_LINE(v_fh, v_finaltxt);
      END LOOP;
      UTL_FILE.FCLOSE(v_fh);
      DBMS_SQL.CLOSE_CURSOR(c);
    END;This allows for the header row and the data to be written to seperate files if required.
    e.g.
    SQL> exec run_query('select * from emp','TEST_DIR','output.txt');
    PL/SQL procedure successfully completed.Output.txt file contains:
    empno,ename,job,mgr,hiredate,sal,comm,deptno
    7369,"SMITH","CLERK",7902,17/12/1980 00:00:00,800,,20
    7499,"ALLEN","SALESMAN",7698,20/02/1981 00:00:00,1600,300,30
    7521,"WARD","SALESMAN",7698,22/02/1981 00:00:00,1250,500,30
    7566,"JONES","MANAGER",7839,02/04/1981 00:00:00,2975,,20
    7654,"MARTIN","SALESMAN",7698,28/09/1981 00:00:00,1250,1400,30
    7698,"BLAKE","MANAGER",7839,01/05/1981 00:00:00,2850,,30
    7782,"CLARK","MANAGER",7839,09/06/1981 00:00:00,2450,,10
    7788,"SCOTT","ANALYST",7566,19/04/1987 00:00:00,3000,,20
    7839,"KING","PRESIDENT",,17/11/1981 00:00:00,5000,,10
    7844,"TURNER","SALESMAN",7698,08/09/1981 00:00:00,1500,0,30
    7876,"ADAMS","CLERK",7788,23/05/1987 00:00:00,1100,,20
    7900,"JAMES","CLERK",7698,03/12/1981 00:00:00,950,,30
    7902,"FORD","ANALYST",7566,03/12/1981 00:00:00,3000,,20
    7934,"MILLER","CLERK",7782,23/01/1982 00:00:00,1300,,10The procedure allows for the header and data to go to seperate files if required. Just specifying the "header" filename will put the header and data in the one file.
    Adapt to output different datatypes and styles are required.

  • Create Dynamic variant for date field

    Hello all,
    I need to have the current month year displayed in my selection screen in format MM.YYYY and the field is of type SPMON (Period to analyze - month).
    and while saving the variant it is showing only 'T' (entries from TVARVC table)  in  "selection variable" field and not showing 'D' (Dynamic selection) for the above field.
    So,please help me in resolving this issue.
    Thanks in advance.

    hi
    good
    go through this code,i hope this ll help you to create the dynamic variant.
    Please find the sample using RS_CREATE_VARIANT (FM).
    It make use of other FM also , just have a look .
    Hope this may help you.
    REPORT ZEXAMPLE.
    DATA: JVARI_DESC LIKE VARID,
    RC LIKE SY-SUBRC,
    VARIANT_TEXT LIKE VARIT-VTEXT,
    JVT LIKE VARIT OCCURS 0 WITH HEADER LINE,
    SELPA LIKE RSPARAMS OCCURS 0 WITH HEADER LINE,
    PARMS LIKE RSPARAMS OCCURS 0 WITH HEADER LINE,
    OBJS LIKE VANZ OCCURS 0 WITH HEADER LINE.
    PARAMETERS: P_VAR LIKE RSVAR-VARIANT. "NAME OF VARIANT
    JVARI_DESC-REPORT = SY-REPID.
    JVARI_DESC-VARIANT = P_VAR.
    JVARI_DESC-ENAME = 'EXAMPLES'.
    JVT-REPORT = SY-REPID.
    JVT-VARIANT = P_VAR.
    JVT-LANGU = SY-LANGU.
    JVT-VTEXT = 'FUNCTION EXAMPLES'.
    APPEND JVT.
    CLEAR SELPA.
    SELPA-SIGN = 'I'.
    SELPA-OPTION = 'EQ'.
    SELPA-KIND = 'P'.
    SELPA-SELNAME = 'P_VAR'.
    SELPA-LOW = P_VAR.
    APPEND SELPA.
    CHECK IF VARIANT EXISTS
    CALL FUNCTION 'RS_VARIANT_EXISTS'
    EXPORTING
    REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    IMPORTING
    R_C = RC
    EXCEPTIONS
    NOT_AUTHORIZED = 1
    NO_REPORT = 2
    REPORT_NOT_EXISTENT = 3
    REPORT_NOT_SUPPLIED = 4
    OTHERS = 5.
    IF RC = 0 AND SY-SUBRC EQ 0.
    DELETE OLD VARIANT
    CALL FUNCTION 'RS_VARIANT_DELETE'
    EXPORTING
    REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    FLAG_CONFIRMSCREEN = 'X'
    EXCEPTIONS
    NOT_AUTHORIZED = 1
    NOT_EXECUTED = 2
    NO_REPORT = 3
    REPORT_NOT_EXISTENT = 4
    REPORT_NOT_SUPPLIED = 5
    VARIANT_LOCKED = 6
    VARIANT_NOT_EXISTENT = 7
    NO_CORR_INSERT = 8
    VARIANT_PROTECTED = 9
    OTHERS = 10.
    IF SY-SUBRC NE 0.
    WRITE: 'UNABLE TO DELETE VARIANT:', P_VAR ,'STATUS=', SY-SUBRC.
    EXIT.
    ELSE.
    WRITE:/ P_VAR, 'DELETED'.
    ENDIF.
    ELSE.
    WRITE:/ P_VAR, 'DOES NOT EXIST'.
    ENDIF. " ALREADY EXISTS
    CALL FUNCTION 'RS_CREATE_VARIANT'
    EXPORTING
    CURR_REPORT = JVARI_DESC-REPORT
    CURR_VARIANT = P_VAR
    VARI_DESC = JVARI_DESC
    TABLES
    VARI_CONTENTS = SELPA
    VARI_TEXT = JVT
    EXCEPTIONS
    ILLEGAL_REPORT_OR_VARIANT = 1
    ILLEGAL_VARIANTNAME = 2
    NOT_AUTHORIZED = 3
    NOT_EXECUTED = 4
    REPORT_NOT_EXISTENT = 5
    REPORT_NOT_SUPPLIED = 6
    VARIANT_EXISTS = 7
    VARIANT_LOCKED = 8
    OTHERS = 9.
    IF SY-SUBRC EQ 0.
    WRITE:/ 'VARIANT', P_VAR, 'CREATED FOR PROGRAM', JVARI_DESC-REPORT.
    ELSE.
    WRITE:/ 'VARIANT', P_VAR, 'NOT CREATED FOR PROGRAM', JVARI_DESC-REPORT.
    EXIT.
    ENDIF.
    CALL FUNCTION 'RS_VARIANT_CONTENTS'
    EXPORTING
    REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    TABLES
    VALUTAB = PARMS
    OBJECTS = OBJS
    EXCEPTIONS
    VARIANT_NON_EXISTENT = 1
    VARIANT_OBSOLETE = 2
    OTHERS = 3.
    IF SY-SUBRC NE 0.
    WRITE : / 'ERROR READING VARIANT CONTENTS.'.
    ELSE.
    CALL FUNCTION 'RS_VARIANT_TEXT'
    EXPORTING
    LANGU = SY-LANGU
    CURR_REPORT = JVARI_DESC-REPORT
    VARIANT = P_VAR
    IMPORTING
    V_TEXT = VARIANT_TEXT.
    WRITE:/ 'VARIANT DESCRIPTION:', VARIANT_TEXT.
    LOOP AT PARMS.
    CHECK PARMS-LOW NE SPACE OR PARMS-HIGH NE SPACE.
    READ TABLE OBJS WITH KEY NAME = PARMS-SELNAME.
    WRITE : /2 PARMS-SELNAME, OBJS-TEXT,
    45 PARMS-KIND,
    PARMS-SIGN,
    PARMS-OPTION,
    PARMS-LOW,
    PARMS-HIGH.
    NEW-LINE.
    ENDLOOP.
    SKIP.
    ENDIF.
    some other approach....
    This function module selects the Selection Screen contents
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
    EXPORTING
    curr_report = sy-repid
    TABLES
    selection_table = loc_int_tab
    EXCEPTIONS
    not_found = 1
    no_report = 2
    OTHERS = 3.
    IF sy-subrc NE 0.
    MESSAGE i000 WITH 'Error in RS_REFRESH_FROM_SELECTOPTIONS'(029).
    LEAVE LIST-PROCESSING.
    ENDIF.
    Craete the variant VAR1
    CALL FUNCTION 'RS_CREATE_VARIANT'
    EXPORTING
    curr_report = sy-repid
    curr_variant = wf_variant
    vari_desc = loc_varid
    TABLES
    vari_contents = loc_int_tab
    vari_text = loc_varit
    EXCEPTIONS
    illegal_report_or_variant = 1
    illegal_variantname = 2
    not_authorized = 3
    not_executed = 4
    report_not_existent = 5
    report_not_supplied = 6
    variant_exists = 7
    variant_locked = 8
    OTHERS = 9.
    IF sy-subrc <> 0.
    MESSAGE i000 WITH 'Error while creating dynamic variant'(028).
    LEAVE LIST-PROCESSING.
    ENDIF.
    reward point if helpful.
    thanks
    mrutyun^

  • Salmple at How to Create Dynamical Object for RTTC

    Hi all, I need a sample at How to Create Dynamical Object for RTTC.
      you can help me?.

    Hello Martinez,
    I have attached a sample for structure types. With the Where-Used-List on the Create() Method of the various RTTC classes one may find more samples. If you meant with object on OO Type then it is to mention that this is not possible yet.
    Regards
      Klaus
    PROGRAM sample.
    DATA: sdescr1 TYPE REF TO cl_abap_structdescr,
          sdescr2 TYPE REF TO cl_abap_structdescr,
          tdescr1 TYPE REF TO cl_abap_tabledescr,
          tdescr2 TYPE REF TO cl_abap_tabledescr,
          tref1   TYPE REF TO data,
          tref2   TYPE REF TO data,
          comp    TYPE abap_component_tab,
          wa      TYPE t100,
          xbuf    TYPE xstring.
    FIELD-SYMBOLS: <tab1> TYPE table,
                   <tab2> TYPE table.
    sdescr1 ?= cl_abap_typedescr=>describe_by_name( 'T100' ).
    comp     = sdescr1->get_components( ).
    sdescr2  = cl_abap_structdescr=>create( comp ).
    tdescr1  = cl_abap_tabledescr=>create( sdescr2 ).
    tdescr2  = cl_abap_tabledescr=>create( sdescr2 ).
    CREATE DATA: tref1 TYPE HANDLE tdescr1,
                 tref2 TYPE HANDLE tdescr2.
    ASSIGN: tref1->* TO <tab1>,
            tref2->* TO <tab2>.
    wa-sprsl = 'E'. wa-arbgb = 'SY'. wa-msgnr = '123'. wa-text = 'first text'.   INSERT wa INTO TABLE <tab1>.
    wa-sprsl = 'D'. wa-arbgb = 'SY'. wa-msgnr = '456'. wa-text = 'second text'.  INSERT wa INTO TABLE <tab1>.
    wa-sprsl = 'D'. wa-arbgb = 'XY'. wa-msgnr = '001'. wa-text = 'third text'.   INSERT wa INTO TABLE <tab1>.
    wa-sprsl = 'D'. wa-arbgb = 'ZZ'. wa-msgnr = '123'. wa-text = 'fourth text'.  INSERT wa INTO TABLE <tab1>.
    wa-sprsl = 'E'. wa-arbgb = 'SY'. wa-msgnr = '123'. wa-text = 'ABAP is a miracle'. INSERT wa INTO TABLE <tab1>.
    EXPORT tab = <tab1> TO DATA BUFFER xbuf.
    IMPORT tab = <tab2> FROM DATA BUFFER xbuf.
    LOOP AT <tab2> INTO wa.
      WRITE: / wa-sprsl, wa-arbgb, wa-msgnr, wa-text.
    ENDLOOP.

  • Dynamic recordset

    So, i have a page that allows a user to select a value from a menu... once they choose the value, and hit submit they then go to a new page that grabs the value and needs to search in a different db table depending on the value of the menu item from their submital.
    Here is the problem... how do i tell dreamweaver to basically run a different recordset depending on the value of the menu item... OR, how do i write one dynamic recordset that is set based on the value of the menu item submited.
    Thanks for any ideas.

    >Yea, i tried that before... but dreamweaver did not like it at all.
    Yes, you'll need to code this by hand. And once you modify DW code, you won't be able to manage it with DW server behaviors because DW will no longer recognize it.
    >The reason they are looking in different tables is becuase depending
    >on the selection they choose the results reside in different tables.
    The reason I ask is because 99% of the time people asked about this, it's because they are using multiple tables to store data that belongs in the same table. I don't know enough about your applications, but the fact that each table will return the same result set columns makes me think that might be the case here.

  • Dynamically table for sapscript

    hi expects,
    how could i create dynamical table for form in script.

    hi,
      to pass the table to script means passing a field sting to script by using function module write_form.
    example program,
    TABLES: SPFLI,SFLIGHT.
    DATA: BEGIN OF FS_SFLIGHT,
            CARRID TYPE SPFLI-CARRID,
            CONNID TYPE SPFLI-CONNID,
            FLDATE TYPE SFLIGHT-FLDATE,
            CITYFROM TYPE SPFLI-CITYFROM,
            CITYTO TYPE SPFLI-CITYTO,
          END OF FS_SFLIGHT.
    TABLES SCARR.
    DATA T_SCARR LIKE STANDARD TABLE OF SCARR.
    DATA: W_LINES TYPE I,
          W_P TYPE I,
         W_TEMP  TYPE I  .
    DATA T_FLIGHT LIKE STANDARD TABLE OF FS_SFLIGHT.
    SELECT SPFLI~CARRID
           SPFLI~CONNID
           SFLIGHT~FLDATE
           SPFLI~CITYFROM
           SPFLI~CITYTO
      INTO CORRESPONDING FIELDS OF TABLE T_FLIGHT
      FROM SPFLI AS SPFLI JOIN SFLIGHT AS SFLIGHT
      ON   SPFLICARRID = SFLIGHTCARRID AND
           SPFLICONNID = SFLIGHTCONNID
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
      APPLICATION                       = 'TX'
      ARCHIVE_INDEX                     =
      ARCHIVE_PARAMS                    =
      DEVICE                            = 'PRINTER'
      DIALOG                            = 'X'
       FORM                              = 'YH648_060104'
      LANGUAGE                          = SY-LANGU
      OPTIONS                           =
      MAIL_SENDER                       =
      MAIL_RECIPIENT                    =
      MAIL_APPL_OBJECT                  =
      RAW_DATA_INTERFACE                = '*'
      SPONUMIV                          =
    IMPORTING
      LANGUAGE                          =
      NEW_ARCHIVE_PARAMS                =
      RESULT                            =
    EXCEPTIONS
       CANCELED                          = 1
       DEVICE                            = 2
       FORM                              = 3
       OPTIONS                           = 4
       UNCLOSED                          = 5
       MAIL_OPTIONS                      = 6
       ARCHIVE_ERROR                     = 7
       INVALID_FAX_NUMBER                = 8
       MORE_PARAMS_NEEDED_IN_BATCH       = 9
       SPOOL_ERROR                       = 10
       CODEPAGE                          = 11
       OTHERS                            = 12
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    DESCRIBE TABLE T_FLIGHT LINES W_LINES.
    LOOP AT T_FLIGHT INTO FS_SFLIGHT.
      ADD 1 TO W_TEMP.
    IF W_LINES NE W_TEMP.
      CALL FUNCTION 'WRITE_FORM'
       EXPORTING
         ELEMENT                        = 'BOXES'
        FUNCTION                       = 'SET'
         TYPE                           = 'TOP'
        WINDOW                         = 'MAIN'
      IMPORTING
        PENDING_LINES                  =
      EXCEPTIONS
        ELEMENT                        = 1
        FUNCTION                       = 2
        TYPE                           = 3
        UNOPENED                       = 4
        UNSTARTED                      = 5
        WINDOW                         = 6
        BAD_PAGEFORMAT_FOR_PRINT       = 7
        SPOOL_ERROR                    = 8
        CODEPAGE                       = 9
        OTHERS                         = 10
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ELSE.
    IF W_TEMP NE W_LINES.
    AT NEW  CONNID.
        CALL FUNCTION 'WRITE_FORM'
           EXPORTING
             ELEMENT                        = 'DATA'
            FUNCTION                       = 'SET'
             TYPE                           = 'BODY'
            WINDOW                         = 'MAIN'
          IMPORTING
            PENDING_LINES                  =
           EXCEPTIONS
             ELEMENT                        = 1
             FUNCTION                       = 2
             TYPE                           = 3
             UNOPENED                       = 4
             UNSTARTED                      = 5
             WINDOW                         = 6
             BAD_PAGEFORMAT_FOR_PRINT       = 7
             SPOOL_ERROR                    = 8
             CODEPAGE                       = 9
             OTHERS                         = 10
          IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    ENDIF.
    ENDAT.
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
             ELEMENT                        = 'DATA1'
            FUNCTION                       = 'SET'
             TYPE                           = 'BODY'
            WINDOW                         = 'MAIN'
          IMPORTING
            PENDING_LINES                  =
           EXCEPTIONS
             ELEMENT                        = 1
             FUNCTION                       = 2
             TYPE                           = 3
             UNOPENED                       = 4
             UNSTARTED                      = 5
             WINDOW                         = 6
             BAD_PAGEFORMAT_FOR_PRINT       = 7
             SPOOL_ERROR                    = 8
             CODEPAGE                       = 9
             OTHERS                         = 10
          IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    ELSE.
      SELECT CARRID CARRNAME
      FROM SCARR
      INTO TABLE T_SCARR.
      LOOP AT T_SCARR INTO SCARR.
      CALL FUNCTION 'WRITE_FORM'
           EXPORTING
             ELEMENT                        = 'PROTECT1'
            FUNCTION                       = 'SET'
            TYPE                           = 'BODY'
             WINDOW                         = 'WINDOW2'
          IMPORTING
            PENDING_LINES                  =
           EXCEPTIONS
             ELEMENT                        = 1
             FUNCTION                       = 2
             TYPE                           = 3
             UNOPENED                       = 4
             UNSTARTED                      = 5
             WINDOW                         = 6
             BAD_PAGEFORMAT_FOR_PRINT       = 7
             SPOOL_ERROR                    = 8
             CODEPAGE                       = 9
             OTHERS                         = 10
          IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
         ENDLOOP.
    ENDIF.
    ENDLOOP.
    IF W_LINES NE W_TEMP.
      CALL FUNCTION 'WRITE_FORM'
       EXPORTING
         ELEMENT                        = 'LAST'
        FUNCTION                       = 'SET'
        TYPE                           = 'TOP'
        WINDOW                         = 'MAIN'
      IMPORTING
        PENDING_LINES                  =
      EXCEPTIONS
        ELEMENT                        = 1
        FUNCTION                       = 2
        TYPE                           = 3
        UNOPENED                       = 4
        UNSTARTED                      = 5
        WINDOW                         = 6
        BAD_PAGEFORMAT_FOR_PRINT       = 7
        SPOOL_ERROR                    = 8
        CODEPAGE                       = 9
        OTHERS                         = 10
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    CALL FUNCTION 'CLOSE_FORM'
    IMPORTING
      RESULT                         =
      RDI_RESULT                     =
    TABLES
      OTFDATA                        =
    EXCEPTIONS
       UNOPENED                       = 1
       BAD_PAGEFORMAT_FOR_PRINT       = 2
       SEND_ERROR                     = 3
       SPOOL_ERROR                    = 4
       CODEPAGE                       = 5
       OTHERS                         = 6
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    to draw boxes on script the syntax will be
    Boxes, Lines, Shading: BOX, POSITION, SIZE
    Use the BOX, POSITION, and SIZE commands for drawing boxes, lines, and shading to print particular windows within a form or passages of text within a window in a frame or with shading.
    The SAP printer drivers that are based on page-oriented printers (the HP LaserJet driver HPL2, the Postscript driver POST, the Kyocera Prescribe driver PRES) employ these commands when printing. Line printers and page-oriented printers not supported in the standard ignore these commands. You can view the resulting printer output in the SAPscript print preview.
    Syntax:
    /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
    /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
    /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
    BOX Command
    Syntax
    /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]
    Effect: draws a box of the specified size at the specified position.
    Parameters: For each of XPOS, YPOS, WIDTH, HEIGHT, and FRAME, you must specify both a measurement and a unit of measurement. Specify the INTENSITY parameter as a percentage between 0 and 100.
    XPOS, YPOS
    Upper left corner of the box, relative to the values of the POSITION command.
    Default: Values specified in the POSITION command.
    The following calculation is performed internally to determine the absolute output position of a box on the page:
    X(abs) = XORIGIN + XPOS
    Y(abs) = YORIGIN + YPOS
    WIDTH
    Width of the box. Default: WIDTH value of the SIZE command.
    HEIGHT
    Height of the box. Default: HEIGHT value of the SIZE command.
    FRAME
    Thickness of frame.
    Default: 0 (no frame).
    INTENSITY
    Grayscale of box contents as %.
    Default: 100 (full black)
    Measurements: You must specify decimal numbers as literal values (like ABAP numeric constants) by enclosing them in inverted commas. Use the period as the decimal point character. See also the examples listed below.
    Units of measurement: The following units of measurement may be used:
    TW (twip)
    PT (point)
    IN (inch)
    MM (millimeter)
    CM (centimeter)
    LN (line)
    CH (character).
    The following conversion factors apply:
    1 TW = 1/20 PT
    1 PT = 1/72 IN
    1 IN = 2.54 CM
    1 CM = 10 MM
    1 CH = height of a character relative to the CPI specification in the form header
    1 LN = height of a line relative to the LPI specification in the form header
    /: BOX FRAME 10 TW
    Draws a frame around the current window with a frame thickness of 10 TW (= 0.5 PT).
    /: BOX INTENSITY 10
    Fills the window background with shading having a gray scale of 10 %.
    /: BOX HEIGHT 0 TW FRAME 10 TW
    Draws a horizontal line across the complete top edge of the window.
    /: BOX WIDTH 0 TW FRAME 10 TW
    Draws a vertical line along the complete height of the left hand edge of the window.
    /: BOX WIDTH '17.5' CM HEIGHT 1 CM FRAME 10 TW INTENSITY 15
    /: BOX WIDTH '17.5' CM HEIGHT '13.5' CM FRAME 10 TW
    /: BOX XPOS '10.0' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
    /: BOX XPOS '13.5' CM WIDTH 0 TW HEIGHT '13.5' CM FRAME 10 TW
    Draws two rectangles and two lines to construct a table of three columns with a highlighted heading section.
    POSITION Command
    Syntax
    /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
    Effect: Sets the origin for the coordinate system used by the XPOS and YPOS parameters of the BOX command. When a window is first started, the POSITION value is set to refer to the upper left corner of the window (default setting).
    Parameters: If a parameter value does not have a leading sign, then its value is interpreted as an absolute value, in other words, as a value that specifies an offset from the upper left corner of the output page. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value. If one of the parameter specifications is missing, then no change is made to this parameter.
    XORIGIN, YORIGIN
    Origin of the coordinate system.
    WINDOW
    Sets the values for the left and upper edges to match those of the current window (default setting).
    PAGE
    Sets the values for the left and upper edges to match those of the current output page (XORIGIN = 0 cm, YORIGIN = 0 cm).
    /: POSITION WINDOW
    Sets the origin for the coordinate system to the upper left corner of the window.
    /: POSITION XORIGIN 2 CM YORIGIN '2.5 CM'
    Sets the origin for the coordinate system to a point 2 cm from the left edge and 2.5 cm from the upper edge of the output page.
    /: POSITION XORIGIN '-1.5' CM YORIGIN -1 CM
    Shifts the origin for the coordinates 1.5 cm to the left and 1 cm up.
    SIZE Command
    Syntax
    /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
    Effect: Sets the values of the WIDTH and HEIGHT parameters used in the BOX command. When a window is first started, the SIZE value is set to the same values as the window itself (default setting).
    Parameters: If one of the parameter specifications is missing, then no change is made to the current value of this parameter. If a parameter value does not have a leading sign, then its value is interpreted as an absolute value. If a parameter value is specified with a leading sign, then the new value of the parameter is calculated relative to the old value.
    WIDTH, HEIGHT
    Dimensions of the rectangle or line.
    WINDOW
    Sets the values for the width and height to the values of the current window (default setting).
    PAGE
    Sets the values for the width and height to the values of the current output page.
    /: SIZE WINDOW
    Sets WIDTH and HEIGHT to the current window dimensions.
    /: SIZE WIDTH '3.5' CM HEIGHT '7.6' CM
    Sets WIDTH to 3.5 cm and HEIGHT to 7.6 cm.
    /: POSITION WINDOW
    /: POSITION XORIGIN -20 TW YORIGIN -20 TW
    /: SIZE WIDTH +40 TW HEIGHT +40 TW
    /: BOX FRAME 10 TW
    A frame is added to the current window. The edges of the frame extend beyond the edges of the window itself, so as to avoid obscuring the leading and trailing text characters.

  • Highest speed for a loop in the microprocessor of my CRIO?

    Hello:
    Im trying to develop a control system for an inverter with with my CRIO 9022, the speed of my system is 10 kHz(the switching frequency for the inverter is 10 kHz).
    Im trying to develop the controller using the microprocesor, but I was reading that the highest speed achievable for a loop in the microprocessor is around 1 Khz, is this true?
    If is it, how can I develop a control with a loop of 10 Khz? this speed is only achievable using the FPGA?
    Thanks a lot!
    Regards

    Sorry for dont attach the subVI, but the calculation that I perform inside are not diffcult, the first one is only aritmetic calculations and the second one is a PID (I attach them).
    Maybe I can try to move them to the FPGA, but would be very tedious because I need huge times for compile and if I want to make any change will be very more difficult.
    Do you think that the processor can not carry out these loop a higher speed than 400 Hz?
    Thanks
    Attachments:
    SubVI1.PNG ‏50 KB
    SubVI2(PID).PNG ‏81 KB

  • How to set up Dynamic Variants for job which is based on Pay Period

    Hi,
    We need to set up dynamic variant for payroll interface.  This interface is based on Pay periods and that is why we need to use different variant for each month.  Letus know how to set up dynamic variant which will take care of Pay Periods

    Hi,  Thnx for reply.
    We are not changing the control records, current period will be some old period in system. 
    payroll is not processed in SAP,

  • How to know the dynamic values for this :AND category_id_query IN (1, :3, )

    Hi Team,
    R12 Instance :
    Oracle Installed Base Agent User Responsibility --> Item Instances -->
    Item Instance: Item Instances > View : Item Instance : xxxxx> Contracts : Item Instance : xxxxx> Service Contract: xxxxx>
    In the above page there are two table regions.
    Notes.
    -------------------------------------Table Region---------------------------
    Attachments
    -------------------------------------Table Region---------------------------
    --the attachments are shown using the query from the fnd_lobs and fnd_docs etc...
    I want to know what are the document types are displayed in this page ?
    --We developed a custom program to attach the attachments to the  services contracts and the above seeded OAF page displays those ..as needed.
    But after recent changes..the Attachments--> table region is not showing the attachments.
    I have verified the query..and could not find any clue in that..
    but i need some help if you guys can provide..
    SELECT *
    FROM
    *(SELECT d.DOCUMENT_ID,*
    d.DATATYPE_ID,
    d.DATATYPE_NAME,
    d.DESCRIPTION,
    DECODE(d.FILE_NAME, NULL,
    *(SELECT message_text*
    FROM fnd_new_messages
    WHERE message_name = 'FND_UNDEFINED'
    AND application_id = 0
    AND language_code  = userenv('LANG')
    *), d.FILE_NAME)FileName,*
    d.MEDIA_ID,
    d.CATEGORY_ID,
    d.DM_NODE,
    d.DM_FOLDER_PATH,
    d.DM_TYPE,
    d.DM_DOCUMENT_ID,
    d.DM_VERSION_NUMBER,
    ad.ATTACHED_DOCUMENT_ID,
    ad.ENTITY_NAME,
    ad.PK1_VALUE,
    ad.PK2_VALUE,
    ad.PK3_VALUE,
    ad.PK4_VALUE,
    ad.PK5_VALUE,
    d.usage_type,
    d.security_type,
    d.security_id,
    ad.category_id attachment_catgeory_id,
    ad.status,
    d.storage_type,
    d.image_type,
    d.START_DATE_ACTIVE,
    d.END_DATE_ACTIVE,
    d.REQUEST_ID,
    d.PROGRAM_APPLICATION_ID,
    d.PROGRAM_ID,
    d.category_description,
    d.publish_flag,
    DECODE(ad.category_id, NULL, d.category_id, ad.category_id) category_id_query,
    d.URL,
    d.TITLE
    FROM FND_DOCUMENTS_VL d,
    FND_ATTACHED_DOCUMENTS ad
    WHERE d.DOCUMENT_ID = ad.DOCUMENT_ID
    *) QRSLT*
    WHERE ((entity_name    ='OKC_K_HEADERS_V'-- :1
    AND pk1_value          IN ( 600144,599046) --:2
    AND category_id_query IN (1, :3, :4, :5, :6, :7) )
    AND datatype_id       IN (6,2,1,5)
    AND (SECURITY_TYPE     =4
    OR PUBLISH_FLAG        ='Y')))
    --='000180931' -- 'ADP118'
    The above seeded query is the one which is used for table region to retrieve the data..
    how to know the dynamic values for this : AND category_id_query IN (1, :3, :4, :5, :6, :7) )
    --Sridhar                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi Patricia,
    is it working for restricted key figure and calculated key figure ??
    Note Number Fisc Period Opening Days
    1 1 2
    2 1 3
    3 1 0
    because I have other restriction, so I create two restricted key figure..
    RK1  with restriction :  Total Number of Note,
    RK2  with restriction :  Total Opening Days ,
    then I Created a calculated key figure, average opening days in a period
    CK1 = RK2 / RK1..
    in this case, I am not sure if it will work or not..
    for example, during RK2 calclation, it might be this   2+3 = 5, the line with 0 will be ignored..
    during RK1 calcualtion, it might be 1 + 1 + 1 = 3. ---> Not sure in this case, the line with opening days 0 will be calculated or not..
    could you please confirm..

Maybe you are looking for

  • Messaging server  7 duplicate folders

    Sun Java(tm) System Messaging Server 7.3-11.01 64bit (built Sep 1 2009) libimta.so 7.3-11.01 64bit (built 19:54:45, Sep 1 2009) Using /opt/sun/comms/messaging64/config/imta.cnf (compiled) SunOS 5.10 Generic_142900-03 sun4v sparc SUNW,SPARC-Enterprise

  • Zen vision M Video -

    Is it possible to plug your zen vision m to the tv to record off it's Is there a cable? I thought you could record off the telivision or cant you? And why doesnt the converter work well with wmp formats? It wont convert the videos i try to put on tha

  • Connection with SQL server 2000

    Hello.I could sure use help here :) I have JBuilder 9 and jdk1.4(OS Windows XP).I have downloaded from Microsoft the driver for Sql server and installed it.I fixed the classpath too.But when I try to connect I cant get it work. I have the next source

  • Visual Administrator - Login Problem

    hi all, I am having problem starting visual administrator.since i am a new user here, i am provided with the user id/password ( not Administrator UID/PW ) and told that it has necessary authorizations. when i try to start the VA by using my UID/PW an

  • Using Time capsule via internet

    if my time capsule is at home, can i have access via internet from my company?