Skip to Content

Modify table control in the PBO of the screen.

Hi all,

i have an table control in the screen which is input enabled when displayed.

my req :

for some condition the table control should be input disabled when the screen is displayed.

I tried by modifying the table control in the PBO.... but it is not affected when the screen is displayed . Only after some action on the table control my code is been affected .

Please help me..

---Patil

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jun 29, 2007 at 09:08 AM

    HI.

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 29, 2007 at 08:59 AM

    You can try this: define the table fields as input disabled in the screen.

    Then try to change the field characteristic to 'inpurt enabled' depending on your requirement, in PBO of the screen. For this you have to use loop at screen/endloop syntax.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 29, 2007 at 09:03 AM

    Hi santhosh

    Create one new module in PBO Module.There give code like this.Give proper screen name, screen name is important,so before doing check in layout about screen name.

    do coding like this.

    LOOP AT SCREEN.

    IF SCREEN-NAME = 'ZRFQ-ANFNR' OR SCREEN-NAME = 'ZRFQ-LIFNR' OR

    SCREEN-NAME = 'ZRFQ-ASART' OR SCREEN-NAME = 'ZRFQ-ANFDT'.

    SCREEN-INPUT = 0.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    if its useful dont forget to give points

    thanks

    senthil

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 29, 2007 at 09:04 AM

    Hi,

    In the PBO write one module to modify screen.

    and code will go like,

    loop at screen.

    if screen-name = <field name>

    screen-input = 0/1.

    endif.

    endloop.

    Reward if useful!

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.