Procedure created for OLS table update

I have created the following procedure in ( PL/SQL )that will insert rows into a table - in addition to the rowlabel. It inserts the rows correctly when I use the 'label_to_char' function in the procedure, however my users cannot see the data that they have access to until they manually insert a row into the table themselves.
I have changed the procedure using the 'to_data_label' function to see if that might work. I get an invalid column error when the procedure gets executed. However, when I do a manual insert using the to_data_label function for only one row, it does work.
I also have tried aliasing the rowlabel row, and it still does not work. Here is my procedure:
(I am new to creating procedures, so it may be something in the way it is written.)
create or replace procedure insert_comps(v_tag number,
v_short varchar2,
v_long varchar2,
v_parent varchar2,
v_row varchar2 default null)
is
v_rl varchar2(60) := 'TS:';
begin
if v_row is null then
if v_short != v_parent then
v_rl := v_rl||v_parent||','||v_short;
elsif v_parent = v_short then
v_rl := v_rl||v_short;
end if;
else
v_rl := v_row;
end if;
insert into policy_compartments(
rowlabel,
short_name,
long_name,
tag,
parent)
values(to_data_label('BBORDER',v_rl),
v_short,
v_long,
v_tag,
v_parent);
end insert_comps;
Are there any suggestions?
Thanks in advance,
Christine

Example...
Schema 1 (scott):
SQL> create table x (x number);
Table created.Schema 2:
SQL> create table x (x number);
Table created.
SQL> ed
Wrote file afiedt.buf
  1  create or replace procedure pop_x authid current_user is
  2  begin
  3  insert into x values (1);
  4  commit;
  5* end;
SQL> /
Procedure created.
SQL> grant execute on pop_x to scott;
Grant succeeded.Schema 1 (scott):
SQL> exec schema2.pop_x;
PL/SQL procedure successfully completed.
SQL> select * from x;
         X
         1
SQL>Schema 2:
SQL> select * from x;
no rows selected
SQL>;)

Similar Messages

  • How to identify whether any data source is created for a table?

    hi all,
    How to identify whether any extractions is been carried out for a particular table, view or function module(generic extraction)? from r/3.
    bcos i need to create an extraction for a table, view and function module. But  iam not sure whether any extractions is already been created for those tables, view, function modules??
    thanxs
    haritha

    Hi,
    By passing the following values as selection to table  ROOSOURCE we can find whether any data source has been created or not .
    EXMETHOD = V
    EXTRACTOR = Table name
    hope it helps..
    regards,
    raju

  • How downtime can be reduced for setup table update.

    Hi;
    Can anyone tell me various ways to reduced system downtime for setup table updates.
    thanks
    Warm Regards
    Sharebw

    Hi,
    You will need to fill the set up tables in 'no postings period'. In other words when no trasnactions are posted for that area in R/3 otherwise those records will not come to BW. Discuss this with end user and decide. Weekends are a general choice for this activity.
    try Early Delta Initialization
    With early delta initialization, you have the option of writing the data into the delta queue or into the delta tables for the application during the initialization request in the source system. This means that you are able to execute the initialization of the delta process (the init request), without having to stop the posting of data in the source system. The option of executing an early delta initialization is only available if the DataSource extractor called in the source system with this data request supports this.
    Extractors that support early delta initialization are delivered with Plug-Ins as of Plug-In (-A) 2002.1.
    You cannot run an initialization simulation together with an early delta initialization.
    hope this link may make you clear about early delta init
    http://help.sap.com/saphelp_nw04s/helpdata/en/80/1a65dce07211d2acb80000e829fbfe/frameset.htm
    thanks,
    JituK

  • How to find the TCODE that is created for the table maintanance generator

    Hi ,
    How to find the TCODE that is created for the table maintanance generator of particular table,if we only know the table name.
    Regards
    Ramakrishna L

    Hello,
    I try it this way
    1. Goto SE16 --> enter table TSTCP.
    2. In the selection-screen displayed, enter
    PARAM = *<ZTABNAME>*
    You will get the t-code for the TMG.
    BR,
    Suhas
    PS: Are you sure a t-code has been created for this TMG ?

  • How many SECONDARY INDEXES are created for CLUSTER TABLES?

    how many SECONDARY INDEXES are created for CLUSTER TABLES?
    please explain.

    There seems to be some kind of misunderstanding here. You cannot create a secondary index on a cluster table. A cluster table does not exist as a separate physical table in the database; it is part of a "physical cluster". In the case of BSEG for instance, the physical cluster is RFBLG. The only fields of the cluster table that also exist as fields of the physical cluster are the leading fields of the primary key. Taking again BSEG as the example, the primary key includes the fields MANDT, BUKRS, BELNR, GJAHR, BUZEI. If you look at the structure of the RFBLG table, you will see that it has primary key fields MANDT, BUKRS, BELNR, GJAHR, PAGENO. The first four fields are those that all cluster tables inside BSEG have in common. The fifth field, PAGENO, is a "technical" field giving the sequence number of the current record in the series of cluster records sharing the same primary key.
    All the "functional" fields of the cluster table (for BSEG this is field BUZEI and everything beyond that) exist only inside a raw binary object. The database does not know about these fields, it only sees the raw object (the field VARDATA of the physical cluster). Since the field does not exist in the database, it is impossible to create a secondary index on it. If you try to create a secondary index on a cluster table in transaction SE11, you will therefore rightly get the error "Index maintenance only possible for transparent tables".
    Theoretically you could get around this by converting the cluster table to a transparent table. You can do this in the SAP dictionary. However, in practice this is almost never a good solution. The table becomes much larger (clusters are compressed) and you lose the advantage that related records are stored close to each other (the main reason for having cluster tables in the first place). Apart from the performance and disk space hit, converting a big cluster table like BSEG to transparent would take extremely long.
    In cases where "indexing" of fields of a cluster table is worthwhile, SAP has constructed "indexing tables" around the cluster. For example, around BSEG there are transparent tables like BSIS, BSAS, etc. Other clusters normally do not have this, but that simply means there is no reason for having it. I have worked with the SAP dictionary for over 12 years and I have never met a single case where it was necessary to convert a cluster to transparent.
    If you try to select on specific values of a non-transparent field in a cluster without also specifying selections for the primary key, then the database will have to do a serial read of the whole physical cluster (and the ABAP DB interface will have to decompress every single record to extract the fields). The performance of that is monstrous -- maybe that was the reason of your question. However, the solution then is (in the case of BSEG) to query via one of the index tables (where you are free to create secondary indexes since those tables are transparent).

  • Required to create a script for base table update using XMLSTORE package.

    Hi can anybody provide me some help full suggestion on how to update base table using XMLSTORE package.
    I created a simple script for Employee table and can able to do the basic operation like Insert and update on the table.
    Query is as follow's
    DECLARE
    insCtx DBMS_XMLSTORE.ctxType;
    rows NUMBER;
    xmlDoc CLOB :=
    '<ROWSET>
    <ROW num="1">
    <EMPLOYEE_ID>922</EMPLOYEE_ID>
    <SALARY>1801</SALARY>
    <HIRE_DATE>17-DEC-2007</HIRE_DATE>
    <JOB_ID>ST_CLERK</JOB_ID>
    <EMAIL>RAUSSJACK</EMAIL>
    <LAST_NAME>JACK</LAST_NAME>
    <DEPARTMENT_ID>20</DEPARTMENT_ID>
    </ROW>
    <ROW>
    <EMPLOYEE_ID>923</EMPLOYEE_ID>
    <SALARY>2001</SALARY>
    <HIRE_DATE>31-DEC-2005</HIRE_DATE>
    <JOB_ID>ST_CLERK</JOB_ID>
    <EMAIL>PATHAK</EMAIL>
    <LAST_NAME>PRATIK</LAST_NAME>
    <DEPARTMENT_ID>20</DEPARTMENT_ID>
    </ROW>
    </ROWSET>';
    BEGIN
    insCtx := DBMS_XMLSTORE.newContext('EMPLOYEES'); -- Get saved context
    DBMS_XMLSTORE.clearUpdateColumnList(insCtx); -- Clear the update settings
    -- Set the columns to be updated as a list of values
    DBMS_XMLSTORE.setUpdateColumn(insCtx, 'EMPLOYEE_ID');
    DBMS_XMLSTORE.setUpdateColumn(insCtx, 'SALARY');
    DBMS_XMLSTORE.setUpdateColumn(insCtx, 'HIRE_DATE');
    DBMS_XMLSTORE.setUpdateColumn(insCtx, 'JOB_ID');
    DBMS_XMLSTORE.setUpdateColumn(insCtx, 'EMAIL');
    DBMS_XMLSTORE.setUpdateColumn(insCtx, 'LAST_NAME');
    DBMS_XMLSTORE.setUpdateColumn(insCtx, 'DEPARTMENT_ID');
    -- Insert the doc.
    rows := DBMS_XMLSTORE.insertXML(insCtx, xmlDoc);
    --COMMIT;
    DBMS_OUTPUT.put_line(rows || ' rows inserted.');
    -- Close the context
    DBMS_XMLSTORE.closeContext(insCtx);
    END;
    SELECT employee_id, LAST_name FROM employees WHERE employee_id = 114;
    DECLARE
    updCtx DBMS_XMLSTORE.ctxType;
    rows NUMBER;
    xmlDoc CLOB :=
    '<ROWSET>
    <ROW>
    <EMPLOYEE_ID>114</EMPLOYEE_ID>
    <LAST_NAME>PRABHU</LAST_NAME>
    </ROW>
    </ROWSET>';
    BEGIN
    updCtx := DBMS_XMLSTORE.newContext('EMPLOYEES'); -- get the context
    DBMS_XMLSTORE.clearUpdateColumnList(updCtx); -- clear update settings
    -- Specify that column employee_id is a "key" to identify the row to update.
    DBMS_XMLSTORE.setKeyColumn(updCtx, 'EMPLOYEE_ID');
    rows := DBMS_XMLSTORE.updateXML(updCtx, xmlDoc); -- update the table
    DBMS_XMLSTORE.closeContext(updCtx); -- close the context
    commit;
    END;
    Nowi want little modification on this above query like as i am passing static XML tags and i want it to pick the dynamic XML from web and use the XMLSTORE for the update.
    and also for complex XML having 2-3 levels how this query needs to be changed.As i am new to this Oracle utillity any help from xepert will be a great help for me.
    Thanks

    Nowi want little modification on this above query like as i am passing static XML tags and i want it to pick the dynamic XML from webFrom a Web Service?
    You'll need UTL_HTTP or HttpUriType interface to send the request and receive the XML response.
    Search in the forum, there are already a lot of useful examples available.
    and also for complex XML having 2-3 levels how this query needs to be changed.DBMS_XMLStore is OK for readily processing a canonical XML format (/ROWSET/ROW/COLUMN structure or alike).
    However, if you have to deal with a more complex structure, you either have to :
    - use a target object table that matches the XML structure
    - preprocess the input document using XSLT to transform it to canonical format
    That's why DBMS_XMLStore is not appropriate for multilevel documents, especially if they contain nested repeating groups.
    In this case, XMLTable is a more flexible way of parsing the XML and process it relationally at the same time.
    Depending on the size of the document, performance may be improved with schema-based object-relational storage.
    For more help, please post a new thread in the {forum:id=34} forum, with the following information :
    - database version (select * from v$version)
    - a sample XML document (the complex one)
    - DDL of your target table
    - mapping between XML elements and columns (ie which tag goes to which column?)
    - an XML schema (if you have one)

  • Bizarre situation with the "Where used list" for a table updated by FB50

    Hello all,
    I use the "where used list" (all check boxes selected) function in SE11 to find out where and how the table FMGLFLEXT (General Ledger Public Sector: Total) is being used and updated. All I get is a reference to a function module, namely   “G_POSTING_FMGLFLEXT”. When I do a "where used list" (once again, all check boxes selected) for the FM, I get the message: Function Module G_POSTING_FMGLFLEXT not found in selected search area Message no. ES120“ despite the fact that all check boxes are selected.
    Yet this table contains data which were put in there via transaction FB50 (G/L Acct Pstg: Single Screen Trans.). So somehow, somewhere this data was created and put into the table.
    I don’t get it! What am I missing?
    Thank you for your help

    There could be several reasons for this, including:
    - The cross reference tables (used by the "where used" functionality) have not been updated in the system you are logged into - check with your Basis team on this as the programs that do this (a) run for hours and (b) take up a fair chunk of database space.
    - The data may be stored via dynamic SQL (e.g. "insert into (g_tab_name)") so the table reference doesn't show up
    - The function module may be called dynamically so the FM where used doesn't reflect this
    You could try, instead, using the ST05 SQL Trace to track what code is updating the table when you run FB50.
    Jonathan

  • Procedure help for loading tables

    I am trying to load data from one table to another eg Table A to Table B
    I would like the procedure to load all data that has been updated or inserted since last load and delete any rows that have not been
    updated since the last load. Can anyone help me please with a procedure for this.
    Thanks in advance.

    Truncate table B then run something similar to:
    DECLARE
    -- Assuming you are running this daily and
    -- the last_update_date column is populated on every insert/update
    CURSOR cura is
    SELECT *
    FROM tablea
    WHERE trunc(last_update_date) = trunc(sysdate);
    -- If you run it at a standard interval then
    CURSOR cura is
    SELECT *
    FROM tablea
    WHERE trunc(last_update_date) BETWEEN trunc(sysdate - n) AND TRUNC(sysdate);
    -- n is the number of days between runs
    tabb_rowid ROWID;
    BEGIN
       FOR arec in cura LOOP
          BEGIN
             SELECT rowid INTO tabb_rowid
             FROM tableb
             WHERE pk_field1 = arec.pk_field1 and
                   pk_field2 = arec.pk_field2;
             UPDATE tableb
             SET pk_field1 = arec.pk_field1,
                 pk_field2 = arec.pk_field2,
                 field3 = arec.field3,
                 field4 = arec.field4
             WHERE rowid = tabb_rowid;
          EXCEPTION WHEN NO_DATA_FOUND THEN
             INSERT INTO tableb
             VALUES (arec.pk_field1,arec.pk_field2,arec.field3,arec.field4);
          END;
       END LOOP;
       COMMIT;
    END;

  • BADI/User Exit for custom table update from Delivery

    Hi
    Our requirement is to update a custom table with the delivery number and other related details when the picking status is changed to "C". Kindly suggest BADI/User exit for this requirement .
    Thanks in Advance for your immediate help .

    Hi Joseph,
    See SAP Note 415716 - User exits in delivery processing. It says when you have the document number available, what is permitted, what not, ....
    I hope this helps you
    Regards
    Eduardo

  • BAPI or FM for KNVV table updation

    Hi,
    I  want to know a function module or BAPI which updates the Customer Sales data in the KNVV table.
    If any one has worked on the same, please let me know. Thanks in advance.
    Regards,
    Sajith.

    Hi,
    Why not create a IDOC DEBMAS01 to change the data ?
    There is no BAPI available to do this or a function module as far as I know.
    Cheers
    Colin.

  • Logic for MVER table update

    Hi Experts,
    Can anyone let me know how this table MVER updates. What are all the mvt type it will consider for updation. Your fast reply is appreciated.
    Thanks,
    Suresh

    Hi Suresh,
    The following are the various mvmt types that are used for consumption.
    201
    221
    231
    241
    251
    261
    281
    291
    331
    333
    335
    551
    553
    555
    557
    These values are updated in the MVER table. For eg. V06, V08 fields of MVER are updated with 261 and 201 Mvmt types.
    Reward if cleared and close the thread.

  • Any BAPI for PAYR table updation

    Hi All,
    Is there any BAPI available for payment medium file table (PAYR) update?
    Thanks,
    Anil.

    check with FM : INSERT_PAYR
    You may have to use FM DEQUEUE_EFPAYR ENQUEUE_EFPAYR alongwith above FM..
    also try
    HRPY_RGDIR_CHANGE_PAYROLL
    BAPI_EXTPAYROLL_INSERT_OUT
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • BAPI for Mean table updation

    Hi Friends,
      I need to update the Internation Artical number (EAN11) field in MEAN table and also EAN11,NUMTP fields from MARA. Could any one of you please let me know the BAPI to update the table data.
    Thanks & Regards
    Ravindra

    check with FM : INSERT_PAYR
    You may have to use FM DEQUEUE_EFPAYR ENQUEUE_EFPAYR alongwith above FM..
    also try
    HRPY_RGDIR_CHANGE_PAYROLL
    BAPI_EXTPAYROLL_INSERT_OUT
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • Chnage pointers table updation

    Hello,
    I am updating the EKPO-Netpr field using programm.After updation i am trying to extract the data for BW.But there is no change pointer are created for this table updation.
    Can you please clarify,How to create change pointers for table updation?
    Best regards,
    Shyam

    Hi ,
    You need to create a change document object for that from transaction SCDO .
    After that you need to call the automatically created function module (during creation of change Doc. Object)
    from your program where you wrote the update or insert statement after those statement.
    Now those changes will reflect on the database table CDPOS and CDHDR .
    Please check the link  - -
    [https://wiki.sdn.sap.com/wiki/display/ABAP/Change+Document]
    Regards
    Pinaki

  • Creating Tcode for Custom Table

    Hi all,
              I have created a custom table ZSALESMANAGER, I have created a Maintenance view for this table ZSALESMANAGER_MV. I have to create a custom Tcode for this maintenance. so that when the i enter this tcode i should get the maintenance view scree of the table.
             Please help me, how to do this.
    Thanks & Regards,
    Poorna.

    please  go throught   below link ..... it was  given with  screen  shots  of the   T.code   Creating  for the   table after the   maintaince  view   had been created ......
    <a href="http://">http://www.sapdevelopment.co.uk/tips/tips_tabmaint_tcode.htm</a>
    <a href="http://">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/abap/how%20to%20implement%20events%20in%20table%20maintenance.doc</a>
    reward points  if it  is  usefull ...
    Girish

Maybe you are looking for

  • Error in bdc report program .

    Hello Experts ,     I was doing the BDC demo program as explained in tutorial , http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/309cb157-738d-2910-7691-b74c4ddba3c7&overridelayout=true but when i  run the pgm i get runtime error as shrt text  

  • Change href Attribute

    I'm currently working on a website in DW8. This site has both English and Spanish pages. The document names are the same but are in separate folders ("en/home.htm" for English and "es/home.htm" for Spanish). I put a link on the top right of each page

  • How to extract the actual XML document from soap message?

    My problem is " how to extract the actual XML document from soap message? " i just want to extract the attachment i.e. (pure XML document without any soap header or envolope). i could be ver thank full if u could solve my problem. [email protected]

  • HT204266 My App Store has changed to the us store how do I get back to the uk store?

    As question my App Store has changed to the us site and I don't know how to get back to the uk one

  • Regarding link option in crystal report 2008

    respected sir,        how to enable full outer join and right outer join in link option because default is disable????