‎2009 Aug 07 5:46 PM
I only want 4 rows in my table control but it is coming as a number of rows...I want to restrict row in my table control,Please tell me how do that?
‎2009 Aug 07 5:55 PM
HI,
Try the following
Say the tablecontrol has the name tabctrl in your program, set the property lines of the table control as 4.
tabctrl-lines = 4. in the PBO
hope this helps.
Regards,
Sachin
‎2009 Aug 08 7:14 AM
Hi priya
I am sending the code which i used in my screen see weather it will suite you.if any doubts let me know as well this is for 10 lines
MODULE COUNT_UPDATE INPUT.
data cnt(10).
DESCRIBE TABLE itab1 lines cnt.
append itab1 TO ITAB2.
LOOP AT itab2.
IF itab2-srno is INITIAL.
cnt = cnt + 1.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = cnt
IMPORTING
OUTPUT = itab2-srno
.
itab2-srno = cnt.
ENDIF.
READ TABLE itab1 WITH TABLE KEY srno = itab2-srno aufnr = itab2-aufnr." vbeln = itab2-vbeln.
IF sy-subrc eq 0.
MOVE-CORRESPONDING itab2 to itab1.
MODIFY itab2.
MOVE itab2[] to itab1[].
else.
MOVE-CORRESPONDING itab2 to itab1.
append itab1.
ENDIF.
ENDLOOP.
PERFORM operations.
REFRESH CONTROL 'TCL' FROM SCREEN '1000'.*
tcl-lines = 10. " for 10 lines
clear itab2.
CLEAR itab2[].
ENDLOOP.
ENDMODULE.
‎2009 Aug 11 10:25 AM
Just Select 4 rows only into the internal table.
Select * from mara into itab up to 4 rows.
‎2009 Aug 11 10:36 AM
Hi,
Try this,
In the layout, resize the table control's height so that it shows only 4 rows.
If you want only 4 rows to be editable on display, then use the following in the PBO
LOOP AT gt_itab1 WITH CONTROL tabcontrol.
MODULE check_control.
ENDLOOP.
MODULE check_control.
if gt_itab1[] is INITIAL.
TABCONTROL-lines = 4.
endif.
ENDMODULE.
‎2009 Aug 11 11:03 AM