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: 

To insert a new row in a table control without affecting the other rows

Former Member
0 Kudos

Halo experts,

I have a Table control TCTRL in a program .

The lt_tab contains two cols A and B

In change mode of the transaction Col A is in display mode and Col B is in change mode

When i press the + button to insert a new blank entry .I need a blank row with both col A and col B input enabled w/o affecting the display of above and below rows of table control

In PBO module of subscreen 101

LOOP AT lt_tab WITH CONTROL tctrl.

MODULE tctrl_status.

endloop.

In the user command of 0101

i am writn

When 'INS'.

INSERT INITIAL LINE INTO itab.

Inside MODULE tctrl_status.

IF lt_tab IS INITIAL.

LOOP AT SCREEN.

IF screen-name = 'COLA'.

screen-input = 1.

ENDIF.

ENDLOOP.

MODIFY SCREEN.

endif.

but the problem here is still the Col A is in display mode and Col B is in change mode after output

.Here modify statement is happening but it does not update the TCTRL-COLS-Screen structure for the col A ( which I have set statically while designing the screen ).I dont want to make the entire row in edit mode only the inserted row ( for both Col A and Col B) and the rest shud remain as it is

Thanks

Kallu

4 REPLIES 4

naveen_inuganti2
Active Contributor
0 Kudos

In that case do one thing, dont make that column input disable at layout attribute level. do it in PBO event.

So depend on condition (like no.of entries in your internal table) you can make enable or disable.

--Naveen Inuganti.

0 Kudos

hi Naveen

I have made my tctrl input disabled for both the columsn and

I have a module before the PBO loop where I set the like

module set_tctrl_status.

IF gv_ok_code NE gc_disp.

LOOP AT tctrl-cols INTO gs_cols.

IF gs_cols-screen-name = 'ColB'.

gs_cols-screen-input = 1.

MODIFY tctrl-cols FROM gs_cols INDEX sy-tabix.

ENDIF.

ENDLOOP.

This is just to set the Col B in edit mode when in change and create status.

But if i press the INS button for that change i am coding inside the loop endloop of the pBO like

if itab is initial.

LOOP AT tctrl-cols INTO gs_cols.

gs_cols-screen-input = 1.

MODIFY tctrl-cols FROM gs_cols INDEX sy-tabix.

endloop.

But the problems i it is setting the enite rows as input enabled . I want tos et only that row inpur enabled

0 Kudos

Hi Kallu,

what i think that u need to give one more condition in PAI nt in PBO to enable the colA for making it input enabled.. i.e

module check input.

LOOP AT tctrl-cols INTO gs_cols.

read table <internal table> into <wa> with key colA.

if colA is initial.

gs_cols-screen-input = 1.

MODIFY tctrl-cols FROM gs_cols INDEX sy-tabix.

endif.

endloop.

endmodule.

Try out.. I hope it helps....

Best of Luck !!!!

Regards

Ravi Aswani

Former Member
0 Kudos

Hi,

use the below code

when 'INS'.

append intial line to itab.

Thanks & Regards,

Sateesh.