Error in modify statement

Hi,
When i am trying to update a z table by using modify statement, i am getting the following error:
                                                                                Short text                                                                               
SQL error in the database when accessing a table.                                              
What happened?                                                                               
When writing a data record to the database (i.e. when                                          
     updating the database), only part of the data field was                                        
     written (updated). The rest was truncated.                                                     
Error analysis                                                                               
An exception occurred that is explained in detail below.                                       
     The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught                  
      in                                                                               
procedure "FILLTABLE" "(FORM)", nor was it propagated by a RAISING clause.                     
     Since the caller of the procedure could not have anticipated that the                          
     exception would occur, the current program is terminated.                                      
     The reason for the exception is:                                                               
     The problem has arisen because, within the database interface,                                 
     one of the data buffers made available for the INSERT (UPDATE)                                 
     is longer than the maximum defined in the database.                                            
     On the other hand, it may be that the length in the NAMETAB                                    
     does not match the maximum length defined in the database.                                     
     (In this case, the length in the NAMETAB is longer.)                                                                               
Please guide me how this error can be resolved.
Thanks and Regards

Hi,
The error message is as follows:
Short text                                                                               
SQL error in the database when accessing a table.                                                
What happened?                                                                               
When writing a data record to the database (i.e. when                                            
     updating the database), only part of the data field was                                          
     written (updated). The rest was truncated.                                                       
Error analysis                                                                               
An exception occurred that is explained in detail below.                                         
     The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught                    
      in                                                                               
procedure "FILLTABLE" "(FORM)", nor was it propagated by a RAISING clause.                       
     Since the caller of the procedure could not have anticipated that the                            
     exception would occur, the current program is terminated.                                        
     The reason for the exception is:                                                                 
     The problem has arisen because, within the database interface,                                   
     one of the data buffers made available for the INSERT (UPDATE)                                   
     is longer than the maximum defined in the database.                                              
     On the other hand, it may be that the length in the NAMETAB                                      
     does not match the maximum length defined in the database.                                       
     (In this case, the length in the NAMETAB is longer.)                                             
Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of dump
Edited by: Rob Burbank on May 1, 2010 5:59 PM

Similar Messages

  • Unicode error free MODIFY statement

    HI All,
    I have midify statement in a loop like this.
    loop at itab into wa_itab.
    modify itab from wa_itab index tabx.
    endloop.
      I am working in ECC 6.0. It is showing unicode error at modify statement. Please suggest me the correct statemnt.ANy extension for modify statemnt..?
    Thanks,
    kishore

      LOOP AT IT_VBRK.
    <b>    CTAB = SY-TABIX.</b>
        LOOP AT IT_T001 WHERE BUKRS = IT_VBRK-BUKRS.
          IF SY-SUBRC  = 0.
            IT_VBRK-BUTXT = IT_T001-BUTXT.
    <b>        MODIFY IT_VBRK INDEX CTAB.</b>
            CLEAR CTAB.
          ENDIF.
        ENDLOOP.
      ENDLOOP.
    The problem may be with SY-TABIX, check the above code

  • Syntax error in modify statement

    Hi Friends,
    There is an Internal table IT_STATUS which is the Parameter in BADI Method IF_EX_WORKORDER_UPDATE~BEFORE_UPDATE.
    Below is the code i have written
    Data:  wa_status type cobai_s_status,
                       stat TYPE TABLE OF jstat,
                       wa_stat type jstat.
          CALL FUNCTION 'STATUS_READ'
            EXPORTING
             client                 = sy-mandt
              objnr                  = gv_objnr
    *     ONLY_ACTIVE            = ' '
    *   IMPORTING
    *     OBTYP                  =
    *     STSMA                  =
    *     STONR                  =
           TABLES
             status                 = stat
           EXCEPTIONS
             object_not_found       = 1
             OTHERS                 = 2
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ELSE.
           loop at it_status into wa_status.
            read table stat into wa_stat with key STAT = wa_status-stat.
            if sy-subrc = 0.
             wa_status-stat = wa_stat-stat.
             wa_status-INACT = wa_stat-INACT.
             modify it_status from wa_status transporting stat inact.
            endif.
           endloop.
          ENDIF.
    At Modify statement it is giving a syntax error 'The <b>field "IT_STATUS" cannot be changed.-</b>'. what could be the reason?
    Please provide me the solution.
    Thanks & Regards,
    Satish

    Hi Rob,
    This is the whole code which i had written in method
    METHOD if_ex_workorder_update~before_update.
      DATA: gv_aufnr TYPE afih-aufnr,
            gv_objnr TYPE jest-objnr,
            stat TYPE TABLE OF jstat,
            wa_stat TYPE jstat,
            wa_header TYPE cobai_s_header,
            wa_status TYPE cobai_s_status,
            it_status_new TYPE cobai_t_status.
      DATA: status_index TYPE sy-tabix.
      BREAK-POINT.
      LOOP AT it_header INTO wa_header.
        SELECT SINGLE aufnr FROM afih INTO gv_aufnr WHERE warpl = wa_header-warpl AND abnum = 1.
        IF sy-subrc = 0.
          CONCATENATE 'OR' gv_aufnr INTO gv_objnr.
          CALL FUNCTION 'STATUS_READ'
            EXPORTING
             client                 = sy-mandt
              objnr                  = gv_objnr
    *     ONLY_ACTIVE            = ' '
    *   IMPORTING
    *     OBTYP                  =
    *     STSMA                  =
    *     STONR                  =
           TABLES
             status                 = stat
           EXCEPTIONS
             object_not_found       = 1
             OTHERS                 = 2
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ELSE.
            LOOP AT it_status INTO wa_status.
              status_index = sy-tabix.
              READ TABLE stat INTO wa_stat WITH KEY stat = wa_status-stat.
              IF sy-subrc = 0.
                wa_status-stat = wa_stat-stat.
                wa_status-inact = wa_stat-inact.
                MODIFY it_status INDEX status_index FROM wa_status TRANSPORTING stat inact.
              ENDIF.
            ENDLOOP.
          ENDIF.
        ENDIF.
      ENDLOOP.
    ENDMETHOD.
    Hope it will get resolved
    Regards,
    Satish

  • Time Out Error in Modify statement

    Hi ,
    While executing the following statement in standard program,  timeout error occurs.
    Program                                 SAPLSBAL_DB_INTERNAL
    Include                                 LSBAL_DB_INTERNALU02
    Row                                     72
    Module type                             (FUNCTION)
    Module Name                             BAL_DB_INTERNAL_NO_UPDATE_TASK
    update all tables specified
      IF NOT c_s_db_tables-baldat_u IS INITIAL.
        MODIFY baldat CLIENT SPECIFIED FROM TABLE c_s_db_tables-baldat_u.
      ENDIF.
    Internal Table c_s_db_tables-baldat_u
    MANDANT     RELID     LOG_HANDLE                      BLOCK     SRTF2     CLUSTR    CLUSTD
    120     AL     FYsqIm1SE6hX00002WF87m     112     0     512              hfdfgdfgdfdgd........
    120     AL     FYsqIm1SE6hX00002WF87m     112     1     512             ...
    120     AL     FYsqIm1SE6hX00002WF87m     112     2     512
    120     AL     FYsqIm1SE6hX00002WF87m     112     3     512
    120     AL     FYsqIm1SE6hX00002WF87m     112     4     370
    CLUSTD having  values like the one below FF060201020280003431303300000000218F0000121F9D02A37CF3F98DE2C8E2784D777B3CA3A0687E787E705919E3181F38B867EC9E6E8903C6C6369293187B00FB149265132271C0594780C4011C58
    Please help.

    I am not a developper, so I cannot answer your question about the modify-directly-on-db-issue - but look at the FM BAL_DB_INTERNAL_NO_UPDATE_TASK - as the shorttext says: Application-Log: Database: Internal: Protocolls without Update Task - maybe it has to do with the way this modify is processed?
    Just so. It will not help you - of course you can open a Call with SAP on this special function and see if they come up with an explanation and/or a correction - in the meantime, consider my proposals as possible workarounds.
    Another thought: if you are so interested in that FM, why not post a question in the Abap-performance forum - there's a tough group of guys over there who might be interested to study that FM.

  • TABLE ILLEGAL STATEMENT  error with MODIFY command

    Hi gurus,
    i want you to inform me about table illegal statement error. The error occurs when i use modify as below.
    loop at itab.
       select .......
             where xxx eq itab-xxxx.
           MODIFY itab.
      endselect.
    endloop.
    i know that i have to give the sy-tabix as INDEX parameter to the modify command. but i want to know why i have to do this?
    cause when i debug, i follow the sy-tabix field and it have not a change in select endselect.
    may the reason of the error about cursor in select and cursor effects modify command?
    or why?
    Thx,

    Hello,
    I guess this is because your MODIFY statement is inside the SELECT ... ENDSELECT & not inside the LOOP ... ENDLOOP.
    SAP documentation says:
    Within a LOOP loop, the INDEX addition can be ommitted. In this case the current table line of the LOOP loop is changed.
    You have to change the coding:
    DATA: v_index TYPE i.
    loop at itab.
    v_index = sy-index.
    select .......
    where xxx eq itab-xxxx.
    MODIFY itab INDEX v_index.
    endselect.
    endloop.
    BR,
    Suhas
    PS: The coding practice followed is not very performance oriented as well. May be you should have a look around in some blogs, wikis in SCN & change the code accordingly.
    Edited by: Suhas Saha on Nov 19, 2009 9:41 AM

  • SQL Error in the modify statement

    Hi All,
    We are facing an SQL error while uploading an archive file. The error is   
    caused while executing a modify statement which leads to a dump. The       
    text given in the SM21 logs is                                   
    'Database error -1 with SEL access to table SMMW_MCD_DMY_AVE'              
    The dump generated in ST22 says DBIF_RSQL_SQL_ERROR
    Database error text........: "[Microsoft][SQL Native Client]Session Provider:
    Connection has been closed by peer [xFFFFFFFF]. "
    Any pointers to figure out how to resolve this could be really helpful.
    Regards,
    Liji

    Hi,
    This sounds like internal message 0000062076 2010  
    which I'm currently working on.
    If it is this BUZ-upload problem: ask your system responsible to set the instance profile parameter
    dbs/mss/packet_size=8192
    After the R3-system is restarted, the transaction should work.
    The problem was caused by an UPSERT-command writing a 170 MB BLOB.
    UPSERT means: all values for the row are provided. Try first an UPDATE, if this fails with NOT FOUND insert.
    This UPDATE, IF NOT FOUND INSERT is send as one batch to the database server.
    For SQL Server 9.00, a batch may only
    consist of 64K network packets. The default network packet size is 4K. 4K * 64KB == 256 MB.
    The 170 MB BLOB is sent twice, so we don't fit in the 64K packets.
    This breaks the connection and you get on client side the"Connection has been closed by peer".
    On server side you see (SQL Server error log) "A fatal error occurred while reading the input stream from the network. The session will be terminated."
    If you want to increase the network packet size used by your db connections in the SAP work processes, you can use  the profile parameter
    dbs/mss/packet_size.
    Maximal setting is 32767. In your case I would recommend 8192.
    Best regards,
    Guenther
    Edited by: Guenther Drach on Jan 7, 2010 3:13 PM
    Edited by: Guenther Drach on Jan 7, 2010 3:15 PM

  • Short dump - CX_SY_OPEN_SQL_DB during MODIFY statement

    In production system, sometimes it dumps with this error:
    Runtime Errors         DBIF_RSQL_INVALID_RSQL
    Exception              CX_SY_OPEN_SQL_DB
    And here is the code cause this problems:
    CALL FUNCTION 'ENQUEUE_E_TABLE'
      EXPORTING
      mode_rstable = 'E'
      tabname     = 'ZVKN_TRPHIST'.
    MODIFY zvkn_trsphist FROM TABLE lt_trsphist. <<<<<< Error
    CALL FUNCTION 'DEQUEUE_E_TABLE'
      EXPORTING
      mode_rstable = 'E'
      tabname = 'ZVKN_TRPHIST'.
    IF sy-subrc EQ 0.
      return-type = 'S'.
    ELSE.
      ROLLBACK WORK.
      return-type = 'E'.
    ENDIF.
    I have tried to use ENQUEUE statement with WAIT but no succeed. How to manage with no dump?

    Hi, thanks for your reply.
    Did you mean that adding COMMIT WORK AND WAIT when ENQUEUE is success and before modify statement?
    I not get it clearly. I use the code below. Is this ok to transport to Production?
    CALL FUNCTION 'ENQUEUE_E_TABLE'
        EXPORTING
          MODE_RSTABLE         = 'E'
          TABNAME              = 'ZVKN_TRPHIST'
    *   VARKEY               =
    *   X_TABNAME            = ' '
    *   X_VARKEY             = ' '
    *   _SCOPE               = '2'
          _WAIT                = 'X' 
    *   _COLLECT             = ' '
        EXCEPTIONS
          FOREIGN_LOCK         = 1
          SYSTEM_FAILURE       = 2
          OTHERS               = 3
       IF SY-SUBRC <> 0.
         return-type = 'E'.
         return-number = sy-msgno.
         return-id = sy-msgid.
         CALL FUNCTION 'MESSAGE_TEXT_BUILD'
           EXPORTING
             msgid               = sy-msgid
             msgnr               = sy-msgno
             msgv1               = sy-msgv1
             msgv2               = sy-msgv2
             msgv3               = sy-msgv3
             msgv4               = sy-msgv4
           IMPORTING
             message_text_output = return-message.
         ROLLBACK work.
         RETURN.
       ELSE.
         COMMIT WORK AND WAIT.
         MODIFY zvkn_trsphist FROM TABLE lt_trsphist.
         CALL FUNCTION 'DEQUEUE_E_TABLE'
           EXPORTING
             mode_rstable = 'E'
             tabname      = 'ZVKN_TRPHIST'.
         RETURN-type = 'S'.
       ENDIF.

  • INSERT or MoDIFY statement

    hi,
    I have to insert a data for my ztable,for 1st time it is updating the data,but for the second time (since all the key fields are same as 1st record),it is going to modify the data in my table.(since i have used modify statement),But i want both the records.
    any idea?

    hi
    MODIFY - Will update the table, if the data already exists, if NOT inserts new rows.
    UPDATE - Will update the table, errors out if the data is not found.
    In case of MODIFY the sy-subrc is always 0 so you would't know whether the data is actually updated or not.
    INSERT - Inserting Data in Database Tables
    Update Modify Insert stmts we use when we want to do some change / Insertion
    (1) to database table from internal table or
    (2) from work area to internal table.
    ( AA ) Update
    If the intended record in the internal table is found in databse table means it will just update that record.
    syntax to update database table from itab:::::
    UPDATE dbtab FROM TABLE itab
    Changes to lines made with the UPDATE command only becomefinal after a database commit
    Without using internal table we can update database table directly as shown below:::::::::::::::::::::
    TABLES SFLIGHT.
    UPDATE SFLIGHT SET SEATSOCC = SEATSOCC + 3
    WHERE CARRID = 'LH' AND
    CONNID = '0400' AND
    FLDATE = '19950228'.
    ( BB ) Modify is used to insert new record if the record doesnt exist in datbase table.system check this on primary key basis.
    If the intended record in the internal table is found in databse table means it will just update that record.So here its equal to UPDATE stmt.
    For changes to database table we use syntax as below ::::
    MODIFY DatabaseTable FROM TABLE itab.
    For changes to Internal table we use syntax as below ::::
    MODIFY itab FROM wa INDEX idx.
    http://TRANSPORTING f1 ... fn WHERE cond.
    ( CC ) Insert stmt is used to insert New records into databse table from internal table or to internal table from work area.
    By default, data is only inserted in the current client. However, ifyou use the CLIENT SPECIFIED addition, you can switch off theautomatic client handling.
    You cannot insert a table line if the table alreadycontains a record with the same primary key.
    Syntax::::::::::
    INSERT INTO dbtab CLIENT SPECIFIED VALUES wa.
    or
    INSERT (dbtabname) CLIENT SPECIFIED FROM TABLE itab.
    Example
    Adding customer "Robinson" to client 002:
    TABLES SCUSTOM.
    SCUSTOM-MANDT = '002'.
    SCUSTOM-ID = '12400177'.
    SCUSTOM-NAME = 'Robinson'.
    SCUSTOM-POSTCODE = '69542'.
    SCUSTOM-CITY = 'Heidelberg'.
    SCUSTOM-CUSTTYPE = 'P'.
    SCUSTOM-DISCOUNT = '003'.
    SCUSTOM-TELEPHONE = '01234/56789'.
    INSERT INTO SCUSTOM CLIENT SPECIFIED VALUES SCUSTOM.
    Re: difference update and insert
    The specified item was not found.
    /message/4622903#4622903 [original link is broken]
    regards,
    Vipul

  • RMAN-10006: error running SQL statement: alter session set remote_dependenc

    Backups are failing with following error
    RMAN-00554: initialization of internal recovery manager package failed
    RMAN-12001: could not open channel default
    RMAN-10008: could not create channel context
    RMAN-10002: ORACLE error: ORA-00096: invalid value SIGNATURE for parameter remote_dependencies_mode, must be from among MANUAL, AUTO
    RMAN-10006: error running SQL statement: alter session set remote_dependencies_mode = signature
    Not able to change to signature
    SQL> alter session set remote_dependencies_mode=signature;
    ERROR:
    ORA-00096: invalid value SIGNATURE for parameter remote_dependencies_mode, must
    be from among MANUAL, AUTO
    I dont see MANUAL or AUTO as valid value for this parameter (http://download.oracle.com/docs/cd/B10501_01/server.920/a96536/ch1175.htm#1023124) DB version is 9.2.0
    Parameter type
    String
    Syntax
    REMOTE_DEPENDENCIES_MODE = {TIMESTAMP | SIGNATURE}
    Default value
    TIMESTAMP
    Parameter class
    Dynamic: ALTER SESSION, ALTER SYSTEM
    =======================================
    I believe it could be because of following bug
    "A PRE-PATCHED ORACLE IMAGE CAN BE INSTALLED IN MEMORY "
    Refer: "https://metalink2.oracle.com/metalink/plsql/f?p=130:15:1613505143885559758::::p15_database_id,p15_docid,p15_show_header,p15_show_help,p15_black_frame,p15_font:BUG,4610411,1,1,1,helvetica"
    I appreciate your effort in fixing this issue.
    Edited by: user10610722 on Nov 25, 2008 4:37 PM

    Hi:
    It seems when you are starting RMAN it's executing some commands (one 'ALTER SESSION...'. It's seems to be a batch which has a bad value for SORT_AREA_SIZE. Find it and modify to a proper value as message shows. If you can't find start RMAN by calling directly the executable ($ORACLE_HOME/bin/rman or %ORACLE_HOME%/bin/rman.exe).

  • Database Updation and Insertion using Modify Statement

    Hi All,
    I am using Modify statment for data insertion and updation
    MODIFY zmpit_ven_bgg_rg FROM TABLE t_ven_bgg .
    But I am getting error
    The type of the database table and work area (or internal table) "T_VEN_BGG" are not compatible.
    I have defined my internal table of below type :
    TYPES : BEGIN OF ty_ven_bgg,
            mandt             TYPE mandt,
            lifnr                 TYPE lfa1-lifnr,
            bgg                 TYPE zmpit_ven_bgg_rg-matkl,
            ind                  TYPE zmpit_ven_bgg_rg-active_ind,
            created_by      TYPE zmpit_ven_bgg_rg-created_by,
            created_on      TYPE zmpit_ven_bgg_rg-created_on,
            last_changed_by TYPE zmpit_ven_bgg_rg-last_changed_by,
            last_changed_on TYPE zmpit_ven_bgg_rg-last_changed_on,
            remarks              TYPE zmpit_ven_bgg_rg-remarks,
            ind1(1)                TYPE c,
                 END OF ty_ven_bgg.
    Here, ind1 is not field  of the table.
    I have added a new field Remarks in the table and thus i included it in the Internal table also.
    Above Modify statement was working fine without Remarks field. I am not able to understand the error
    as work area is also of type ty_ven_bgg.
    Please suggest some solution.
    Regards,
    Nibha

    Hi,
    Though you have creaated one more internal tsble without the indc field, but you can do it using the same intrenal table by simply using
    1. MOVE-CORRESPONDING <internal table> to <ztable>.
    2.MODIFY <ztable>.
    will solve your problem
    Secondly declare the internal table using DATA after structure has been declared using TYPES.
    This is better approach to follow.
    Pooja

  • Javac(1.4.2) gives error in import statement

    Hi All,
    I am facing a surprising problem. I have 2 java class files. I write the import statement for second one in the first one. There is no package & these are in the same directory. I have compiled the second one. But when I try to compile the First one. Javac throws error at import statement like below :
    D:\Clubs\oct\6>javac -d . ManojTest.java
    ManojTest.java:1: '.' expected
    import SessionBean;
    ^
    1 error
    My Java Files are as below :
    import SessionBean;
    public class ManojTest
         public static void main(String args[])
    //ManojTest.java
    public class SessionBean
         public static void main(String args[])
    //SessionBean.java
    I have compiled SessionBean.java successfully but when I try to compile ManojTest.java I get error mentioned above.
    However this probelm comes when I use j2se 1.4.2.. but works in j2se 1.3.1..
    Another way could be I use package structure.
    But I can't do any of these, as I have to port my big project to j2se1.4.2.. from j2se1.3.1.. (Live project is running on Tomcat).
    Problems is similar in Unix & Windows both.
    Is this javac compiler issue or there is some setting which I can make.
    I have already included . (dot) in PATH & CLASSPATH environment varibales.
    Please help me out if there is any way around this, as i am stuck up in between
    thank you
    Manoj :confused:

    Use a package and then add that package in your classpathOr don't use a package, leave the file in the default (noname) package, and don't use the import statement. Java will find it in the default package without the import.
    Explicit import statements from the default package are no longer allowed

  • Getting error message that states itunesexe has been set to run in compatibilty mode for an older versions of windows for best results turn off compatibility mode for itunes before you open it .How do i turn off compatibility mode?

    recieved error message that states" itunes exe has been set to run in compatibility mode for an older versions of windows for best results turn off compatibility mode for itunes before you open it. How do i access compatibility mode and turn it off ? Believe i have Windows 7.

    Try the following document, only be sure that none of the boxes in the compatibility tab are checked (not just the compatibility mode box itself): 
    iTunes for Windows: How to turn off Compatibility Mode

  • When my lightroom opens up I keep getting an error message that states, "Lightroom encountered an error whne reading from its preview  cache and needs to quit" I have relaunched it a number of times and keep getting the same message.

    when my lightroom opens up I keep getting an error message that states, "Lightroom encountered an error whne reading from its preview  cache and needs to quit" I have relaunched it a number of times and keep getting the same message. Any thoughts on how to fix this?

    You need to delete your preview cache and have Lightroom rebuild it.   Cache location can be found here.
    https://helpx.adobe.com/lightroom/kb/preference-file-locations-lightroom-41.html
    Why And How To Clear Your Lightroom Cache - Lightroom Fanatic

  • Error in if statement

    i am writing a stored procedure in which i have made use of if statement my requirement is that in the if statement if a
    certain record exists then go inside the if condition otherwise else condition i am getting error
    my SQL Statement is this
    create or replace
    PROCEDURE usp_addAppointment_Mst
    parameter list
    AS
    pAppdetailsid number(10,0);
    v_Appcode varchar(10);
    begin
         if exists(Select * from dr_slots Where SlotId = pSlotId and MaximumPatient = AllocatedPatient )then
    Select v_AppDetailsId from dual;
         return ; -- this is my return statement
    else
    Select NVL(max(AppId),0) + 1 into v_Appid From Appointment_Mst;
    v_Appcode := 'APP' || cast(*v_Appid* as varchar(5)); -error in this line
    /*some code*/
         Select AppDetailsId from Appointment_Dtls where AppDetailsId=pAppdetailsid;
    end if;
    end;
    what i am doing is that if statement mentioned above becomes TRUE then execute select statement and return
    from there otherwise it goes inside else statement and perform some operation which is there inside the transaction
    and then select some value which actually the last statement in else block this is my actual requirement
    while executing i am getting this error
    Error(71,58): PLS-00103: Encountered the symbol "(" when expecting one of the following:     . ) @ %
    Edited by: user21354 on Feb 21, 2011 1:05 AM
    Edited by: user21354 on Feb 21, 2011 1:08 AM

    What is this line doing in there?
    variable declaration That's not valid PL/SQL code.
    Please also consider posting your code using {noformat}{noformat} tags as desribed in the SQL and PL/SQL FAQ: SQL and PL/SQL FAQ                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to use "where" clause in modify statement

    Hi
    can any1 telll me is it possible to use a where clause in a modify statemetn. I want to use modify statemetn  to insert a new recoed in a database table.
    Regards
    Sabahuddin Ahmed

    MODIFY itab - itab_lines
    Syntax :
    ... itab FROM wa TRANSPORTING comp1 comp2 ... WHERE log_exp.
    With these additions the MODIFY statement assigns the content of the comp1 comp2 ... components of the wa work area specified after TRANSPORTING to all lines in the itab table that meet the logical condition log_exp. The wa work area must be compatible with the line type of the internal table.
    The TRANSPORTING addition has the same effect as changing individual lines. The WHERE addition can only be specified together with the TRANSPORTING addition. After WHERE, any logical expression can be specified in which the first operand of each individual comparison is a component of the internal table. All logical expressions are therefore possible, with the exception of IS ASSIGNED, , and IS SUPPLIED. It is not possible to dynamically specify a component using bracketed character-type data objects.
    While for standard tables and hashed tables all lines in the internal table are checked for the logical expression of the WHERE statement, for sorted tables, optimized access can be achieved by checking at least one opening part of the table key for parity using AND linked queries in the logical expression.
    Example
    Change the contents of the planetype component for all lines in the sflight_tab internal table in which this component contains the value p_plane1 to the value p_plane2.
    PARAMETERS: p_carrid TYPE sflight-carrid,
                p_connid TYPE sflight-connid,
                p_plane1 TYPE sflight-planetype,
                p_plane2 TYPE sflight-planetype.
    DATA sflight_tab TYPE SORTED TABLE OF sflight
                     WITH UNIQUE KEY carrid connid fldate.
    DATA sflight_wa TYPE sflight.
    SELECT *
           FROM sflight
           INTO TABLE sflight_tab
           WHERE carrid = p_carrid AND
                 connid = p_connid.
    sflight_wa-planetype = p_plane2.
    MODIFY sflight_tab FROM sflight_wa
           TRANSPORTING planetype WHERE planetype = p_plane1.
    reward if useful

Maybe you are looking for