Application Development 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: 

How to add/Delete line to Table Control ?

former_member402443
Contributor
0 Kudos

How to add/Delete line to Table Control ?

3 REPLIES 3

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi,

To delete and add rows in the table control, first set the selection mode property and give a name to it (Say "SEL").

Either u can select the rows in the table control and press the push button.

Then in PAI write the module.

CONTROLS TC1 TYPE TABLEVIEW USING SCREEN 9001.

MODULE DeleteADDRecord INPUT.

if SEL = 'X' AND sy-ucomm = 'DELETE'.

delete it_purchase index tc1-Current_line.

elseif SEL = 'X' AND sy-ucomm = 'ADD'.

it_purchase-itemno = tc1-Current_line + 1.

insert it_purchase index tc1-Current_line.

endif.

ENDMODULE. " DeleteRecord INPUT

Also refer Program...

<b>RSDEMO_TABLE_CONTROL</b>

For More Information,

Delete rows from Table Control->

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbac5e35c111d1829f0000e829fbfe/content.htm

Add rows in Table Control->

http://help.sap.com/saphelp_45b/helpdata/en/d1/801bdf454211d189710000e8322d00/content.htm

Regards,

Padmam.

0 Kudos

The idea is to add or delete a line to the ITAB that corresponds to your TabCtrl. Adding is straight forward as all you have to do is append a blank line to the itab. For deletion, as you have to identify which row to delete, you must have some way to do this. One can be a radio box or the selection button functionality that the wizard provides. For this you should have a field of length 1 in the Internal which will be set to X. Now in the PAI module, all you need to do is delete that row which has this selection field set to X. Hope this helped. If you have more queries regarding this, feel free to get back.