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: 

Sort a View

Former Member
0 Kudos
101

Hi,

I want to sort a View with 4 fields in a program. I want to sort it before to write some registers in a internal table.

how i can do it?

thanks a lot

1 ACCEPTED SOLUTION

Former Member
0 Kudos
59

hi

statements like sort, append, insert, read, etc. are all commands that perform operations on internal tables...you can't use them on a database object...

if helpful, reward

Sathish. R

3 REPLIES 3

Former Member
0 Kudos
59

Hi Marc,

I did not get your actual scenario.

Can u explain a bit in detail?

Regards,

Tejas

0 Kudos
59

I have a view : Z99BW69.

In a programa, I want to select some registers and insert into a internal table.

I had create the internal table with the same structure than the View.

But before insert the registers, I want to sort the view in 3 some fields. The reason is becase after that I want to use the instruction AT NEW, ENDAT.

Example:

REPORT Z99BW047.

tables : Z99BW69.

*sort z99BW69 by BUKRS MATNR POPER BLDAT BELNR.

DATA: begin of ITAB1 occurs 0.

INCLUDE STRUCTURE Z99BW69.

DATA: end of ITAB1.

<b>HERE I WANT TO SORT THE Z99BW69!!</b>

sort Z99BW69 by ..... // I cant do it.

select *

from Z99BW69

INTO CORRESPONDING FIELDS OF TABLE itab1

where MATNR = 'P39161200'

*AND POPER = '2'

AND WAERS = 'EUR'

AND BELNR IN ('0070000020','0070000023','0070000021','0070000022').

Former Member
0 Kudos
60

hi

statements like sort, append, insert, read, etc. are all commands that perform operations on internal tables...you can't use them on a database object...

if helpful, reward

Sathish. R