Application Development 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: 

Internal table

sastry_gunturi
Active Participant
0 Kudos

My internal table has 5 fields. I would like to hardcode the value for one field in internal table how would i do that.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi Karthik,

lets say your internal table is ITAB with fields F1, F2, F3, F4 and F5.

and W_TAB is the work area defined for ITAB having the same structure.

Let me assume that F2 is to be hard-coded with a value 2000 .

1) if you would like all records to have the same value for F2,

loop at itab into w_tab.

w_tab-f2 = 2000.

modify itab from w_tab transporting f2.

endloop.

2) if you want a particular record to have the hardcoded value 2000. fetch that record by say condition c2(this condition is based on your selection).

read table itab into w_tab where <c2>.

w_tab-f2 = 2000.

modify itab from w_tab transporting fw where <c2>.

<b>Reward points for helpful answers.</b>

Kiran

3 REPLIES 3

Former Member
0 Kudos

hi Karthik,

lets say your internal table is ITAB with fields F1, F2, F3, F4 and F5.

and W_TAB is the work area defined for ITAB having the same structure.

Let me assume that F2 is to be hard-coded with a value 2000 .

1) if you would like all records to have the same value for F2,

loop at itab into w_tab.

w_tab-f2 = 2000.

modify itab from w_tab transporting f2.

endloop.

2) if you want a particular record to have the hardcoded value 2000. fetch that record by say condition c2(this condition is based on your selection).

read table itab into w_tab where <c2>.

w_tab-f2 = 2000.

modify itab from w_tab transporting fw where <c2>.

<b>Reward points for helpful answers.</b>

Kiran

0 Kudos

Thanx kiran and Chandrasekhar

Points awarded.

Former Member
0 Kudos
loop at itab.
 itab-field1 = 'VALUE'.
 append itab.
endloop.