07-28-2007 11:48 AM
hi gurus
i have madwe table control
but when i am activating the same its showing this error
table control <table control name>is not define
please help me with the same
as sson as possible
thanks in advance
anuj
07-28-2007 12:03 PM
see example program in sap
transcation code abapdocu.
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbac1d35c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_sm32/helpdata/en/d1/801bdf454211d189710000e8322d00/content.htm
ABAP/4 table control
Basic form
CONTROLS ctrl TYPE TABLEVIEW USING SCREEN scr.
Effect
Creates a table control ctrl of the type TABLEVIEW . The reference screen for the initialization is the screen scr .
Area of use
The table control (referred to here as TC ) facilitates the display and entry of one-line, tabular data in dialog transactions.
The functional scope has been defined so that you can implement many typical set operations usually handled by an elementary STEP-LOOP with the standard methods of a TC .
Functional scope
Resizeable table grid for displaying and editing data.
Column width and column position modifiable by user and by program.
Storing and loading of user-specific column layout.
Selection column for line selection with color selection display.
Variable column headers as pushbuttons for column selection.
Simple selection, multiple selection, Select/deselect all.
Scrolling functions (horizontal and vertical) via scroll bar.
Fixing of any number of key columns.
Setting attributes for each cell at runtime.
Programming
The data exchange between the application and the SAPgui is achieved with a STEP-LOOP , i.e. an ABAP/4 module is called to transfer data for each page.
Example
Processing without an internal table
PROCESS BEFORE OUTPUT.
LOOP WITH CONTROL ctrl.
MODULE ctrl_pbo.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP WITH CONTROL ctrl.
MODULE ctrl_pai.
ENDLOOP.
In this case, the module ctrl_pbo OUTPUT is called once for each output line before the screen is displayed, in order to fill the output fields.
After the user has entered data on the screen, the module ctrl_pai INPUT is executed to check the input and copy the new contents.
Example
Processing with an internal table
PROCESS BEFORE OUTPUT.
LOOP AT itab WITH CONTROL ctrl CURSOR ctrl-CURRENT_LINE.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT itab WITH CONTROL ctrl.
MODULE ctrl_pai.
ENDLOOP.
Here, the system fills the output fields before displaying the screen by reading the internal table itab .
When the user has entered data, the module ctrl_pai INPUT must be executed to check the input and to refresh the contents of the internal table.
Vertical scrolling with the scroll bar is followed by the event PAI for the displayed page. Then, cntl-TOP_LINE is increased and PBO is processed for the next page.
Program-driven scrolling and the most of the functionality described above is achieved by manipulating the control attributes.
Attributes
The CONTROLS statement creates a complex data object of the type CXTAB_CONTROL with the name of the control.
You maintain the initial values in the Screen Painter and assign the screen with the initial values for a control using the addition USING SCREEN .
Initialization is achieved automatically in the "1st access to the control" (setting or reading values).
You can use the customizing button (in the top right corner) to save the current setting (column widths and column positions) and use it as the initial value for the next call.
All the initial values can be overwritten by the program using the MOVE ... TO TC attributes statement.
Example
ctrl-fixed_cols = 2. "2 columns fixed
The contents of the SCREEN structure (table Cols ) acts as a default value for each line of this column, but within LOOP ... ENDLOOP (flow logic), it can be overwritten by LOOP AT SCREEN / MODIFY SCREEN .
With the attributes listed below, you should be aware of the following:
LINES This must always be set as the only attribute if you are not using LOOP AT itab .
TOP_LINE Also set by the SAPgui through the vertical scroll bar slider.
CURRENT_LINE Read only, set by the system ( TOP_LINE + SY-STEPL - 1 )
LEFT_COL Also set by the SAPgui through the horizontal scroll bar slider.
COLS-INDEX Also set by the SAPgui after moving columns.
COLS-SELECTED Also set by the SAPgui after column selection.
When displaying the control, the system uses the current contents when the event DCO occurs (i.e. after all PBO modules have run). The modified values (brought about by the user making changes on the screen) are set immediately after DCI (i.e. before the first PAI module runs).
07-28-2007 12:19 PM
hi Karthikeyan,
thanks for fast response
i please provide me what should i do
with the following code to make it activate
plz check the code
DATA: BEGIN OF itab OCCURS 0,
sel TYPE s_flag,
matnr TYPE matnr,
ersda TYPE ersda,
ernam TYPE ernam,
END OF itab.
*CONTROLS: tab_cntl TYPE TABLEVIEW USING SCREEN 100.
CONTROLS: tab_cntl TYPE TABLEVIEW USING SCREEN 100.
*START-OF-SELECTION.
CALL SCREEN 100.
*END-OF-SELECTION.
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
MODULE status_0100 OUTPUT.
SET PF-STATUS 'TABCNTL'. "pf status
SET TITLEBAR 'xxx'.
SET PF-STATUS 'ZSTATUS'. "pf status
CASE sy-ucomm.
WHEN 'BACK' OR
'CANCEL' OR
'EXIT'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " STATUS_0100 OUTPUT
&----
*& Module ITAB_MODIFY INPUT
&----
text
----
MODULE itab_modify INPUT.
CASE sy-ucomm .
WHEN ' '. " When pressed enter
if itab-sel = 'X'.
MODIFY itab INDEX tab_cntl-current_line.
APPEND itab. " append lines to internal table
CLEAR itab.
*endif.
ENDCASE.
ENDMODULE. " ITAB_MODIFY INPUT
*Screen 100 flow logic.
**PROCESS BEFORE OUTPUT.
MODULE status_0100.
LOOP AT itab WITH CONTROL tab_cntl CURSOR
tab_cntl-current_line..
**
ENDLOOP.
**
**PROCESS AFTER INPUT.
MODULE select_data.
LOOP .
CHAIN.
FIELD itab-matnr.
FIELD itab-ersda.
FIELD itab-ernam.
MODULE itab_modify ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
MODULE USER_COMMAND_0100.
please reply as soon as possible
point ll be surely awarded
07-28-2007 1:31 PM
Hi,
1.First please check your table control name defined in the Screen Painter SE51 for that program is same as you are defining in CONTROLS statement.
Check screen name is correct.
2. Also Check where exactly it is showing error.
Reward if useful!
07-28-2007 1:59 PM
Hi
Table control syntax is
CONTROLS: <TABLE NAME> TYPE TABLEVIEW USING SCREEN '<SCREEN NUMBER>'.
THANKS & REGARDS,
S.SURESH.
REWARD IF USEFUL..........
04-01-2013 5:38 PM
I'm sure you found this answer in the last six years. But for the record:
Make sure the TC in the screen element list is the same as the TC you defined in your program's data definitions.
06-07-2023 8:26 AM
Go To the Screen and Select the Layout
Now Select the table control and check the name, it should match with the declaration of the table control.
Here, i have defined the TC as the table control in the TOP INLCUDE of the program as
CONTROLS: tc TYPE TABLEVIEW USING SCREEN '0100'.
06-07-2023 9:45 AM
It is really interesting you could still have interest in replying to a post made 15+ years ago.