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

HI

Former Member
0 Likes
494

HI I USED THE FOLLOWING CODE TO DISABLE A ROW IN TABLE CONTROL.. BUT THIS CODE DISABLES ONLY THE FIRST ROW..

I NEED TO DISABLE THE ROW WHICH I SELECT..

sy-ucomm.

WHEN 'DELETE'.

  • IF cflag = 'X'.

IF table1-lineS = 1.

LOOP AT SCREEN.

screen-input = 0.

MODIFY SCREEN.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

screen-input = 1.

MODIFY SCREEN.

ENDLOOP.

  • ENDIF.

ENDIF.

ENDCASE.

DO HELP ME

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
474

Hi,

use the method get_selected_rows

this will return the index number of the row selected by the user

by using the index number you lock the row

Regards,

siva chalasani.

Reward points if found usefull

HI I USED THE FOLLOWING CODE TO DISABLE A ROW IN TABLE CONTROL.. BUT THIS CODE DISABLES ONLY THE FIRST ROW..

I NEED TO DISABLE THE ROW WHICH I SELECT..

sy-ucomm.

WHEN 'DELETE'.

  • IF cflag = 'X'.

IF table1-lineS = 1.

LOOP AT SCREEN.

screen-input = 0.

MODIFY SCREEN.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

screen-input = 1.

MODIFY SCREEN.

ENDLOOP.

  • ENDIF.

ENDIF.

ENDCASE.

DO HELP ME

4 REPLIES 4
Read only

Former Member
0 Likes
475

Hi,

use the method get_selected_rows

this will return the index number of the row selected by the user

by using the index number you lock the row

Regards,

siva chalasani.

Reward points if found usefull

Read only

Former Member
0 Likes
474

Hi Ramya

i think u r table control will have chek box if u select the row tht check box will get filled with 'x'

so based on tht u can meet u r requirement

if u r table control does not have this check box do like this

declare on field as type c of lenght one in the internal table wht u gave for table control and in the wizard give tht field as check box then automatically it iwll be treated as check box and u r problem get solves plzz reward if u found my answer as helpfull to u

for further quiries my mail id is [email protected]

plzz dont forget to reward

Read only

Former Member
0 Likes
474

Hi,

Write the code in some module and call this module in loop and endloop for internal table of tablecontrol.

I didnt inderstnad of

IF table1-lineS = 1. stmt.

Could you try in otherway to achieve the samething by using loop .

Regds

Sivaparvathi

Please reward points if helpful...

Read only

Former Member
0 Likes
474

hi

good

pls check this code and change your code accordingly.

You need to execute a PBO module between LOOP AT WITH table_control and ENDLOOP.

In the PBO module

LOOP AT itab WIHT table_control.

module init_tab.

ENDLOOP.

MODULE init_tab OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME = 'FIELD1' and field1 = 'ABC' "check your data here

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDMODULE.

thanks

mrutyun^