Skip to Content
author's profile photo Former Member
Former Member

Table control enable and disable rows

Hi,

I want to keep the table control in disabled mode initially.

When user press the add button,the row next to where data is already present should alone be enabled for data entry.

In PBO event i was able to disable the entire table control.but when i could not find a way to identify the first blank line to enable it for data entry.

Please help.

Thanks

Ambily

Add comment
10|10000 characters needed characters exceeded

4 Answers

  • Best Answer
    Posted on Sep 16, 2010 at 04:52 PM

    When ever user presses the add button, Append a initial line to the internal table. Then use the below logic.

    In PAI

    When 'ADD'.

    Append Initial line to it.

    In PBO

    LOOP AT IT INTO WA WITH CONTROL TBCTRL.
    module Disable.
    ENDLOOP.
    
    MODULE DISABLE.
    Check it[] is not initial."To restrict enabling of TBCTRL rows Initially in the first run
    IF WA IS INITIAL." Where ever a initial line is found it enables
    LOOP AT SCREEN.
    SCREEN-INPUT = 1.
    MODIFY SCREEN.
    ENDLOOP.
    else.                     "It disables
    LOOP AT SCREEN.
    SCREEN-INPUT = 0.
    MODIFY SCREEN.
    ENDLOOP.
    endif.
    

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 21, 2010 at 06:40 AM

    This is a general way to make a particular field to be available to enter data.

    I have created a group for the text field,and when that label is clicked only the corresponding text box is enabled gor input.

    LOOP AT SCREEN.

    IF UCOMM = 'APPEAR' AND SCREEN-GROUP1 = 'groupname'.

    SCREEN-ACTIVE = 1. SCREEN-INPUT = 1.

    MODIFY SCREEN.

    ELSEIF UCOMM = 'DISAPPEAR' AND SCREEN-GROUP1 = 'groupname'.

    SCREEN-ACTIVE = 0. SCREEN-INPUT = 0.

    MODIFY SCREEN.

    ENDIF.

    ENDLOOP.

    Hope this helps your need.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      I solved the problem.

      In PBO i used the loop at screen to enable adn disable the input based on flag set in PAI.

      Thanks for all the answers.

      Thanks

      Ambily

  • author's profile photo Former Member
    Former Member
    Posted on Sep 16, 2010 at 02:18 PM

    Hi Ambily,

    follow the below steps

    declare a data : w_flag type c. in the global

    and next write the code the PBO

    PROCESS BEFORE OUTPUT.
    * Module screen GUI-Screen&Status and Screen Logic
      MODULE status_<Screennum>.
    
    * Table control for OUTPUT
      LOOP AT <table-control> .
        MODULE Modify_screen.
      ENDLOOP.
    
    
    Module modify_screen output.
    * Table control reading values from input screen & displaying on screen
      READ TABLE <table>   INDEX <tablecontrol>-current_line.
    
     If w_flag is initial.
        LOOP AT SCREEN.
          IF screen-name = <Tablecontrol Line>.
            screen-input = 0.
          ENDIF.
          MODIFY SCREEN.
        ENDLOOP.
      ENDIF.
    wndif.
    Endmodule.
    "next in PAI mark the w_flag to 'X'
    

    Prabhudas

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi,

      This only enables the rows which have data.

      My requirement is bit different.

      For eg: my table control have initially 3 rows.When the user press add button, the 4th row alone should be enabled for data entry.

      Please help to do this enabling of specific row.

      Thanks

      Ambily

      Edited by: Ambily R on Sep 16, 2010 5:28 PM

  • Posted on Feb 19 at 06:53 PM

    You can do it using statement LOOP AT spfli_tab INTO spfli WITH CONTROL flight_tab.

    example:

    PROCESS BEFORE OUTPUT.
    MODULE prepare_tab.
    LOOP AT spfli_tab INTO spfli WITH CONTROL flight_tab.

    module disable_row. " you can write your logic inside module disable_row with statements loop at screen and screen-input = 0.

    ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP AT spfli_tab.
    MODULE modify_tab.
    ENDLOOP.

    Add comment
    10|10000 characters needed characters exceeded