Application Development and Automation 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: 
Read only

about table control

Former Member
0 Likes
613

hi experts,

Please tell me the use of table control and i can work on it.

Thanks, Pont sure

Anshu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
582

Hi,

<b>Table Control</b> is used in Module Pool Programming.

Table Control is used to display data of any internal table of ur program or the data from dictionary table directly ino a table format.

Using table control with the help of screen painter, data can be easily displayed.

It can be created manually through coding or using Table Control Wizard given in the sreen painter.

PROGRAM ZTABLECON.

TABLES: LFA1, EKKO.

DATA: OKCODE1 LIKE SY-UCOMM,

OKCODE2 LIKE SY-UCOMM.

CONTROLS TABC TYPE TABLEVIEW USING SCREEN 1001.

DATA: BEGIN OF ITAB OCCURS 0,

MANDT LIKE EKKO-MANDT,

EBELN LIKE EKKO-EBELN,

BSTYP LIKE EKKO-BSTYP,

BSART LIKE EKKO-BSART,

END OF ITAB.

MODULE USER_COMMAND_1000 INPUT.

CASE OKCODE1.

WHEN 'BACK'.

SET SCREEN 0.

WHEN 'NEXT'.

SET SCREEN 1001.

SELECT * FROM EKKO INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE

LIFNR = LFA1-LIFNR.

ENDCASE.

ENDMODULE. " USER_COMMAND_1001 INPUT

MODULE MOVE_DATA OUTPUT.

EKKO-MANDT = ITAB-MANDT.

EKKO-EBELN = ITAB-EBELN.

EKKO-BSTYP = ITAB-BSTYP.

EKKO-BSART = ITAB-BSART.

ENDMODULE. " MOVE_DATA OUTPUT

MODULE USER_COMMAND_1001 INPUT.

CASE OKCODE2.

WHEN 'BACK'.

SET SCREEN 1000.

ENDCASE.

ENDMODULE. " USER_COMMAND_1001 OUTPUT

MODULE STATUS_1001 OUTPUT.

SET PF-STATUS 'MENU'.

SET TITLEBAR 'TIT'.

ENDMODULE. " STATUS_1001 OUTPUT

MODULE STATUS_1000 OUTPUT.

SET PF-STATUS 'DMENU'.

  • SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_1000 OUTPUT

FORM ON_CTMENU_FORM1 USING CMENU TYPE REF TO CL_CTMENU.

CALL METHOD CMENU->LOAD_GUI_STATUS

EXPORTING

PROGRAM = ' ZBHTCTRL'

STATUS = 'CMENU'

MENU = CMENU.

CALL METHOD CMENU->ADD_FUNCTION

EXPORTING

FCODE = 'RX'

TEXT = 'RECIEVE'.

ENDFORM.

<b>FLOW LOGIC:</b>

PROCESS BEFORE OUTPUT.

MODULE STATUS_1000.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1000.

PROCESS BEFORE OUTPUT.

MODULE STATUS_1001.

LOOP AT ITAB WITH CONTROL TABC CURSOR TABC-TOP_LINE.

MODULE MOVE_DATA.

ENDLOOP.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1001.

LOOP AT ITAB.

ENDLOOP.

Useful Sites

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_45b/helpdata/en/d1/801bdf454211d189710000e8322d00/content.htm

http://www.sapmaterial.com/tablecontrol_sap.html

<b>REWARD POINTS IF USEFUL</b>

Regards

Gokul

4 REPLIES 4
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
582

Hi,

<b>Table Controls</b>

Table Controls are labeled screen elements to display and process table-type data on dynpros. In a table control, a maximum of 255 screen elements is summarized in a table control row, which can be repeated multiple times within the table control on the screen. The fields of a row have to be created only once as dynpro fields in the dynpro and as global data objects in the ABAP program. Table controls provide an area on the screen for editing the displayed table control rows which offers column headers, marking of rows and columns, horizontal and vertical scrolling with scroll bars, the definition of lead columns and saving of the current settings (see DEMO_DYNPRO). Parts of the user actions in table controls are processed on the presentation server. Vertical scrolling, saving of settings, and changes of screen size (if the resizing properties have been set accordingly when defining the table controls) trigger the event PAI.

A column of the table controls can be defined as marking column , in which the screen element is displayed like a pushbutton and treated like a checkbox (see the first column of the table control in DEMO_DYNPRO). A checked selection key sets the content of the assigned dynpro-field to "X", an unchecked key sets the content to " ". The state of the selection key is transported at the event PAI to a data object of the same name in the ABAP-program and at PBO, you can set the marker via the content of the data object.

Table Controls encapsulate step loops and make their independent use obsolete. The processing of table controls in the dynpro flow logic accordingly bases on the step loop technique using the statement LOOP. In contrary to the processing of independent step loops, the loops of the dynpro flow logic are linked with the addition WITH CONTROL with the table controls of the dynpros during the processing of table controls.

In the ABAP-program, table controls must be declared with the statement CONTROLS, whereat a special structure for handling of table controls is created.

Check this link for more

http://help.sap.com/saphelp_46c/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/frameset.htm

Regards,

Sesh

Read only

Former Member
0 Likes
583

Hi,

<b>Table Control</b> is used in Module Pool Programming.

Table Control is used to display data of any internal table of ur program or the data from dictionary table directly ino a table format.

Using table control with the help of screen painter, data can be easily displayed.

It can be created manually through coding or using Table Control Wizard given in the sreen painter.

PROGRAM ZTABLECON.

TABLES: LFA1, EKKO.

DATA: OKCODE1 LIKE SY-UCOMM,

OKCODE2 LIKE SY-UCOMM.

CONTROLS TABC TYPE TABLEVIEW USING SCREEN 1001.

DATA: BEGIN OF ITAB OCCURS 0,

MANDT LIKE EKKO-MANDT,

EBELN LIKE EKKO-EBELN,

BSTYP LIKE EKKO-BSTYP,

BSART LIKE EKKO-BSART,

END OF ITAB.

MODULE USER_COMMAND_1000 INPUT.

CASE OKCODE1.

WHEN 'BACK'.

SET SCREEN 0.

WHEN 'NEXT'.

SET SCREEN 1001.

SELECT * FROM EKKO INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE

LIFNR = LFA1-LIFNR.

ENDCASE.

ENDMODULE. " USER_COMMAND_1001 INPUT

MODULE MOVE_DATA OUTPUT.

EKKO-MANDT = ITAB-MANDT.

EKKO-EBELN = ITAB-EBELN.

EKKO-BSTYP = ITAB-BSTYP.

EKKO-BSART = ITAB-BSART.

ENDMODULE. " MOVE_DATA OUTPUT

MODULE USER_COMMAND_1001 INPUT.

CASE OKCODE2.

WHEN 'BACK'.

SET SCREEN 1000.

ENDCASE.

ENDMODULE. " USER_COMMAND_1001 OUTPUT

MODULE STATUS_1001 OUTPUT.

SET PF-STATUS 'MENU'.

SET TITLEBAR 'TIT'.

ENDMODULE. " STATUS_1001 OUTPUT

MODULE STATUS_1000 OUTPUT.

SET PF-STATUS 'DMENU'.

  • SET TITLEBAR 'xxx'.

ENDMODULE. " STATUS_1000 OUTPUT

FORM ON_CTMENU_FORM1 USING CMENU TYPE REF TO CL_CTMENU.

CALL METHOD CMENU->LOAD_GUI_STATUS

EXPORTING

PROGRAM = ' ZBHTCTRL'

STATUS = 'CMENU'

MENU = CMENU.

CALL METHOD CMENU->ADD_FUNCTION

EXPORTING

FCODE = 'RX'

TEXT = 'RECIEVE'.

ENDFORM.

<b>FLOW LOGIC:</b>

PROCESS BEFORE OUTPUT.

MODULE STATUS_1000.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1000.

PROCESS BEFORE OUTPUT.

MODULE STATUS_1001.

LOOP AT ITAB WITH CONTROL TABC CURSOR TABC-TOP_LINE.

MODULE MOVE_DATA.

ENDLOOP.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1001.

LOOP AT ITAB.

ENDLOOP.

Useful Sites

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_45b/helpdata/en/d1/801bdf454211d189710000e8322d00/content.htm

http://www.sapmaterial.com/tablecontrol_sap.html

<b>REWARD POINTS IF USEFUL</b>

Regards

Gokul

Read only

Former Member
0 Likes
582

hi Anshu,

Table Control is an area on the (user) screen where the system displays data in a tabular form. It will be processed using a loop.

its used to display data in a GRID format. and u can perform the following operations-- Insertion, deletion, modification & updation of records.

u can sort the data and u can change the settings also.

table control is created using screen painter & has to be declared as follows.

CONTROLS <table control name> TYPE TABLEVIEW USING SCREEN

<screen no>.

check the following sample programs :(version ECC 6.0 )

1. SAPBC410TABD_A_FUNCTIONS

2. SAPMBC410ATABS_TABLE_CONTROL1

3. SAPMBC410ATABS_TABLE_CONTROL2

4. SAPMBC410ATABS_TABLE_CONTROL3

thanks

Read only

Former Member
0 Likes
582

Hello,

Table control is a complex screen programming element

You can consider it as a table in which operations like insert , delete operations to or from an object can be programmed

The main advantages include interacting with multiple records in the same window

Please check the following link for details on

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/content.htm

1)What a table control is?

2)Table controls offer users the functions

3)Table Controls on the Screen

4)Table Controls in the Flow Logic

5)Table Controls in ABAP Programs

6)Table Controls: Examples with Scrolling

7)Table Controls: Examples with Modifications

Appendix: The Step Loop Technique

For more examples...in SAP itself

Run t-code : ABAPDOCU

go to BC ABAP Programming -> ABAP USER DIALOGS ->SCreens -> Complex screen elements ->

1) table control with scrolling (REPORT demo_dynpro_tabcont_loop.)

2) Table control with modifications(REPORT demo_dynpro_tabcont_loop_at.)

Once you understand the coding...try to create your own program and learn more

Hope it was useful

Reward all helpful answers and close thread if it suits ur requirement

Regards

Byju