Method to transfer data from Table control to Internal table

hi,
Hi,
I´m working with CL_GUI_ALV_GRID and use the following methods:
- CALL METHOD grid->set_table_for_first_display, to display my ALV;
- CALL METHOD grid->get_selected_rows, to select the rows.
But i have some fields that can suffer alterarions in the values...
How can i recoup this values from the screen? Is there any method to do this?
thnks.

HI,
You neeed to handle the change event.
Example below...
Definition.
Code:
CLASS lcl_event_handler DEFINITION.
  PUBLIC SECTION.
    METHODS:
          handle_data_changed
        FOR EVENT data_changed
        OF cl_gui_alv_grid
        IMPORTING er_data_changed.
ENDCLASS.                    "lcl_event_handler DEFINITION
Implement
Code:
    CLASS lcl_event_handler IMPLEMENTATION.
  METHOD  handle_data_changed.
    CONSTANTS:
      lc_wa(11) TYPE c VALUE '<LW_SDITM>-'.
    DATA:
      l_subrc TYPE sy-subrc,
      l_variable TYPE string,
      lw_good TYPE lvc_s_modi.
    FIELD-SYMBOLS:
      <lw_sditm> TYPE /powercor/sditm,
      <lw> TYPE ANY. "Generic field symbol
    LOOP AT er_data_changed->mt_good_cells INTO lw_good.
    Update the internal table
      READ TABLE t_item_sel ASSIGNING <lw_sditm> INDEX lw_good-row_id.
      IF sy-subrc EQ 0.
        CONCATENATE lc_wa lw_good-fieldname INTO l_variable.
        ASSIGN (l_variable) TO <lw>.
        IF sy-subrc EQ 0.
          <lw> = lw_good-value.
        ENDIF.
     ENDIF.
     ENDLOOP.
  ENDMETHOD.                    "handle_data_changed
ENDCLASS.                    "lcl_event_handler IMPLEMENTATION
Set for your grid.
Code:
  SET HANDLER g_handler->handle_data_changed FOR my_grid.
Cheers,
Chandra Sekhar.

Similar Messages

  • To transfer data from one db table to anotherdb's table

    I have to transfer data from one db table A to another db table B.
    Both the tables have data which is common.
    I want to transfer data from table A to table B.
    Data transfer needed is only the excess data in table A

    Yes it works from one database to another by means of db links, but you should be aware that there it has been reported a bug with this environment:
    Bug 4311273 - ORA-2064 using MERGE statement over a database link
    Doc ID: Note:4311273.8
    Executing a MERGE statement over database link can
    fail with ORA-2064
    There are patches for this, but I suggest you to verify at metalink patch availability according to your Oracle version and OS platform.
    ~ Madrid

  • Transfer data from SAP R/3 to Microsoft Navision

    Hi gurus,
    This is my first post here. I'm wondering what the easiest way is to transfer mainly master data (customers/materials) but also historical order data (sales- and purchase orders) out of SAP. I need to get the result in .txt files that then will be used as base for the import to the Navision system.
    I've read about this and several people are talking about ABAP Queries, transform data to complete IDOC's and pass-out, use BI etc.
    Will we end-up creating a new customized ABAP program or is there already an existing tool or another easy way to solve this ?
    Edited by: Robert Schulin on May 7, 2008 4:33 PM

    Hi,
    You have various methods for getting the data to flat files for uploading into another NONSAP system.
    Some of the methods are BAPIs, IDOCS, .
    Simple method for downloading data from tables to textfiles is as follows:
    GOTO se11 --> table name --> display all entries --> EDIT MENU --> download .
    here it will give options for downloading to text files, spreadsheets, rich text etc.
    This is the case if you want to download data from tables . if you want data regarding the transactions (which affects more than 1 table)  then  you have to go to IDOCS or BAPIs.
    Reward points if helpful.
    Thanks and regards,
    Narayana.

  • How to Transfer Data from editable ALV grid control to internal table?

    Hi,
    Can anyone give me a simple example by which I can transfer data from editable alv grid control back to the internal table. The ALV has been created by OO approach.
    I would appreciate if the solution is provided without handling any events.
    Regards,
    Auro

    Hello Auro
    You simply need to call method <b>go_grid->check_changed_data</b> at PAI of the dynpro displaying the ALV grid. If data have been changed on the editable ALV grid then this method will raise event DATA_CHANGED. If you do not want or need to handle this event (e.g. for validating the edited values) then you do not define any event handler method.
    Regards
      Uwe

  • How to transfer texts from text control to table and vice versa

    Hi
    if anybody can give me link or any code giving how to transfer text from text control to table and vice versa, that will be of great help to me
    THanks in advance

    Rashmi,
    Use the methods GET_TEXT_AS_R3TABLE / SET_TEXT_AS_R3TABLE and then you will have to use the SAVE_TEXT to store in the database.
    The GET_TEXT_AS_R3TABLE method will give you back a internal in which text, in which text on the screen is existing. Similarly once you fetch the data from database using READ_TEXT, use the method SET_TEXT_AS_R3TABLE to put the text on the screen.
    These methods belong to class CL_GUI_TEXTEDIT class.
    Regards,
    Ravi
    note : Please mark all the helpful answers

  • Transfer data from ALV to Z table

    Hi,
    I need to confirm the exact procedure to transfer data from ALV into z table.I am entering few values at runtime in the ALV & need to populate the z table with the same.
    I created a z table,it has been assigned a internal table & work area.A loop is there on the internal table passed to fieldcatalog.
    LOOP AT GIT_EKPO INTO GS_EKPO.
        LS_ZPS005-EBELN = GS_EKPO-EBELN.
        LS_ZPS005-EBELP = GS_EKPO-EBELP.
        LS_ZPS005-ERECDAT = GS_EKPO-ERDAT. "this field is not passing value into z table
        LS_ZPS005-LINEID = SY-TABIX.
        LS_ZPS005-POQTY = GS_EKPO-POQTY.
        LS_ZPS005-EREQTY = GS_EKPO-EREQTY. "this field is not passing value into z table
    ENDLOOP.
      INSERT INTO ZPS005 VALUES LS_ZPS005.
    When I assign the values from Internal table into internal table of z table,the values in fields populated at runtime does not come.
    Please help me with your suggestions on the same.
    Thanks.

    Hi,
    I tried the procedure,but do I need to include this before method set_table_for_first_display?
    You can have a look at the whole code.Please let me know of a possible solution.Looking forward to an early reply.
    Thanks.
    TABLES: EKKO,
            EKPO,
            ZPS005.
    INITIALIZATION.
    PERFORM CREATE_FIELD_CATLOG.
                               Types Declaration                          *
    *Structure for EKPO table
      TYPES: BEGIN OF TYPE_EKPO,
              EBELN TYPE EKPO-EBELN, "PURCHSE ORDER NUMBER
              EBELP TYPE EKPO-EBELP, "Item Number of Purchasing Document
              POQTY TYPE EKPO-MENGE, "Purchase Order Quantity
              ERDAT TYPE SY-DATUM, "Date on Which Record Was Created
             LINEID TYPE ZPS005-LINEID, "Unique identification of document line
              EREQTY TYPE ZPS005-EREQTY, "Erection Quantity
         END OF TYPE_EKPO.
                                        Data                              *
               Data Declaration for Internal Table & Work Area            *
    *INTERNAL TABLE FOR EKPO TABLE
      DATA:LIT_EKPO TYPE TABLE OF EKPO,
           LS_EKPO TYPE EKPO.
    *SECOND INTERNAL TABLE FOR EKPO TABLE
      DATA: GIT_EKPO TYPE TABLE OF TYPE_EKPO.
      DATA: GS_EKPO TYPE TYPE_EKPO.
    *INTERNAL TABLE FOR FIELD CATALOG
      DATA: LIT_FIELDCAT TYPE lvc_t_fcat,
            LS_FIELDCAT LIKE LINE OF LIT_FIELDCAT. "WORK AREA FOR FIELD CATALOG
    *INTERNAL TABLE FOR Z TABLE ZPS005
      DATA: LIT_ZPS005 TYPE TABLE OF ZPS005,
            LS_ZPS005 TYPE ZPS005.
                            ALV GRID Data Declaration                     *
      DATA: V_CONTAINER TYPE REF TO cl_gui_custom_CONTAINER.
      data: grid TYPE REF TO cl_gui_alv_grid.
      data: ok_code type sy-ucomm.
      DATA: V_LAYOUT TYPE lvc_s_layo.  " FOR LAYOUT
      DATA: V_LINE TYPE I,
            LINEID TYPE I.
      DATA: V_INDEX TYPE SY-TABIX.
                                   PARAMETER                              *
      parameter : p_ebeln like ekko-ebeln.
                                  START OF SELECTION                      *
    START-OF-SELECTION.
                                   SELECTION OF DATA                      *
      CALL FUNCTION 'ME_PURCHASE_DOCUMENT_DATA_READ'
        EXPORTING
          I_EBELN                    = P_EBELN
          I_TCODE                    = 'ME23'
      I_NO_COMMIT                = ' '
          I_TRTYP                    = 'A'
      I_NO_MESSAGING             =
      I_NO_MESSAGE_REQ           =
      I_NO_AUTHORITY_CHECK       =
      I_VORGA                    =
    IMPORTING
      E_EKKO                     =
       TABLES
         T_EKPO                     = LIT_EKPO
      T_EKET                     =
      T_EKKN                     =
      T_KOMV                     =
       EXCEPTIONS
         NO_EBLNR                   = 1
         EBLNR_NOT_FOUND            = 2
         NO_TCODE                   = 3
         TCODE_NOT_ALLOWED          = 4
         NO_TRTYP                   = 5
         INVALID_CALL_OF_FB         = 6
         OTHERS                     = 7
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT LIT_EKPO INTO LS_EKPO.
        MOVE : LS_EKPO-EBELN TO GS_EKPO-EBELN,
               LS_EKPO-EBELP TO GS_EKPO-EBELP,
               LS_EKPO-MENGE TO GS_EKPO-POQTY.
        APPEND GS_EKPO TO GIT_EKPO.
      ENDLOOP.
    End-of-selection.
      perform field_catalog.
      call screen 100.
                                   END-OF-SELECTION                       *
                                MODULES FOR ALV DISPLAY                   *
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'PF-STAT'.
      SET TITLEBAR 'TITLE'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    **&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
      CASE OK_CODE.
        WHEN 'BACK'.
          LEAVE PROGRAM.
        WHEN 'EXIT'.
          LEAVE TO SCREEN 0.
       WHEN 'SWITCH'.
         PERFORM switch_edit_mode.
        WHEN 'SAVE'.
          PERFORM FILL_TABLE.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    **&      Module  layout_0100  OUTPUT
          text
    MODULE layout_0100 OUTPUT.
      V_LAYOUT-grid_title = 'Purchase Order Erection Details'.
    ENDMODULE.                 " layout_0100  OUTPUT
    **&      Module  data_retrivaL  OUTPUT
          text
    MODULE data_retrivaL OUTPUT.
      IF V_CONTAINER IS INITIAL.
        CREATE OBJECT V_CONTAINER
          EXPORTING container_name = 'GRID'.
        CREATE OBJECT grid
        EXPORTING i_parent = V_CONTAINER.
      ENDIF.
      CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          IS_LAYOUT                     = V_LAYOUT
        CHANGING
          IT_OUTTAB                     = GIT_EKPO
          IT_FIELDCATALOG               = LIT_FIELDCAT
        EXCEPTIONS
          INVALID_PARAMETER_COMBINATION = 1
          PROGRAM_ERROR                 = 2
          TOO_MANY_LINES                = 3
          others                        = 4.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDMODULE.                 " data_retrivaL  OUTPUT
    *&      Module  field_catalog  OUTPUT
          text
    FORM field_catalog.
      CLEAR LS_fieldcat.
      LS_fieldcat-fieldname = 'EBELN'.
      LS_fieldcat-ref_table = 'GIT_EKPO'.
      LS_FIELDCAT-coltext  = 'PURCHSE ORDER NUMBER'.
      LS_FIELDCAT-col_pos   = 0.
      LS_FIELDCAT-EDIT = ' '.
    ls_FIELDCAT-style = cl_gui_alv_grid=>mc_style_disabled.
    INSERT LS_FIELDCAT INTO TABLE LIT_FIELDCAT.
      APPEND LS_fieldcat TO LIT_fieldcat.
      CLEAR LS_fieldcat.
      LS_fieldcat-fieldname = 'EBELP'.
      LS_fieldcat-ref_table = 'GIT_EKPO'.
      LS_FIELDCAT-coltext  = 'ITEM NUMBER'.
      LS_FIELDCAT-col_pos   = 1.
      LS_FIELDCAT-EDIT = ' '.
    ls_FIELDCAT-style = cl_gui_alv_grid=>mc_style_disabled.
    INSERT LS_FIELDCAT INTO TABLE LIT_FIELDCAT.
      APPEND LS_fieldcat TO LIT_fieldcat.
      CLEAR LS_fieldcat.
      LS_fieldcat-fieldname = 'POQTY'.
      LS_fieldcat-ref_table = 'GIT_EKPO'.
      LS_FIELDCAT-coltext  = 'PURCHASE ORDER QUANTITY'.
      LS_FIELDCAT-col_pos   = 2.
      LS_FIELDCAT-EDIT = ' '.
    ls_FIELDCAT-style = cl_gui_alv_grid=>mc_style_disabled.
    INSERT LS_FIELDCAT INTO TABLE LIT_FIELDCAT.
      APPEND LS_fieldcat TO LIT_fieldcat.
      CLEAR LS_fieldcat.
      LS_fieldcat-fieldname = 'ERDAT'.
      LS_fieldcat-ref_table = 'GIT_EKPO'.
      LS_FIELDCAT-coltext  = 'DATE OF ERECTION'.
      LS_FIELDCAT-col_pos   = 3.
      LS_FIELDCAT-EDIT = 'X'.
    ls_fieldcat-style = cl_gui_alv_grid=>mc_style_enabled.
    INSERT LS_FIELDCAT INTO TABLE LIT_FIELDCAT.
      APPEND LS_fieldcat TO LIT_fieldcat.
      CLEAR LS_fieldcat.
      LS_fieldcat-fieldname = 'EREQTY'.
      LS_fieldcat-ref_table = 'GIT_EKPO'.
      LS_FIELDCAT-coltext  = 'ERECTION QUANTITY'.
      LS_FIELDCAT-col_pos   = 4.
      LS_FIELDCAT-EDIT = 'X'.
    ls_fieldcat-style = cl_gui_alv_grid=>mc_style_enabled.
    INSERT LS_FIELDCAT INTO TABLE LIT_FIELDCAT.
      APPEND LS_fieldcat TO LIT_fieldcat.
    ENDFORM.                 " field_catalog  OUTPUT
    *&      Form  SWITCH_EDIT_MODE
          text
    -->  p1        text
    <--  p2        text
    *FORM switch_edit_mode.
    IF GRID->is_ready_for_input( ) eq 0.
    set edit enabled cells ready for input
       CALL METHOD GRID->set_ready_for_input
         EXPORTING
           i_ready_for_input = 1.
    ELSE.
    lock edit enabled cells against input
       CALL METHOD GRID->set_ready_for_input
         EXPORTING
           i_ready_for_input = 0.
    ENDIF.
    *ENDFORM.                               " SWITCH_EDIT_MODE
    *&      Form  FILL_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM FILL_TABLE .
      LOOP AT GIT_EKPO INTO GS_EKPO.
        LS_ZPS005-EBELN = GS_EKPO-EBELN.
        LS_ZPS005-EBELP = GS_EKPO-EBELP.
        LS_ZPS005-POQTY = GS_EKPO-POQTY.
        LS_ZPS005-ERECDAT = GS_EKPO-ERDAT.
        LS_ZPS005-EREQTY = GS_EKPO-EREQTY.
      ENDLOOP.
      MODIFY ZPS005 FROM LS_ZPS005.
    ENDFORM.                    " FILL_TABLE

  • How to delete a single data from table using control file

    I want delete a single row data from table using sql loder control file
    Edited by: 977940 on Dec 19, 2012 9:00 PM

    977940 wrote:
    I want delete a single row data from table using sql loder control file
    Edited by: 977940 on Dec 19, 2012 9:00 PMWhy?
    And how do you imagine this happening with sqlloader?
    The entire purpose of sqlloader is to load data (hence, the name sql*loader*) into a table from an external source. If you want to delete rows from a table, you use the sql DELETE statement.
    What is the business problem you are trying to solve?

  • HOW TO TRANSFER DATA FROM ONE INTERNAL TABLE TO ANOTHER

    FOR PERTICULAR OBJECT ID ONE INT TABLE JTAB CONTAINS ONE RECORD(ROW) AND ANOTHER INT TABLE KTAB CONTAINS 3 RECORDS(ROWS). THEN HOW I SHOULD TRANSFER DATA FROM KTAB TO JTAB? WHAT R THE VARIOUS WAYS TO DO THAT. PLS HELP ME OUT. THANKS IN ADVANCE

    Try something like
    If you want one record per ktab :
    LOOP AT jtab.
      MOVE-CORRESPONDING jtab TO itab.
      LOOP AT ktab WHERE id = jtab-id.
        MOVE-CORRESPONDING ktab TO itab.
        APPEND itab.
      ENDLOOP.
    ENDLOOP.
    or
    LOOP AT ktab.
      READ TABLE jtab WITH KEY id = ktab-id. " binary implicit if sorted type
      MOVE-CORRESPONDING jtab TO itab.
      MOVE-CORRESPONDING ktab TO itab.
      APPEND itab.
    ENDLOOP. 
    If you want to sum ktab ratio into itab for each jtab
    LOOP AT jtab.
      MOVE-CORRESPONDING jtab TO itab.
      LOOP AT ktab WHERE id = jtab-id.
        ADD-CORRESPONDING ktab TO itab.
        APPEND itab.
      ENDLOOP.
    ENDLOOP.
    Use sorted type table when LOOP AT WHERE, else SORT table is enough.
    Regards

  • Transfer data from a table to another table

    Hello
    I want to transfer data from a table in one server to another table in a different server, I want to do this on a nightly job, what will be the best way, please advise, thank you.

    Multiple options
    1. Create linked server  and use INSERT..SELECT * FROM [Server].[DB].dbo.Table
    2. Use OPENROWSET
    http://searchsqlserver.techtarget.com/tip/Using-the-OPENROWSET-function-in-SQL-Server
    3. Use export import wizard
    http://www.leniel.net/2011/07/import-export-data-sql-server-database.html#sthash.l4fgNNdV.dpbs
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • How to transfer data from a dynamic internal table

    Hi All
    I want to transfer data from a dynamic internal table<dyn_table>
    to a non dynamic internal table itab which should have the same structure as <dyn_table>.
    How can this be done?
    Regards,
    Harshit Rungta

    As stated earlier this can be done only through field symbols...
    You cannot create an non dynamic internal table with ANY structure...using DATA statement
    If the strucutre is defined well and good...you can create an non-dynamic internal table...
    If you do not know the structure then the internal table has to be dynamic...and to be generated using field symbols
    DATA: lv_ref TYPE REF TO data.
    FIELD-SYMBOLS: <fs_dyn_table> TYPE STANDARD TABLE.
    * You create a dynamic internal table...
    CREATE DATA lv_ref LIKE (your_dynamic_internal_table).
    ASSIGN lv_ref->* TO <fs_dyn_table>.
    Now...do the transfer.
    <fs_dyn_table> = "your_dynamic_internal_Table
    Hope it helps!

  • How to transfer data in table control in bdc

    hi
    how to transfer data in table control in bdc . I need the theory regarding this
    bye

    Hi,
    just check in the forum , there is many threads available to ur questions.
    Table control in BDC
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    You can even refer to these related threads
    bdc table control
    Re: table control in bdc
    table control in BDC
    Reward if helpful.
    Thanks
    Naveen khan

  • Transfer data from SAP TABLES to a SQL table

    Hi,
    I need to transfer data from SAP tables to a SQL table. Please suggest the best way as well as the steps please.
    Regards,
    Kamlesh

    Hi
    Step 1: Create an entry for the External database in DBCON table using Trxn: DBCA.
    Field Name Description Value (For: E.g.:)
    CON_NAME Logical name
    for database con RAJ
    DBMS Database system MSS
    USER_NAME Database user <username>
    PASSWORD Password for setting up
    the connection
    to the database <pwd>/<pwd>
    CON_ENV Database-specific MSSQL_SERVER=depotserver MSSQL_DBNAME=HOF_INDORE
    DB_RECO Availability type for an open database connect
    Then, you can define internal table and code the following way:
    DATA: BEGIN OF wa,
    c_locid(3),
    c_locname(50),
    c_locstate(5),
    END OF wa.
    EXEC SQL.
    CONNECT TO 'RAJ' AS 'V'
    ENDEXEC.
    EXEC SQL.
    SET CONNECTION 'V'
    ENDEXEC.
    < Populate SAP data into an internal table >
    Loop on itab.
    EXEC SQL.
    < code here for populating data into MS-SQL Server table>
    ENDEXEC.
    Endloop.
    Regards,
    Raj

  • Transfer data from MS Excel to Oracle table

    Hello,
    hope someone can help: What is the easiest way to transfer data from Excel sheet to a Oracle table and how ?
    An example of a row to transfer is given below
    Date Time Value 1 Value 2
    2004-02-02     03:47:39     9,62     3,62     
    Thanks in advance
    Regards
    Roar

    From Microsoft access , import data from Excel to an Access table.
    Format that Access Table properly in Design mode.
    Create a table as per your specification in oracle Database.
    Then export to oracle from access using approppriate ODBC driver.
    --Sayan                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Sample pgm for moving data from table control to internal table

    Hi Experts,
          I am newbi to ABAP. I don't have good material for Table control . Appreciate if you direct me to some good source of knowledge on Table control.
    The problem at hand : I am trying to move info/data from table control (in screen painter/ input and output mode ) to ITAB but couldn't . Sample pgm if possible.
    <b>Modify ITAB index TC-Current_Line .</b>
    The above statement is not inserting new lines to ITAB . Help me!
    Thanks for your time

    hi,
    do like this...
    <b>PROCESS AFTER INPUT.</b>
    *&SPWIZARD: PAI FLOW LOGIC FOR TABLECONTROL 'TAB1'
      LOOP AT itab_det.
        CHAIN.
         FIELD itab_det-comp_code.
          FIELD itab_det-bill_no.
          FIELD itab_det-bill_date.
          FIELD itab_det-vend_cust_code.
          FIELD itab_det-bill_amt.
          MODULE <b>tab1_modify</b> ON CHAIN-REQUEST.
        ENDCHAIN.
        FIELD itab_det-mark
          MODULE tab1_mark ON REQUEST.
      ENDLOOP.
    <b>MODULE tab1_modify INPUT.</b>
      APPEND itab_det.
    <b>ENDMODULE.                    "TAB1_MODIFY INPUT</b>

  • General method to fetch data from transparent tables with cluster field

    Hi,
    I want to know is there any general method to fetch data from the transparent tables which have cluster type field. For
    example MDTC, STXL, PCL1.
    thanks

    Means using the IMPORT statement we can fetch data from any cluster field?
    Yes, basically you should use IMPORT/EXPORT statements for clusters.
    AR and MC are cluster ID (area identification), so called RELID.
    By definition cluster is a combination of table and such area i.e
    PCL2(RX) - international payroll resuts from table PCL2
    PCL2(B2) - time results
    Regards
    Marcin

Maybe you are looking for