Copy selected lines in the table control

Hi friends,
I Have a screen 200 in which i have a button COPY and table control.
In my table control i have 6 lines of data.
now my requirement is when i select any lines  ie :  let us say i ahve selected 1 , 3 , 5 lines of my table control and when i click on the button COPY of that screen. i need those 3 selected lines 1 , 3 , 5 to be copied again in the table control
example  :
line 1         selected
line2
line3          selected
line4
line5          selected .
line6
now my table control should be
line1
line2
line3
line4
line5
line6
line1
line3
line5
How can i do that
Regards
Priyanka.

I have similar issue...i need help how to accomplish automatic addition on every line.  example (see below)
this is how it looks right now
DATE    EMPLOYEE       DEPT JOB     LOT     OPER#     LX_HRS     OP_SETUP     LX_TYPE     COMPLETE
2/23/2009     M.Paquiao   NB         1960     001     10             1.50                14.00                     S                      NO
2/24/2009                                                      1.00             14.00                  S                        NO
2/25/2009                                                      4.50                14.00                  S                    NO
2/27/2009                                                      3.00             14.00                  S                        NO
2/28/2009                                                      1.50             14.00                  R                       YES
3/1/2009                                                      2.00             14.00                  R                  YES
this what I need it to do when I meant automatic addition of each line:
DATE   EMPLOYEE     DEPT     JOB     LOT     OPER#     LX_HRS     OP_SETUP     LX_TYPE     COMPLETE
2/23/2009     M.Paquiao      NB        1960     001     10             1.50        14.00               S         NO
2/24/2009                                                      2.50             14.00                  S             NO
2/25/2009                                                      7.00        14.00                  S             NO
2/27/2009                                                      10.00     14.00               S             NO
2/28/2009                                                      11.50     14.00               R             YES
3/1/2009                                                      13.50     14.00               R             YES
As you can see everything is the same but on column LX_HRS, the first example one is not doing anything addition but on the second example is now doing addition.  This additions were done manually, how can I tell crystal to add each line, in the example above, the
first example                                              second example: (addition is involved)
date                lx_hrs                                  date                  lx_hrs
2/23/09           1.50                                     2/23/09              1.50
2/24/09           1.00                                     2/24/09              2.50 (sum of : 1.50 + 1.00 was added)
2/25/09           4.50                                     2/25/09              7.00 (sum of 2.50 (on date 2/24/09 &  4.50 from date 2/25/09 of the first example).

Similar Messages

  • Copy more lines in the Table Control

    Hi ,
    I have created a table control in one of my mod pool programs,
    I have to paste lines from Excel (for instance) to this table control, but it copies only to the lines in the table control which I see in the screen. if I have more lines to copy than the lines which I see in the screen, it doesn't copy it.
    plz help me in this regard.......
    Thanx
    SHOAIB REHMAN

    Hi, Shoaib
    I think you have to Program for this in Special Button like in Select-Option's (EXTENSION) Button Window you have an Button Upload from Clipboard (Shift + F12) just left side of the Cancel button.
    For Copy data from Clipboard Check the Bellow Sample Code. (Copy data and Run the Bellow Code)
    TYPES:  BEGIN OF ty_char256,
            line TYPE c LENGTH 256,
            END OF ty_char256.
    DATA: it_data TYPE STANDARD TABLE OF ty_char256,
          wa_data LIKE LINE OF it_data,
          length TYPE i.
    CALL METHOD cl_gui_frontend_services=>clipboard_import
      IMPORTING
        data                 = it_data[]
        length               = length
      EXCEPTIONS
        cntl_error           = 1
        error_no_gui         = 2
        not_supported_by_gui = 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.
    LOOP AT it_data INTO wa_data.
      write: wa_data-line.
    ENDLOOP.
    Please Reply if any Confusion.
    Thanks and Regards,
    Faisal

  • How to find out the selected line in the table control

    Hi Guys,
    i have a requirement like this. i have table control and the internal table for that table control as IT_CASE. this internal table i declared as CHECKBX, MATNR, QUANTITY. but when i am enter the values in the table control i am getting the values in MATNR and QUANTITY in the that internal table IT_CASE. but when iam selecting that that line iam not getting CHECKBOX as 'X' in that internal table IT_CASE. i declared the table control as CAS_CONTROL and in that i have given the "w/selcolum" property as IT_CASE-CHECKBOX. now i want to fill that CHECKBOX as 'X' inthat internal table IT_CASE whatever the lines we are selecting only for those lines i want to fill up as 'X' in that internal table.
    Can you please suggest any one reg this.
    Thanks in advance
    Rahul

    Hello body,
    You can give a name such as 'SEL' in  w/selcol and declare SEL as char1. Then follow the coading.
    in TOP.
    data: sel type c.
    PROCESS AFTER INPUT.
    user_command_0011.
    loop at <Your internal table>.
    module get_data.
    endloop.
    Inside Module get_data.
        if sy-ucomm = <Your Fcode>
        if sel = 'X'.
           <Your internal table>-<Field for checkbox> = 'X'.
          append <Your internal table>.
        endif.
      endif.
    I think your issue is resolved.
    Regards.
    S Mahanta.

  • Copy selected values from a table control into another table control

    hi there,
    as seen in the subject i need to copy selected values from a table control into another table control in the same screen. as i dont know much about table controls i made 2 table controls with the wizard and started to change the code... right now im totally messed up. nothing works anymore and i don't know where to start over.
    i looked up the forums and google, but there is nothing to help me with this problem (or i suck in searching the internet for solutions)
    i have 2 buttons. one to push the selected data from the top table control into the bottom tc and the other button is to push selected data from the bottom tc into the top tc. does somebody has a sample code to do this?

    you're funny
    i still don't get it... can't believe, there is no tutorial or sample code around how to copy multiple selected rows from a tc.
    here's my code, maybe you can tell me exactly were i have to change it:
    tc1 = upper table control
    tc2 = lower table control
    SCREEN 0100:
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
      MODULE get_nfo. --> gets data from the dictionary table
      MODULE tc1_change_tc_attr.
      LOOP AT   it_roles_tc1
           INTO wa_roles_tc1
           WITH CONTROL tc1
           CURSOR tc1-current_line.
      ENDLOOP.
      MODULE tc2_change_tc_attr.
      LOOP AT   it_roles_tc2
           INTO wa_roles_tc2l
           WITH CONTROL tc2
           CURSOR tc2-current_line.
      ENDLOOP.
    PROCESS AFTER INPUT.
      LOOP AT it_roles_tc1.
        CHAIN.
          FIELD wa_roles_tc1-agr_name.
          FIELD wa_roles_tc1-text.
        ENDCHAIN.
        FIELD wa_roles_tc1-mark
          MODULE tc1_mark ON REQUEST.
      ENDLOOP.
      LOOP AT it_roles_tc2.
        CHAIN.
          FIELD wa_roles_tc2-agr_name.
          FIELD wa_roles_tc2-text.
        ENDCHAIN.
        FIELD wa_roles_tc2-mark
          MODULE tc2_mark ON REQUEST.
      ENDLOOP.
      MODULE ok_code.
      MODULE user_command_0100.
    INCLUDE PAI:
    MODULE tc1_mark INPUT.
      IF tc1-line_sel_mode = 2
      AND wa_roles_tc1-mark = 'X'.
        LOOP AT it_roles_tc1 INTO g_tc1_wa2
          WHERE mark = 'X'.    -
    > big problem here is, that no entry has an 'X' there
          g_tc1_wa2-mark = ''.
          MODIFY it_roles_tc1
            FROM g_tc1_wa2
            TRANSPORTING mark.
        ENDLOOP.
      ENDIF.
      MODIFY it_roles_tc1
        FROM wa_roles_tc1
        INDEX tc1-current_line
        TRANSPORTING mark.
    ENDMODULE.                    "TC1_MARK INPUT
    MODULE tc2_mark INPUT.
      IF tc2-line_sel_mode = 2
      AND wa_roles_tc2-mark = 'X'.
        LOOP AT it_roles_tc2 INTO g_tc2_wa2
          WHERE mark = 'X'.             -
    > same here, it doesn't gets any data
          g_tc2_wa2-mark = ''.
          MODIFY it_roles_tc2
            FROM g_tc2_wa2
            TRANSPORTING mark.
        ENDLOOP.
      ENDIF.
      MODIFY it_roles_tc2
        FROM wa_roles_tc2
        INDEX tc2-current_line
        TRANSPORTING mark.
    ENDMODULE. 
    thx for anybody who can help with this!

  • How to find the current line in the table control in module pool ?

    How to find the current line in the table control in module pool ?
    This is an urgent requirement? please do help me.

    refer to this example
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA: cols LIKE LINE OF flights-cols,
    lines TYPE i.
    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 CORRESPONDING FIELDS OF 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'.
    DESCRIBE TABLE itab LINES lines.
    flights-lines = lines.
    ENDMODULE.
    MODULE cancel INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE read_table_control INPUT.
      MODIFY itab FROM demo_conn INDEX<b> flights-current_line.</b>
    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.
    ENDCASE.
    ENDMODULE.

  • 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 the Chosen line from the Table Control

    Hi Friends,
      i am new to Module Pool Programming , i developed a Table Control in input mode and i am getting data also into that table control. my requirement is that i want to delete the current chosen line from that table control. please help me out.

    HI
    GOOD
    GO THROUGH THIS REPORT
    REPORT demo_dynpro_tabcont_loop_at.
    CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.
    DATA: cols LIKE LINE OF flights-cols,
    lines TYPE i.
    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 CORRESPONDING FIELDS OF 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'.
    DESCRIBE TABLE itab LINES lines.
    flights-lines = lines.
    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.
    ENDCASE.
    ENDMODULE.
    CHANGE THE CODE AS PER THIS LIGIC.
    THANKS
    MRUTYUN

  • Selecting data in the table control

    Hi Friends,
    I have final data in my table control now the user wants to select only few records from the displayed data, for that I kept a check box for selection, But my question is I am unable to read the selected data.
    Actually user requirement is he has to update only the selected data from the displayed data in the table control.
    Can any one tell me how to read the selected records after displaying in the table control.
    Thanx in advance,
    Line

    Hello Line,
    As gopi has suggested do the following..
    for the table control properties u have an option called W/SelColumn.
    Give in some name (ROW_SEL)to that and also include a field CHK in the internal which is being passed to the table control.
    and in the PAI of the table control module wirte like this...
    Then in your code..
    PROCESS BEFORE OUTPUT.
    PBO FLOW LOGIC FOR TABLECONTROL 'TABCONTROL'
    MODULE TABCONTROL_CHANGE_TC_ATTR.
    MODULE TABCONTROL_CHANGE_COL_ATTR.
    LOOP AT lt_final
    INTO lw_final
    WITH CONTROL tabcontrol
    CURSOR tabcontrol-current_line.
    MODULE tabcontrol_get_lines.
    MODULE TABCONTROL_CHANGE_FIELD_ATTR
    ENDLOOP.
    MODULE status_0101.
    PROCESS AFTER INPUT.
    PAI FLOW LOGIC FOR TABLECONTROL 'TABCONTROL'
    LOOP AT lt_final.
    MODULE read_data.
    MODULE tabcontrol_user_command.
    ENDLOOP.
    MODULE TABCONTROL_CHANGE_TC_ATTR.
    MODULE TABCONTROL_CHANGE_COL_ATTR.
    MODULE user_command_0101.
    MODULE tabcontrol_user_command input.
    if lt_final-chek = 'X'.
    *put your logic here something like
    move corresponding lt_final to gt_final.
    *now you have selcted rows data in gt_final.
    endif.
    endmodule.
    Regards

  • Read select line in the table

    hi,
    can any one tell me how we code to get the selected line in the display table
    thanks.

    Hi ,
    1.Just select a row of table and click on button to read the value of selected row.
    2. In the OnAction of button, just read the context node binded to the table using Code wizard(Control + F7).
    3. below menttioned code will be automatically genearated and selected value's content will be stored in ls_cn_flight :
    DATA lo_nd_cn_flight TYPE REF TO if_wd_context_node.
      DATA lo_el_cn_flight TYPE REF TO if_wd_context_element.
      DATA ls_cn_flight TYPE wd_this->element_cn_flight.
    * navigate from <CONTEXT> to <CN_FLIGHT> via lead selection
      lo_nd_cn_flight = wd_context->get_child_node( name = wd_this->wdctx_cn_flight ).
    * get element via lead selection
      lo_el_cn_flight = lo_nd_cn_flight->get_element(  ).
    * get all declared attributes
      lo_el_cn_flight->get_static_attributes(
        IMPORTING
          static_attributes = ls_cn_flight ).
    CN_FLIGHT is the node binded with table.

  • Reading selected data in the table control

    Hi Friends,
    I have final data in my table control now the user wants to select only few records from the displayed data, for that I kept a check box for selection, But my question is I am unable to read the selected data.
    Actually user requirement is he has to update only the selected data from the displayed data in the table control.
    Can any one tell me how to read the selected records after displaying in the table control.
    Thanx in advance,
    Line

    Hi
    If your table control has a check box, your internal table should have a field for it. Its value will be X if the checkbox is setted else it'll be SPACE.
    So in the PAI u should read only the records where that flag is X:
    LOOP AT ITAB WHERE MARK = 'X'.
    ENDLOOP.
    Max

  • Selecting records in the table control

    Hi Friends,
    I have the requirement to be displayed in the table control, I got the data displayed in the table control. Now I need to select some of the records from the table control and update in the database. When I am trying to do that i am able to select only one records instead of some number of records. When I try to select the second record the first record which i selected is being unselected. Can any one tell me how to select more than one record in the table control.
    Regards,
    Line

    hello,
    to select more then 1 record
    1> you need to put CHECK BOX FEILD
             or
    1> you have to manually use control and select the feilds.
    hope i have replied to your query
    thankx
    bhanu malik

  • 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

  • Adding an extra line in the table control

    Hi All,
    How can we add an extra record in the table control after the user hits ADD button?We tried doing it by incrementing the lines field in the table control,but it is executing the PBO part again after hitting the ADD button.Any SAP standard program will be helpful.
    Thanks,
    Rakesh.

    Hi,
    I think you can do that by inerting new line to Internal table that used in your Table Control. Here the sample:
    TC_DATA = Your Table Control
    IT_DATA = Your Internal Table used for Table Control.
    In your MODULE USER_COMMAND INPUT, add this code:
    IF OK_CODE = 'ADD'.
      CLEAR: IT_DATA.
      APPEND IT_DATA.
    ENDIF.
    Regards,

  • Variant for selection screen with the Table control entries in another Tab

    Hi Guys,
      The requirement is to create a variant for the two tabs on a selection screen.
      First tab contains the select options and the second contains table control for making entries.
      So will it be possible to create a variant when the user makes entries in the fields in one tab and the table on other tab?

    You wrote
    Utilizing the "Save as variant" option from the selection screen itself works out perfectly, but this variant cannot be transported.
    But, give the variant a name beginning with "CUS&" and this variant will be transported. Variant beginning with "CUS&" or "SAP&" are so-called "system variant" and are  transported automatically. You can then copy the transaction code and use this new variant in the new transaction.
    Regards,
    Raymond

  • How to delete select data in the table control

      this problem makes me headache.
      I am new to labview, when  a table shows some data. many rows and column. how can delete on row which I selected. the other rows are remain no change.
    I really need help.thanks in advance. It is better to attach the program.my labview is 2009
    Solved!
    Go to Solution.

    Hi,
    You can do it with a table control as well. Check out the attached VI. To delete a row, Run the VI, just right click the row and click "Delete Row". To get back the default values, click reinitialize.
    Reards,
    NitZ
    (Give Kudos to Good Answers, Mark it as a Solution if your problem is Solved) 
    Attachments:
    Untitled 3.vi ‏8 KB

Maybe you are looking for

  • Will only give print option of "current frame" for a six page PDF document opened from link in Safari.

    I'm new to Mac having just moved from a PC.  The TD Ameritrade site provides statements as PDF documents which are opened by clicking on a link.  The document is displayed in a pop-up window and there is no problem viewing all pages by scrolling.  Bu

  • Lion vs Front Row

    Since Lion installation the remote control first generation, doesn't work as usually. On Leopard when I pushed the menu button, it opened a menu that showed Front Row. Now it doesn't work anymore. Is there anyone to explain me why this happen or is t

  • Create .XML Project File from Scratch

    Hi, i am from germany, currently writing my bachelors degree creating an automated video editing solution based on final cut studio (yeeessss ... finally I need to write complex final cut pro projects FROM SCRATCH in an EXTERNAL .XML editor using to

  • How to setup a user account?

    i am new to the macbook air and have logged in and made an account but now i want to make another and have no idea how to.

  • Intel 82567LM won't update to newer release automaticly or manually w/x200T win7 64bit

    I'm getting the occasional bsod in win7 64 on my 7450-CTO. IT's a 0x0000007F which is sometimes the nic driver. So, I went to the regular download/support section, looked at the matrix and found that the Intel lan drivers is still listed as vista32/6