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: 

Problem in data selection with Logical database

former_member421809
Participant
0 Kudos

Hello All ,

I try to get some posts in BSEG with BKPF Key
GET BSIK
GET BKPF
GET BSEG
append gs_bseg to gt_bseg

i found just the first post for each header bkpf data
so just bseg-buzei = 1

in my case in bseg table i have three posts for a header data

Please , i'm beginner in logical database
can you please provide me an answer to my question

Thanks in advance,
Rachid

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

Your first GET is GET BSIK so I suppose your are using logical database KDF (?) which only contains the record with vendor account in BSEG node, so usually only one per document, except if you add GET GSEG for offset accounts. If you want every item you must append BSEG and GSEG records to rebuild the full document.

Hint: As logical database are now obsolete (and rarely used outside of HR) why wouldn't you build you report with direct access to database table so BSIK and BSAK -> BKPF -> BSEG every records.

NB: In cas of doubt, build a simple test query/dataset with SQ01/SQ02 on the logical database. Or look for statements PUT bseg/gseg in the logical database program. (You should find a SELECT SINGLE with equal BUZEI and a SELECT INTO TABLE with non-equal BUZEI)

6 REPLIES 6

0 Kudos

Thanks Horst ,
but i didn't found what i need there , i'm asking if i can get all posts for a bkpf header ,because here it retrieves just the first post for each header data

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

The idea is, if you want to use obsolete Logical Databases, you have to learn how they work and with that knowledge analyze your problem, e.g. by debugging the program flow.

Jelena
Active Contributor

Why are you using a logical database? If you have the document number then just do SELECT yourself. It's not clear what you're doing or trying to achieve though.

raymond_giuseppi
Active Contributor
0 Kudos

Your first GET is GET BSIK so I suppose your are using logical database KDF (?) which only contains the record with vendor account in BSEG node, so usually only one per document, except if you add GET GSEG for offset accounts. If you want every item you must append BSEG and GSEG records to rebuild the full document.

Hint: As logical database are now obsolete (and rarely used outside of HR) why wouldn't you build you report with direct access to database table so BSIK and BSAK -> BKPF -> BSEG every records.

NB: In cas of doubt, build a simple test query/dataset with SQ01/SQ02 on the logical database. Or look for statements PUT bseg/gseg in the logical database program. (You should find a SELECT SINGLE with equal BUZEI and a SELECT INTO TABLE with non-equal BUZEI)

0 Kudos

Thanks Raymond
Yes , i'm working with 'KDF' as logical database

I add a GET GSEG to retrieve other posts
That's what i want to achieve