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: 

Disabling and Enabling the table control lines

Former Member
0 Kudos

Hi all,

Iam having the scenario where in whenever we fetch the data into a table control from another tablecontrol or internal table, the lines of data occupied by target tablecontrol should be in disabled mode ( i.e, output only mode).

Whenever user enters data manually in the lines of table control, those lines should be in the enabled mode ( so that those can be editable further).

Approach :

Initially I made the table control fields as output only. Whenever enduser clicks a pushbutton, iam adding two more lines to the table control for manual entry.

But it is not working. Whenever enduser clicks button it should add two lines and these lines should be in the enabled mode. Please give me some idea of how to set the added lines in enabled mode programmatically.

Thanks in advance

Regards

Murali Krishna Tatoju

10 REPLIES 10

Former Member
0 Kudos

Hi,

You want to eneable the newly added rows:

so in PAI module

make the table control new lines as editable by using tablecontrol->currentline

loop at screen

if tabctrl->currentline = ''.

field1-name = ''.

field1-input = 1.

modify screen.

repeat the above code for each of the input fields within the table control

0 Kudos

Hi,

When i use field1-input, it is giving error saying field1 is not the structure. So, I have used itab-field1-input. Still it is unable to recognize the command input. it is saying -- " itab structure does not have field "field1-input".

Murali

0 Kudos

Hi,

Hey sorry my mistake

It should be screen-name = field1

0 Kudos

Hi Radhika,

when i use this code

loop at screen.

screen-input = 0.

endloop.

in the same screen Iam having some screen fields and one table control.

it is disabling the screen fields but not the tablecontrol fields. so please consider this.

Initially iam setting the tablecontrol fields as input-enabled through layout ( this means tablecontrol fields are enabled).

after fetching the data into the tablecontrol, i want to disable the tablecontrol fields ( up to the data stored ).

please tell me how to disable the table control fields.

thanks

regards

Murali

0 Kudos

Hi,

For disabling the field

write:

screen-active = 0.

former_member217544
Active Contributor
0 Kudos

Hi Murail,

May we know what is the problem you are facing now, as it is already answered in your last thread?

Regards,

Swarna Munukoti

0 Kudos

Hi Swarna,

I want to know how to make the table control lines enabled via programmatically.

Former Member
0 Kudos

Hi Murali,

I think if ur query is like if the datafrom the table has some N lines then these N lines should be in disable mode and if the user made a new entry then it is in enable mode.

So,

1 Case.

DESCRIBE TABLE ITAB LINES line.

then PBO.

in

LOOP WITH CONTROL tabc.

MODULE dis_tab.

ENDLOOP.

MODULE DIS_TAB.

if tabc-current_line not gt line.

loop at screen.

if screen-name = 'DB/ITTABLE'.

screen-input = 0.

modify screen.

endloop.

else.

loop at screen.

if screen-name = 'DB/IT table'.

screen-input = 1.

modify screen.

endloop.

endif.

endmodule.

-Anmol

0 Kudos

Hi Anmol,

Thanks for your views. I have used the code suggested by you.


if not tbc1000-current_line gt line.
    LOOP AT SCREEN.
      IF screen-name = 'xekpo3'.
        screen-input = '0'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSE.
    LOOP AT SCREEN.
      IF screen-name = 'xekpo3'.
        screen-input = '1'.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
endif.

But it is not working.

thanks,

Murali

Former Member
0 Kudos

Hi Murali,

Try this code,

DATA: wa_cols TYPE cxtab_column.

loop at TC_RATE_CARD-cols into wa_cols. "TC_RATE_CARD - Name of the Table Control.

wa_cols-SCREEN-INPUT = 0.

modify TC_RATE_CARD-cols from wa_cols.

endloop.

ENDIF.

additionally for your requirement to enable new rows use this code,

PROCESS BEFORE OUTPUT.

LOOP AT itab WITH CONTROL tc.

MODULE modify_screen.

ENDLOOP.

MODULE STATUS_0100.

MODULE modify_screen OUTPUT.

row_count = row_count + 1.

LOOP AT SCREEN.

if row_count = 2. " For the 2nd row in the table control

screen-input = 1.

MODIFY SCREEN .

endif.

ENDLOOP.

Hope it helps you,

Regards,

Abhijit G. Borkar