04-23-2007 12:05 PM
I've been using an internal table as follows,
DATA: BEGIN OF grid OCCURS 0,
D1 VALUE '_', " the value stored is an underscore
D2 VALUE '_',
END OF grid.
In the program, the values of D1 and D2 will change. Depending on some condition, I want to reset the values of D1 and D2 to initial values (i.e. Underscore). CLEAR statement initializes the values to ' ' (space). Kindly guide me with the same.
04-23-2007 12:08 PM
you can use this to get the default value as _
CLEAR grid-D1 WItH '_'.
04-23-2007 12:07 PM
Hi,
the problem will not get solved using Clear or REFRESH statement as both will set the values to blank.
In ur case u hv to manually set the values as '_'.
e.g.
loop at grid.
grid-D1 = '_'.
grid-D2 = '_'.
Modify grid index sy-tabix.
endloop.
Regards,
Himanshu
04-23-2007 12:07 PM
hi,
data: wa_grid like line of it_grid.
wa_grid-d1 = '_'.
wa_grid-d2 = '_'.
instead of using clear statement.. clear it_grid.
move wa_grid to it_grid.
Regarsd
sailaja.
04-23-2007 12:08 PM
you can use this to get the default value as _
CLEAR grid-D1 WItH '_'.
04-23-2007 12:08 PM
Hi ,
You can use the modify command with the addition TRANSPORTING to acheive this,
Regards
Arun
04-23-2007 12:11 PM
Try
LOOP AT grid.
CLEAR grid-d1 WITH '_'.
CLEAR grid-d2 WITH '_'.
MODIFY grid TRANSPORTING d1 d2.
ENDLOOP.
Regards