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

TC does not recognize scrollable records

Former Member
0 Likes
1,199

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,167

Hi,

Did you used LINES to set table control size,,,,like

ztable(name of tc) = 30. in PBO of your logic.

Thank and Regards.

11 REPLIES 11
Read only

Former Member
0 Likes
1,167

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.


Read only

Former Member
0 Likes
1,168

Hi,

Did you used LINES to set table control size,,,,like

ztable(name of tc) = 30. in PBO of your logic.

Thank and Regards.

Read only

0 Likes
1,167

YES...i did use

   TRAIN_CANCELL-LINES = 250.

Read only

0 Likes
1,167

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

Read only

0 Likes
1,167

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

Read only

0 Likes
1,167

Hi,

try for deleting other entries and see sy-stepl. If it is still one less than that use sy-stepl - 1.

regards.

Aswath.

Read only

0 Likes
1,167

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.

Read only

0 Likes
1,167

Use the table control-current_line parameter

Read only

0 Likes
1,167

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.

Read only

0 Likes
1,167

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.

Read only

0 Likes
1,167

thank you and it works fine now.