Insert,  Delete and Update options in Table control

Experts,
I have writen code for Insert,  Delete and Update options in Table control. They are not working properly...
can any one send the code for the above please...
Thanks in advance..

Hi,
Following steps will help you.
1.TOP-INCLUDE
DATA: ITAB1 LIKE KNA1 OCCURS 0 WITH HEADER LINE.
DATA: ITAB2 LIKE KNA1 OCCURS 0 WITH HEADER LINE.
DATA: WA LIKE KNA1.
DATA: ANT TYPE I,CUR TYPE I.
DATA: OK_CODE TYPE SY-UCOMM.
CONTROLS: TABCTRL TYPE TABLEVIEW USING SCREEN 100.
IN FLOWLOGIC
PROCESS BEFORE OUTPUT.
LOOP AT ITAB1 CURSOR CUR WITH CONTROL TABCTRL.
ENDLOOP.
PROCESS AFTER INPUT.
MODULE CLEAR_DATA.
LOOP AT ITAB1.
MODULE MOVE_DATA.
ENDLOOP.
ADD “OK_CODE” IN ELEMENT LIST. CLICK ON LAYOUT AND  ADD TABLE CONTROL(name it as TABCTRL) AND PUSHBUTTONS AS FOLLOWS.
SELECT THE FIELDS FROM PROGRAM. SAVE CHECK AND ACTIVATE.
CLICK ON FLOWLOGIC EDITOR FROM APPLICATION TOOL BAR.
DOUBLE CLICK ON MODULE “CLEAR_DATA”.
write the in this module as below.
CLEAR ITAB2. REFRESH ITAB2.
DOUBLE CLICK ON MODULE “MOVE_DATA”.
write the code in this module as below.
APPEND ITAB1 TO ITAB2.
ACTIVATE PAI AND WRITE THE CODE AS BELOW.
CASE OK_CODE.
WHEN 'FETCH'.
SELECT * FROM KNA1 INTO TABLE ITAB1 UP TO 20 ROWS.
TABCTRL-LINES = SY-DBCNT.
WHEN 'ADD'.
GET CURSOR LINE CNT.
CNT = TABCTRL-TOP_LINE + CNT - 1.
CLEAR WA.
INSERT WA INTO ITAB1 INDEX CNT.
WHEN 'MODIFY'.
GET CURSOR LINE CNT.
READ TABLE ITAB2 INDEX CNT.
LOOP AT ITAB2.
MODIFY KNA1 FROM ITAB2.
ENDLOOP.
SELECT * FROM KNA1 INTO TABLE ITAB1.
WHEN 'EXIT'.
LEAVE PROGRAM.
ENDCASE.
SAVE,CHECK AND ACTIVATE ALL.
CREATE TCODE AND EXECUTE.
contact if u hv any issues regarding this code.
reward points,if it is useful.
Thanks,
Chandu.

Similar Messages

  • Simple insert, delete and update not working after oracle 10g installation

    Hello,
    I made a new installation of Oracle 10g (10.2.0.1.0) and created a schema . Now i try to insert or update data using simple queries, but unfortunately nothing happens. I tried inserting or updating data even via sqlplus, but unfortunately the same result. Query takes infinite time to end, so i had to manually end it every time... No errors... No warnings... but takes long time... I have given all the required permissions to the schema but the same result. Can somebody help me figure out the problem?
    Tried creating a new table and the insert and delete are working fine... think the problem is with this table... Imported the rows of the table from another online database. I dont understand how this might be a problem.
    Edited by: user13333704 on Mar 15, 2011 1:26 AM

    However how do you generate awr reports and how to find the session wait?TO generate the AWR report
    sql> ?/rdbms/admin/awrrpt
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/autostat.htm#BABDHAGF
    The event column in v$session , in v$active_session_wait will show you the session wait event.What the session was actually waiting for.
    HTH
    Anand

  • Selected Column insert, delete and updation at replication end

    Hello,
    In GoldenGate, is there a way to get a timestamp column at target table to get updated for some selected columns from source table only. For eg.
    At source - Table Temp_Source , columns - Emp_Id (PK), Emp_Name, Department, Address
    At target - Table Temp_Target, columns - Emp_Id (PK), Emp_Name, Department, Last_Update
    The Last_Update column takes timestamp for last updation made at source table which is replicated at target end.
    Now I just want the changes made in EMP_Id, EMP_Name , Department columns to be replicated at target table and also the Last_Update to get updated for changes made in these columns only. The changes made in Address column should not affect Last_Update at target end.
    The extract or replication script for this should work for insert, update and delete scenarios for specified columns. Using COLS creates problem in insertion as it Abends the replication process.
    Is there any way I can achieve this functionality??

    At target end I have written the following code in Replication process -
    GetUpdates
    IgnoreInserts
    IgnoreDeletes
    Map <source table>, target <target table>, COLMAP (USEDEFAULTS, LAST_UPDATE = @IF((EMP_ID <> BEFORE.EMP_ID OR EMP_NAME <> BEFORE.EMP_NAME OR DEPT <> BEFORE.DEPT), @getenv("GGHEADER", "COMMITTIMESTAMP"),REFRESH_TIMESTAMP));
    But this code entertains only the Primary Key changes i.e. EMP_ID, I want the Last_update to get updated for changes in EMP_NAME and DEPT even but not for Address column change at source end.

  • Insert delete or update entry in Custom table from KONV entry changed

    Hi All,
    I have custom table ZKONV with only few required columns and should have same number of records as KONV has at any point in time.
    KONV is a cluster table so its not readable from ORACLE level. So ZKONV is created. But I dont know how to keep these both tables in sync.
    I need to perform insert delete or update entry in Custom table if insert delete or update happens on cluster table KONV from any transactions.
    As KONV is a cluster table and does not have changed time stamp I am not able to know the number of records changed in perticulat time period.
    Thanks,

    Thanks for reply,
    There is a Outside SAP system which needs to read KONV data to feed into their system, but as KONV is cluster table they are not able to read it from ORACLE level.
    To solve this we are thinking to create a transparent Z-table and will fill it with KONV and catch Update, delete or Insert statement and do same on ZKONv.
    Is this possible some how? by some database event or something....

  • Deleting and updating records in a database table

    dear all ,
    i have created a databse table to which i have to update and delete records thru my program whixh i am unable to do so plz help me.

    Hi Sonu,
    To delete and update the records in your database table, you can create a Function Group and all the necessary function modules for it. This will a good approach as this will separate the database interface logic and the business logic. You need to use the DELETE and UPDATE ABAP keywords to delete and update the records of the database tables. Have a look at the ABAP Keyword documentation for a complete details of the usage.
    Have a look at the following link:
    DELETE
    http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb3aef358411d1829f0000e829fbfe/frameset.htm
    UPDATE
    http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb3aef358411d1829f0000e829fbfe/frameset.htm
    Hope this will help.
    Thanks,
    Samantak.

  • To insert a new row in a table control without affecting the other rows

    Halo experts,
    I have a Table control TCTRL in a program .
    The lt_tab contains two cols A and B
    In change mode of the transaction Col A is in display mode and Col B is in change mode
    When i press the + button to insert a new blank entry .I need a blank row with both col A and col B input enabled w/o affecting the display of above and below rows of table control
    In PBO module of subscreen 101
    LOOP AT lt_tab  WITH CONTROL tctrl.
    MODULE tctrl_status.
    endloop.
    In the user command of 0101
    i am writn
    When 'INS'.
    INSERT INITIAL LINE INTO itab.
    Inside MODULE tctrl_status.
    IF lt_tab IS INITIAL.
        LOOP AT SCREEN.
          IF screen-name = 'COLA'.
          screen-input = 1.
      ENDIF.
        ENDLOOP.
          MODIFY SCREEN.
    endif.
    but the problem here is still the Col A is in display mode and Col B is in change mode after output
    .Here modify statement is happening but it does not update the TCTRL-COLS-Screen structure for the col A ( which I have set statically while designing the screen ).I dont want to make the entire row in edit mode only the inserted row ( for both Col A and Col B) and the rest shud remain as it is
    Thanks
    Kallu

    hi Naveen
    I have made my tctrl input disabled for both the columsn and
    I have a module before the PBO loop where I set the like
    module set_tctrl_status.
    IF gv_ok_code NE gc_disp.
        LOOP AT tctrl-cols INTO gs_cols.
          IF gs_cols-screen-name = 'ColB'.
            gs_cols-screen-input = 1.
            MODIFY tctrl-cols FROM gs_cols INDEX sy-tabix.
          ENDIF.
        ENDLOOP.
    This is just to set the Col B in edit mode when in change and create status.
    But if i press the INS button for that change i am coding inside the loop endloop of the pBO like
    if itab is initial.
    LOOP AT tctrl-cols INTO gs_cols.
    gs_cols-screen-input = 1.
    MODIFY tctrl-cols FROM gs_cols INDEX sy-tabix.
    endloop.
    But the problems i it is setting the enite rows as input enabled . I want tos et only that row inpur enabled

  • Find record insert date and time in a table

    Hi All,
    I want to get record insert date and time in a table. There is no datetime column in my table. Are there any possibility to get date and time for each record?
    Thank You

    Thats not easy. If your transaction info still resides on active portion of the log you can use fn_dblog to read out the time at which the transactions occurs. This is useful only if you try it shortly after transaction.
    the code would look like this
    SELECT *
    FROM fn_dblog(null,null)
    WHERE [Transaction Name] LIKE 'INSERT%'
    OR [Transaction Name] LIKE 'UPDATE%'
    Also see
    http://www.mssqltips.com/sqlservertip/3076/how-to-read-the-sql-server-database-transaction-log/
    http://solutioncenter.apexsql.com/read-a-sql-server-transaction-log/
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How can I  delete and update records using where conditions?

    I want to delete and update the coherence records with some conditions, I describe it to use SQL as follows:
    delete from "contacts" where getStreet() = "dsada";
    update contacts set getStreet() = "dddd" where getCity() = "ssss";
    Can I use the filter like query to achieve this requirement as follows:
    ValueExtractor::View vHomeStateExtractor = ChainedExtractor::create(
    ChainedExtractor::createExtractors("getHomeAddress.getState"));
    Object::View voStateName = String::create("MA");
    Set::View setResults = hCache->entrySet(
    EqualsFilter::create(vHomeStateExtractor, voStateName));
    I know I can use get and put to achieve this requirement , but it Requires a two-interaction between the client and coherence server. Does it have And another way?
    Thanks very much, and please Forgive my English is not very good.

    Hi,
    You have a couple of options for updating or deleting using a Filter.
    For deleting you can use an Entry Processor and the cache invokeAll method. Using "out of the box" Coherence you can use the ConditionalRemove entry processor. I'm a Java person so the C++ below might not be exactly right but you should get the idea.
    ValueExtractor::View vHomeStateExtractor = ChainedExtractor::create(
    ChainedExtractor::createExtractors("getHomeAddress.getState"));
    Object::View voStateName = String::create("MA");
    hCache->invokeAll(EqualsFilter::create(vHomeStateExtractor, voStateName),
    ConditionalRemove::create(AlwaysFilter.getInstance());For update you would either need to write custom Entry Processor implementations that perform the updates you require or you can use out of the box POF or Reflection ValueUpdaters that update specific fields of the entries in the cache. These valueUpdaters would be wrapped in an UpdaterProcessor so the call would be very similar to the code above.
    JK

  • How can we delete a line from the table control .

    hi all
    how can we delete a line from the table control .
    situation is.
    created table control in se51 which will display the data of a table.
    how could i select a line from the table control ?
    how could i delete the selected lines form the table.
    thanks in advance

    Change the Table Control attributes such that user can only select a single record(row).
    <u>Tip to delete a selected record</u>
    1) write a module 'Mark' in the PAI as below
    PROCESS AFTER INPUT.
    MODULE cancel AT EXIT-COMMAND.
    LOOP WITH CONTROL table_view.
    MODULE read_table_control.
    FIELD flag MODULE mark ON INPUT.
    ENDLOOP.
    MODULE user_command_0100.
    2) Module Mark is below.
    MODULE mark INPUT.
    CHECK flag = 'X'.
    x = table_view-top_line + sy-stepl - 1.
    Delete itab INDEX x.
    ENDMODULE. " mark INPUT
    Table_view is the TableControl Name.
    'flag' is of type char(1) available in the Internal table which was assigned to the select option in the table control.
    <u>award if uesful</u>
    Regards,
    Sudheer

  • How to delete a column from the table control in module pool?

    Hi,
      can any one please tell How to delete a column from the table control in module pool?
    thanks in advance
    warm regards
    HareeshKumar N

    hi hareesh,
    I think it is better to hide it.
    How to hide: You can check this link
    Dynamic Hide column in table control

  • In trying to edit a track - I want to "Delete and Move" the track to automatically fill the area that I deleted - However, after selecting a section to delete - the "Delete and Move" option is grayed out. How do I fix this?

    In trying to edit a track - I want to "Delete and Move" the track to automatically fill the area that I deleted - However, after selecting a section to delete - the "Delete and Move" option is grayed out. How do I fix this?

    Thank you for your attempt to help me. I appreciate that.
    I think I figured out how to fix it-
    I found that if I only delete a small amount at the beginning and at the end of the section that I want to remove - and then highlight that section - Then (and only then) does the "Delete and Move" function work to remove the unwanted section and automatically close the gap between the surrounding sections. I was trying to select a whole section and could only delete it - and then manually move it.
    Problem solved.

  • My App Store is deleted and the option to turn it back on in restrictions is grayed out. How do I get the App Store back?

    My App Store is deleted and the option to turn it back on in restrictions is grayed out. How do I get the App Store back?

    If a reset didn;t work, then you can try restoring your iPad. Don't restore from a back up because if there is a glitch with restrictions, it will just set that option up again. Of if you are sure you have a backup created before you changed restrictions settings, then you can back up from that.
    Backup & Restore
    Restore iOS
    Recovery Mode Restore

  • Does anyone know why the delete and hide options are still missing in the crop tool option bar, despite having changed the background layer to a regular layer?  Thanks!

    Does anyone know why the delete and hide options are still missing in the crop tool option bar, despite having changed the background layer to a regular layer?  Thanks!

    "flying blind."
    "You totally lost me there, and I have no clue as to what your last question means."
    "I think I now know what you mean."
    Evidently language is of difficulty for you. 
    Perhaps the Oxford dictionary can provide you with your much needed “sensible, meaningful” content.
    According to the Oxford dictionary, a dialogue is to "Take part in a conversation or discussion to resolve a problem."  It also states that a dialogue is "A discussion between two or more people or groups, especially one directed toward exploration of a particular subject or resolution of a problem.”
    That IS the inherent nature of posts. A conversation is reciprocation.  Questions, followed by more questions.
    It is not difficult to understand.
    "how to ask your questions correctly for quicker and better answers" is best actualized by simply asking.
    Is it a Mac; is it not, etc.
    That IS sufficient.  That IS "quicker and better answers[ing]."  That IS what a dialogue IS.   And that IS actually what is "sensible," "meaningful," and "detailed." 
    The Oxford dictionary can best delineate and elucidate your lack of comprehension in what ACTUALLY “meaning” is.
    As well as what is "sensible" AND "detailed." 
    By the way, am I being repetitive.
    Still confused.  Let the experts that do not require much explanation respond with "quicker and better answers" for both "sensible, complete" responses." They are not "lost," "blind," or provide "incomplete" drivel.

  • "Delete and Move" option not given

    I want to chop a section of audio. If I highlight a section and type command-x, it deletes the audio and leaves a blank section. According to the help menu, "delete and move" is supposed to chop the section and merge everything -- I want to do this to eliminate a section entirely. But when I highlight a section, the "delete and move" option is gray and can't be selected.
    There must be a simple answer to this but I don't know what it is.
    Thanks.

    Well, it would be easier if you could just do it in the Track Editor, but it doesn't work that way. (You can only delete a portion of the Region there, not have it move automatically).
    Select the Region. That's one mouse click, whether it's an hour of audio or ten seconds. Then simply place the playhead where you want, do a Split (Cmd+T), move the playhead, do a Split, then click in a blank area (to deselect), click on the region to be deleted, and Ctrl+Del.

  • IB51, IB52 : Page up & Page Down option for table control disabled

    Hi experts,
    IB51, IB52 Page up & Page Down option for table control is disabled.
    We want to use these options in the table control while recording .
    Can any one tell us?
    Regards,
    Lakshmi

    Hi,
    You can refer to Note 379208 .
    The same is applicable in CRM too.
    Thanks ,
    Jomy

Maybe you are looking for