6 abap _ table controls

Upload: raza887

Post on 03-Apr-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/29/2019 6 ABAP _ Table Controls

    1/4

    3/18/13 ABAP | Table Controls

    www.saptraininghub.com/abap-table-controls/

    Sap Training Hub

    Free SAP Training & Tutorials

    What is SAP?

    ABAP

    HR

    FICO

    SD

    Video

    Payroll

    Quiz

    Java

    Testing

    Answers

    ABAP | Table Controls

    Table controls and step loops are objects for screen table display that you add to a screen in the Screen Painter.

    From a programming standpoint, table controls and step loops are almost exactly the same. Table controls are simply

    improved step loops that display data with the look and feel associated with tables in desktop applications.

    With table controls, the user can:

    Scroll through the table vertically and horizontally

    Re-size the width of a column

    Scroll within a field (when field contents are wider than the field)

    Select table rows or columns

    Re-order the sequence of columns

    DB2/UDB DBA training

    www.db2team.com

    Learn to be a DBA online Learn from theexperts

    http://www.saptraininghub.com/http://www.google.com/url?ct=abg&q=https://www.google.com/adsense/support/bin/request.py%3Fcontact%3Dabg_afc%26url%3Dhttp://www.saptraininghub.com/abap-table-controls/%26gl%3DPK%26hl%3Den%26client%3Dca-pub-6330153051175486%26ai0%3DC6AOllppGUefnDoXCigbA2YHwB7-tz4gDr-aJu0fAjbcBEAEgm8zvI1CPhpHs-_____8BYMsEyAEBqAMByAPTBKoEhgFP0OIu99qwePqvHog0VI8pfAmgvqixkrqY5xUy_IaZ-CjJQFJWYSW_6tThRLEeBvAXcNytEmjzPn75px_oY1e1-k_M966-R5oAQ9Y-dF-HAYpwU2s0rWO-oSXr5kBnfkQA9X8q9bigkAJLsxxstjE_Ks70uJlK_njEKkpTRv0rTpzF0Pry7IAH99mZKQ&usg=AFQjCNFCJ9EsHYf6li3dXWN_Z1NscHBfrAhttp://googleads.g.doubleclick.net/aclk?sa=L&ai=C6AOllppGUefnDoXCigbA2YHwB7-tz4gDr-aJu0fAjbcBEAEgm8zvI1CPhpHs-_____8BYMsEyAEBqAMByAPTBKoEhgFP0OIu99qwePqvHog0VI8pfAmgvqixkrqY5xUy_IaZ-CjJQFJWYSW_6tThRLEeBvAXcNytEmjzPn75px_oY1e1-k_M966-R5oAQ9Y-dF-HAYpwU2s0rWO-oSXr5kBnfkQA9X8q9bigkAJLsxxstjE_Ks70uJlK_njEKkpTRv0rTpzF0Pry7IAH99mZKQ&num=1&sig=AOD64_05Zd3yC2L1n1bWJq0g-9zZX4qu_w&client=ca-pub-6330153051175486&adurl=http://www.db2team.comhttp://www.83answers.com/http://www.guru99.com/http://www.javatutorialhub.com/http://www.saptraininghub.com/quiz/http://www.saptraininghub.com/sap-payroll/http://www.saptraininghub.com/sapvideos/http://www.saptraininghub.com/free-sap-sd-training-course/http://www.saptraininghub.com/sap-fico-training-tutorials/http://www.saptraininghub.com/sap-hcm/http://www.saptraininghub.com/abap-tutorial/http://www.saptraininghub.com/what-is-sap/http://feeds.feedburner.com/SapTrainingHubhttp://www.facebook.com/pages/Sap-Training-Hub/139632216092864http://twitter.com/SAPTHubhttp://www.saptraininghub.com/
  • 7/29/2019 6 ABAP _ Table Controls

    2/4

    3/18/13 ABAP | Table Controls

    www.saptraininghub.com/abap-table-controls/

    Save the current display settings for future use

    Table controls also offer special formatting features (some automatic, some optional) that make tables easier to look at

    and use. Table Control provides -

    automatic table resizing (vertical and horizontal) when the user resizes the window

    separator lines between rows and between columns (vertical and horizontal)

    column header fields for all columns

    One feature of step loops is that their table rows can span more than one line on the screen. A row of a table control, on

    the other hand, must always be contained in a single line (although scrolling is possible).

    In general, many of the features provided by the table control are handled locally by your systems SAPgui

    frontend, so you do not need to program them yourself. The only notable exception to this is vertical

    scrolling.

    Example (Transaction TZ60)

    Syntax

    To handle table controls in ABAP programs, you must declare a control in the declaration part of the program for each

    table control using the following statement:

    CONTROLS TYPE TABLEVIEW USING SCREEN

    where is the name of the table control on a screen in the ABAP program. The control allows the ABAP

    program to read the attributes of the table control and to influence the control .Here, is the screen number where

    the initial values of the table are loaded.

    Cursor Position for a table control can be set in following ways:

    At PBO you can set the cursor on a specific field of a specific row of a table control.

    SET CURSOR FIELD LINE [OFFSET ]

    Using the optional additionOFFSET, you can enter the offset of the cursor in the field as described under Setting the

    Cursor Position.

    At PAI you can read the current cursor position.

  • 7/29/2019 6 ABAP _ Table Controls

    3/4

    3/18/13 ABAP | Table Controls

    www.saptraininghub.com/abap-table-controls/

    GET CURSOR FIELD LINE

    In addition to the information given under Finding Out the Cursor Position, field contains information on which

    row of the table control the cursor is currently on. You can also use

    GET CURSOR LINE .

    to determine the row of the table control. SY-SUBRCallows you to check if the cursor is placed in a row of a table

    control.

    For getting the corresponding line of the internal table :

    GET CURSOR line .

    ind = -top_line + 1.

    Read table index ind.

    The system variablestepl- contains the current table line index in a loop endloop. Loopc contains number of lines

    visible in the table

    To create a table control

    1.Add a table control element to your screen

    2.Give a name to the table control. In the ABAP program declare a structure with the same ( CONTROLS type

    TABLEVIEW USING SCREEN )

    3.To create fields go to the Dict./Program fields function.

    Enter the name of the structure whose fields you want. (If you want it to pick it from dictionary of your program

    click the relevant puhbutton).

    In the field list choose the fields you want and choose ok.

    Click in the table control area

    If you want a selection column , check the appropriate check box in the attributes and give it a name. Create the field in

    the ABAP program.

    In the PBO you should have the statement

    LOOP at USING CONTROL .

    ENDLOOP.

    In the PAI you should have.

    LOOP at .

    ENDLOOP.

    It is within the loops that data transfer happens between the screen and the internal table.When you populate the interna

    table use DESCRIBE TABLE LINES -lines, to store the total number of lines in the control.The

  • 7/29/2019 6 ABAP _ Table Controls

    4/4

    3/18/13 ABAP | Table Controls

    www.saptraininghub.com/abap-table-controls/

    FIELD statement can be used to control when the data transfer happens

    To change the attributes of individual cells temporarily change the SCREEN table in the PBO. You can change the

    attributes of the structure created by the CONTROLS statement

    -fixed_cols etc are the attributes of the control

    -cols-index etc are the attributes of the columns.

    -cols-screen-invisible etc are the screen attributes of each column.

    You might like:

    Recommended by

    Share10 Tweet0 Share0 +14 Share471

    On January 24, 2011 / ABAP / Comments Off

    Comments are closed.

    Search

    FAQ

    How to Become SAP Consultant

    How to select the Best SAP Module

    All About Outline

    agreement

    LSMW Data

    Migration - Step by

    Step

    How to become SAP

    consultant

    How To Delete a

    Client

    All About Tax

    Determination

    Procedure in SAP SD

    http://www.saptraininghub.com/all-about-tax-determination-procedure-in-sap-sd/http://www.saptraininghub.com/how-to-delete-a-client/http://www.saptraininghub.com/how-to-become-sap-consultant/http://www.saptraininghub.com/lsmw-data-migration-step-by-step/http://www.saptraininghub.com/all-about-outline-agreement/http://www.saptraininghub.com/all-about-tax-determination-procedure-in-sap-sd/http://www.saptraininghub.com/how-to-delete-a-client/http://www.saptraininghub.com/how-to-become-sap-consultant/http://www.saptraininghub.com/lsmw-data-migration-step-by-step/http://www.saptraininghub.com/all-about-outline-agreement/http://www.saptraininghub.com/best-sap-module/http://www.saptraininghub.com/how-to-become-sap-consultant/http://www.saptraininghub.com/abap/