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

Former Member
0 Likes
754

Hi ,

Can anyone help in disabling rows in Table Control. My actual Requirement is user enters data in first Column and the row is filled accordingly. rest all rows should be greyed out at the same time.

thanks in advance,

anjani.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
644

Can this be static? If so, then in screen painter, double click the column that you want to be greyed out, and check the box for OUTPUT.

Regards,

Rich Heilman

6 REPLIES 6
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
645

Can this be static? If so, then in screen painter, double click the column that you want to be greyed out, and check the box for OUTPUT.

Regards,

Rich Heilman

Read only

0 Likes
644

If this is to be dynamic or done at run-time, then you will need to do a loop at the control.



* Here i_pidetcon is the table control

    loop at i_pidetcon-cols into cols where index gt 0.
        if  cols-screen-name = 'YOUR_FIELD'.
          cols-screen-input = '0'.
      endif.
      modify i_pidetcon-cols from cols index sy-tabix.
    endloop.

Regards,

Rich Heilman

Read only

0 Likes
644

Hi Heilman,

This Solution grey's out all the rows in table control . my problem is if user enters in first and second row . those two rows must be editable and rest should be greyed out. Rowwise should be done.

thanks,

anjani.

Read only

0 Likes
644

Hi Anjani,

You can use t_ctrl-current_line ge 2 to gray all other lines.

DATA : i_makt TYPE STANDARD TABLE OF zzz_makt WITH HEADER LINE.

CONTROLS: t_ctrl TYPE TABLEVIEW USING SCREEN '9000'.

PROCESS BEFORE OUTPUT.

.....

LOOP AT i_makt WITH CONTROL t_ctrl CURSOR t_ctrl-current_line.

  • Dynamic screen modifications

MODULE set_screen_fields.

ENDLOOP.

MODULE set_screen_fields OUTPUT.

LOOP AT SCREEN.

IF ( t_ctrl-current_line LE 2 ) .

  • Making the screen fields as editable

screen-input = 1.

ELSEIF ( t_ctrl-current_line GT 3 ).

  • Making the screen field as uneditable

screen-input = 0.

ENDIF.

  • Modifying the screen after making changes

MODIFY SCREEN.

ENDLOOP.

ENDMODULE. " set_screen_fields OUTPUT

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/table control in abap.pdf

If your problem is solved,kindly reward points and close this thread.Otherwise get back.

Read only

0 Likes
644

Hi Jayanthi,

thanks very much. I implemented the code with small modifications and it worked well.

i didnt find any option to give points and close the thread. can you tell me how to do that.

thanks & regards,

anjani.

Read only

0 Likes
644

Hi Anjani,

You can find three options close to each reply.[yellow for helpful answer,green for very helpful answer and blue star for solved problem].

If you click any one [which you think is suitable]nearer to reply , it will automatically assign point for that corresponding person.

If you are not able to find those options,you have to ask the moderator of this forum to assign marks or mail to sdn@sap.com.