07-03-2007 2:34 PM
My internal table has 5 fields. I would like to hardcode the value for one field in internal table how would i do that.
07-03-2007 2:40 PM
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
07-03-2007 2:40 PM
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
07-03-2007 2:49 PM
07-03-2007 2:45 PM