2012 Mar 16 6:04 AM
Hi Masters,
i have created a TABLE CONTROL size of the TC is = 250lines.
but my TC small and it can fit upto 7 rows.
so i the 8TH row.. i INSERT ..it inserts but when i want to delete the 8th record it does not recognize the 8TH ONE.
When i see the selected record = 'X' it shows 7th row instead of the 8TH?
Why does it do? where would be the problem?
thank you,
pasala.
2012 Mar 16 7:00 AM
Hi,
Did you used LINES to set table control size,,,,like
ztable(name of tc) = 30. in PBO of your logic.
Thank and Regards.
2012 Mar 16 6:30 AM
hi Masters to add more to my previous post
i have a TC where it initially shows 7rows...so i input all the 7rows and save it...to custom table...
then i want to add a record or row...so i insert a record and save it....does successfully...
the 8th row i cant see but if i SCROLL DOWN i can see and i want to delete this 8TH row...
i select it and click on DELETE button...
when i debug and see
GET CURSOR LINE sy-stepl = 7 and not 8. but i am deleting the 8TH row and not 7th.
DELETE G_TRAIN_CANCELL_ITAB_ZFRTLOSS INDEX SY-STEPL.sy-stepl = 7 and not 8. but i am deleting the 8TH row and not 7th.
as the SY-STEPL = 7 it deletes the 7th row than the 8th row.
2012 Mar 16 7:00 AM
Hi,
Did you used LINES to set table control size,,,,like
ztable(name of tc) = 30. in PBO of your logic.
Thank and Regards.
2012 Mar 16 7:03 AM
2012 Mar 16 7:15 AM
Hi,
Please paste the code (PAI) ,That will help to identify the problem .might be problem with logic while update to custom table.
Thank and Regards
2012 Mar 16 7:28 AM
Hi
When you are selecting a line it is nothing but a field let says MARK. If you will see in your internal table in debugging for this row its value will be 'X' and you can use that to delete the line as an indicator or you can use TC_ABC-CURRENT_LINE to gbet index of currrent line.
Thanks
Nabheet
2012 Mar 16 7:35 AM
Hi,
try for deleting other entries and see sy-stepl. If it is still one less than that use sy-stepl - 1.
regards.
Aswath.
2012 Mar 16 7:50 AM
PAI LOGIC...
LOOP AT G_TRAIN_CANCELL_ITAB_ZFRTLOSS.
CHAIN.
FIELD ZFRTLOSS-ZCONTROL_NUM.
FIELD ZFRTLOSS-ZTRAIN_NUM.
FIELD ZFRTLOSS-ZRAND_VALUE.
MODULE TRAIN_CANCELL_MODIFY.
ENDCHAIN.
ENDLOOP.
LOOP AT G_TRAIN_CANCELL_ITAB_ZFRTLOSS.
CHAIN.
FIELD ZFRTLOSS-ZCONTROL_NUM.
FIELD ZFRTLOSS-ZTRAIN_NUM.
FIELD ZFRTLOSS-ZRAND_VALUE.
MODULE TRAIN_CANCELL_MODIFY.
ENDCHAIN.
ENDLOOP.
*---LOGIC TO DELETE ROWS FROM TABLE CONTROL
IF SY-UCOMM = 'DEL'
AND G_TRAIN_CANCELL_ITAB-SEL = 'X'.
GET CURSOR LINE SY-STEPL.
DESCRIBE TABLE G_TRAIN_CANCELL_ITAB_ZFRTLOSS LINES VCOUNT.
DELETE G_TRAIN_CANCELL_ITAB_ZFRTLOSS INDEX SY-STEPL.
MOVE SY-STEPL TO G_TRAIN_CANCELL_ITAB_ZFRTLOSS-LINE_COUNT.
DELETE FROM ZFRTLOSS
WHERE REF_NUM EQ G_TRAIN_CANCELL_ITAB_ZFRTLOSS-REF_NUM
AND ZTRAIN_NUM EQ G_TRAIN_CANCELL_ITAB_ZFRTLOSS-ZTRAIN_NUM.
COMMIT WORK AND WAIT.
IF SY-SUBRC = 0.
CHECK = 'Y'.
EST_LOSS = EST_LOSS - G_TRAIN_CANCELL_ITAB_ZFRTLOSS-ZRAND_VALUE.
MOVE EST_LOSS TO BSEG-DMBTR.
ENDIF.
ENDIF.
Thank you,
pasala.
2012 Mar 16 7:55 AM
2012 Mar 16 8:00 AM
if i delete the <= 7th record it works fine.
the issue is only when i insert 8th record and delete it.
if i select the 8th record the SY-STEPL = -1.
2012 Mar 16 9:07 AM
so the 8th record is the record that u insert. What i think is you have to increase lines attribute of table controls to reflect the change.
2012 Mar 19 9:05 AM