Application Development 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: 

RE:How to make a disable row to enable in table control

Former Member
0 Kudos

Hi,

I have created one table control for vbak table. i make all fields as disable as per the requirement . i have three buttons like insert , update and delete. as click on update i want only selected row as enable, for modifying. and for insert only empty rows should be enable. i have tried the below login in pai.

IF WA-MARK = 'X'.

CASE OK_CODE.

WHEN 'UPD'.

LOOP At table-cols INTO cols WHERE index GT 2.

cols-screen-input = '1'.

MODIFY table-cols FROM cols INDEX sy-tabix.

ENDLOOP.

endcase.

endif.

But this is making all rows as enable ,and i want only the particular selected row as enable.

6 REPLIES 6

kesavadas_thekkillath
Active Contributor
0 Kudos

As per the code written whatever is happening is correct


LOOP At table-cols INTO cols WHERE index GT 2.
cols-screen-input = '1'.
MODIFY table-cols FROM cols INDEX sy-tabix.
Exit. " try adding this
ENDLOOP.

When index GT 2 everything is enabled. You have not restricted anything.

Also please search for the related information before posting

0 Kudos

hi ,

thanks for your reply,

I have tried that one also but now it is enabling only one column, and i am using Gt 2 becoz i want key field as disable.

i want that condition through which it will run inside a row.

0 Kudos

please search for the related information before posting..This question is discussed many times

0 Kudos

Thanks for your reply but i have alredy search that's y i post this question. i am not getting what is that logic for restrict only that particular row and if you know that realy it has been discussed so many times please send me those fourm links where it has been discussed..

0 Kudos

Try this way...

LOOP AT gt_quant1 into gs_qunat1 WHERE shkzg  = 'S' .
APPEND gs_quant1 to gt_quant1_s.
ENDLOOP.

LOOP AT gt_quant1 into gs_qunat1 WHERE shkzg  = 'H' .
APPEND gs_quant1 to gt_quant1_h.
ENDLOOP.

LOOP AT gt_quant1 into gs_quant1.
READ TABLE gt_quant1_s INTO gs_quant1_s with key ebeln = gs_quant1-ebeln ebelp = gs_quant1-ebelp.
if sy-subrc eq 0.
 menge_debit = gs_quant1_s .
endif.
READ TABLE gt_quant1_h INTO gs_quant1_h with key ebeln = gs_quant1-ebeln ebelp = gs_quant1-ebelp.
if sy-subrc eq 0.
menge_credit = gs_quant1_h .
endif.
difference = menge_debit - menge_credit.
ENDLOOP.

0 Kudos

Hi try this way,..

LOOP At table-cols INTO cols WHERE index GT 2 and selected eq 'X'.
cols-screen-input = '1'.
MODIFY table-cols FROM cols INDEX sy-tabix.
ENDLOOP.