How to reference LONG field in trigger

I am trying to create a trigger (update and delete) for auditing purposes. The source table has a long field and I need to insert all columns (which includes the long field) into an audit table if any column in the source record changes or if the source record is deleted. I cannot reference :old.longfield or do a select into.
If anyone has a suggestion or has done it in the past, please email me at [email protected] or post an answer.
Thank You so much for your help !!!!!

As you have noticed, you cannot reference the value of a LONG column using :old/:new in a trigger. The work around is to instead process your audit information (including the LONG value) in an after statement trigger. Here is an example to get you started:
http://asktom.oracle.com/pls/ask/f?p=4950:8:605685::NO::F4950_P8_DISPLAYID

Similar Messages

  • How to reference a field statically in a program?

    Hi Everyone,
    Can any one explain me how to reference a field statically.
    As the error on Extended program check is as follows:
    Field FLAG is not referenced statically in the program   
    where as the particular field has been defined as below in the program :
    when 'SMTP_ADDR'.
              DATA: flag type i.
    I think is there a need to define the field globally.
    Thanks and Regards,
    Johny

    Hi,
    We can avoid this EPC check by deleting or putting a comment Or By passeing the EPC to it ie
    DATA:
    w_flag type i." #EPC
    we can also avoid the EPC error by this way.then this willnt be aa part of EPC check
    Thanks & Regards,
    Chandralekha.

  • 8i+WebDB HELP:How to make longer fields for "News items"

    8i+WebDB
    How do I create longer fields for my "News items"?
    If I try to publish long sized News I receive an Error:
    "Ora-02005: Implisit(-1) Length not valid for this bind or define
    data type". I HAVE chosen "long field" settings in the DB
    (8.1.5.0.0)
    Are there any parameter settings in WebDB to allow longer
    fields??
    PLEASE HELP!!
    null

    Hi, Lu:
    If I understand your question correctly, you want to modify the FSG of recociliation account of Vendor/Customer to make sure Cost Center/WBS field display in transaction F-22/F-43 for example, right?
    I am not sure whether it is possible, I also tried in ECC6.0 but failed to show these two fields. And I think that doesn't make sense to assign CO object to AP/AR reconciliation account, but assign it to Revenue/Expense account in following line items.
    And You can use New General Ledger functionality Document Splitting to derive corresponding CO object information to Reconciliation Account line item, but it is enabled only in General Ledger level, not in subledger level.
    If you find any other meaningful solution, please also share with us.
    Thanks & BR, Lawrence

  • How to reference recording fields values?

    hi,
    i am in the LSMW Maintain field mapping and conversion rules screen and i used the following abap coding routine to move values to a destination field :-
    g_amount = VA02-KURSK + 3.     
    write g_amount                 
       to VA02-KURSK decimals 2.  
    What i am doing above is i am adding a value of 3 to the destination structure field VA02-KURSK before writing it to the field. However when i run the convert data step of the lsmw it throws an abap run time error as "Unable to interpret "/ " as a number. " in the first line of the above code.
    Can someone pls tell me how to fix this?

    You've posted to the VB.Net forum which is for Windows Forms applications and service and general Visual Basic topics.  Since this is LightSwitch it is outside of our bailiwick (the first error about the messagebox shouldn't appear in windows forms). 
    I'm going to move this to the LightSwitch forum were you should be able to get more appropriate help.
    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

  • How to manage Long field data Instead of  Substr..............

    Hi,
    I have one long column and need to check the existence of perticular key word in all records. So I used below
    function. Sometimes the length is more than 4000 bytes so i want to check string from 4000 bytes to 8000 bytes etc . till end of the string . result of string Passing to the Sbstr function. Anbody can help me to read the long data column value above 4000 bytes to 8000 etc.
    I tried like DBMS_SQL.COLUMN_VALUE_LONG(V_cursor,4000 , 8000, 3, l_buffer, l_buffer_len ); its returning null.???
    FUNCTION Get_string(--)
    Begin
    DBMS_SQL.PARSE( V_cursor, V_Qry, dbms_sql.native );
    DBMS_SQL.DEFINE_COLUMN_LONG(V_cursor, 1);
    IF (DBMS_SQL.EXECUTE_AND_FETCH(V_cursor) > 0) THEN
    DBMS_SQL.COLUMN_VALUE_LONG(V_cursor, 1 , 4000, 3, l_buffer, l_buffer_len );
    IF L_Buffer IS NOT NULL THEN
    L_Buffer := REPLACE(l_buffer, ' ', NULL);
    END IF;
    END IF;
    DBMS_SQL.CLOSE_CURSOR(V_cursor);
    RETURN l_buffer;
    End;
    Regards
    Bijesh K

    Knowing that TEXT column of all_views is of a LONG type, you can manage to query when doing sth like
    SQL>  SELECT view_name
      FROM (SELECT view_name,
                   EXTRACTVALUE (
                      dbms_xmlgen.getxmltype ('select text from all_views where owner = '''
                         || owner || ''' and view_name =''' || view_name || ''''), '//text()') text
              FROM all_views
             WHERE owner = 'SYS' AND ROWNUM <= 10)
    WHERE LOWER (text) LIKE '%apply_database_link%'
    VIEW_NAME                    
    ALL_APPLY                    
    ALL_APPLY_CONFLICT_COLUMNS   
    ALL_APPLY_DML_HANDLERS       
    ALL_APPLY_KEY_COLUMNS        
    4 rows selected.Hope you get the idea ....

  • How to refernce the field in the cross-tab report

    Hello,
    I'm trying to refer to the field in the cross-tab report using GridRowColumnValue function.
    The field name in formulas is DevelopmentTracking_SELECT.Completed, so I'm trying to refer like this:
    GridRowColumnValue("DevelopmentTracking_SELECT.Completed")
    I'm getting:
    "This is not the name of a grid group for the field being formatted."
    I've tried different way - gave the name of the field, for instance, or used the name form the Cross-tab expert - Max of DevelopmentTracking_SELECT.Completed, or simply use "Completed" - nothing worked.
    I see the possible cause for it. DevelopmentTracking_SELECT.Completed is not a row or column name, in the Cross-tab expert this is a Summarized field. How to reference the field like this correctly?
    Thank you,
    Peter
    Edited by: Peter Afonin on Feb 17, 2009 9:52 AM

    Oh I thought it is
    ROW: Product Name
    COLUMN:  Anticipated Date, Completed
    SUMMARIZED FIELDS: Product Stage
    Anyhow try to move the Completed field above the Anticipated Date in SUMMARIZED FIELDS by clicking up arrow.
    Now right click on the field Completed go to format field-->write the suppress condition like this
    WhilePrintingRecords;
    boolenavar i;
    i:=CurrentFieldValue;
    false
    Now right click on the Anticipated Date field and go to font and write the condition for color like this
    WhilePrintingRecords;
    boolenavar i;
    If CurrentFieldValue &gt;= CurrentDate Then
    crGreen
    Else If CurrentFieldValue &lt; CurrentDate And i=False Then
    crRed
    Else
    crBlack
    I hope this helps!
    Raghavendra

  • HOW to include a reference currency fields in a view ?

    Hello Experts,
    <b>I am having Currency fields error in generic extraction</b>
    I have table where I am trying to extract data to BW via generic extraction. When I tried
    to extract with the TABLE its giving me an error
    <b>Invalid extract structure template RPSCO of DataSource ZBW_REP3_TEST
    You tried to generate an extract structure with the template structure RPSCO. This operation failed, because the template structure quantityfields or currency fields, for example, field WLP00 refer to a differenttable</b>.
    Now I created a view with all the fields same as my table.
    But its still giving me the same error and taking all the fields as a primary keys. I have over 12 currency fields in the table. I am confused how to fix this issue and add a currency field to my view?
    hOW to include a reference currency fields in a view ?
    All inputs are much appreciated.
    Thanks and Regards,
    Harish

    Thank you for your responce,
    Can you please check my view and let me know where I am going wrong     
    View    Table   Field  Dataele  Data
    field                    type                                            0                                                                
    WLP01     RPSCO     WLP01     BP_WPL     CURR     15     Period value in ledger currency
    WLP02     RPSCO     WLP02     BP_WPL     CURR     15     Period value in ledger currency
    WLP03     RPSCO     WLP03     BP_WPL     CURR     15     Period value in ledger currency
    WLP04     RPSCO     WLP04     BP_WPL     CURR     15     Period value in ledger currency
    WLP05     RPSCO     WLP05     BP_WPL     CURR     15     Period value in ledger currency
    WLP06     RPSCO     WLP06     BP_WPL     CURR     15     Period value in ledger currency
    WLP07     RPSCO     WLP07     BP_WPL     CURR     15     Period value in ledger currency
    WLP08     RPSCO     WLP08     BP_WPL     CURR     15     Period value in ledger currency
    WLP09     RPSCO     WLP09     BP_WPL     CURR     15     Period value in ledger currency
    If I add a
    Table TCURC against any field what would be the view field and data element
    Do I need to tick MOD?
    Please suggest.
    Kapadia,
    If I do that its still taking all the fields are a primary keys and bringing 6 lakh records to where I originally have 49 records in a table
    Thanks and Regards,
    Harish

  • How do I reference a field in form portlet?

    I created a simple form portlet in Oracle Portal using the wizard.
    I want to execute a custom pl/sql query using simple select statement. (e.g. select emp from scott where ...)
    I created a new Button item.
    In the PL/SQL Button Event Handler I put the select statement.
    Now I have 2 questions.
    Question 1. Do I have to use the Query or Custom button.
    Question 2. In either way I get PLS-00428: an INTO clause is expected in this SELECT statement.
    I guess the fundamental question here is how do I reference a field in the form?

    If I understand you correctly you want to click on the button and then display a value selected from the database, right?
    1. You have to use the Custom button - query is exclusive for the form query.
    2. You will have to select the value into an interim PL/SQL variable and then set the form field using the portal session attribute.
    The following principles apply:
    * To set a field you have to use code like
    p_session.set_value(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_RFS_ID',
    p_value => 30);
    p_session.save_session;
    where
    - p_session is available in most custom PL/SQL blocks - I'm not sure if its in the custom block for a button - this type of code is used mostly in the "cusom pl/sql before form is displayed" (last tab) - if its not available you might have to jump through some more hoops !:). It refers to a portal stored session that is used to store all the internal variables.
    - block_name is either DEFAULT for simple forms or MASTER or DETAIL for master/detail forms
    - p_attribute_name is the name of the field you want to set BUT (very important) prefixed with A_
    - p_value is the actual value - here you will use your pl/sql variable.
    so try something like:
    l_number number;
    select anumber into l_number from atable where ....;
    p_session.set_value(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_field1',
    p_value => l_number);
    p_session.save_session;

  • How to reference the total pages in a the after-report trigger

    I need to call a procedure in my after report trigger, and send the total number of pages as a parameter. However, a bind reference only applies to columns or parameters.
    I have the total pages displayed on my report, I just can't reference that field in my trigger.
    Does anyone have any ideas?
    Here is a link to my ultimate goal.
    Telling Form the number of pages in a report

    If any body is curious, I found a work around in Metalink that is working for me now.
    Search for Doc ID 130432.1

  • How does Reference Field work?

    Hi All,
    I have short of problem knowing how reference field works. I have one field in ABAP query: MBEW-STPRS. The field type is CURR and it have reference field T001-WAERS.
    In query I made, the currency isn't occurs although I have set it to be display. I try to look how this reference field works in any source but can't find any answer. May be some of you can give me a little explanation.
    Thank you so much
    Regards
    Hadi

    Hi,   
          Reference fields work in the following way,
    When you say quantity is 100, what it refers to - 100 pc, 100 bundles or 100 kg or 100 metres??? The unit of qty defines whether it is PC, KG, M etc...
    In the database, SAP stores all amount values with 2 decimal places. But when SAP reads it, it interprets it based on the currency associated with the amount field.
    We require reference fields to Currency/Quantity fields as they are meaningless with out having the units.
    Ex: If we say, i paid 100. How can we figure out if he had paid 100 paise or 100 rupees.
    So, units are must.
    In case of quantity field QUAN, reference field will be always of type UNIT,
    currency field CURR, reference field will be always of type CUKY.
    It is mandatory to specify reference fields when we create fields of quantity/currency type in data base tables.
    Hope this will clear you.
    Thanks & Regards,
    Pavan.

  • How do we reference a field that is contained in a sortingTable

    Hi,
    Do any of you smart people have an example of this solution.
    Note: I have included the tag baseContext='variables' in the form.
    How do we reference a field that is contained in a sortingTable.
    If a sortingTable has selectEnabled set to true and the table has 5 rows and 3 columns. Suppose the checkbox on row 2 is checked. How does one reference the field defined at row 2/column 3 ?
    Is this reference anywhere close ? variables[selected=true].rowSelected ?
    And I am able to get first column values by refering sortingtable field name. I need first and second columns values. Please help me.
    Thanks,
    Sabaree.

    Restart the computer and hold the mouse button down while it is starting up.
    A dozen ways to eject or unmount a recalcitrant CD or DVD
    http://www.osxfaq.com/dailytips/08-2002/08-12.ws
    Ejecting media in Mac OS X: Removing 'stuck' CDs/DVDs
    http://www.macfixit.com/article.php?story=20041011075232575

  • How to insert a record in to oracle table from Java which has a oracle LONG Field?

    The problem is only 80 char's inserted in to the LONG FIELD which happend to me when i run the same insert statement from SQL plus.
    Here is the code....
    java.io.File inputFile = new java.io.File("input.txt");
    int inputFileLen = (int) inputFile.length();
    java.io.InputStream ipStream = new java.io.FileInputStream(inputFile);
    System.out.println(inputFileLen);
    PreparedStatement myStmt = conn.prepareStatement("insert into LONG_EXAMPLE (notes,name)values(?,?)");
    myStmt.setAsciiStream(1, ipStream, inputFileLen);
    myStmt.setString(2,"Steve");
    int res = myStmt.executeUpdate();
    myStmt.close();
    Note : Here the size of the input.txt 250 bytes , 1KB.
    Thanks in advance......:-)
    Cheers,
    Vetri !

    Hien
    I had a similar requirement to you and put the code on a push button. In my case the reports are being run interactively to the screen and then printed, and I have no way to know whether the report had actually been printed, so we rely on the user pressing the button. Of course there is a danger that the user forgets to press the button, but in our situation that would not be disasterous. Whatever method is used, I don't think there is any way to be sure that it has actually come out of the printer.

  • How to: Reference fields XREF1/2 to be displayed in Acc Doc Line Item

    Hi Experts,
    May I know how to display the fields in the Line Item Level that can also be changed.
    What I already did was the configuration OB32, OB41, FI>GL>Master Data>G/L Accts>Line Items>Define Special Fields for Line Item Dsiplay.
    But it still not working. What is the proper way to configure these fields?
    Thanks

    In the Line item Display list in FBL*N follow this menu path: Settings
    -> Special fields, and add the fields you want from relevant table.
    The fields are later available for display, and you can choose them from
    the Line item Display list following this menu: Settings -> Display
    variant -> Current. From the hidden list you can now choose the fields
    you want to have shown. If the technical name is shown for the fields,
    the special fields are all starting with '1-U_'. It's important, that
    you add the Special field, if the field also exist as Standard field.
    The Special fields are shown in the bottom of the Hidden list.
    Review the solution part of note 215798 the detailed steps.
    XREF1 / XREF2 do not exist in the index table (BSIS/BSAS) for the G/L
    account. Therefore you should create XREF1/2 as special field for
    display via FAGLL03/FBL3N.
    SPRO - ... - Define Special Fields for Line Item Display
    There you should also include the field and store the change.
    You do not have to run the RFPOSXEXT again, because the related
    structure is generated automatically within the storage of the data.
    After you have stored the 'new' field, you should run the report
    BALVBUFDEL. This report will reset the ALV buffer, because the old
    definition of the fieldcatalog does not have the needed fields, and
    so it might happen that these are not displayed in the fieldlist of
    the FAGLL03.
    Please refer to the attached 984305 and 215798 Point 3.
    Regards,
    Fernando

  • Reference a field from master query in detail query

    Hi,
    Please tell me how do I reference a field say incident_no in my master query to a detail query.
    like
    detail.incident_no != master.incident_no
    I am joining both the queries using a link. But still I need to reference another field from the first query in my second query. I thought this was possible using formula columns or trigger's. Please help.

    Hey Vadim,
    That worked. How come.. You know I did it several times before and all it said was, that it was going to create a new parameter field called so and so.
    Good, so does it work just this time or always ? just kidding. Reports is so unpredictable, at least for me.
    Thanks Vadim,
    Joe.

  • HOW CAN I SEND FIELD SYMBOL TO SUBROUTINE

    HAI,
             HOW CAN I SEND FIELD SYMBOL TO SUBROUTINE
             HOW CAN I COME BACK FROM 5TH INTERACTIVE REROT TO 2ND
    INTERACTIVE REPORT.
    THANK YOU.
    ASHOK

    Hi
    Write some code in the program to come to 2nd list from 5th list
    if sy-lsind = 5.
       sy-lsind = 2.
    endif.
    for field symbols see the doc
    Field Symbols
    Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.
    Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.
    Field symbols are similar to dereferenced pointers in C (that is, pointers to which the content operator * is applied). However, the only real equivalent of pointers in ABAP, that is, variables that contain a memory address (reference) and that can be used without the contents operator, are reference variables in ABAP Objects.
    All operations programmed with field symbols are applied to the field assigned to it. For example, a MOVE statement between two field symbols moves the contents of the field assigned to the first field symbol to the field assigned to the second field symbol. The field symbols themselves point to the same fields after the MOVE statement as they did before.
    You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks the compatibility of the field symbol and the field you are assigning to it during the ASSIGN statement.
    Field symbols provide greater flexibility when you address data objects:
    If you want to process sections of fields, you can specify the offset and length of the field dynamically.
    You can assign one field symbol to another, which allows you to address parts of fields.
    Assignments to field symbols may extend beyond field boundaries. This allows you to address regular sequences of fields in memory efficiently.
    You can also force a field symbol to take different technical attributes from those of the field assigned to it.
    The flexibility of field symbols provides elegant solutions to certain problems. On the other hand, it does mean that errors can easily occur. Since fields are not assigned to field symbols until runtime, the effectiveness of syntax and security checks is very limited for operations involving field symbols. This can lead to runtime errors or incorrect data assignments.
    While runtime errors indicate an obvious problem, incorrect data assignments are dangerous because they can be very difficult to detect. For this reason, you should only use field symbols if you cannot achieve the same result using other ABAP statements.
    For example, you may want to process part of a string where the offset and length depend on the contents of the field. You could use field symbols in this case. However, since the MOVE statement also supports variable offset and length specifications, you should use it instead. The MOVE statement (with your own auxiliary variables if required) is much safer than using field symbols, since it cannot address memory beyond the boundary of a field. However, field symbols may improve performance in some cases.
    check the below links u will get the answers for your questions
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/field_sy.htm
    http://searchsap.techtarget.com/tip/1,289483,sid21_gci920484,00.html
    Syntax Diagram
    FIELD-SYMBOLS
    Basic form
    FIELD-SYMBOLS <fs>.
    Extras:
    1. ... TYPE type
    2. ... TYPE REF TO cif
    3. ... TYPE REF TO DATA
    4. ... TYPE LINE OF type
    5. ... LIKE s
    6. ... LIKE LINE OF s
    7. ... TYPE tabkind
    8. ... STRUCTURE s DEFAULT wa
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Untyped Field Symbols ad Cannot Use Field Symbols as Components of Classes.
    Effect
    This statement declares a symbolic field called <fs>. At runtime, you can assign a concrete field to the field symbol using ASSIGN. All operations performed with the field symbol then directly affect the field assigned to it.
    You can only use one of the additions.
    Example
    Output aircraft type from the table SFLIGHT using a field symbol:
    FIELD-SYMBOLS <PT> TYPE ANY.
    DATA SFLIGHT_WA TYPE SFLIGHT.
    ASSIGN SFLIGHT_WA-PLANETYPE TO <PT>.
    WRITE <PT>.
    Addition 1
    ... TYPE type
    Addition 2
    ... TYPE REF TO cif
    Addition 3
    ... TYPE REF TO DATA
    Addition 4
    ... TYPE LINE OF type
    Addition 5
    ... LIKE s
    Addition 6
    ... LIKE LINE OF s
    Addition 7
    ... TYPE tabkind
    Effect
    You can define the type of the field symbol using additions 2 to 7 (just as you can for FORM parameters (compare Defining the Type of Subroutine Parameters). When you use the ASSIGN statement, the system carries out the same type checks as for USING parameters of FORMs.
    This addition is not allowed in an ABAP Objects context. See Cannot Use Obsolete Casting for FIELD SYMBOLS.
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See Defining Types Using STRUCTURE.
    Effect
    Assigns any (internal) field string or structure to the field symbol from the ABAP Dictionary (s). All fields of the structure can be addressed by name: <fs>-fieldname. The structured field symbol points initially to the work area wa specified after DEFAULT.
    The work area wa must be at least as long as the structure s. If s contains fields of the type I or F, wa should have the structure s or at least begin in that way, since otherwise alignment problems may occur.
    Example
    Address components of the flight bookings table SBOOK using a field symbol:
    DATA SBOOK_WA LIKE SBOOK.
    FIELD-SYMBOLS <SB> STRUCTURE SBOOK
    DEFAULT SBOOK_WA.
    WRITE: <SB>-BOOKID, <SB>-FLDATE.
    Related
    ASSIGN, DATA
    Additional help
    Declaring Field Symbols
    Reward points if useful
    Regards
    Anji

Maybe you are looking for

  • CFID and CFToken Problems

    Hello, Some times there seems to be a problem when the server has generated cfid and cftokens after the cold fusion authentication . When I use cflocation to go to another page then It seems that server is not recognizing the tokens assinged to clien

  • Oas webforms - getting user state info

    hi OAS4 does a great job of providing WebForms and i've found all sorts of documentation about these forms being state-based but how is it possible to determine the username of the user accessing a particular form (from within the form)? And, what ot

  • APD Data Issue

    Hi Gurus, I am using a APD to load data from Query to a T-ODS. I am getting the " No storage space available for extending an internal table" error though I Unchecked the " Process In Memory" Performace setting. Please let me know if there is a solut

  • MDS and Business Intelligence Schema

    Hi, I have installed succesfulyy the oracle database and after that i have installed RCU and it got installed sucessfully,now i want to know where does the schemas reside in oracle database and how to view the schemas with out installing the obiee? T

  • Error uploading or updating site

    Hi and thank you. When I go to update or upload my site, I get the following message: PUBLISH ERROR Can't create the file "01_2008_Welcome_01.png." The disk may be damaged or full, or you may not have sufficient access privileges. I did a google sear