‎2007 Sep 04 7:32 AM
Hi all,
I have an internal table with fields ( Name , age ,place ) . I appended the values to that intrenal table for all the 3 fields . Currently the values are in the internal table .
My doubt is , i want to refresh only one field in the internal table say the field ( Place) befor the record is get displayed .
can anyone suggest me the way how to do it .
Sample Code :
DATA : BEGIN OF structure OCCURS 0,
name(10),
age TYPE i,
place(10),
END OF structure.
DATA structure1 LIKE structure OCCURS 0 WITH HEADER LINE.
DATA itab LIKE structure OCCURS 0 WITH HEADER LINE.
structure1-name = 'RAMESH'. structure1-age = '25'. structure1-place = 'BANGALORE'.
APPEND structure1. CLEAR structure.
structure1-name = 'dinesh'. structure1-age = '25'. structure1-place = 'hyderadad'.
APPEND structure1. CLEAR structure1.
LOOP AT structure1.
write : / structure1-name,
structure1-age.
endloop.
‎2007 Sep 04 7:34 AM
DATA : BEGIN OF structure OCCURS 0,
name(10),
age TYPE i,
place(10),
END OF structure.
DATA structure1 LIKE structure OCCURS 0 WITH HEADER LINE.
DATA itab LIKE structure OCCURS 0 WITH HEADER LINE.
structure1-name = 'RAMESH'. structure1-age = '25'. structure1-place = 'BANGALORE'.
APPEND structure1. CLEAR structure.
structure1-name = 'dinesh'. structure1-age = '25'. structure1-place = 'hyderadad'.
APPEND structure1. CLEAR structure1.
LOOP AT structure1.
write : / structure1-name,
structure1-age.
<b>clear structure1-place.
Modify structure1.</b>
endloop.
‎2007 Sep 04 7:34 AM
DATA : BEGIN OF structure OCCURS 0,
name(10),
age TYPE i,
place(10),
END OF structure.
DATA structure1 LIKE structure OCCURS 0 WITH HEADER LINE.
DATA itab LIKE structure OCCURS 0 WITH HEADER LINE.
structure1-name = 'RAMESH'. structure1-age = '25'. structure1-place = 'BANGALORE'.
APPEND structure1. CLEAR structure.
structure1-name = 'dinesh'. structure1-age = '25'. structure1-place = 'hyderadad'.
APPEND structure1. CLEAR structure1.
LOOP AT structure1.
write : / structure1-name,
structure1-age.
<b>clear structure1-place.
Modify structure1.</b>
endloop.
‎2007 Sep 04 7:40 AM
Hi
use CLEAR statement
Ex:
loop at itab.
clear itab-name.
write 😕 itab-name, itab-age.
endloop.
OR
just use this
loop at itab.
write 😕 itab-age.
endloop.
name will not be displayed
Regards
prajwala.k
‎2007 Sep 04 7:36 AM
Hi,
Your requirement is not clear, what do you mean by REFRESH one field, you mean you want to REMOVE the data in that field?
Regards,
Sesh
‎2007 Sep 04 7:36 AM
Hi Vighnesh,
Make that field blank which you want to refersh.
e.g.
LOOP AT structure1.
structure1-place = ' '.
write : / structure1-name,
structure1-age, structure1-place.
endloop.
Reward points if helpful.
Regards,
Hemant
‎2007 Sep 04 7:51 AM
Hope the following code will help you.
*LOOP AT structure1.
*write : / structure1-name,
*structure1-age.
*endloop.
CLEAR STRUCTURE1-PLACE.
MODIFY STRUCTURE1 TRANSPORTING PLACE
WHERE NOT PLACE IS INITIAL.