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: 

SY-SUBRC = 4 While SORT.

Former Member
0 Kudos

Hi All,

While SORT the internal table, it sorts but the return code is 4.

I am using only CHAR type fields only and its a STANDARD type table.

In 20 fields of the internal table, the 2nd, 3rd & 4th fields are used to sort.

Even these three fields have values or not, it returns 4.

When a SORT statement with STANDARD internal table will return 4? Provided all fields are CHAR type.

Regards,

R.Nagarajan.

-


We can -


1 ACCEPTED SOLUTION

JozsefSzikszai
Active Contributor
0 Kudos

I don't think the SORT sets the sy-subrc at all. Can you check if it is set by another statement before the SORT?

5 REPLIES 5

JozsefSzikszai
Active Contributor
0 Kudos

I don't think the SORT sets the sy-subrc at all. Can you check if it is set by another statement before the SORT?

0 Kudos

Hi Nag..

What Eric said is obiously correct.

Can you please check this issue in debugging mode once.

Otherwise try to paste the sample code here.

Thanks,

Naveen.I

0 Kudos

Hi All,

Yes... SORT statement is not setting value for SY-SUBRC.

Regards,

R.Nagarajan.

-


We can -


Former Member
0 Kudos

Hi,

I am not sure whether the SORT statement will have any effect on you sy-subrc. I think this sy-subrc = 4 is because of some other statement before your sort.

Regards,

Pramod

Former Member
0 Kudos

Thanks all.