‎2007 Apr 04 6:44 AM
Hi,
Can anyone help me how to insert a new line dynamically to the internal table.
Assume there are 5 records that has been added to ITAB.
In that if a particular field in that ITAB crosses the limit 10 then i have to split that line into two lines with the same data except that Par.field as 5 and the other record has 5.
In the third record that particular field has value 10.
Loop at ITAB.
Once i found that field has 10 then how to insert a new line dynamically over here to add another record.
endloop.
‎2007 Apr 04 6:58 AM
Hi Joseph..
Are you looking at this type of code.
<b>
Data:
Begin of itab occurs 0,
f1 type i,
f2 type i,
f3 type i,
end of itab,
w_temp type i.
Loop at itab.
if itab-f3 GE 10.
w_temp = itab-f3 - 5.
itab-f3 = 5.
modify itab.
itab-f3 = w_temp.
insert itab index sy-tabix.
endif.
endloop. </b>
If it helps Reward with points
Regards Rk
‎2007 Apr 04 7:27 AM
Hi..
Hi..
try this..
loop at itab.
if ( i found that field <f1> has 10 ).
w_line2 = itab-f1+5(5).
w_line3 = itab-f1.
***********First line********
itab-f1 = itab-f1+0(5).
modify itab index sy-tabix from itab transporting f1.
***********second line******** Hi..
try this..
loop at itab.
if ( i found that field <f1> has 10 ).
w_line2 = itab-f1+5(5).
w_line3 = itab-f1.
***********First line********
itab-f1 = itab-f1+0(5).
modify itab index sy-tabix from itab transporting f1.
***********second line********
itab-f1 = w_line2.
insert itab INDEX SY-TABIX.
**********third line**************
itab-f1 = w_line3.
insert itab INDEX SY-TABIX.
endloop.
itab-f1 = w_line2.
insert itab INDEX SY-TABIX.
**********third line**************
itab-f1 = w_line3.
insert itab INDEX SY-TABIX.
endloop.
‎2007 Apr 04 7:44 AM
Hi !!
Your requirement is ideal to use the Function Module : RKD_WORD_WRAP .
Here you can specify the no of characters to which you want to split a given line . Even it takes care if a particular word i getting broken in between it is carried forward to the next line.
please have a look and let me know .
‎2007 Apr 04 7:44 AM
Hi !!
Your requirement is ideal to use the Function Module : RKD_WORD_WRAP .
Here you can specify the no of characters to which you want to split a given line . Even it takes care if a particular word i getting broken in between it is carried forward to the next line.
please have a look and let me know .
‎2007 Apr 04 7:53 AM
Hi,
Try this:
loop at itab.
if itab-field = 10.
clear wa_itab.
insert wa_itab into itab INDEX SY-TABIX.
endif.
endloop.
Hope this will help you.
Jogdand M B