02-07-2005 10:38 PM
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.
02-07-2005 11:44 PM
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.
02-07-2005 11:44 PM
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.
02-08-2005 6:49 AM
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.
02-08-2005 8:01 AM
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