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: 

Passing SORTED internla table to ALV Function Module

Former Member
0 Kudos

Hello all,

I define a work area WA1 with reference I defined a table (itab) by using following statement.

DATA: itab TYPE SORTED TABLE OF WA1 WITH UNIQUE KEY field1 field2 WITH HEADER LINE.

I am unable pass the table itab to FM Reuse_alv_grid_display bcoz itab is sorted table. At the same time I can't define itab as a STANDARD table with UNIQUE KEY addition.

If I define a itab as DATA: itab TYPE STANDARD TABLE OF wa1 WITH KEY field1 field2 WITH HEADER LINE.

I'm getting unnecessary day.

Give me suggestions.......

1 ACCEPTED SOLUTION

Former Member

Hi,

Even i faced the same prob.

what i would suggest is, first perform all ur operations in the sorted internal table, Then after that while passing the itab to Function module, just transfer all the data from the sorted internal table to stanadrd internal table and pass the standrd itab to the FM.

this is the approach i followed.

revert back if any issues.

Regards,

naveen

3 REPLIES 3

Former Member
0 Kudos

Hi,

Create one more standard internal table, move contents from this sorted itab to the new one. And pass this new itab to the FM

Thanks & Regards,

Navneeth K.

abdul_hakim
Active Contributor
0 Kudos

Hi

YOu cannot use Unique key for standard table as the key of the standard table is always Non-Unique.

Also dont use internal table with header lines as it is completely obsolete.

Please try the below statement.

DATA itab LIKE SORTED TABLE OF wa WITH UNIQUE KEY field1 field2.

Cheers,

Hakim

Former Member

Hi,

Even i faced the same prob.

what i would suggest is, first perform all ur operations in the sorted internal table, Then after that while passing the itab to Function module, just transfer all the data from the sorted internal table to stanadrd internal table and pass the standrd itab to the FM.

this is the approach i followed.

revert back if any issues.

Regards,

naveen