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

Table Control allows input on all cells upon initial display

Former Member
0 Likes
674

I have a table control that I don't want the users to be allowed to input into until they insert a line first. Whether I preload the table or have it initialized (nothing in the internal table) it always shows all rows as inputable. Yet when I hit insert the first time, the correct number of rows show.

Example:

Initial display: 4 rows allow input yet table is empty. I want none.

Insert clicked once: 1 row allows input. This is correct.

preloaded table: 1 record.

Initial display: 1 record displayed. 4 rows allow input. There should be 1 (The displayed row)

Insert clicked once: 2 rows allow input, including the original displayed row. This is correct.

I'd rather not have to "loop at <TC>-COLS" and change them all to no-input. What am I missing on the control that says "There are no current lines to be inputted." ?

4 REPLIES 4
Read only

Former Member
0 Likes
636

Hi Robert,

Inside the loop in PBO, create one module and check for the work area.

If the work area is inital. use the statement EXIT FROM STEP LOOP.

Regards,

Jeevan

Read only

Former Member
0 Likes
636

Hi,

I think that you are using Table control with wizard.

In your case, you have to go to the form tc_9000_user_command and customize the code

you have to loop at screen and initially you have to disable the inputing

like screen-input = 0.

This code should be executed only once when you start your program. Like that set a flag variable also.

There is no other way.

Within that tc_9000_user_command form you will have user_ok_tc form. There you have to customize your code.

Thanks and regards,

Venkat.

Read only

Former Member
0 Likes
636

Hi,

If I have not understood you wrong, you can implement the ADD functionality. In the ADD functionality, you can have just one row or no rows that are inputtable when you see your table control. You will have to initialize the table control lines in the PBO like this.



  if gt_itab[] is INITIAL.
  TABCONTROL2-lines = 1. "This will set the number of input lines in the table control to be 1. 
 endif.                                  " So you will have just one row to be input. The rest will be greyed out

On clicking the ADD functionality, make the second row to be input. So whenever the user has to input some data, he/she needs to be clicking on this ADD button. Wrte the code in the PAI when the SY-UCOMM is 'F_ADD'.



if SY-UCOMM eq F_'ADD'. 
    tabcontrol-lines = tabcontrol-lines + 1.
endif.

Read only

Former Member
0 Likes
636

Hi,

Robert Catlin

Try This,

In PBO.

Describe Table itab lines ln.

Tc-lines = ln.

IF table doesn't have any record table control rows will be closed.

If it has some rows the same no of rows will be open.