ORA-22902 CURSOR expression not allowed Error Cause: CURSOR on a subquery..

Hi,
I found same issue in a metalink thread which is addressed in Oracle 12.1 which doesn't help me now. I need to rewrite the below query. Does anyone have any suggestions how to go about it?
thanks,
April
working in Oracle 11.2.0.3.1, windows server, doing an upgrade from 10g to 11g. Piece of code is failing with following error via TOAD
Oracle Database Error Code ORA-22902 Description :
CURSOR expression not allowed
Error Cause:
CURSOR on a subquery is allowed only in the top-level SELECT list of a query.
The below code is returning a tree of data for projects, units within the buildings.
Code as follows:
SELECT LEVEL
, p.project_id
|| NVL (p.file_ref, ' ')
|| '] ['
|| NVL (p.project_ref, ' ')
|| '] '
|| p.project_name
|| ' ( '
|| (SELECT COUNT (*)
FROM PROJECT p1
WHERE p1.parent_project_id = p.project_id)
|| ' sub-projects, '
|| (SELECT COUNT (*)
FROM PROJECT_ELEMENT pe2
WHERE pe2.project_id = p.project_id)
|| ' elements)' AS project_description
CURSOR
(SELECT pe.element_id
|| pe.element_ref
|| '] '
|| pe.element_name
|| ' ('
|| pe.unit_count
|| ')' AS element_description
CURSOR
(SELECT hu.hu_id
|| hu.hu_ref
|| '] '
|| CASE
WHEN hu.bedroom_count IS NOT NULL
THEN ', Bedrooms: ' || hu.bedroom_count
ELSE NULL
END
|| CASE
WHEN hu.bedspace_count IS NOT NULL
THEN ', Bedspaces: ' || hu.bedspace_count
ELSE NULL
END AS hu_descripton
FROM HOUSING_UNIT hu
WHERE hu.element_id = pe.element_id
ORDER BY hu.hu_ref
) AS housing_units
FROM PROJECT_ELEMENT pe
WHERE pe.project_id = p.project_id
ORDER BY pe.element_ref, pe.element_name
) elements
FROM PROJECT p
START WITH p.project_id = l_root_project_id
CONNECT BY PRIOR p.project_id = p.parent_project_id -- connect by used with LEVEL keyword
ORDER SIBLINGS BY p.file_ref DESC
, p.project_ref DESC
, p.project_name DESC;
Edited by: AprilM on Jul 17, 2012 10:28 AM

Interesting. I am getting even worse results on 11.2.0.1.0:
SQL> select * from v$version
  2  /
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE    11.2.0.1.0      Production
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL> select dname,cursor(select ename from emp e where e.deptno = d.deptno) from dept d
  2  /
select dname,cursor(select ename from emp e where e.deptno = d.deptno) from dept d
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-00905: missing keyword
SQL> connect scott
Enter password: *****
Connected.
SQL> select * from v$version
  2  /
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
PL/SQL Release 10.2.0.4.0 - Production
CORE    10.2.0.4.0      Production
TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> select dname,cursor(select ename from emp e where e.deptno = d.deptno) from dept d
  2  /
DNAME          CURSOR(SELECTENAMEFR
ACCOUNTING     CURSOR STATEMENT : 2
CURSOR STATEMENT : 2
ENAME
CLARK
KING
MILLER
RESEARCH       CURSOR STATEMENT : 2
CURSOR STATEMENT : 2
ENAME
SMITH
JONES
SCOTT
ADAMS
FORD
SALES          CURSOR STATEMENT : 2
CURSOR STATEMENT : 2
ENAME
ALLEN
WARD
MARTIN
BLAKE
TURNER
JAMES
6 rows selected.
OPERATIONS     CURSOR STATEMENT : 2
CURSOR STATEMENT : 2
no rows selected
SQL> And double CURSOR also works fine in 10g:
SQL> select cursor(select dname,cursor(select ename from emp e where e.deptno = d.deptno) from dept d) from dual
  2  /
CURSOR(SELECTDNAME,C
CURSOR STATEMENT : 1
CURSOR STATEMENT : 1
DNAME          CURSOR(SELECTENAMEFR
ACCOUNTING     CURSOR STATEMENT : 2
CURSOR STATEMENT : 2
ENAME
CLARK
KING
MILLER
RESEARCH       CURSOR STATEMENT : 2
CURSOR STATEMENT : 2
ENAME
SMITH
JONES
SCOTT
ADAMS
FORD
SALES          CURSOR STATEMENT : 2
CURSOR STATEMENT : 2
ENAME
ALLEN
WARD
MARTIN
BLAKE
TURNER
JAMES
6 rows selected.
OPERATIONS     CURSOR STATEMENT : 2
CURSOR STATEMENT : 2
no rows selectedSY.
Edited by: Solomon Yakobson on Jul 17, 2012 1:27 PM

Similar Messages

  • Help regarding Materialized view ( subquery expression not allowed here )

    Hi all,
    while creating materialized view i got following error
    ORA- 22818
    subquery expression not allowed here
    following is my query
    CREATE  MATERIALIZED VIEW MV_NAV_REC
    BUILD IMMEDIATE
    REFRESH COMPLETE ON DEMAND
    as
    select folio_no FOLIONO,CHKDIGIT as Check_Digit,sch_code SCHEMECODE, sysdate as FOLIODATE ,
         (select case when count(distinct SUBBROKERCODE) =1 then to_char(max(SUBBROKERCODE)) else 'Multiple Broker' end   from transaction_st
         where folio_no = tst.folio_no
         group by  folio_no)  ARN_Number ,
         (select sum(case when tran_type in ('PURCHASE','SWITCH IN') then UNITS else 0 - UNITS end ) from transaction_st
         where folio_no = tst.folio_no AND SCH_CODE = tst.sch_code
         group by  folio_no,sch_code)  NUM_UNITS_NEW ,
    --SUM (case when tran_type NOT in ('REDEMPTION','SWITCH OUT') THEN UNITS ELSE 0 - UNITS END )  AS  Num_Units,
         (select sum(case when tran_type in ('PURCHASE','SWITCH IN') then AMOUNT else 0 - AMOUNT end ) from transaction_st
         where folio_no = tst.folio_no AND SCH_CODE = tst.sch_code
         group by  folio_no,SCH_CODE) as NUM_AMOUNT_NEW ,
    --SUM (case when tran_type NOT in ('REDEMPTION','SWITCH OUT') THEN AMOUNT ELSE 0 -AMOUNT  END )  AS  Scheme_Amount,
    sum(  CASE WHEN upper(tran_type) NOT in ('REDEMPTION','SWITCH OUT') THEN
                 units * (select nav_rs from nav_rec where nav_rec.sch_code = tst.sch_code and nav_rec."Date" = /*trunc(sysdate)*/to_date('23/03/2009','dd/mm/yyyy'))
               ELSE  (0 - units) * (select nav_rs from nav_rec where nav_rec.sch_code = tst.sch_code and nav_rec."Date" = /*trunc(sysdate)*/to_date('23/03/2009','dd/mm/yyyy')) END  ) Scheme_Valuation ,
    null as SCHEMEPHRASEID ,
    null as "Prefered Mode of SOA",
    (  select sum(      case when upper(tran_type) NOT in ('REDEMPTION','SWITCH OUT') THEN AMOUNT ELSE 0 - AMOUNT END  ) from transaction_st t where t.folio_no = tst.folio_no group by folio_no )  as Folio_Amount,
                   select sum(CASE when upper(tran_type) NOT in ('REDEMPTION','SWITCH OUT') THEN
                                              units * ( select nav_rs from nav_rec where nav_rec.sch_code = ts.sch_code and nav_rec."Date" = /*trunc(sysdate)*/to_date('23/03/2009','dd/mm/yyyy'))
                                  ELSE
                                      (0 - units) * ( select nav_rs from nav_rec where nav_rec.sch_code = ts.sch_code and nav_rec."Date" = /*trunc(sysdate)*/to_date('23/03/2009','dd/mm/yyyy')) END     
                                  )  from transaction_st ts where ts.folio_no =tst.folio_no  group by ts.folio_no
    ) as Folio_Valuation
    from transaction_st   tst 
    group by folio_no ,sch_code,CHKDIGIT
    order by folio_no , SCH_CODE
    please help me

    Hi,
    You cannot use scalar subqueries in a materialized view.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:4110947624538#22981269011674
    edit
    From 10g doc:
    ORA-22818: subquery expressions not allowed here
    Cause: An attempt was made to use a subquery expression where these are not supported.
    Action: Rewrite the statement without the subquery expression.
    (http://download.oracle.com/docs/cd/B19306_01/server.102/b14219/e19400.htm#sthref6020)
    Edited by: hoek on Jun 10, 2009 7:56 AM

  • Received ORA-22818 subquery expressions not allowed here when creating mate

    Hello,
    I was trying to create a materialized view to describe the referential integrity between the tables in my schema:
    create materialized view user_references
    tablespace tbspc
    build immediate
    using index
    refresh complete on demand next sysdate + 1
    as
    select uic.table_name to_table, uic.column_name to_column,
    ucc.table_name from_table, ucc.column_name from_column
    from user_ind_columns uic, user_constraints uc, user_cons_columns ucc
    where uic.index_name = uc.r_constraint_name
    and uc.constraint_name = ucc.constraint_name
    and uc.owner=upper('my_schema');
    I was able to create this MV in Oracle 9.2. It failed with the following error when I ran it against Oracle 10.1:
    from user_ind_columns uic, user_constraints uc, user_cons_columns ucc
    ERROR at line 9:
    ORA-22818: subquery expressions not allowed here
    Is not allowing subqueries in MV a new restriction in Oracle 10? Is there a workaround?
    Thanks

    Hello
    This may be a bug in your version as I can do it successfully on 10.2
    tylerd@DEV2> create materialized view user_references
      2  build immediate
      3  using index
      4  refresh complete on demand next sysdate + 1
      5  as
      6  select uic.table_name to_table, uic.column_name to_column,
      7  ucc.table_name from_table, ucc.column_name from_column
      8  from user_ind_columns uic, user_constraints uc, user_cons_columns ucc
      9  where uic.index_name = uc.r_constraint_name
    10  and uc.constraint_name = ucc.constraint_name
    11  and uc.owner=upper('my_schema');
    Materialized view created.
    tylerd@DEV2> select * from v$version
      2  /
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Prod
    PL/SQL Release 10.2.0.2.0 - Production
    CORE    10.2.0.2.0      Production
    TNS for 32-bit Windows: Version 10.2.0.2.0 - Production
    NLSRTL Version 10.2.0.2.0 - Production
    5 rows selected.HTH
    David

  • Materialized view ....subquery expression not allowed

    Hi,
    I have been assigned to create a materialized view using the following subquery.
    When I executed it is giving error ora-22818:subquery expressions not allowed here. The same query is good for view but not MV.
    Can anybody help me in writing MV for my query.
    select rownum as ROWNUMBER,f.id Folder_ID, concatyear(f.id) year_name,
    (select nvl(fr.requestor,fr.requested_by) from fts_folder_request fr where
    fr.folder_id=f.id and fr.status=0 ) Pending_Requestor,
    (select nvl(fr.requestor,fr.requested_by)
    from fts_folder_request fr,fts_folder_checkout_history fch where
    fr.folder_id=f.id and fch.folder_requested=fr.id and fch.return_date is null) CheckOut_To from fts_folder f;
    Thanks in advance.

    Any help in creating MV for my query.It contains subquery expressions that have to be avoided in MV.
    select rownum as ROWNUMBER,f.id Folder_ID, concatyear(f.id) year_name,
    (select nvl(fr.requestor,fr.requested_by) from fts_folder_request fr where
    fr.folder_id=f.id and fr.status=0 ) Pending_Requestor,
    (select nvl(fr.requestor,fr.requested_by)
    from fts_folder_request fr,fts_folder_checkout_history fch where
    fr.folder_id=f.id and fch.folder_requested=fr.id and fch.return_date is null) CheckOut_To from fts_folder f;
    Thanks.
    Message was edited by:
    user617694

  • ORA-30563, Outer Join not allowed in select list

    I can not find any information about this error message that I am getting.
    I have just upgraded my Oracle database from Version 7.3 to Version 8.1.7, a stored procedure that was written in v7.3 has outer joins in the select statement.
    when trying to run this proc in version 8 I get this meesage.(ORA-30563, Outer Join not allowed in select list)
    code ex:
    Select alt.id
    decode(alt.advise, NULL, NULL, AA.act_yr(+))||'-'||AA.act_per(+)||'-'||AA.Acc_per_no(+)) as advise_no
    from alt, AA;
    Is there any information about this message anywhere? or does anybody know if this is a known issue with oracle ver 8.1.7?
    Thanks
    CJ

    It appears to have been a bug in 7.x
    From a metalink note on bugs fixed in 8i (doc 132632.1)
    974742 Oracle does not report an error if (+) is specified in select-list. The OUTER JOIN operator (+) is only valid in WHERE clause predicates. As this is not flagged as an error the query can give unexpected results. The correct action to avoid this problem is to fix the query.
    Ken

  • ORA-01733- virtual column not allowed here  - Insert using inline view

    Does anyone know why I am getting ORA-01733- virtual column not allowed here
    SQL> select * from v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE 11.1.0.6.0 Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    ---no error without WITH CHECK option
    SQL> INSERT INTO
    2 (SELECT
    3 location_id,
    4 city,
    5 l.country_id
    6 FROM countries c, locations l,regions r
    7 where l.country_id = c.country_id
    8 and r.region_id=c.region_id
    9 and r.region_name = 'Asia')
    10 VALUES (5500, 'Wansdworth Common', 'UK');
    1 row created.
    SQL> rollback;
    Rollback complete.
    -----error with WITH CHECK OPTION
    SQL> INSERT INTO
    2 (SELECT
    3 location_id,
    4 city,
    5 l.country_id
    6 FROM countries c, locations l,regions r
    7 where l.country_id = c.country_id
    8 and r.region_id=c.region_id
    9 and r.region_name = 'Asia' WITH CHECK OPTION)
    10 VALUES (5500, 'Wansdworth Common', 'UK');
    INSERT INTO
    ERROR at line 1:
    ORA-01733: virtual column not allowed here
    I was expecting
    ORA-01402: view WITH CHECK OPTION where-clause violation
    for the second one. Is there anything I am missing here ?

    Randolf
    Thank you very much for the update to this old question
    After reading the link I think I should ignore this error and accept it as ORA-01402
    The information you asked me to check did not lead me an understanding of different error types.
    SQL> ----view for ORA-01733
    SQL> create view test_v_1
      2  as
      3  SELECT
      4  location_id,
      5  city,
      6  l.country_id
      7  FROM countries c, locations l,regions r
      8  where l.country_id = c.country_id
      9  and r.region_id=c.region_id
    10  and r.region_name = 'Asia' WITH CHECK OPTION;
    View created.
    SQL>
    SQL>
    SQL>
    SQL> select * from user_updatable_columns where table_name='TEST_V_1';
    OWNER                          TABLE_NAME                     COLUMN_NAME                    UPD INS DEL
    HR                             TEST_V_1                       CITY                           YES YES YES
    HR                             TEST_V_1                       COUNTRY_ID                     NO  NO  NO
    HR                             TEST_V_1                       LOCATION_ID                    YES YES YES
    SQL>
    SQL> ----view for ORA-01402
    SQL>
    SQL> create view test_v_2
      2  as
      3  SELECT
      4  d.department_id,
      5  d.department_name,
      6  d.location_id
      7  FROM hr.departments d,hr.locations l
      8  WHERE l.location_id=d.location_id
      9  and d.location_id < 2000
    10  WITH CHECK OPTION;
    View created.
    SQL>
    SQL> select * from user_updatable_columns where table_name='TEST_V_2';
    OWNER                          TABLE_NAME                     COLUMN_NAME                    UPD INS DEL
    HR                             TEST_V_2                       DEPARTMENT_ID                  YES YES YES
    HR                             TEST_V_2                       DEPARTMENT_NAME                YES YES YES
    HR                             TEST_V_2                       LOCATION_ID                    NO  NO  NO
    SQL>
    SQL>
    SQL> ----INSERT STILL FAILING WITH DIFFERENT ERROR DESPITE THE SAME UPDATABLE COLUMN STRUCTURE
    SQL> insert into test_v_1 values  (5500, 'Wansdworth Common', 'UK');
    insert into test_v_1 values  (5500, 'Wansdworth Common', 'UK')
    ERROR at line 1:
    ORA-01733: virtual column not allowed here
    SQL> insert into test_v_2 values  (9999, 'Entertainment', 2500);
    insert into test_v_2 values  (9999, 'Entertainment', 2500)
    ERROR at line 1:
    ORA-01402: view WITH CHECK OPTION where-clause violation
    SQL>A. Coskan GUNDOGAR
    Oracle DBA
    http://coskan.wordpress.com
    “A man's errors are his portals of discovery.”
    James Joyce

  • ORA-02253: constraint specification not allowed here

    I'm trying to create a table clients with primairy key, but I'm getting the error "ORA-02253: constraint specification not allowed here"
    if anyone call what to do
    CREATE TABLE CLIENTS
    NUMERO NUMBER(6) CONSTRAINT PK_CLIENTS PRIMAIRY KEY,
    NOM VARCHAR(63), NOT NULL,
    PRENOM VARCHAR(63),
    NAISSANCE DATE
    Edited by: user10397656 on Oct 13, 2008 1:40 AM

    There are some errors in your script :
    PK_CLIENTS PRIMAIRY KEY
    and
    NOM VARCHAR(63)*,* NOT NULL,
    Try this way
    CREATE TABLE CLIENTS
    NUMERO NUMBER(6) CONSTRAINT PK_CLIENTS PRIMARY KEY,
    NOM VARCHAR(63) NOT NULL,
    PRENOM VARCHAR(63),
    NAISSANCE DATE
    );

  • Cannot create application - 405 Method Not Allowed error

    Installed 11.1.2.1. Tried using EPMA to deploy app. Getting abort with the Method Not Allowed Error. Tried using Classic and getting the same error. Some of the details says "Server Error in Application "DEFAULT WEB SITE/HFM", "The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used." Any thoughts on possible causes?

    Hi Fsotto,
    The below document would resolve the issue.
    New Install on IIS 7, Cannot Access HFM from Workspace 404.3 Error in IIS Logs on HFM Web Server (Doc ID 1285684.1)
    Hope this helps,
    Please feel free to mark the answer as Helpful Answer/ Correct Answer should you find the relevant posting helpful so that it also helps us in keeping track of the answered queries.
    Thank you,
    Charles Babu J

  • ORA-02289: sequence does not exist Error

    When add Entity Attribute Value : adf.object.nextVal('DenialCommentId')
    Value Type: Expression
    Iam getting ORA-02289: sequence does not exist Error in 11g 1.1.3.0 version .How to Solve it .Any solutions please suggest me .Thanx in advance
    Ravi

    try using adf.object.nextValue('DenialCommentId') to find out whether the compiler is looking for a sequence named object in schema adf or not.
    Regards
    Etbin

  • Java.sql.BatchUpdateException: ORA-01027: bind variables not allowed for da

    Hi guys, I m facing a problem while executing below query .Query is working fine in toad i don't know what is the issue with the code
    <code>
    String url3 = "CREATE OR REPLACE VIEW Table2(PERIOD, YEARS, COST_CENTRE, S_DIR_PERM, S_DIR_CONT, S_INDIR_PERM, S_INDIR_CONT, O_DIR_PERM, O_DIR_CONT, O_INDIR_PERM, O_INDIR_CONT)AS select period, year, cost_center, sum(s_dir_perm), sum(s_dir_cont), sum(s_indir_perm), sum(s_indir_cont), sum(o_dir_perm), sum(o_dir_cont), sum(o_indir_perm), sum(o_indir_cont) from ( select b.period, b.year, a.cost_center, sum(a.perm_dir_hc) as s_dir_perm, sum(a.contract_dir_hc) as s_dir_cont, sum(a.perm_indir_hc) as s_indir_perm, sum(a.contract_indir_hc) as s_indir_cont, 0 as o_dir_perm, 0 as o_dir_cont, 0 as o_indir_perm, 0 as o_indir_cont from ZVHR_ACT_HC_ASOF_FISPRD a, pertable b where to_char(as_of_date, 'mm/dd/yyyy') = b.ENDPERIOD and shift not in ('G','N','O2','O7') and b.endperiod = ? group by b.period, b.year, a.cost_center union select b.period, b.year, a.cost_center, 0 as s_dir_perm, 0 as s_dir_cont, 0 as s_indir_perm, 0 as s_indir_cont, sum(a.perm_dir_hc) as o_dir_perm, sum(a.contract_dir_hc) as o_dir_cont, sum(a.perm_indir_hc) as o_indir_perm, sum(a.contract_indir_hc) as o_indir_cont from ZVHR_ACT_HC_ASOF_FISPRD a, pertable b where to_char(as_of_date, 'mm/dd/yyyy') = b.ENDPERIOD and shift in ('G','N','O2','O7') and b.endperiod = ? group by b.period, b.year, a.cost_center) group by period, year, cost_center";
    PreparedStatement statement3 = connection.prepareStatement(url3);
    statement3.setString(1, "12/10/2008");
    statement3.setString(2, "12/10/2008");
    statement3.addBatch();
    statement3.executeBatch();
    </code>
    i m getting the following error
    java.sql.BatchUpdateException: ORA-01027: bind variables not allowed for data definition operations
    can any1 help me with this.

    Can you explain what you are trying to do from a business perspective?
    If you are creating a view, it doesn't make sense to pass bind variables to that DDL statement. The view definition itself is going to have to end up with hard coded date values there. So what possible benefit is there to using bind variables?
    As an aside, if you are using bind variables and you have DATE columns, you really want to pass in the proper data type (i.e. setDate or setTimestamp rather than setString). Otherwise, Oracle has to do implicit string to date conversion, which depends on the session's NLS settings, which is likely to be different on different client machines and lead to all sorts of odd errors and behaviors down the line.
    Are you trying to build a view that takes parameters? If so, there are a few options for that sort of thing.
    Justin

  • ORA-02089: COMMIT is not allowed in a subordinate session

    Here is my configuration.
    jdbc driver:10.2.0.3.0
    EJB-CMP
    Am using oracle.jdbc.xa.client.OracleXADataSource as the driver in my websphere application server 6.0.0.1.
    when i am calling a stored procedure from my EJB and in the stored procedure if
    i perform any DDL operation like truncate a table,create a table or commit it throws the exception:-
    ORA-02089: COMMIT is not allowed in a subordinate session
    please help me in solving this issue asap.

    hi umesh ,
    i had seen this link before ,
    My oracle version is 10g.still its giving the same error.
    In the link yoy send they say the problem is in oracle 9i driver and it is solved in 10g .The driver version is 10.2.0.3 ,still i get the same error.
    do u have any idea?
    Regards,
    sreenath.

  • Coding not allowed error in BDC

    Hi,
    Recorded transaction MB1C with "Not a Batch Input Session' option. In the code should I mention this anywhere. Because, I get coding not allowed error while running BDC program.
    Please go thru the code below:
    perform bdc_dynpro      using 'SAPMM07M' '0400'.
          perform bdc_field       using 'BDC_CURSOR  'MKPF-BKTXT'.
          perform bdc_field       using 'BDC_OKCODE' '/00'.
          perform bdc_field       using 'MKPF-BLDAT'  W_HDR-BLDAT.
          perform bdc_field       using 'MKPF-BUDAT'  W_HDR-BUDAT.
          perform bdc_field       using 'MKPF-BKTXT'   W_HDR-BKTXT.
          perform bdc_field       using 'RM07M-BWARTWA'   W_HDR-BWARTWA.
          perform bdc_field       using 'RM07M-WERKS'  W_HDR-WERKS.
          perform bdc_field       using 'RM07M-LGORT'   W_HDR-LGORT.
          perform bdc_field       using 'RM07M-WVERS2'   W_HDR-WVERS2.
          LOOP AT T_MAT INTO W_MAT.
              i = i + 1.
              IF i > 99.
                MOVE i to k.
                CONCATENATE 'MSEG-MATNR(' k ')' INTO l_field1.
                CONCATENATE 'MSEG-ERFMG(' k ')' INTO l_field2.
              ELSE.
                MOVE i to j.
                CONCATENATE 'MSEG-MATNR(' j ')' INTO l_field1.
                CONCATENATE 'MSEG-ERFMG(' j ')' INTO l_field2.
              ENDIF.
              perform bdc_dynpro      using 'SAPMM07M' '0421'.
              perform bdc_field       using 'BDC_CURSOR'
                                            l_field2.
              perform bdc_field       using 'BDC_OKCODE'
                                            '/00'.
              perform bdc_field       using l_field1
                                            W_MAT-MATNR.
              perform bdc_field       using l_field2
                                            W_MAT-ERFMG.
              l_field1 = ''.
              l_field2 = ''.
          ENDLOOP.
          perform bdc_dynpro      using 'SAPMM07M' '0421'.
          perform bdc_field       using 'BDC_CURSOR'
                                        'MSEG-ERFMG(01)'.
          perform bdc_field       using 'BDC_OKCODE'
                                        '=BU'.
          perform bdc_transaction using 'MB1C'.
      ENDLOOP.
    Regards,
    Sriram
    Edited by: Sriram_14880 on Jul 28, 2009 2:53 PM

    Hi  there is no problem weather u r using option  'Not a Batch Input Session'  or not , generally it is used in call transaction
    see the documentation of call transaction options (ctu_params).
    structure of ctu_params is
    DISMODE
    UPMODE
    CATTMODE
    DEFSIZE
    RACOMMIT
    NOBINPT      ( Selection for the symbol field sy-binpt. Values: " " (sy-binpt contains in the called transaction "X"),
                         "X" (sy-binpt          contains in the called transaction " ").
    NOBIEND     Selection for the system field sy-binpt. Values: " " (sy-binpt contains "X" after the end of the batch input
                        data in   the  called transsaction ) "X" (sy-binpt contains " " after the end of the batch input data in the called   transaction).
    In the  new recordinng screen u will have four options ctu_params.
                              default size
                             cntinue after commit
                             Not a Batch Input Session
                            simulate back......
    The above four options u can set manually in call transaction from ctu_params
    not a batch input session option  refers to ctu_params-NOBINPT.
    read the documentation of call transaction statement.
    Ram

  • Unable to rotate pdf with script(not allowed error security settings prevent  error)

    I am using a script to rotate each pages in pdf file when clicking a button. I have added a script to rotate file in the rotate button's click event as a javascript.It is working in acrobat but not in adobe reader. Pleae see the script
    nStart = 0;
    nEnd = this.numPages - 1;
    nRotate = 90;
    try
    if (this.numPages > 0)
               this.setPageRotations(nStart , nEnd , nRotate)
    catch(e)
    app.alert("Processing error: "+e)
    But I'm getting this  error in adobe reader not in acrobat.'not allowed error security settings prevent access to this property or method'. What is the problem. Please anybody tell me.

    I have got it working usig by installing a script on the local machine. Thanks

  • Page rotate script not working(not allowed error security settings prevent access to this property)

    HI,
    I am using a script to rotate each pages in pdf file when clicking a button. I have added a script to rotate file in the rotate button's click event as a javascript.It is working in acrobat but not in adobe reader. Pleae see the script
    nStart = 0;
    nEnd = this.numPages - 1;
    nRotate = 90;
    try
    if (this.numPages > 0)
               this.setPageRotations(nStart , nEnd , nRotate)
    catch(e)
    app.alert("Processing error: "+e)
    But I'm getting this  error in adobe reader not in acrobat.'not allowed error security settings prevent access to this property or method'. What is the problem. Please anybody tell me.

    OK, so here's what you do:
    - Create a new file in a plain-text editor (I recommend Notepad++), and paste this code into it:
    safeExecMenuItem = app.trustPropagatorFunction(function(code){
        app.beginPriv();
        app.execMenuItem(code);
        app.endPriv();
    mySafeExecMenuItem = app.trustedFunction(function(code){
        app.beginPriv();
        safeExecMenuItem(code);
        app.endPriv();
    Close Reader if it was open and then save this file as "MyScripts.js" and place it in the following directory (this is for Windows):
    C:\Program Files (x86)\Adobe\Reader 11.0\Reader\Javascripts
    If you want it to work in Acrobat as well place the file also under:
    C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\Javascripts
    Now to rotate the pages clockwise attach this code to your button (in Acrobat, of course):
    mySafeExecMenuItem("RotateCW");
    And to rotate them counter-clockwise, use this code:
    mySafeExecMenuItem("RotateCCW");
    Open your file in Reader and the buttons should rotate the pages when clicked...

  • Ora-02089-COMMIT is not allowed in a subordinate session - V'urgent pls

    All,
    BPEL version: 11.1.1
    I have to invoke a pl/sql procedure which inserts a data to a table. After insert, I used commit. When BPEL try to invoke this procedure, I got ora-02089-COMMIT is not allowed in a subordinate session+. I know without commit in pl/sql, BPEL does the commit. But for a requirement, I've to explicitly use COMMIT inside the procedure. How do I go about in this case?
    Please advise.
    Thanks,
    Sen

    IMHO.... I personally do not like using XA data sources most of the time. I can only think of a few scenarios in all my implementation where I had to undo all the 50 steps (in which case they should be a single call anyway). Mixing and matching "pragma autonomous transaction" calls with DBAdapter updates on a XA data source in a single process have gotten me into tremendous trouble and data corruption.
    Also if you really have a case where you dont want to commit, I believe you can use the idempotent flag on partnerlinks to avoid the commit. There also might be cases where the PL/SQL defined as "pragma.." might be used by other non-BPEL stuff and you are just opening DB connections even when you dont need to.

Maybe you are looking for