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: 

LDB-Sort

Former Member
0 Kudos

Hello All,

After a long long time i am working on 3.1I and am using a LDB - BRF.

In my code i am using

GET BKPF Fields

BUKRS

BELNR

GJAHR.

(at this step - can i SORT the BKPF data by BUKRS BELNR? before i go to BSEG)

and then use

GET BSEG FIELDS

X

Y

Z.

Please let me know the syntax.

Regards,

- PSK

2 REPLIES 2

Former Member
0 Kudos

Hi,

Sort is used only for sorting the internal table entries and not for the database tables, while using LDB, you can use Get <tablename/nodename> to get the contents of the table.

Syntax would be like,

Get <tabname1> where condition optional.

Get<tabname2> .

Hope this helps.

Rgds,

Former Member
0 Kudos

Hello,

seems to be difficult, what this 'Get'-statment does.

At the GET statment you don't read the Table BKPF, but it is the event,when you get one (only one !) entry of table BKPF.

Since the fields BUKRS,BELNR,GJAHR are the primary keys of that table, a sort does not make sense.

At 'GET BSEG' you get the first position, then the next and so on to that BKPF entry.

Could be usefull to try this logic:

GET BKPF.

Write: / BKPF-BUKRS, BKPF-BELNR, BKPF-GJAHR.

GET BSEG.

WRite: / BSEG-BUKRS, BSEG-BELNR, BSEG-GJAHR, BSEG-BUZEI.

And test it with a selection of ten FI-documents.

If you wish to sort in your program, you would use the old extract-logic. Look to the commands FIELD-GROUPS and EXTRACT.

Regards,

Wolfgang