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 - Selective cell input

Former Member
0 Likes
1,143

Hi all,

I am stuck with a problem with the table control. I want to change the Input attribute for a particular cell only and not for the entire column. An example is when creating a new Z table, we can click on "Data Element/Direct Type' button to enable/disable certain cells in different columns instead of the entire column.

So while the 1st row may have the Data Element cell ready for input and others as disabled, the other rows will have that column disabled and columns "Data Type", "Length" and "Dec. Pl." columns ready for input.

I've tried looping through the table control's int. table upto a desired row and then changing the INPUT attribute within the LOOP AT SCREEN loop, but to no avail. It affects the entire column. Plz help.

Regards,

Madhur

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,097

Hi Madhur,

Give me answers for some ques. for more clarification.

U want only one cell disable from the whole column, right?

In loop at screen r u using index with attribute name?

Means if yr column name is emp_name then, r u disable column emp_name or emp_name(3), where index three specifies column field in third row. I think it will help u.

8 REPLIES 8
Read only

Former Member
0 Likes
1,098

Hi Madhur,

Give me answers for some ques. for more clarification.

U want only one cell disable from the whole column, right?

In loop at screen r u using index with attribute name?

Means if yr column name is emp_name then, r u disable column emp_name or emp_name(3), where index three specifies column field in third row. I think it will help u.

Read only

0 Likes
1,097

Hi Bhavik,

Thanks for your inputs. You have understood my requirements perfectly. I am using the following code to change the INPUT attribute:

LOOP AT SCREEN.

IF SCREEN-NAME = 'IT_ORGAS-EMPLCODE'.

LOOP AT IT_ORGAS.

IF IT_ORGAS-SEL_COL = 'X'.

SCREEN-INPUT = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

ENDLOOP.

where,

a) IT_ORGAS is the internal table used by the Table control,

b) IT_ORGAS-SEL_COL is the name of the w/SelColumn parameter of the table.

Since the changes to the table control are made using the structure SCREEN that contains all atrributes of the table, there is no way that i can specify the name of the column directly along with the index.

In case, you have another way of referring the columns' attributes, please let me know.

Read only

0 Likes
1,097

You will need to LOOP AT SCREEN for each line of your table.

In PBO logic you should have:

PROCESS BEFORE OUTPUT.
MODULE SET_ATTRIB.
  LOOP AT itab INTO wa_itab WITH CONTROL my_control.
ENDMODULE.

MODULE SET_ATTRIB.
  LOOP AT SCREEN.
    IF ...
      SCREEN-INPUT = 1.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.
ENDMODULE.

This allows you to set the screen attributes one row at a time, i.e row oriented instead of column oriented.

Let us know how it goes.

Read only

0 Likes
1,097

Hey Charles,

Thanks a lot man. Its simple logic, but did'nt strike me. Great going man! Really appreciate it. It really did solve the problem in one go.

Take care,

Madhur

Read only

Former Member
0 Likes
1,097

Hi Madhur,

I am also facing the same problem which you were. You are saying that your problem is solved but my problem is still unsolved. can you please tell me in detail about this ?

I did it but it applied for whole column and not for cell.

Regards,

Sharad

Read only

0 Likes
1,097

Hi, Sharad

In PBO you just add following lines,with assumption that you have table contol which all columns and disable & you want to enable only 3 column's some perticular field.

LOOP AT itab WITH CONTROL my_control.

MODULE Loop_Screen.

ENDLOOP.

-


MODULE Loop_Screen OUTPUT.

LOOP AT SCREEN.

IF my_control-current_line = 3 .

IF SCREEN-NAME = 'itab-fieldName' .

SCREEN-INPUT = 1.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

ENDMODULE.

Read only

0 Likes
1,097

Hey Sunil,

Thanks a lot. Really appreciate it.

It really did solve my problem.

Regards,

Sharad

Read only

0 Likes
1,097

Hey Sharad,

Its great that Sunil managed to solve your problem. The logic really is simple. Its just that the Modify Screen is to be called from inside the loop. Then it applies only to the row that is being procesed currently

Thanks Sunil

Regards,

Madhur