09-20-2007 10:21 AM
09-20-2007 10:24 AM
09-20-2007 10:24 AM
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.
09-20-2007 10:28 AM
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.