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: 

sorting the itab

Former Member
0 Kudos

hi,

sorting the itab and if the no of lines equals to 98 we have to

create a new purch req.

each requisition is limited by 98 line items.

this is the flat file i am getting.

0001|100041003|P100001|00010|01005100601054015510

0001|100041003|F100001|00010|01005100601054015510

0001|100041004|P100002|00025|01005100601054015510

0008|100041005|P100002|00020|01005100601054015510

0008|100041005|F100002|00020|01005100601054015510

0032|100041006|P100003|00035|01005100601054015510

0032|100041006|F100003|00020|01005100601054015510

0040|100041007|P100004|00005|01005100601054015510

0040|100041007|F100004|00015|01005100601054015510

0041|100041008|P100005|00021|01005100601054015510

0041|100041008|F100005|00015|01005100601054015510

thanks regards

suman chekuri

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

data : l1 type i.

sort itab by PK1 , PK2.

  • Get Total no of Records in Internal Table

describe table itab lines l1.

if l1 GE 98.

create a new purch req.

endif.

Regards,

Deepthi.

2 REPLIES 2

Former Member
0 Kudos

hi,

data : l1 type i.

sort itab by PK1 , PK2.

  • Get Total no of Records in Internal Table

describe table itab lines l1.

if l1 GE 98.

create a new purch req.

endif.

Regards,

Deepthi.

Former Member
0 Kudos

Hi,

Try this,

First upload your flat file into an internl table,

Suppose you name your 'serial no' as 'ser_no' in your interna table,

then you can try like this.

SORT itab BY ser_no.

LOOP at itab into work_area.

count = count + 1.

if count = 98.

PERFORM create_po.

.........

.........

.........

ENDIF.

ENDLOOP.