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: 

EKBE & EKET

former_member182371
Active Contributor
0 Kudos

hi,

i´m working on a report using Logical DataBase

MEPOLDB

.

The problem i´m facing is that there are several entries of ekbe-menge for a single entry of eket-menge.

is there a relationship between ekbe-menge ekbe-bldat and eket-menge eket-sfldt?

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Sorry, but without knowing more about what you are trying to do this will be a difficult question to answer. EKBE is the line item history for the purchasing doc. It lists related movements that have posted against the PO.

3 REPLIES 3

Former Member
0 Kudos

Sorry, but without knowing more about what you are trying to do this will be a difficult question to answer. EKBE is the line item history for the purchasing doc. It lists related movements that have posted against the PO.

0 Kudos

Hi joel,

the code i use is as follows:

TABLES: LFA1.

NODES: EKKO, EKPO, EKBE, EKET.

START-OF-SELECTION.

GET EKKO.

SELECT SINGLE NAME1 FROM LFA1 INTO LFA1-NAME1 WHERE LIFNR = EKKO-LIFNR.

WRITE AT: / LFA1-NAME1,

37 EKKO-EBELN.

GET EKPO.

WRITE AT: 48 EKPO-EBELP,

56 EKPO-MATNR,

74 EKPO-TXZ01.

GET EKBE.

CHECK EKBE-VGABE = '1'.

WRITE AT: 155 EKBE-MENGE,

175 EKBE-BLDAT.

GET EKET.

WRITE AT: 115 EKET-MENGE,

140 EKET-SLFDT.

the question is that for an entry in eket-menge i´ve got several entries of ekbe-menge and i don´t know how to establish a relationship between them in order to get a

single record

.

Best regards.

0 Kudos

Hi calsadillo,

the point is, it's quite normal that there are several entries in table EKBE for a single position of a purchase order. Table EKBE stores every goods-receipt movement and every invoice posted to one single position of a purchase order. So if you want to retrieve just one record from table EKBE, I think it's not possible.

But: depending on what you want to do, you could write some sort of


select shkzg sum(menge)
into corresponding fields of ekbe
from ekbe
where ebeln = ...
and ebelp = ...
group by vgabe

...and then you will have, for instance, two records: one for debit positions (shkzg = S), and one for credit positions (shkzg = H). Then you could say:


if ekbe-shkzg = 'H'.
  ekbe-menge = ekbe-menge * ( -1 ).
endif.

...and continue with the summarization.

Please let us know if it helped. Best regards,

Alvaro