How to Edit a general table

Hi Experts,
In my requirement am working on general DML operations i need help for editing a selected record. Please help me.
Thanks,
Sandy.

Hi Sandy,
I think you have table ready to change values.. change your table rows.
create one button save.. SAVE. in on action of that button.
Use code wizard to read table. and code like this.. for example
LOOP AT lt_segment1 INTO ls_segment1.  //
      wa_segment-person      =   level1.
      wa_segment-cdate       =   ls_level-date.
      wa_segment-dealer_code =  lv_dealer_code.
      wa_segment-dimension   =   ls_segment1-segment.
      APPEND wa_segment TO it_segment.
    ENDLOOP.
    MODIFY zwd_apo FROM TABLE it_segment.
  // To modify data from internal table to database table.
Cheers..
Kris.

Similar Messages

  • How to edit and update table control into database?

    I am doing table control. Here are my codes:
    *& Report  ZHERA_TABLE2
    REPORT  ZHERA_TABLE2.
    ***&SPWIZARD: DATA DECLARATION FOR TABLECONTROL 'ZTABLE_CONTROL'
    *&SPWIZARD: DEFINITION OF DDIC-TABLE
    TABLES:   ZHERA.
    *&SPWIZARD: TYPE FOR THE DATA OF TABLECONTROL 'ZTABLE_CONTROL'
    TYPES: BEGIN OF T_ZTABLE_CONTROL,
             NAME LIKE ZHERA-NAME,
             AGE LIKE ZHERA-AGE,
           END OF T_ZTABLE_CONTROL.
    *&SPWIZARD: INTERNAL TABLE FOR TABLECONTROL 'ZTABLE_CONTROL'
    DATA:     G_ZTABLE_CONTROL_ITAB   TYPE T_ZTABLE_CONTROL OCCURS 0,
              G_ZTABLE_CONTROL_WA     TYPE T_ZTABLE_CONTROL. "work area
    DATA:     G_ZTABLE_CONTROL_COPIED.           "copy flag
    *&SPWIZARD: DECLARATION OF TABLECONTROL 'ZTABLE_CONTROL' ITSELF
    CONTROLS: ZTABLE_CONTROL TYPE TABLEVIEW USING SCREEN 1000.
    START-OF-SELECTION.
    CALL SCREEN 1000.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'ZTABLE_CONTROL'. DO NOT CHANGE THIS LI
    *&SPWIZARD: COPY DDIC-TABLE TO ITAB
    MODULE ZTABLE_CONTROL_INIT OUTPUT.
      IF G_ZTABLE_CONTROL_COPIED IS INITIAL.
    *&SPWIZARD: COPY DDIC-TABLE 'ZHERA'
    *&SPWIZARD: INTO INTERNAL TABLE 'g_ZTABLE_CONTROL_itab'
        SELECT * FROM ZHERA
           INTO CORRESPONDING FIELDS
           OF TABLE G_ZTABLE_CONTROL_ITAB.
        G_ZTABLE_CONTROL_COPIED = 'X'.
        REFRESH CONTROL 'ZTABLE_CONTROL' FROM SCREEN '1000'.
      ENDIF.
    ENDMODULE.
    *&SPWIZARD: OUTPUT MODULE FOR TC 'ZTABLE_CONTROL'. DO NOT CHANGE THIS LI
    *&SPWIZARD: MOVE ITAB TO DYNPRO
    MODULE ZTABLE_CONTROL_MOVE OUTPUT.
      MOVE-CORRESPONDING G_ZTABLE_CONTROL_WA TO ZHERA.
    ENDMODULE.
    Screen 1000 codes:
    PROCESS BEFORE OUTPUT.
    *&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'ZTABLE_CONTROL'
      MODULE ZTABLE_CONTROL_INIT.
    *&SPWIZARD: MODULE ZTABLE_CONTROL_CHANGE_TC_ATTR.
    *&SPWIZARD: MODULE ZTABLE_CONTROL_CHANGE_COL_ATTR.
      LOOP AT   G_ZTABLE_CONTROL_ITAB
           INTO G_ZTABLE_CONTROL_WA
           WITH CONTROL ZTABLE_CONTROL
           CURSOR ZTABLE_CONTROL-CURRENT_LINE.
    *&SPWIZARD:   MODULE ZTABLE_CONTROL_CHANGE_FIELD_ATTR
        MODULE ZTABLE_CONTROL_MOVE.
      ENDLOOP.
    MODULE STATUS_1000.
    PROCESS AFTER INPUT.
    *&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'ZTABLE_CONTROL'
      LOOP AT G_ZTABLE_CONTROL_ITAB.
        CHAIN.
          FIELD ZHERA-NAME.
          FIELD ZHERA-AGE.
        ENDCHAIN.
      ENDLOOP.
    *&SPWIZARD: MODULE ZTABLE_CONTROL_CHANGE_TC_ATTR.
    *&SPWIZARD: MODULE ZTABLE_CONTROL_CHANGE_COL_ATTR.
    MODULE USER_COMMAND_1000.
    Please show me where to put my codes to edit(edit directly on table control fields) and update my table control(using the 'save' button)?

    Hi,
    You have to put the following code in the PBO of screen 1000.This code would make the fields editable to make changes in the table control fields directly.
    Here there are 3 transactions.For create and change transactions, the fields will be in editable mode and for display transaction,they will be non editable mode.
    DESCRIBE TABLE tb_line LINES lin.    " tb_line is the name of the internal table for the table control
      tcl_item-lines = lin.                             '' lin hold the number of lines of the internal table
    CASE sy-tcode.
        WHEN 'ZCREATE09' OR 'ZCHANGE09'.
    ***Checking if the table control is empty or not***
          IF lin NE 0.       
            LOOP AT SCREEN.
    ***To make the screen editable****
              screen-input = 1.
            ENDLOOP.
          ELSE.
            LOOP AT SCREEN.
              IF screen-name CS 'TB_LINE'.
    ****To make the screen non-editable if no values are present in the
    ***table control****
                screen-input = 0.
                MODIFY SCREEN.
              ENDIF.
            ENDLOOP.
          ENDIF.
    Once the fields are edited and the save button is pressed,the entered values have to be populated into the Z tables.The code has to written in the PAI of the screen 1000.Here the values from the work area of the internal table are moved into the Z Table. The code will be.
    LOOP AT tb_line.
        ztm09_ekpo-ebeln = ztm09_ekko-ebeln.  "ztm09_ekko and ztm09_ekpo are the names of the Z Tables.
        ztm09_ekpo-ebelp = tb_line-ebelp.   
        ztm09_ekpo-matnr = tb_line-matnr.
        ztm09_ekpo-menge = tb_line-menge.
        ztm09_ekpo-meins = tb_line-meins.
        ztm09_ekpo-netpr = tb_line-netpr.
        ztm09_ekpo-waers = tb_line-waers.
    *****Update the entries into item table*****
        MODIFY ztm09_ekpo.
      ENDLOOP.
    Reward if helpfull
    Thanks,
    Kashyap

  • Numbers: how to edit multiple "sheets" "tables" all at the same time

    I have read earlier posts from 2004 about this topic. Hoping things have changes.
    I have 19 sheets/tables in a numbers file "Pigeonrecords.numbers". I would like to globally alter all of them a one time as new columns or rows are needed and or data that applies to all the sheets/tables. How do I do that?
    Thank you.

    You can do a few things. For instance, you can select all the tables you want to modify and you can add a new row or column to each.

  • How to edit to a table.

    Hi All,
    I am trying to create a table with inputfield columns.
    So, i want the user to input data in this table.
    I want to bind this columns with a node context of a BAPI and to save this data.
    The procedure i did is:
    From the Standart Complex i choose table.
    Create binding and in the Standard Cell Editor i choose InputField.
    When i test my project i can input data in the columns.
    What else must i do?
    I will appreciate any help.
    Thanks,
    Ari

    Hi Phil,
    Thank you for your help.
    I checked the node of the context(ie with 0..n ) and i cannot see any problem there.
    What do you mean "if the node is defined correctly"?
    For binding the UI element table i selected Create Binding (this is the wizard you are talking for?)
    I selected the Context Node, in the "Standard Cell Editor" i selected InputField.
    I selected InputField for any "Context Attribute" too.
    I don't understand were the problem is.
    Please Phil if you have any documentation or tutorial how to solve this problem i will appreciate it.
    Thanks,
    Ari

  • How to edit data from a "View Table"?

    I am importing data from a "table view" where in sql it joins several tables into one view. When I passed it in using the template it doesnt have the "Edit command column" like other direct link tables. Is there anyway I could make a view table editable? Can I manually try to do it or I have to edit the individual ables? thanks

    oh sorry about that.The "template" I mean in HTMLDB when I start building a new application I used "Based on existing tables" method and with single tables it generates everything fine with search fields and edit column to the left. I have a table view that combines about 4 tables together and I used the same template (Based on existing tables) and it has the search and create but it doesnt have the "edit" column on the left. Is there a way I can edit the view table's information so that the other tables that the view combines will be updated/edited?
    The reason is that lets say I dont know this person's ID number but I know his name. I search for his name on table A and it returns some general data including his ID number. Instead of going to another Table B with the person's ID number and edit that table I really want to see the information just from one search (Table A)- if a global search can be implemented that would be great too. Thanks Sergio.

  • How to edit a particular row in the table ctrl when a push button is clickd

    Hi Experts,
    How to edit a particular row (except the Primary keys) after selecting it in the TABLE CONTROL when a
    push button is clicked in the table control.
    For Eg. If you have a push button say "Modify", the particular row what we select in the table control should be in a
    editable mode after clicking "Modify" Push button.
    Please help me out.
    Thanks in advance.

    Hey Ram,
    Thanks a ton.
    Its working fine...sorry for the late reply.
    The reason behind the delay is because i had modified my code as per your logic it worked fine but the thing is that the whole column was in editable mode but not a single row.
    For E.g  If i want to edit a particular row, first i select the row and then  click on "Modify" button. After i click on the button, the whole column gets in a editable mode including the one which i intentionally selected.
    Here, the solution is that you have to set a flag in PBO so that once it is done with PBO then it need not come back again after we click on "Modify" button.
    And one more query is that after you modify a particular row in the table control ( When it is in editable mode) and click on the "Save" button, it is not getting updated to database.
    To update the database, we need to select the row once again after modifying it and click on the "Save" button.
    Here, database is updating only when it is selected again. If it is not selected, it is not getting updated.
    If you have any alternative solution, then please help me out.( I hope i am clear with the question.)
    Thanks,
    Ananth.

  • How to edit table frame style

    I would like to know how to edit table style in front panel. For the example shown below, I would like to remove the gray color overcast frame.
    I couldn't find the table style editor.
    Solved!
    Go to Solution.

    Try using decoration frames. Find the attached vi too
    Attachments:
    frame.vi ‏6 KB

  • How to edit planning table so that only promote option comes for user

    how to edit planning table so that only promote option not aproove, comes for user for process management in planning unit state first pass.
    i am using 11.1.1.3 planing version, i have to do this customization very urgently.
    guys pls give some clue...thanks in advance!

    Hi John,
    a lot of thanks for your valuable help on this forum.
    if u see first pass state options, it gives only two options(promote,approve) but for other states it give >2 options so they must have put some condition on first pass state by restricting it to two options only.
    do u have any idea in which table this condition has been put so that i can restrict it further to 1 option only.
    thanks.

  • How to edit general podcast description?

    How do I edit the general description of my podcasts that appears before each individual podcast (at the top of the iTunes page)? The information that is displayed is shorter than the description that is on my podcast feed page at libsyn. In other words, iTunes is *not* publishing what's in the feed, so there must be some other place where I can edit the description.

    Would you please ask this in the Producing Podcasts forum, and please include the URLs of both your feed and the Store page - this latter can be found by control-clicking on the podcast image (or where it should be) - and choosing 'Copy link'.  Please include the http:// in both cases to make the links clickable. Without this information it's not possible to comment.

  • How to edit a datagridview/textboxes using tableadapters in c# and sql

    I am wondering what is the best way to edit a database that has multiple tables. 
    (Section 1) I have a Administration, Teacher and Student table that is linked up with the Person table which has a Primary Key. 
    The Person table consists of the general information of the person.
    The Student table consists of information about the student; student ID and qualification code.
    The Teacher table consists of information about the teacher; teacher ID, Reg No and password.
    The Administration table consists of information about the admin; admin ID, Role and password.
    As the Primary Key in the Person table is the ID, I have linked up with each of the other's table with their appropriate ID. 
    (Section 2) I have a Course and Qualification table that is linked up with the Student and Teacher table as well as each other. 
    The course table constists of the Course ID, Course Name ... and Teacher ID.
    The Qualifications table consists of Qualification Code, Qualification Name and Duration. 
    There is a section where I have to create a view which shows just the Student ID, Course ID and has the Student's Marks in it. 
    I have got a combobox which then links up with the dgv(datagridview).
    I have got insert and delete methods for both sections. Here is an example of the insert method into the Admin/Person table. 
    try
    personTableAdapter.Insert(aFirstName.Text, aSurname.Text, Convert.ToDateTime(aDoB.Text), aPhone.Text, aAdd1.Text, aAdd2.Text, aSuburb.Text, aState.Text, aPostcode.Text, AdminType.Text);
    administrationTableAdapter.Insert(Convert.ToInt32(aAID1.Text), aRole.Text, aPassword.Text);
    MessageBox.Show(aFirstName.Text + " " + aSurname.Text + " has been added. Your ID is " + aAID1.Text);
    this.personTableAdapter.Fill(this._30002195DataSet.Person);
    this.administrationTableAdapter.Fill(this._30002195DataSet.Administration);
    catch (Exception ex)
    MessageBox.Show(ex.Message);
    Here is an example of the delete method in the Admin/Person table.
    try
    personTableAdapter.Delete(Convert.ToInt32(aID.Text), aFirstName.Text, aSurname.Text, Convert.ToDateTime(aDoB.Text), aPhone.Text, aAdd1.Text, aAdd2.Text, aSuburb.Text, aState.Text, aPostcode.Text, AdminType.Text);
    administrationTableAdapter.Delete(Convert.ToInt32(aAID.Text), aRole.Text, aPassword.Text);
    MessageBox.Show("Person Deleted");
    this.personTableAdapter.Fill(this._30002195DataSet.Person);
    this.administrationTableAdapter.Fill(this._30002195DataSet.Administration);
    catch (Exception)
    MessageBox.Show("Cannot delete Person");
    Those methods above are working fine, what I'm having problems with, is with the editing/updating part. 
    I have tried a few things and haven't worked. 
    Here's an example of an edit, while trying to use textboxes. 
    personTableAdapter.Update(aFirstName.Text, aSurname.Text, Convert.ToDateTime(aDoB.Text), aPhone.Text, aAdd1.Text, aAdd2.Text, aSuburb.Text, aState.Text, aPostcode.Text, AdminType.Text, Convert.ToInt32(aID.Text), aFirstName.Text, aSurname.Text, Convert.ToDateTime(aDoB.Text), aPhone.Text, aAdd1.Text, aAdd2.Text, aSuburb.Text, aState.Text, aPostcode.Text, AdminType.Text);
    administrationTableAdapter.Update(aRole.Text, aPassword.Text, Convert.ToInt32(aAID.Text), aRole.Text, aPassword.Text);
    personBindingSource.EndEdit();
    administrationBindingSource.EndEdit();
    administrationTableAdapter.Update(_30002195DataSet.Administration);
    personTableAdapter.Update(_30002195DataSet.Person);
    MessageBox.Show("Person Updated");
    this.personTableAdapter.Fill(this._30002195DataSet.Person);
    this.administrationTableAdapter.Fill(this._30002195DataSet.Administration);
    Here I tried to do the new values/original values, while trying to use textboxes
    personTableAdapter.Update(aFirstName.Text, aSurname.Text, Convert.ToDateTime(aDoB.Text), aPhone.Text, aAdd1.Text, aAdd2.Text, aSuburb.Text, aState.Text, aPostcode.Text, AdminType.Text, Convert.ToInt32(aID.Text), aFirstName.Text, aSurname.Text, Convert.ToDateTime(aDoB.Text), aPhone.Text, aAdd1.Text, aAdd2.Text, aSuburb.Text, aState.Text, aPostcode.Text, AdminType.Text);
    administrationTableAdapter.Update(aRole.Text, aPassword.Text, Convert.ToInt32(aAID.Text), aRole.Text, aPassword.Text);
    Trying to use the example through the mdsn, this is trying to use the datagridview.
    this.Validate();
    personBindingSource.EndEdit();
    teacherBindingSource.EndEdit();
    _30002195DataSet.PersonDataTable deletedPerson = (_30002195DataSet.PersonDataTable)
    _30002195DataSet.Person.GetChanges(DataRowState.Deleted);
    _30002195DataSet.PersonDataTable newPerson = (_30002195DataSet.PersonDataTable)
    _30002195DataSet.Person.GetChanges(DataRowState.Added);
    _30002195DataSet.PersonDataTable modifiedPerson = (_30002195DataSet.PersonDataTable)
    _30002195DataSet.Person.GetChanges(DataRowState.Modified);
    try
    if (deletedPerson != null)
    personTableAdapter.Update(deletedPerson);
    teacherTableAdapter.Update(_30002195DataSet.Teacher);
    if (newPerson != null)
    personTableAdapter.Update(newPerson);
    if (modifiedPerson != null)
    personTableAdapter.Update(modifiedPerson);
    _30002195DataSet.AcceptChanges();
    catch (System.Exception ex)
    MessageBox.Show(ex.Message);
    finally
    if (deletedPerson != null)
    deletedPerson.Dispose();
    if (newPerson != null)
    newPerson.Dispose();
    if (modifiedPerson != null)
    modifiedPerson.Dispose();
    MessageBox.Show("Updated");
    this.personTableAdapter.Fill(this._30002195DataSet.Person);
    this.teacherTableAdapter.Fill(this._30002195DataSet.Teacher);
    Now because I am trying to edit a certain user which requires the Person table along with the other table, it just doesn't seem to work at all. 
    With the datagridview, I made a new view in the sql and it has both tables combined and shows when I bring it out from the datasource, but where I go into the dataset builder and try to create an update method, all I get is the "Update" not what
    I would get when I created the update method from just the person's table by itself. 
    Can someone provide me with an example or help me out someway because I am struggling with this, I can't seem to find much information at all. 
    Thanks. 

    I have used the designer to create a new datagridview, when using that dgv it doesn't want to update to the relevent tables in my database. So say you have the person and admin dgv together and you need to update it, how would you get it to work
    to the database? I did just end up using 2 seperate dgv's but it won't get accepted.
    try
    _30002195DataSetTableAdapters.PersonTableAdapter personTableAdapter = new _30002195DataSetTableAdapters.PersonTableAdapter();
    // person table
    _30002195DataSetTableAdapters.AdministrationTableAdapter administrationTableAdapter = new _30002195DataSetTableAdapters.AdministrationTableAdapter();
    // admin table
    ViewSetTableAdapters.AdminViewTableAdapter adminviewTableAdapter = new ViewSetTableAdapters.AdminViewTableAdapter();
    // tried using this for both the admin/person tables together but didn't work?
    this.Validate();
    adminViewBindingSource.EndEdit(); //both
    personBindingSource.EndEdit();
    administrationBindingSource.EndEdit();
    personTableAdapter.Update(_30002195DataSet.Person);
    administrationTableAdapter.Update(_30002195DataSet.Administration);
    MessageBox.Show("Updated");
    this.personTableAdapter.Fill(this._30002195DataSet.Person);
    this.administrationTableAdapter.Fill(this._30002195DataSet.Administration);
    catch (Exception ex)
    MessageBox.Show(ex.Message);
     So, how would I write the code so it edits both the tables from just the one dgv?
    Hello,
    Based on these words above, it seems that the key issue is that you want to display and edit the data of two tables with a single datagridview, right? If so, I am afraid that I would recommend you consider using code other than designer to get that done.
    Are these table store in the same database?
    If so, then you could consider getting that done with ADO.NET, we could getting the data of multiple table with sql query. You could consider
    using sql query to get all data from multiple tables
    of database, and then fill them to a single datatable.
    For query issue, you could consider getting help from
    Transact-SQL forum.
    If not, then we need to create update query for both table and execute these queries with sperate connection strings.
    Regards,
    Carl
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to edit the node value of a tree in webdynpro java

    Hi ALL
    I have Tree UI element where i got displayed all the nodes by calling the BAPI
    Now my requirement is when i put the cursor at any node in the Tree struture then on click of insert button i need to insert the new node with the text  , the user has to be option to give new text for the new node dynamically  , so while adding the new node in a tree the tree has to choose the text for new node , like how to edit the node of a tree to add new text.
    If any one can send the sample code on the same then it would be great help to me.
    Similar requirement like in table UI Like however we are adding the new row in a table when we click on the insert button then cursor will go to that new row in a table where user can enter his details in the table.. now i am looking for the same requirement in a Tree UI element.
    is it possible the same requirement in tree UI element in webdynpro for Java??
    Thanks
    kallki reddy

    Hi kallki reddy
    In general I think this is not possible in the form you'd like. It seems the Tree control is read-only thing always. It cannot provide editing capabilities.
    Table is different thing. You can select within many different cell editors including Input Fields.
    I guess that you scenario could be implemented not with Tree control, but with Table with Master Column. The master column allows to bring up a hierarchy into a plain table. So it's just a tree inside a table.
    Here you can find further details: [TreeByNestingTableColumn API|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/92/12a74046033913e10000000a155106/content.htm]
    BR, Siarhei

  • How to mark the physical tables as cacheable

    Hi All,
    Can someone please tell me how to mark the physical tables as cacheable.
    Thnaks a lot

    Hi,
    by default they are cacheable...
    You can see it on repository, physical layer, right clik on table, properties, on general tab, check cacheable...
    You can specify peristence time...
    See this article, you will find an image with table properties:
    http://obieeblog.wordpress.com/2009/01/19/obiee-cache-is-enabled-but-why-is-the-query-not-cached/
    Regards
    Nicoale
    Edited by: Nicolae Ancuta on 26.05.2010 09:15

  • How to edit TCURC values in BI

    Can someone tell me how to edit values in TCURC table?
    (I'm having issues importing it from R3 and I need a quick fix in mean time)
    Thanks

    Just a bit more explanation on what Ravi posted:
    You should go to Customizing transaction SPRO and select the following path:
    SAP NetWeaver   ->General Settings->Currencies->Check currency codes
    That way you can also access the relevant documentation.
    This leads you to the view V_CURC.
    In there you can take advantage of the cross system table viewer to compare with the settings in your R/3 system. To do so select from the menu:
    Utilities->Adjustment (in Change mode)
    Utilities->Comparison (in Display mode)
    Pick the RFC connection to connect to your R/3 system. Use the Filter icon to hide identical records. Select all (Edit->Select->...) and click on Adjust. Copy all and go back confirming the pop up with Yes. That way you can copy over values from R/3 to BW.
    *Note: This tool works on all views that exist in both systems and you can compare and copy data easily.
    Best,
    Ralf

  • How to populate data in table control  .

    hi all,
    i put matnr no. in screen no. 103
    validation is done at that screen only.
    now when i want to modify dat record
    when i put matnr no. at screen 103
    so how i will get all  data of dat number to table control screen.

    Hi Darshan,
       Here is a detailed description of how to update data in table controll.
      Updating data in table control
    The ABAP language provides two mechanisms for loading the table control with data from the internal table and then storing the altered rows of the table control back to the internal table.
    Method 1: Read the internal table into the Table Control in the screenu2019s flow logic.  Used when the names of the Table Control fields are based on fields of the internal table.
    Method 2: Read the internal table into the Table Control in the module pool code. Used when the names of the Table Control fields are based on fields of the database table.
    Method 1 (table control fields = itab fields)
    In the flow logic we can read an internal table using the LOOP statement. Define the reference to the relevant able control by specifying WITH CONTROL <ctrl>
    Determine which table entry is to be read by specifying CURSOR <ctrl>-CURRENT_LINE.
    After the read operation the field contents are placed in the header line of the internal table. If the fields in the table control have the same name as the internal they will be filled automatically. Otherwise we need to write a module to transfer the internal table fields to the screen fields.
    We must reflect any changes the user makes to the fields of the table control in the internal table otherwise they will not appear when the screen is redisplayed after PBO processing, (eg, after the user presses Enter or scrolls) However, this processing should be performed only if changes have actually been made to the screen fields of the table control (hence the use of the ON REQUEST)
    PROCESS BEFORE OUTPUT.
    LOOP AT ITAB_REG WITH CONTROL TCREG
    CURSOR TCREG-CURRENT_LINE.
    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP AT ITAB_REG.
    MODULE MODIFY_ITAB_REG.
    ENDLOOP.
    MODULE MODIFY_ITAB_REG INPUT.
    MODIFY ITAB_REG INDEX TCREG-CURRENT_LINE.
    ENDMODULE.
    Method 2 (table control fields = dict. fields)
    If using a LOOP statement without an internal table in the flow logic, we must read the data in a PBO module which is called each time the loop is processed.
    Since, in this case, the system cannot determine the number of internal table entries itself, we must use the EXIT FROM STEP-LOOP statement to ensure that no blank lines are displayed in the table control if there are no more corresponding entries in the internal table.
    PROCESS BEFORE OUTPUT.
    LOOP WITH CONTROL TCREG.
    MODULE READ_ITAB_REG.
    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP WITH CONTROL TCREG.
    CHAIN.
    FIELD: ITAB_REG-REG,
    ITAB_REG-DESC.
    MODULE MODIFY_ITAB_REG
    ON CHAIN-REQUEST.
    ENDCHAIN.
    ENDLOOP.
    MODULE READ_ITAB_REG OUTPUT.
    READ TABLE ITAB_REG INDEX TCREG-CURRENT_LINE.
    IF SY-SUBRC EQ 0.
    MOVE-CORRESPONDING ITAB_REREG TO TCREG.
    ELSE.
    EXIT FROM STEP-LOOP.
    ENDIF.
    ENDMODULE.
    MODULE MODIFY_ITAB_REG INPUT.
    MOVE-CORRESPONDING TCREG TO ITAB_REG.
    MODIFY ITAB_REG INDEX
    TCREG-CURRENT_LINE.
    ENDMODULE.
    Updating the internal table
    Method 1
    PROCESS AFTER INPUT.
    LOOP AT ITAB_REG.
    CHAIN.
    FIELD: ITAB_REG-REG,
    ITAB_REG-DESC.
    MODULE MODIFY_ITAB_REG ON CHAIN-REQUEST.
    ENDCHAIN.
    ENDLOOP.
    MODULE MODIFY_ITAB_REG INPUT.
    ITAB_REG-MARK = u2018Xu2019.
    MODIFY ITAB_REG INDEX TCREG-CURRENT_LINE.
    ENDMODULE.
    Method 2
    PROCESS AFTER INPUT.
    LOOP WITH CONTROL TCREG.
    CHAIN.
    FIELD: TCREG-REG,
    TCREG-DESC.
    MODULE MODIFY_ITAB_REG ON CHAIN-REQUEST.
    ENDCHAIN.
    ENDLOOP.
    MODULE MODIFY_ITAB_REG INPUT.
    MOVE-CORRESPONDING TCREG TO ITAB_REG.
    ITAB_REG-MARK = u2018Xu2019.
    MODIFY ITAB_REG INDEX TCREG-CURRENT_LINE.
    ENDMODULE.
    Updating the database
    MODULE USER_COMMAND_100.
    CASE OK_CODE.
    WHEN u2018SAVEu2019.
    LOOP AT ITAB-REG.
    CHECK ITAB_REG-MARK = u2018Xu2019.
    MOVE-CORRESPONDING ITAB_REG TO TCREG.
    UPDATE TCREG.
    ENDLOOP.
    WHEN u2026
    u2026
    ENDCASE.
    ENDMODULE.
    Hope this will solve your problem.
    Regards,
    Pavan.
    Edited by: PAVAN CHANDRASEKHAR GANTI on Aug 3, 2009 12:48 PM

  • How to modify changes of table control data in PAI

    I have a table control where the columns are brought by dict fields.I am able to bring data into table control through an itab.
    Now what i want is whenever user edits data in table control and clicks on save button the corresponding changes should be made in database.
    For this according to my understanding we need to (in PAI) modify the changes in itab from the table control and then in SY-UCOMM of SAVE button we need to update in database table using itab.
    For this , I am not able to write code for modifying the changes in itab from table control. Here is my code below.Please tell me how to do this.
    PROCESS BEFORE OUTPUT.
    MODULE FILL_DATA.
    LOOP AT ITAB INTO ZEMPLOYEE_MASTER WITH CONTROL EMPTABLE CURSOR
    EMPTABLE-CURRENT_LINE.
    ENDLOOP.
    MODULE STATUS_0001.
    PROCESS AFTER INPUT.
    LOOP AT ITAB.
       MODULE MODIFY_ITAB.
    ENDLOOP.
    MODULE USER_COMMAND_0001.
    REPORT  ZDATA_FORM1.
    TABLES: ZEMPLOYEE_MASTER.
    CONTROLS EMPTABLE TYPE TABLEVIEW USING SCREEN 0001.
    data: begin of itab occurs 0,
           emp_no like zemployee_master-emp_no,
           name like zemployee_master-name,
           city like zemployee_master-city,
          end of itab,
          rowno TYPE I VALUE 1.
    *&      Module  STATUS_0001  OUTPUT
    *       text
    MODULE STATUS_0001 OUTPUT.
    *  SET PF-STATUS 'xxxxxxxx'.
    *  SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0001  OUTPUT
    *&      Module  USER_COMMAND_0001  INPUT
    *       text
    MODULE USER_COMMAND_0001 INPUT.
      MESSAGE 'Inside INPUT' TYPE 'I'.
    CASE SY-UCOMM.
       WHEN 'SAVE'.
         UPDATE zemployee_master.
       WHEN 'EXIT'.
         LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0001  INPUT
    *&      Module  fill_data  OUTPUT
    *       text
    MODULE fill_data OUTPUT.
      select emp_no name city from zemployee_master into TABLE itab ORDER BY emp_no.
      Describe table itab lines EMPTABLE-LINES.
    ENDMODULE.                 " fill_data  OUTPUT
    *&      Module  modify_itab  INPUT
    *       text
    MODULE modify_itab INPUT.
    * MODIFY itab from zemployee_master index
    * MESSAGE 'Inside modify_itab' TYPE 'I'.
    ENDMODULE.                 " modify_itab  INPUT

    Hi
    In the following module of your code
    MODULE modify_itab INPUT.
    MODIFY itab from zemployee_master index tc-current_line " Where TC is the name of the Table control on the Screen
    ENDMODULE.
    Table control data gets refreshed on *enter*
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/2165e990-0201-0010-5cbb-b5c2ad436140
    Cheerz
    Ramchander Rao.K

Maybe you are looking for

  • Ipod Touch 4--Not recognized in iTunes

    As per the title, my Touch 4 is not showing up under "Devices". I've tried uninstalling and reinstalling iTunes (going so far as to run a registry cleaner to ensure all traces are gone), and rebooting, to no avail. I have an ongoing problem with Bonj

  • Hierarchy look-n-feel?

    Hi, Can i have the look-n-feel of a hierarchy very similar to that of SQL Server Analysis Services in Web Intelligence report? The hierarchy should have +/ - to drillup/ drilldown, It has to show all the levels in the hierarchy, not only one level at

  • System status and user status in Line Item Reports

    Dear PS-friends, I have to extend the CI CI_PROJ with some new fields. These fields should be shown in diverse Line Item Reports (CJI3 u2026). I know how to get these customer fields into the field catalog for the reports (maintain include table CI_R

  • NWBC opens GUI in the wrong system

    Hi all, I have a problem with GUI transactions opening in the wrong system. The description for the logonpad in the NWBC system connection is correct, but i do have multiple definitions for the same systems (e.g. different cockpits, etc). In short I

  • Publishing helo

    I'm trying to publish a flash document, and I keep getting an error message that says "Error creating SWF movie file. Be sure the destination file is not read-only or opened by another application. Also, make sure the file name is not too long." The