‎2008 Feb 20 9:12 AM
Hi,
I have a table control that is in the display mode.
I have a button called insert on top of the table control .
When i click on the insert button , I should have a new row in the table control with change mode,i.e. I should be able to enter some values in the new row .
Please could anyone help me out with this.
Regards,
Sushanth H.S.
‎2008 Feb 20 9:43 AM
Hi Sushanth Srinivas,
In your PBO, you can adjust the field properties using the usual "loop
at screen." style logic - but with a table control, you just need to do
this inside the table control loop e.g. along the lines of this (not
syntax checked):
Screen flow PBO
loop at gt_data1 into gs_data1 with control gtc_9999.
module d9999_modify_screen_tc.
endloop.PBO module
Module d9999_modify_screen_tc output.
if sy-ucomm eq 'INSERT'.
loop at screen. "for current row of TC
if screen-name = 'XYZ'. "for one cell
screen-input = 1.
endif.
modify screen.
endloop.
endif.
endmodule.Regards,
Mahi.
‎2008 Feb 21 6:15 AM
Hi
To add a new row you can do
PBO
case sy-ucomm.
when 'INSERT'.
loop at screen.
if screen-name = 'TABLE_CINTROL'.
TABLE_CINTROL-count = TABLE_CINTROL-count + 1.
endif.
endloop.
endcase.
Regards
Aditya
‎2008 Mar 06 11:52 AM
hi,
CASE OK_CODE.
WHEN 'INSERT'.
LOOP AT ITAB.
IF ITAB-MARK = 'X'.
INSERT INITIAL LINE INTO ITAB.
FLAG = '1'.
ENDIF.
ENDLOOP.
IF FLAG <> '1'.
APPEND INITIAL LINE TO ITAB.
ENDIF.
ENDCASE.
try this piece of code,it may be helpful.
regards,
sravanthi