Skip to Content
avatar image
Former Member

sorting the itab

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 29, 2008 at 11:56 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 29, 2008 at 12:01 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded