Application Development 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: 

Table Control

Former Member
0 Kudos

Hi ,

Can somebody gimme the links to know more about table control.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

Check out these demo programs

RSDEMO_TABLE_CONTROL

DEMO_DYNPRO_TABLE_CONTROL_1

DEMO_DYNPRO_TABLE_CONTROL_2

Check

http://www.sap-img.com/ab031.htm

through this link

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

table control scrolling:

dyanamic tc:

https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/t...

also take a look at the FM

take a look at FM:

FREE_SELECTIONS_INIT

FREE_SELECTIONS_DIALOG

5 REPLIES 5

Former Member

Former Member
0 Kudos

check these links

http://www.geekinterview.com/Interview-Questions/SAP-R-3

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

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

reward if usefull .

Former Member
0 Kudos

hi,

Check out these demo programs

RSDEMO_TABLE_CONTROL

DEMO_DYNPRO_TABLE_CONTROL_1

DEMO_DYNPRO_TABLE_CONTROL_2

Check

http://www.sap-img.com/ab031.htm

through this link

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

table control scrolling:

dyanamic tc:

https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/t...

also take a look at the FM

take a look at FM:

FREE_SELECTIONS_INIT

FREE_SELECTIONS_DIALOG

Former Member
0 Kudos

Hi,

check this program.

PROGRAM ZBHTCTRL.

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

<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.

rgds,

bharat.

Former Member
0 Kudos

HI,

refer this link.

https://www.sdn.sap.com/irj/sdn/advancedsearch?query=table%20control&cat=sdn_all

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).

Reward all helpfull answers.

Regards.

Jay