01-28-2008 3:01 PM
hi,
i want to select first few records and do the next process and the rest of the records with another process. how to select say first 5 records from an internal table.
Thanks in advance
01-28-2008 3:05 PM
Hi Arun,
Check this code ,
DATA : begin of itab occurs 0 ,
a type char1,
b type i ,
end of itab ,
begin of jtab occurs 0 ,
a type char1,
b type i ,
end of jtab ,
Getting details
lin1 type i ,
lin2 type i ,
final type i .
itab-a = 'a' .
itab-b = '1' .
append itab .
itab-a = 'a' .
itab-b = '2' .
append itab .
itab-a = 'a' .
itab-b = '3' .
append itab .
itab-a = 'b' .
itab-b = '1' .
append itab .
jtab] = itab[ .
DESCRIBE TABLE ITAB lines lin1.
DELETE JTAB WHERE a = 'a' .
DESCRIBE TABLE JTAB lines lin2 .
Required Data
final = lin1 - lin2 .
write : 'number of records =' , final .
hope it helps...
or try this:
try like this :
itab_buff[ ] = itab[ ].
delete itab_buff where kunnr NE '10000'.
Data: lv_lines type i.
Describe table itab_buff lines lv_lines.
kindly reward if found helpful.
cheers,
Hema.
01-28-2008 3:05 PM
Hi Arun,
Check this code ,
DATA : begin of itab occurs 0 ,
a type char1,
b type i ,
end of itab ,
begin of jtab occurs 0 ,
a type char1,
b type i ,
end of jtab ,
Getting details
lin1 type i ,
lin2 type i ,
final type i .
itab-a = 'a' .
itab-b = '1' .
append itab .
itab-a = 'a' .
itab-b = '2' .
append itab .
itab-a = 'a' .
itab-b = '3' .
append itab .
itab-a = 'b' .
itab-b = '1' .
append itab .
jtab] = itab[ .
DESCRIBE TABLE ITAB lines lin1.
DELETE JTAB WHERE a = 'a' .
DESCRIBE TABLE JTAB lines lin2 .
Required Data
final = lin1 - lin2 .
write : 'number of records =' , final .
hope it helps...
or try this:
try like this :
itab_buff[ ] = itab[ ].
delete itab_buff where kunnr NE '10000'.
Data: lv_lines type i.
Describe table itab_buff lines lv_lines.
kindly reward if found helpful.
cheers,
Hema.
01-28-2008 3:05 PM
Hello,
Loop through the internal table and check sy-tabix > 5 and do the call to the process.
Thanks,
Venu
01-28-2008 3:09 PM
01-28-2008 3:18 PM