2011 Nov 02 11:51 AM
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.
2011 Nov 02 11:54 AM
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
2011 Nov 02 12:02 PM
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.
2011 Nov 02 12:12 PM
please search for the related information before posting..This question is discussed many times
2011 Nov 02 12:18 PM
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..
2011 Nov 02 1:57 PM
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.
2011 Nov 02 1:58 PM
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.