Skip to Content

table control problem

how can i modify/update a particular row in the table control when all the rows of the cotrol are locked. Just want to update only one record which also needs to be unlocked ( with input =1).

how to trap the selected row property.

how to insert into control when all the columns are locked. only the NEW row to be inserted must be unloacked. when save button is pressed, it should be saved to the REFERENCE table.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 12, 2007 at 05:58 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.