Application Development and Automation 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: 
Read only

How do I disable input for a table control?

Former Member
0 Likes
6,439

Hi,

How do I disable input for a table control?

I know that to disable a text editor control, I can use the following codes:

CALL METHOD G_EDITOR_V->SET_READONLY_MODE

EXPORTING

READONLY_MODE = CL_GUI_TEXTEDIT=>TRUE.

Are there similar codes for table controls?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,912

Hi,

With the use of step-loop you can restict the input for a given input field.

Just write the code in the PBO event as follows:

PROCESS BEFORE OUTPUT.

MODULE STATUS_0200.

loop at itab with control tc cursor tc-current_line.

field itab-matnr module disable.

endloop.

module disable output.

if sy-stepl <> 1.

loop at screen.

if screen-name = 'ITAB-MATNR'.

screen-input = 0.

modify screen.

endif.

endloop.

endif.

endmodule.

Reward points if useful.

Regards,

Sankar.

Hi,

With the use of step-loop you can restict the input for a given input field.

Just write the code in the PBO event as follows:

PROCESS BEFORE OUTPUT.

MODULE STATUS_0200.

loop at itab with control tc cursor tc-current_line.

field itab-matnr module disable.

endloop.

module disable output.

if sy-stepl <> 1.

loop at screen.

if screen-name = 'ITAB-MATNR'.

screen-input = 0.

modify screen.

endif.

endloop.

endif.

endmodule.

Reward points if useful.

Regards,

Sankar.

7 REPLIES 7
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
2,912

Hi,

For table control to disable input field you need to write you code in PBO module which is called between

LOOP AT itab using CONTROL <tab_cntrl>
MODULE disable_input output.
ENDLOOP.

MODULE disable_output.
LOOP AT SCREEN.
IF SCREEN-NAME = 'COLUMN NAME'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDMODULE.

Regards,

Sesh

Read only

0 Likes
2,912

Hi Sesh Madala,

What is this internal table 'itab' and control '<tab_cntrl>' in your example?

Edited by: Kian Keong on Mar 25, 2008 7:05 PM

Read only

0 Likes
2,912

HI,

For table control you will have LOOP ENDLOOP statements in the Flowlogic of the screen that contains this table control.

You need to put your PBO module between these statements. And do a LOOP at screen in your PBO module.

See this program for sample code RSDEMO_TABLE_CONTROL.

In this program check the flow logic of screen 100.

Regards,

Sesh

Read only

Former Member
0 Likes
2,912

HI

You cannot use it for table control.

for table control

at flow logic of screen

PAI

loop at tabc.

module disable_input.

endloop.

perform disable_input.

tabc-input = 0.

modify tabc index sy-tabix.

Read only

Former Member
0 Likes
2,912

Hi,

On the screen one option is there.

click Attributes--> Click the check box output only.

Regards,

S.Nehru

Read only

Former Member
0 Likes
2,912

hi,

in ur PBO one loop will be there...

make one module disable there.

PROCESS BEFORE OUTPUT.

*&SPWIZARD: PBO FLOW LOGIC FOR TABLECONTROL 'MYTAB1'

MODULE get_data.

MODULE mytab1_change_tc_attr.

LOOP AT mytab

INTO mytab

WITH CONTROL mytab1

CURSOR mytab1-current_line.

MODULE disable.

MODULE mytab1_get_lines.

ENDLOOP.

MODULE disable OUTPUT.

LOOP AT SCREEN.

IF screen-name = 'MYTAB-MATNR'.

screen-input = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDMODULE. " disable OUTPUT

here mytab is my internal table and mytab1 is my table control name...

reward if usefull....

Read only

Former Member
0 Likes
2,913

Hi,

With the use of step-loop you can restict the input for a given input field.

Just write the code in the PBO event as follows:

PROCESS BEFORE OUTPUT.

MODULE STATUS_0200.

loop at itab with control tc cursor tc-current_line.

field itab-matnr module disable.

endloop.

module disable output.

if sy-stepl <> 1.

loop at screen.

if screen-name = 'ITAB-MATNR'.

screen-input = 0.

modify screen.

endif.

endloop.

endif.

endmodule.

Reward points if useful.

Regards,

Sankar.