Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Detailed table control

Former Member
0 Likes
579

Hi can any one give me a detailed example of table control with all those fuctionalities like "select all rows"

"deselect all rows", "add a new row","delete all rows"......

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
498

Hi

Ref below prg

demo_dynpro_tabcont_loop

demo_dynpro_tabcont_loop_at

demo_dynpro_step_loop

RSDEMO02.

RSDEMO_TABLE_CONTROL

4 REPLIES 4
Read only

Former Member
0 Likes
499

Hi

Ref below prg

demo_dynpro_tabcont_loop

demo_dynpro_tabcont_loop_at

demo_dynpro_step_loop

RSDEMO02.

RSDEMO_TABLE_CONTROL

Read only

Former Member
0 Likes
498

hi saravanan,

try this piece of code,it may help u.

* Add rows and delete ,select all , deselect all
*  button actions in item table

  IF TABSTRIP1-ACTIVETAB = 'LINE_ITEMS'.

FLAG = '0'.

    CASE OK_CODE1.

* when add button is pressed we add a new line to the table control

      WHEN 'ADD'.
        LOOP AT LINEITEM.
          IF LINEITEM-MARK = 'X'.
            INSERT INITIAL LINE INTO LINEITEM.
            FLAG = '1'.
          ENDIF.
        ENDLOOP.
        IF FLAG <> '1'.
          APPEND INITIAL LINE TO LINEITEM.
        ENDIF.
        CLEAR OK_CODE1.

* When delete button is clicked delete the line
      WHEN 'DELETE'.
        LOOP AT LINEITEM.
          IF LINEITEM-MARK = 'X'.
            MOVE-CORRESPONDING LINEITEM TO LINEITEM_DELETE.
            APPEND LINEITEM_DELETE.
            CLEAR LINEITEM_DELETE.
            CLEAR LINEITEM.
            DELETE LINEITEM.
          ENDIF.
        ENDLOOP.
        CLEAR OK_CODE1.

* When select all button is clicked select all the lines which are
* editable .
      WHEN 'SELECT_ALL'.
        LOOP AT LINEITEM.
          LINEITEM-MARK = 'X'.
          MODIFY LINEITEM.
        ENDLOOP.
        CLEAR OK_CODE1.

* When deselect all button is clicked deselect all the lines which are
* editable .
      WHEN 'DESELECT_ALL'.
        LOOP AT LINEITEM.
          LINEITEM-MARK = ' '.
          MODIFY LINEITEM.
        ENDLOOP.
        CLEAR OK_CODE1.
    ENDCASE.
ENDIF.

Here LINEITEM and LINEITEM_DELETE are internal tables.

Revert back for any queries.

Regards,

Sravanthi.

Read only

Former Member
Read only

Former Member
0 Likes
498

Hi Sarvanan,

While creating the table control, you have the options to create it manually as well as With Wizard.

If you create it with Wizard, you just need to check the respective radio buttons for all the functionalities you want (containing select all, deselect all, delete, add new row).

Wizard writes the code it self for all these functions. So try it as it will save a lot of your effort.

Please revert for any clarification.

Regards,

Ashish