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 enable and disable rows

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor
0 Kudos

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.

6 REPLIES 6

Former Member
0 Kudos

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

0 Kudos

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

kesavadas_thekkillath
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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.

0 Kudos

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

kzak
Explorer
0 Kudos

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.