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: 

Deleting empty lines in table control

Former Member
0 Kudos

Hi,

In Table control how can i delete empty lines.

Thanks, Ahmed.

6 REPLIES 6

abdul_hakim
Active Contributor
0 Kudos

Hi,

Try making use of the Resizing attribute of the table control. Check the same in the table control settings in the screen painter, This cannot be set dynamically from ABAP Program.

Cheers,

Hakim

Former Member
0 Kudos

Hi...

please refer below mentioned simple code.

on Screen.

PROCESS AFTER INPUT.

LOOP AT ITAB_ZENCBILL_INFO.

MODULE MODIFY_BILL_INFO_DATA.

ENDLOOP.

MODULE USER_COMMAND_0200.

Now in code ..

MODULE MODIFY_BILL_INFO_DATA INPUT.

MODIFY ITAB_ZENCBILL_INFO FROM ZSENCBILL_INFO INDEX

TCRL_BILL_INFO-CURRENT_LINE.

CLEAR : ZENCBILL_INFO.

ENDMODULE. " MODIFY_BILL_INFO_DATA INPUT

**********************************************

MODULE USER_COMMAND_0200 INPUT.

CLEAR OK_CODE.

CASE SAVE_OK.

WHEN 'SUB'.

CLEAR TCRL_BILL_INFO-LINES.

CLEAR V_LINE.

CLEAR WA_ZENCBILL_INFO.

LOOP AT ITAB_ZENCBILL_INFO INTO WA_ZENCBILL_INFO.

IF WA_ZENCBILL_INFO-XMARK = 'X'.

DELETE TABLE ITAB_ZENCBILL_INFO FROM WA_ZENCBILL_INFO.

ENDIF.

ENDLOOP.

ENDMODULE.

Salil....

Edited by: salil chavan on Dec 1, 2008 10:55 AM

Former Member
0 Kudos

hi

do u want to delete empty lines from the table control

or empty lines having no data from the internal table that is being used to populate the table control

0 Kudos

Hi Kiran,

I want to delete the empty lines of table which are being displayed if internal table has the entries lessthan the rows that are displayed in table control by default.

Thanks, Ahmed.

0 Kudos

Hi

simply in the PBO

describe table itab lines tc-lines

In PAI

module user_command.

module user_command

delete itab where key_field = initial.

select the row in the table control

delete itab where index = 'X'.

This index is the row selector which you maintain the screen painter

endmodule

regards

Ramchander Rao.K

Edited by: ramchander krishnamraju on Dec 1, 2008 11:07 AM

Former Member
0 Kudos

hi,

you can delete as:

DELETE gi_itab WHERE index IS INITIAL.

where gi_itab is your table.

or you can give some value as:

WHEN gc_exec. " Execute

DELETE gi_itab WHERE matnr EQ space.