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 before get logical database

Former Member
0 Kudos

Hi,

I would like to know any way to apply sorting before get logical database?

for e.g.

GET regup.

PERFORM extract.

IF reguh-zbukr NE regup-bukrs.

tab_uebergreifend-zbukr = reguh-zbukr.

tab_uebergreifend-vblnr = reguh-vblnr.

COLLECT tab_uebergreifend.

ENDIF.

END-OF-SELECTION.

I need to sort regup before GET regup which before it trigger for each line.

Thanks.

1 REPLY 1

Former Member
0 Kudos

Hi,

Instead of going for a sort before GET statement, you can move the required fields into an internal table first and sort that table and use it for your processing.

A small eg:

GET bkpf.

MOVE:bkpf-bukrs TO tb_bkpf-bukrs,

bkpf-budat TO tb_bkpf-budat,

bkpf-belnr TO tb_bkpf-belnr.

APPEND tb_bkpf.

CLEAR tb_bkpf.

Please revert back for any further queries.

Regards,

Chandra.