‎2006 Oct 05 8:06 AM
hi all,
plz give me a brief expalnation and example of table control
‎2006 Oct 05 8:17 AM
Hi Narendra,
Chk these sample programs on table control
DEMO_DYNPRO_TABCONT_LOOP Table Control with LOOP - ENDLOOP
DEMO_DYNPRO_TABCONT_LOOP_AT Table Control with LOOP AT ITAB
DEMO_DYNPRO_TABLE_CONTROL_1 Table Control with LOOP Statement
DEMO_DYNPRO_TABLE_CONTROL_2 Table Control with LOOP AT ITAB
‎2006 Oct 05 8:18 AM
Hi,
search the forum and you will find it.
Anyway you can see standard examples by:
SE38 > Enviroment > Ergonomics examples > Screens
Regards.
Jose.
‎2006 Oct 05 8:20 AM
Hi,
Table control is used for item displaying or creating or modifying Item level value for any header documents.
A good example is, in transaction SE11(data dictionary) when you display a table you can find the field names of that table. the field names are viewed in an table control. This is one example, like wise when you create a Purchase Order you provide the Mateiral number for that PO in an Table control.
Table controls are done through Dialog Programming(Screens). It is like an internal table that is viewed on a Screen.
Hope this would be helpfull.
Thanks and Regards,
Prashanth
‎2006 Oct 05 8:32 AM
hi narendra,
check this sample code..
TABLES: kna1,knbk.
DATA: v_kunnr LIKE kna1-kunnr.
DATA: v_check TYPE c.
DATA: BEGIN OF it_knbk OCCURS 0,
banks LIKE knbk-banks,
bankl LIKE knbk-bankl,
bankn LIKE knbk-bankn,
bkont LIKE knbk-bkont,
koinh LIKE knbk-koinh,
chk TYPE c,
END OF it_knbk.
DATA: v_ucomm TYPE sy-ucomm,
v_dynnr TYPE sy-dynnr.
DATA: l_index TYPE sy-index.
data: count type i.
CONTROLS: tc1 TYPE TABLEVIEW USING SCREEN 0200.
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
MODULE status_0100 OUTPUT.
SET PF-STATUS 'ABC'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
&----
*& Module USER_COMMAND_0100 INPUT
&----
text
----
MODULE user_command_0100 INPUT.
v_ucomm = sy-ucomm.
CASE v_ucomm.
WHEN 'DISP' OR 'CHNG'.
IF v_kunnr <> space.
SELECT banks
bankl
bankn
bkont
koinh
FROM knbk
INTO TABLE it_knbk
WHERE kunnr = v_kunnr.
LEAVE TO SCREEN '0200'.
ENDIF.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
&----
*& Module MOD_KUNNR INPUT
&----
text
----
MODULE mod_kunnr INPUT.
IF NOT v_kunnr IS INITIAL.
SELECT SINGLE
kunnr
FROM kna1
INTO v_kunnr
WHERE kunnr = v_kunnr.
IF sy-subrc <> 0.
MESSAGE e000(zz) WITH 'INCORRECT CUSTOMER NUMBER'.
ENDIF.
ENDIF.
IF v_kunnr IS INITIAL.
MESSAGE e000(zz) WITH 'PLEASE ENTER A VALUE'.
ENDIF.
ENDMODULE. " MOD_KUNNR INPUT
&----
*& Module STATUS_0200 OUTPUT
&----
text
----
MODULE status_0200 OUTPUT.
SET PF-STATUS 'ABC1'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0200 OUTPUT
&----
*& Module SCREENMOD OUTPUT
&----
text
----
MODULE screenmod OUTPUT.
IF v_ucomm = 'DISP'.
LOOP AT SCREEN.
screen-input = 0.
MODIFY SCREEN.
ENDLOOP.
ELSE."if v_UCOMM = 'CHNG'.
LOOP AT SCREEN.
IF screen-group1 = 'G1'.
screen-input = 0.
ELSE.
screen-input = 1.
ENDIF.
MODIFY SCREEN.
ENDLOOP.
endif.
endif.
ENDMODULE. " SCREENMOD OUTPUT
&----
*& Module EXIT2 INPUT
&----
text
----
MODULE exit2 INPUT.
LEAVE TO SCREEN 0.
ENDMODULE. " EXIT2 INPUT
&----
*& Module modify INPUT
&----
text
----
MODULE modify INPUT.
IF v_check = 'X'.
it_knbk-chk = 'X'.
MODIFY it_knbk index tc1-current_line.
ELSE.
CLEAR it_knbk-chk .
ENDIF.
ENDMODULE. " modify INPUT
&----
*& Module USER_COMMAND_0200 INPUT
&----
text
----
MODULE user_command_0200 INPUT.
v_ucomm = sy-ucomm.
CASE v_ucomm.
WHEN 'DELE'.
DELETE it_knbk where chk eq 'X'.
DESCRIBE TABLE it_knbk LINES tc1-lines.
ENDCASE.
ENDMODULE. " USER_COMMAND_0200 INPUT
&----
*& Module validate INPUT
&----
text
----
module validate input.
IF IT_KNBK IS INITIAL.
MESSAGE E000(ZZ) WITH 'A BLANK LINE CANNOT BE SAVED'.
ENDIF.
endmodule. " validate INPUT
‎2006 Oct 05 9:22 AM
hi Narendra,
A table control is used in module pool programming to display the items. Using this you can create new item, change the existing items, delete the item, and if the item list is long you can check the values by scrolling up and down. It is mainly used to display the item level values like purchasing document item for any header data like purchase document header itself. You can see all the data in your item internal table and if it is more than you can easily scroll also.
Examples.
Check out the program
demo_dynpro_tabcont_loop - demo example with scrolling.
demo_dynpro_tabcont_loop_at- demo example with table control modification
Hope this helps.
Regards,
Richa