How to Enable a Selected single record from Table control...

Hi,
I have 5 records in my table control and in screen Painter in Made all the fields in Table control as Output field.
and  successfully all my Table control fields are disabled...
Now Now i want to enable the record which i selected n rest all the 4 records should be in Disable.
what i did is:
in PBO.
loop at itab into wa with contol TBC1 .
Module XYZ.
endloop.
Module XYZ.
loop at screen.
if screen-group = 'x'.
screen-input =  1.
modify screen.
endif.
End Module.
Please help me....
Thanks,

hi
in the layout of the screen u might have dragged and dropped the table control
double click on it u will get attributes screen in that u select MULTIPLE or SINGLE under Line-Selection
under attributes tab based on ur requirement.
table control declaration:
controls : control type tableview using screen 8000.
the internal table in table control must be like
data : begin of itab occurs 0,
empno type .......,
empname......,
empcity.....,
check(1), " for tab selection"
end of itab.
data : itab1 like itab occurs 0 with header line.
data : flag.
data : wk_init type i.
data : lines type i.
in the attributes screen of the table control
pass the value ITAB-CHECK to the field W/SELECTION
in SE51
PBO
Module_status_0800
loop with control table_control_name.
module_fill_tcontrol.
endloop.
PAI
Module_user_command_0800
loop with control table_control_name.
module_read_tcontrol.
endloop.
in se38
Module_status_0800.
describe table itab1 lines lines.
control-lines = lines.
endmodule.
Module_fill_tcontrol.
describe table itab1 lines wk_init.
  if wk_init is not initial.
    read table itab1 into itab index control-current_line.
  endif.
for enabling a row in the table control:
if sy-ucomm = 'EDIT'.
    loop at screen.
      if flag is initial.
        screen-input = 0.
      elseif ( flag eq 'Y' ).
        if  ( ( screen-name = 'ITAB-EMPNO' or
                screen-name = 'ITAB-EMPNAME' or
                screen-name = 'ITAB-EMPCITY' )   
          and control-line_selector eq itab-check
          and control-current_line le lines ).
          screen-input = 1.
        else.
        endif.
      endif.
      modify screen.
    endloop.
  endif.
endmodule.
Module_read_tcontrol.
READ TABLE itab1 INDEX control-current_line.
IF sy-subrc EQ 0.
MODIFY itab1 FROM itab INDEX control-current_line.
ELSE.
MOVE-CORRESPONDING itab TO itab1.
APPEND itab1.
CLEAR itab1.
ENDIF.
endmodule.
module_user_command.
case sy-ucomm.
when 'EDIT'. -
> Function Code assigned to the pushbutton to enable the field 
      flag = 'Y'.
endcase.
endmodule.
Regards
Murali.M

Similar Messages

  • How to save the selected records from Table control in dialog programming

    Hiiiiiiii Every1
    Actually the problem is like this:-
    I have to select some records from table control and then want to save the selected records in DB table.
    Example
    I have some rows having inforamtion bout employees...
    Now what i want is that when i click on 'SAVE' button then these selected rows should be moved into DB table.
    Sachin Dhingra

    see below example, I have added INSERT option after DELETE option.
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA cols LIKE LINE OF flights-cols.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    DATA: itab TYPE TABLE OF demo_conn.
    TABLES demo_conn.
    SELECT * FROM spfli INTO TABLE itab.
    LOOP AT flights-cols INTO cols WHERE index GT 2.
      cols-screen-input = '0'.
      MODIFY flights-cols FROM cols INDEX sy-tabix.
    ENDLOOP.
    CALL SCREEN 100.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'SCREEN_100'.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
      MODIFY itab FROM demo_conn INDEX flights-current_line.
    ENDMODULE.
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'TOGGLE'.
          LOOP AT flights-cols INTO cols WHERE index GT 2.
            IF  cols-screen-input = '0'.
              cols-screen-input = '1'.
            ELSEIF  cols-screen-input = '1'.
              cols-screen-input = '0'.
            ENDIF.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDLOOP.
        WHEN 'SORT_UP'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) ASCENDING.
            cols-selected = ' '.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'SORT_DOWN'.
          READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.
          IF sy-subrc = 0.
            SORT itab STABLE BY (cols-screen-name+10) DESCENDING.
            cols-selected = ' '.
            MODIFY flights-cols FROM cols INDEX sy-tabix.
          ENDIF.
        WHEN 'DELETE'.
          READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              DELETE itab.
            ENDLOOP.
          ENDIF.
        WHEN 'INSERT'.
          READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.
          IF sy-subrc = 0.
            LOOP AT itab INTO demo_conn WHERE mark = 'X'.
              itab1 = itab.
              modify itab1.
            ENDLOOP.
          ENDIF.
          if not itab1 is initial.
            INSERT dbtab FROM TABLE itab1.
          endif.
      ENDCASE.
    ENDMODULE.

  • Selecting single record from multiple record based on date

    Hi experts,
    I have a table which contains the multiple records for single ID No. Now i have to select single record which contains the latest date.
    here is the structure
    Name   Null Type        
    ID_P        NUMBER      
    NAME_P      VARCHAR2(12)
    DATE_P      TIMESTAMP(6)
    Records
    1 loosi     22-AUG-13 01.27.48.000000000 PM
    1 nammi  26-AUG-13 01.28.10.000000000 PM
    2 kk        22-AUG-13 01.28.26.000000000 PM
    2 thej      26-AUG-13 01.28.42.000000000 PM
    now i have to select below 2 rows how can write select qurie for this?
    1 loosi     26-AUG-13 01.27.48.000000000 PM
    2 thej      26-AUG-13 01.28.42.000000000 PM

    Hi,
    You can use the analytic ROW_NUMBER function.
    I don't have a copy of your table, so I'll use scott.emp to illustrate.  In scott.emp, there may be multiple rows for a single job.  To display just 1 row per job, the row with the most recent hiredate:
    WITH got_r_num AS
         SELECT  empno, job, deptno, hiredate -- Or whatever columns you want
         ,       ROW_NUMBER () OVER ( PARTITION BY  job
                                      ORDER BY      hiredate DESC
                                    )  AS r_num
        FROM    scott.emp
    --  WHERE ...   -- If you need any filtering put it here
    SELECT   *      -- Or list all columns except r_num
    FROM     got_r_num
    WHERE    r_num   = 1
    What results do you want in case of ties?  Depending on your requirements, you may want to add tie-breaking expressions to the analytic ORDER BY clause, and/or use RANK instead of ROW_NUMBER.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
    Point out where the query above is producing the wrong results, and explain, using specific examples, how you get the right results from the given data in those places.
    If you modify the query at all, post your modified version.
    Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • How do I query a single record from a database?

    I need to retrieve a record from a specific table within a .mdb file using it's name or primary key to search.
    I have the database connectivity toolkit(LV7.1) and have not been able to figure this out.
    Any help would be greatly appreciated.
    Jim

    Bdougr,
    Thanks for the reply, but it's a little over my head.
    Maybe I should give some more info. We store test parameters in a MSAccess database.
    Using LabView 7.1, I would like to retrieve a "record" or row based on a primary key (our part#)from a .mdb file and then use that data as my test parameters, I do not want to use the row# or record#. The database contains several tables so I also need to get to the specific table.
    I have figured out how to get a "feild" or the hole thing but I don't know how to return just one specific row.
    I have tried Select data, Fetch, Fetch all and Execute query VIs without success. Would "Execute query" be the way to do it? If so, what would be the correct SQL syntax to retrieve a record base on its primary key?
    Jim

  • Selecting a single row from table control of standard transaction via repor

    Hi Experts,
    I have a requirement of selecting a single row from standard trasaction via ineractive report.
    For eg. for a given document number & item number, how can i select the specified item from transaction VA03.
    I am using call transaction to naviagate to the screen but unable to select the specified item.
    thanks in adavance for your Help.

    You mean selecting the item via BDC?
    Have you tried something like:
    perform bdc_field       using 'BDC_CURSOR'
                                  'VBAP-POSNR(01)'.
    perform bdc_field       using 'RV45A-VBAP_SELKZ(01)'
                                  'X'.
    or whatever your dynpro is to select the first row?

  • How to delete record from table control in BDC?

    Hello friends,
    I am running a BDC program to delete records.
    I have file with following records and i got these records into t_itab.
    Material     Plant     Start date     End date     Cost
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100004     S002     09/01/2008     09/31/2008     56.00
    MQ100008     S003     09/01/2008     09/31/2008     57.00
    Now, I have BDC transaction in which table control screen which contains following structure.
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100002     S002     09/01/2008     09/31/2008     56.00
    MQ100004     S003     09/01/2008     09/31/2008     47.00     
    MQ100005     S004     09/01/2008     09/31/2008     25.00
    MQ100006     S012     09/01/2008     09/31/2008     76.00
    MQ100007     S033     09/01/2008     09/31/2008     17.00
    MQ100008     S011     09/01/2008     09/31/2008     95.00
    MQ100009     S002     09/01/2008     09/31/2008     46.00
    I have recorded from SHDB in which first record will be delete.
    So, when i loop through t_itab,instead of deleting MQ100001,MQ100004 and MQ100008 from BDC screen,
    it is deleting MQ100001,MQ100002 and MQ100004 (first record for each process ).
    Which i don't want to.
    Is there any facility in BDC to put records on top which i want to delete?
    Please guide me.
    Regards,
    RH

    Hi,
    While doing recording check for Filter button available for the table control, if it available then do the recording for the same.
    Once it is done while passing the data from internal table put the value into Filter field.
    Hope it resolves your issue.
    Thanks & Regards.
    Nagaraj Kalbavi

  • How to delete record from table control using BDC?

    Hello friends,
    I am running a BDC program to delete records.
    I have file with following records and i got these records into t_itab.
    Material     Plant     Start date     End date     Cost
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100004     S002     09/01/2008     09/31/2008     56.00
    MQ100008     S003     09/01/2008     09/31/2008     57.00
    Now, I have BDC transaction in which table control screen which contains following structure.
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100002     S002     09/01/2008     09/31/2008     56.00
    MQ100004     S003     09/01/2008     09/31/2008     47.00     
    MQ100005     S004     09/01/2008     09/31/2008     25.00
    MQ100006     S012     09/01/2008     09/31/2008     76.00
    MQ100007     S033     09/01/2008     09/31/2008     17.00
    MQ100008     S011     09/01/2008     09/31/2008     95.00
    MQ100009     S002     09/01/2008     09/31/2008     46.00
    I have recorded from SHDB in which first record will be delete.
    So, when i loop through t_itab,instead of deleting MQ100001,MQ100004 and MQ100008 from BDC screen,
    it is deleting MQ100001,MQ100002 and MQ100004 (first record for each process ).
    Which i don't want to.
    Is there any facility in BDC to put records on top which i want to delete?
    Please guide me.
    Regards,
    RH

    One option is to identify the table and find out the location as the number of row which should be deleted from the table and then in the bdc program instead of postioning the cursor on the row 1(using the statement perform bdc_cursor ....(01)), replace the 01 with the row number.
    Second option is that if a filter control is available for the table control, then filter the data each and every time with the material number to be deleted and then delete the first row.
    Regards
    Farzan

  • SELECTING  REQUIRED RECORDS FROM TABLE IN SCREEN

    hi experts,
                   I have created a screen and i have used a table control thru wizard.
    that table has to show only the current record that i have saved .what to do .
    thanks
    mani

    HI,
      What is ur requirment.. are you enting data in a table control . or are you entering values in the first screen and you want to show them in the second screen.
    you can take a temporary internal table and when saving and show them in the table control in second screen.
    if this is not the case let me know ur exact requirment
    thanks
    Mahesh

  • How to capture a selected row in a table control in screen

    Hello,
        I have a table in a screen and hv data in it also from a table.Now i want if a user selects a row n clicks a display button , i should display the same fields in empty text fields created outside the table on the same screen.
    Rite now i m lookin for single selection but any help on multiple selection is also welcomed.
    I have given a line-selection element name as 'LSELECT1'  to the table in screen painter n have declared a variable also with the same name of type C(1) in my abap prog.But dont know wat to write in PAI now to caputure the selected row.
    THANKS

    Hi,
    Use ALV to display your table records from FM 'REUSE_ALV_GRID_DISPLAY'.
    In your internal table add a field with char1. This will show you the selected records by 'X' or ' '. Use this field in your layout like g_layout-box_fieldname = 'CHK'.
    Here i used CHK TYPE CHAR1 added to internal table to display. Now ur ALV will be showing u a column to select records. U can select multiple records also. Evry selected record will reflect into internal table by modifying value of CHK as 'X'. Add button to ALV by creating PF-STATUS and  add code its behavior when executed.
    DATA: BEGIN OF ls_ekko,
          ebeln TYPE ekko-ebeln, " this is my internal table showed in alv
          bukrs TYPE ekko-bukrs,
          bstyp TYPE ekko-bstyp,
          bsart TYPE ekko-bsart,
          lifnr TYPE ekko-lifnr,
          ekorg TYPE ekko-ekorg,
          ekgrp TYPE ekko-ekgrp,
          waers TYPE ekko-waers,
          chk(1)   TYPE c, " check field
          END OF ls_ekko.
    DATA it_ekko LIKE TABLE OF ls_ekko.
    DATA : gt_fcat    TYPE slis_t_fieldcat_alv WITH HEADER LINE,
           g_layout   TYPE slis_layout_alv,
           gt_fcat1    TYPE slis_t_fieldcat_alv WITH HEADER LINE,
           g_layout1   TYPE slis_layout_alv.
      g_layout-colwidth_optimize = 'X'.
      g_layout-box_fieldname = 'CHK'. " adding check field to alv
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
       i_callback_program                = sy-repid
       i_callback_pf_status_set          = 'PF_STATUS_ALV'
       i_callback_user_command           = 'USER_COMMAND_ALV'
      IT_EXCLUDING                      =
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
          is_layout          = g_layout
          it_fieldcat        = gt_fcat[]
          i_default          = 'X'
          i_save             = 'A'
        TABLES
          t_outtab           = it_ekko
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
    *&      Form  PF_STATUS_ALV
        Subroutine for PF status
         -->RT_EXTAB   text
    FORM pf_status_alv USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'SELOBJ' EXCLUDING rt_extab.
    ENDFORM.                    "PF_STATUS_ALV
    Hope this help

  • Selection of records in TABLE CONTROL.

    hello friends, this is venkat.
    I have been using a table contrlo to display the contents of a custom table.
    my table control can display 10 records in one shot and my custom table had more than that. vertical scroll bar has been working properly so i can see all the records in the table control area.
    now my problam is after i selecting one record, to select another record i am using the vertical scroll bar. but the moment i am scrolling the vertical scroll bar the previously selected one becomes non selected..
    how can i select a record and still scroll down or up to select some more records..
    another doubt i had is when ever i use vertical scroll bar PAI is geeting triggered but i am not gettig any information in SY-UCOM... how can i catch this event...
    just like checking  for function code when we click on PUSH BUTTON.
    i will be very thanful if any one can give me some guidance.....
    Venkat.

    Hi Venkat,
    Basically there are 2 ways in which u can create a table control either for a internal table or for database table.
    u can use the wizard from within the screen painter OR
    create a table control manually adding individual fields and handling the table control on your own.
    in the former method, SAP generates the code behind automatically which is not really comprehendable.
    I prefer the later method where u code and have a lot of flexibility of changing the table control at a later stage.
    For information on creating table controls, please refer SAP library under
    ABAP Programming>ABAP User dialogs>Screens>Complex screen elements>Table controls

  • How to freeze the selection column in the table control of the module pool.

    hi ,
    in my module pool there is a row selection field  <b>w/selcolumn</b> of the table control called as mark.
    how to freeze the selection column where there is no record in the table control row.
    or in other words where wa is initial.
    thanks
    ekta

    Hi all,
    in the PBO of the screen the following code is written.
    say the selection column is MARK and is declared in the data as well.
    thanks
    ekta
    *************************C O D E **************************************************
    MODULE disp_tabctrl1 OUTPUT.
      IF flag_c = 1.
        READ TABLE it_create_data INTO wa_material_data
             INDEX tab_ctrl1-current_line.
      ELSE.
        READ TABLE it_material_data INTO wa_material_data
             INDEX tab_ctrl1-current_line.
        IF sy-subrc = 0.
          IF ok_code_0101 = '&SEL1'.
            mark = 'X'.
          ELSEIF ok_code_0101 = '&DSEL'.
            mark = ' '.
          ENDIF.
        ELSE.
          LOOP AT SCREEN.
            IF screen-name = 'MARK'.
              screen-input = 0.
              MODIFY SCREEN.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
      index_t = tab_ctrl1-top_line.
      index_d = tab_ctrl1-top_line + n.
    ENDMODULE.                 " DISP_TABCTRL1  OUTPUT

  • How to move multi select rows(records)from one datagrid to another datagrid completelly in flex4

    hi friends,
    I  am doing mxml flex 4 wep application i am using 2 forms, each form i am using datagrid,i am struck in this place,
    my proplem is, in first form i am having a grid with 10rows and columns,i am having 10 records and one move button. Next form also having a datagrid,
    need:
    IF i am doing multi select(2records) from the first datagrid and click move button means that records will show in the second datagrid and will also delete
    from the first data grid again it wont show the records in same datagrid.
    how to do this?
    any useful suggession or snippet code.
    thanks in advance,
    Cheers,
    B.venkatesan.

    One solution could be:
    Source to data grid is an Array collection
    1.> In first data grid extraxct the rows using, grid.selecteditem
    2.>Add it to the arraycollection attached to next grid, use arraycollection addItemat api if rows needed to ve added at particular index
    3.>Use removeitemat api to remove the items from arraycollection attached to first datagrid
    4.>call invalidate on bothe of the datagrids

  • Select Single record from Popup box

    Hi Experts,
    I am calling zcomponent 2 from zcomponent 1 as POPUP screen and populating the table view.
    Now i need to select any 1 of the result from popup and be able to populate the data in the view of zcomponent 2 and close the popup box.
    Can any one help me with this ASAP please.
    Regards,
    Juturi.

    Hi Mario,
    Please take a look at this thread..
    Re: SELECT DISTINCT does not work in a recordset object
    cheers,
    Prashanth
    P.S please mark helpful answers

  • How can I select random records from one column

    How can I random select 400 records from a column contains more than 500,000 records? And how long will it take in oracle? Thanks.

    here is one option: (just change 5 to suit your needs...)
    SQL>select * from (
      2  select object_name
      3  from all_objects
      4  order by dbms_random.random
      5  ) where rownum < 5
      6  /
    OBJECT_NAME
    UTL_SYS_COMPRESS
    GV_$LOG_HISTORY
    GV_$LOGMNR_LOGS
    WWV_FLOW_THEME_7
    SQL>/
    OBJECT_NAME
    WWV_FLOW_UPGRADE_REPORT
    WRI$_ADV_SQLT_STATISTICS_PK
    V_$DATABASE
    GV_$SERVICEMETRIC
    SQL>/
    OBJECT_NAME
    WWV_FLOW_CREATE_FLOW_API
    WRH$_SERVICE_WAIT_CLASS_BL
    EXU8SNAPL
    GV$SERVICEMETRIC_HISTORY
    SQL>                well, regarding how long will it take... it depends from lots of variables...
    Cheers,
    Andrea

  • Displaying the selected multiple records from node using onleadselect event

    Hi all,
    How to display the selected multiple records from node to node using onleadselect event.
    i came to know tht to fulfill this requirement i need to use the method get_selected_elements,
    how to use this method in my event??
    sree

    Hi Sree,
    Try below code..
    DATA : lo_nd_it_lips TYPE REF TO if_wd_context_node,             // This is first node
                 lo_el_it_lips TYPE REF TO if_wd_context_element,
                 ls_it_lips TYPE wd_this->Element_it_lips,
                 lt_it_lips TYPE wd_this->Elements_it_lips.
               DATA: wa_temp TYPE REF TO if_wd_context_element,
                lt_temp TYPE wdr_context_element_set.
    * navigate from <CONTEXT> to <IT_LIPS> via lead selection
          lo_nd_it_lips = wd_context->path_get_node( path = `ZRETURN_DEL_CHANGE.CHANGING_3.IT_LIPS` ).
          CALL METHOD lo_nd_it_lips->get_selected_elements
            EXPORTING
                INCLUDING_LEAD_SELECTION = ABAP_true
            RECEIVING
              set = lt_temp.
          DATA lo_nd_pack_mat TYPE REF TO if_wd_context_node.          //Second Node
          DATA lo_el_pack_mat TYPE REF TO if_wd_context_element.
          DATA ls_pack_mat TYPE wd_this->Element_pack_mat.
          DATA lt_pack_mat TYPE wd_this->Elements_pack_mat.
    * navigate from <CONTEXT> to <PACK_MAT> via lead selection
          lo_nd_pack_mat = wd_context->get_child_node( name = wd_this->wdctx_pack_mat ).
          lo_nd_pack_mat->get_static_attributes_table( importing table = lt_pack_mat ).
          LOOP AT lt_temp INTO wa_temp.
            CALL METHOD wa_temp->get_static_attributes
              IMPORTING
                static_attributes = ls_it_lips.
                  ls_pack_mat-vbeln = ls_it_lips-vbeln.
                  ls_pack_mat-material = ls_it_lips-matnr.
                  ls_pack_mat-vgbel = ls_it_lips-vgbel.
                    append ls_it_lips to lt_unpack.
                  CLEAR ls_pack_mat.
           ENDLOOP.
    Cheers,
    Kris.

Maybe you are looking for

  • DSC Saving Shared Variables to Library

    I'm guessing this is a bug (LV/DSC 2009 SP1), but I wanted to see if anyone else had experienced this or had a workaround. I'd like to make changes to the logging state of some shared variables programmatically and be able to save the changes. When I

  • Best way to work with multiple Flash objects?

    I am making an application that is going to need to use several  custom MovieClip-based classes from Flash.  I'm not sure if I'm using the terminology right.  What I have is a Flash file with movie clips, each clip has a class with properties and met

  • Best practice in HCM

    Hi, 1) Can you please advise,what all processes comes under SAP Best Practices for HCM? 2) What all infotypes comes under Payroll implementations? Thanks! Manish

  • Updating Metadata Fails on all collections

    I am doing various selections of images, either thru collections, folders, star ratings or whatever and finding a "mixed status" for the metadata. Regardless of the selection, I then click the small button to resolve this and get the message asking i

  • Problems with a backup of iPhoto

    I copied an iPhoto library file from my Macbook to an external hard drive. When I copied the file it was approx 35GB in size. I now have a new Macbook - and I am trying to import the iPhoto library file. However, the library file on my external hard