Joing of EKKO, EKPO, EKET and EKBE
Hi Gurus,
We want to achieve two reports with the same query. the first report is the requirement to compare the persons who created the PO and the person who received the PO (migo material doc) were same or not? To achieve this we joined tables EKKO, EKBE and EKPO in the order same order. The report started giving out only those results where EKKO - ERNAM was equal to EKBE - ERNAM. This is fine. But now we have a new requirement to create a late PO deliveries report. The users want the actual dates when the receipts were received (mat doc receipts). Because ME2N, ME2M and ME2L only give whether they are late or not but they dont give by how many days they are late. anyways to achive the late deliveries report, i joined EKET table to the as the fourth table to the already existing previous three tables. But beucase of the EKKO -ERNAM = EKBE - ERNAM criteria we are getting the resutls onyly when they match. What needs to be doen so that the both the reports can be achived from this same infoset.
Thanks
Anmusha
Hi,
If the qns is just how to de-link the join, then select the join in table join view & click on delete join. But if the qns is then how to link these 2 tables, just link them based on document number. Then you will have to add few lines of abap.
But as i said it would be very simple to achieve this in a Z report than a infoset query, as it is more flexible. You will have to build in a OR condition, which says display the record if the name of creator & the person who posted the GR is same OR display the record if it meets your other criteria.
So i would strongly suggest go for a Z report & discuss with your abaper.
Regards,
Vivek
Similar Messages
-
Link of table EKKO,EKPO,EKET,KONV
Hi Experts,
Now , i am writing a program to print purhchase order, and i met 2 problems.
1.why it is different price between 'net price' and 'condition price'? sometimes, they are different.
2.the net price always is wrong. so i need to get the price in condition tab in item detail.
i sent a OSS to SAP, they told me the talbe KONV is a cluster table, so it can not be join in .
but i need get the exact and correct price from KONV,
would somebody please give me the link of table EKKO,EKPO,EKET and KONV?
our system is AFS SAP. we use me23n to display the purchase order.and there is a request we must group the item by MATNR with the same price and ex factory date (j_3aexfcp).
thanksthanks first,
yes , i fetch the data from EKKO,EKPO,EKET first, and alreayd group by them as our user request,but the problem is i can not get the item number (kposn) exactly, the following are the code. i do not add the item number in it, it will make the wrong result .
after group them, some different items were grouped,so i do not know how to fetch the item number exactly.
SELECT DISTINCT EKKOEBELN EKKOBEDAT EKKOLIFNR EKKOZTERM EKKOWAERS EKKOVERKF EKKOTELF1 EKKOINCO1 EKKOINCO2 EKPOMATNR EKPOTXZ01 EKPOJ_3APGNR
EKPOJ_3AVDAT EKPOj_3aexfcp EKPOBPRME EKPOPEINH EKETEINDT Sum( EKETMENGE ) AS SumOfMENGE EKETMEINS EKETJ_3ASIZE EKPOLOEKZ ekkoknumv
Avg( EKETJ_3ANETP ) AS AvgOfJ_3ANETP Avg( ekponetpr ) as Avgofnetpr Sum( EKETJ_3ANETW ) AS SumOfJ_3ANETW J_3APGENJ_3AKORD1 J_3APGENJ_3AKORD2 J_3APGENJ_3AKORD3 J_3APGEN~J_3AKORDX
INTO (EKKO_EBELN,EKKO_BEDAT,EKKO_LIFNR,EKKO_ZTERM,EKKO_WAERS,EKKO_VERKF,EKKO_TELF1,EKKO_INCO1,EKKO_INCO2,EKPO_MATNR,EKPO_TXZ01,EKPO_J_3APGNR,
EKPO_J_3AVDAT, EKPO_j_3aexfcp, EKPO_BPRME,EKPO_PEINH,EKET_EINDT,SUMOFMENGE,EKET_MEINS,EKET_J_3ASIZE,EKPO_LOEKZ,ekko_knumv,
AVGOFJ_3ANETP,AVGOFNETPR,SUMOFJ_3ANETW,J_3APGEN_J_3AKORD1,J_3APGEN_J_3AKORD2,J_3APGEN_J_3AKORD3,J_3APGEN_J_3AKORDX)
FROM
( ( EKKO INNER JOIN EKPO ON ( EKKOEBELN = EKPOEBELN ) AND ( EKKOMANDT = EKPOMANDT ) ) INNER JOIN EKET ON ( EKPOEBELP = EKETEBELP ) AND ( EKPOEBELN = EKETEBELN ) AND ( EKPOMANDT = EKETMANDT ) ) INNER JOIN J_3APGEN ON ( EKET~J_3ASIZE =
J_3APGENJ_3AKORDX ) AND ( EKPOMANDT = J_3APGENMANDT ) AND ( EKPOJ_3AVDAT = J_3APGENJ_3AVDAT ) AND ( EKPOJ_3APGNR = J_3APGEN~J_3APGNR )
GROUP BY
EKKOEBELN EKKOBEDAT EKKOLIFNR EKKOZTERM EKKOWAERS EKKOVERKF EKKOTELF1 EKKOINCO1 EKKOINCO2 EKPOMATNR EKPOTXZ01 EKPOJ_3APGNR EKPOJ_3AVDAT EKPOj_3aexfcp EKPOBPRME EKPOPEINH EKETEINDT EKETMEINS EKETJ_3ASIZE EKKOMANDT
J_3APGENJ_3AKORD1 J_3APGENJ_3AKORD2 J_3APGENJ_3AKORD3 J_3APGENJ_3AKORDX EKPOLOEKZ ekkoknumv
HAVING
EKKOEBELN = ZEBELN AND EKPOMATNR = IT_EKPO1-MATNR AND EKPOj_3aexfcp = it_ekpo1-j_3aexfcp AND EKPOLOEKZ <> 'L'
ORDER BY EKET~J_3ASIZE.
after fetch the date , i select the KBETR from KONV, the item number is the last important problem.
select single kbetr into kbetr from konv where knumv = ekko_knumv and krech = 'C' and kposn = ?(i can not fetch exact item number) and ZAEHK = eket-etenr .
any further reply? thanks very much for your reply. -
How to link tables EKKO, EKPO, EIKP and EIPO
What I'm trying to do is create a view based on these four tables. EKPO contains multiple rows with the same values for EBELN. EKKO contains all distinct values for EBELN. I am trying to pick up all rows from both tables where EBELN in EKPO is the same as in EKKO. This is simple enough for a select statement to handle, without creating a view. The tricky part is linking the relevant rows selected from EKKO and EKPO to EIKP and EIPO. I tried using EXNUM to link EKKO, EIKP and EIPO, but I'm not sure that EXNUM contains distinct values for all 3 tables. In the case of EIKP it doesn't matter because the values for the fields I want (VORNU and VORNA) will be the same for the rows selected from EKKO and EKPO. The problem is with linking EIPO to my selections. If I knew that EXNUM was distinct for all rows in EIPO there would be no problem. However, I have seen some cases where multiple rows in EIPO have the same values for EXNUM. If I am using EXNUM in EIPO as a key field I have no way of being sure that the fields I want to pick up from EIPO (NACNU, BEHOE, NACD2, PRUEL and NACN3) contain the correct values I require. An example of what I am trying to do might make this clearer:
Table EKKO:
EBELN BEDAT WAERS
420000001 10.08.2007 USD
Table EKPO:
EBELN WERKS MATNR MENGE NETWR NETPR TXZ01
420000001 3500 m1 q1 nw1 cnf1 mat1
420000001 3500 m2 q2 nw2 cnf2 mat2
420000001 3000 m3 q3 nw3 cnf3 mat3
Table EIKP:
VORNU VORDA
125/45 12.08.2007
Table EIPO: (Corresponding to the above three rows in EKPO)
NACNU BEHOE NACD2 PRUEL NACN3
1234 1001 30.08.2007 28.08.2007 xx
1235 1002 27.08.2007 29.08.2007 yy
1236 1003 18.08.2007 16.08.2007 zz
So basically, given the above table entries, I want that the result of my selection should be:
| ROW1 | ROW2 | ROW3
EBELN: | 420000001 | 420000001 | 420000001
BEDAT: | 10.08.2007 | 10.08.2007 | 10.08.2007
WAERS: | USD | USD | USD
WERKS: | 3500 | 3500 | 3000
MATNR: | m1 | m2 | m3
MENGE: | q1 | q2 | q3
NETWR: | nw1 | nw2 | nw3
NETPR: | cnf1 | cnf2 | cnf3
TXZ01: | mat1 | mat2 | mat3
VORNU: | 125/45 | 125/45 | 125/45
VORDA: | 12.08.2007 | 12.08.2007 | 12.08.2007
NACNU: | 1234 | 1235 | 1236
BEHOE: | 1001 | 1002 | 1003
NACD2: | 30.08.2007 | 27.08.2007 | 18.08.2007
PRUEL: | 28.08.2007 | 29.08.2007 | 16.08.2007
NACN3: | xx | yy | zz
Sorry for the extremely long post. If anyone can shed some light on this I'd really appreciate it. Thanks.
Kalselect req. fields + a~exnum
from ekko as a
inner join ekpo as b
on aebeln = bebeln
into table gt_ekko_ekpo
where.........if u any conditions...
select req.fields from
eikp
into table gt_eikp
for all entries in gt_ekko_ekpo
where exnum = gt_ekko_ekpo-exnum.
select req.fields
from eipo
into table gt_eipo
for all entries in gt_eikp
where exnum = gt_eikp-exnum.
and also ekpo and eipo are line items tables , so for each exnum, will have multiple lines items in eipo table.
imp. the above and check whether, getting the req. result or not.
next in view , maintain rel. among these 4 tables.
ekko -ekpo, ekko-eikp, eikp-eiko. -
Hi,
I was writing a report that selects data EKKO (Purchase Order), EKPO (Purchase Order Items) and EKET (Purchase Order Delivery Schedule). I needed to get BANFN field (Purchase Requisition) number which is related to the PO.
Both EKPO and EKET tables have BANFN fields. Firstly I selected BANFN from EKPO table, but later I noticed that for some PO BANFN is empty, but EKET includes proper BANFN number. So What is the issue hear? I will get the BANFN from EKET table, but am I going to do correct thing?
Thank you,Hi Tuncay,
Many years later I had a similar question, relating to some very old POs in our SAP system. That is, why does the requisition number appear in the item overview of Me23n, yet EKPO-BANFN is still blank (req no. is filled only in EKET-BANFN).
I found SAP Note 201004 which seems to provide an answer: "In the new enjoy transaction Me22n field EKPO-BANFN is filled. But in the old transaction Me22 it is not filled."
I proved this was so, using an old PO with 2 items. As an example, I modified the statistical delivery date on the schedule line of both items by:
1st item: Using new transactoin Me22n
2nd item: Using old transaction Me22.
Result: EKPO-BANFN is now filled in with Req number for only the 1st item.
Cheers,
Jeff -
Query on tables EKKO, EKPO, EKET, EKES
Hi experts,
I have given below flow
select * from EKKO into table GT_EKKO
where ANGNR = GS_INPUT-PURCHASE_ORDER.
select * from EKPO into table GT_EKPO
for all entries in GT_EKKO
where EBELN = GT_EKKO-EBELN and
LOEKZ = space.
SORT GT_EKPO BY EBELN EBELP.
DELETE ADJACENT DUPLICATES FROM GT_EKPO COMPARING ALL FIELDS.
select * from EKES into table GT_EKES
for all entries in GT_EKPO
where EBELN = GT_EKPO-EBELN and
EBELP = GT_EKPO-EBELP and
EBTYP = 'E1'.
SORT GT_EKES BY J_3ASIZE.
select * from EKET into table GT_EKET
for all entries in GT_EKES
where EBELN = GT_EKES-EBELN and
EBELP = GT_EKES-EBELP and
J_3ASIZE = GT_EKES-J_3ASIZE.
SORT GT_EKET BY J_3ASIZE.
loop at GT_EKES.
clear LV_QUANTITY.
READ TABLE GT_EKES WITH KEY EBELN = GT_EKES-EBELN
EBELP = GT_EKES-EBELP
J_3ASIZE = GT_EKES-J_3ASIZE.
READ TABLE GT_EKET WITH KEY EBELN = GT_EKES-EBELN
EBELP = GT_EKES-EBELP
J_3ASIZE = GT_EKES-J_3ASIZE.
LV_QUANTITY = GT_EKET-MENGE - GT_EKES-MENGE.
LV_TOTAL_QTY = LV_TOTAL_QTY + LV_QUANTITY.
endloop.
if GS_INPUT-E1_QTY = LV_TOTAL_QTY.
if this condition satify then I have to assign LV_QUANTITY to some other table.
But my problem is into EKET & EKES, I am not getting same no. of recoreds...
can any one suggest me which WHERE conditions I have to give into queries on table EKET & EKES so I can get same no. of recoreds in both of them?
Points will be rewarded...
Thanks in advance.
neo S.HI,
its not necessary to have equal number of entries in two table.. a scheduleing agreement and vendor confirmation is different.
One suggestion.. when you are using for all entries ensure that you have to check that that table is not empty example .
if not gt_ekpo[] is initial.
select * from EKES into table GT_EKES
for all entries in GT_EKPO
where EBELN = GT_EKPO-EBELN and
EBELP = GT_EKPO-EBELP and
EBTYP = 'E1'.
endif.
thanks
Mahesh -
In BDCP table I am not getting any entries for EKKO,EKPO,EKBE,EKET,EBAN
In BDCP table I am not getting any entries for EKKO,EKPO,EKBE,EKET,EBAN tables.
But there are entries for many other tables.
I have got objects for EKKO,EKPO,EKBE,EKET,EBAN tables from TCDOB tables.Hi Avishek,
Let me explain the meaning of Change pointers.
If you have entry in BDCP table for MARA, that means everytime a material is created in MARA table in one system, a corresponding Material is created in another system which is connected to the current system VIA ALE. and whenever you change that material in your source system, then the change is propagated to the target system also(If you have done the change pointer set up).
The you do not have entries for other tables becuase the configuration for change pointers is not done for those Objects(In your case the change pointers are not defined for Purchase Orders and hence no entries in BDCP table).
Regards,
Ravi kanth Talagana -
How to write SELECT statement using tables ekko,ekpo and eket?
Hi,
I got a problem in performance tuning using below tables?
how to write SELECT statement using tables EKKO,EKPO and EKET and in conditon ( WHERE clause) use only fields
ekko~ebeln IN ebeln
ekko~loekz EQ ' '
ekko~lifnr IN lifnr
ekko~ekorg IN ekorg
ekko~ekgrp IN ekgrp
ekpo~werks IN werks
ekpo~pstyp EQ '3'
ekpo~loekz EQ space
ekpo~elikz EQ space
ekpo~menge NE 0
eket~rsnum NE space.
Thanks in Advance.
bye.Hi,
ekko~ebeln IN ebeln
ekko~loekz EQ ' '
ekko~lifnr IN lifnr
ekko~ekorg IN ekorg
ekko~ekgrp IN ekgrp
ekpo~werks IN werks
ekpo~pstyp EQ '3'
ekpo~loekz EQ space
ekpo~elikz EQ space
ekpo~menge NE 0 " Remove this from where clause
eket~rsnum NE space. " Remove this from where clause
' instead delete the entries after fetching into the table
DELETE it_itab WHERE menge EQ '0' AND rsnum EQ ' '.
Regards
Bala Krishna -
Buffered Function Modules for EKKO, EKPO, EKBE, EKES etc
Hi,
Could you please let me know of some buffered function modules for reading data from EKKO EKPO EKBE EKES EKET?
Regards,
SurajTry BAPI_PO_GETDETAIL , BAPI_PO_GETITEMS , BAPI_PO_GET_LIST
-
Datasource for the table EKKO,EKPO, EKBE, BKPF, BSEG
Hello Gurus,
I am having a requirement wher i need to create report for the fields coming from the above tables.
pls let me know if der is any such data source from which i can get data for all the tables EKKO,EKPO,EKBE,BKPF,BSEG.
If der is no single data source then how i have to approach for the same using the standard datasource.
and what should be the link info objects between them if iam going with the separate one.
RegardsThanks for ur responses,
Is the Belnr in the EKBE table is same as the BELNR in BKPF table of Data source (0FI_GL_4) ???
When i cross verifed i found multible record in BKPF w.r.t EKBE belnr.
Whats the reason for this ? If i created a infoset by mapping the BELNR AND GJAHR of EKBE and BKPF. Do i get the correct record or i have to handle it by some exception.
Also pls let me know how the MM and FI flow related , I means once the MIRO ie billing document is created what happen in the FI side ??
pls update with ur suggestions.
regards -
Link between EKKO, EKPO and KONP
Hi,
can someone help me out to trace the link between EKKO, EKPO and KONP tables?
regards,
ravi.Hi Ravi
KONP is conditions table.
If we need the conditions(prices) of a purchase order, we can get it from EKKO, EKPO & KONV.
1. Extract KNUMV from EKKO.
2. Using EKKO-KNUMV - Extract conditions from KONV where KONV-KNUMV = EKKO-KNUMV.
3. We can find item prices where KONV-KPOSN = EKPO-EBELP.
Hope this helps you.
Kind Regards
Eswar -
Extractor for Purchasing Conditions for tables EKKO, EKPO and KONV
Hi Experts,
I want to know if there is an Extractor for Purchasing Conditions with fields in tables of Origin: EKKO, EKPO and KONV.
Or, at least an extractor with the table KONV.
Or, how I can look for it.
Any feedback, will be really apreciated.
Thanks in advanceHi David,
Adding to what said above.
Observe the Fileds in the Datasources and the details.
http://help.sap.com/saphelp_nw2004s/helpdata/en/5c/8ea0e626e442efb109232830faded9/frameset.htm
Regards,
Ram. -
Hi,
I want to link tables EKKO, EKPO and KONP. Actually i checked this tables but i could not find link between EKKO and KNOP. Please help me in this regards. Actually we are maintaining the tax codes in the PO. I want to print different taxes in PO out put like BED, EDUCATION CESS, CST, VAT.
NKHello,
You can link the tables by
EKKO- KNUMV = KONP-KNUMH.
And
EKKO-EBELN = EKPO-EBELN.
Hope it helps.
Regards,
Mansi. -
I have a follow up to this question.
What if I want to link the items and schedule lines in table EKET to changes recorded in CDPOS.
There's a field in CDPOS called TABKEY which holds the Client, Document, Item and Line all in one. But the problem is, the Item has a serialized scheme (1,2,3,4,5) but in EKET, my items are (10,20,30,40,50).
How can I easily link them?
Moderator message: please don't attach new questions to old threads.
TABLE LINKS: EKKO, EKET, EKPO, CDHDR, CDPOS and NAST
Edited by: Thomas Zloch on Feb 25, 2010 5:36 PMdear friend,
please use the standard table EKBE (History per Purchasing Document)
EKET-EBELN links to EKBE-EBELN
and EKBE-BELNR links to MSEG-MBLNR (use GJAHR and MJAHR as well)
good luck -
Finding Sum of grouped lines / Tables EKKO, EKPO
Hi, am using the following tables:
TABLES: ekko,ekpo.
with Inner Join
select ekkobukrs ekkoebeln ekkoaedat ekkobsart ekkoekgrp ekkolifnr ekkowaers ekkowkurs ekkoernam ekpobrtwr
into CORRESPONDING FIELDS OF TABLE itab from ekko
inner join EKPO on ekPOEBELN = ekkoebeln.
end-OF-SELECTION.
Basically i want to group the result of this SQL statement by Purchasing Doc (ekko~ebeln) and display the
sum of Gross value (ekpo~brtwr) for the line items of each Purchasing Doc.
Note: i want the Purchasing Doc to appear one time only in the report
i have tried the following :
select ekkobukrs ekkoebeln ekkoaedat ekkobsart ekkoekgrp ekkolifnr ekkowaers ekkowkurs ekkoernam sum( ekpobrtwr )
into CORRESPONDING FIELDS OF TABLE itab from ekko
inner join EKPO on ekPOEBELN = ekkoebeln
WHERE ekkobukrs IN S_bukrs AND ekkobsart IN s_bsart
Group By ekkoebeln ekkobukrs ekkoaedat ekkobsart ekkoekgrp ekkolifnr ekkowaers ekkowkurs ekko~ernam.
then loop through the ITAB:
LOOP at itab.
write:/ itab-bukrs under 'Company Code',
itab-ebeln UNDER 'PO-Number',
itab-aedat UNDER 'Date' ,
itab-bsart UNDER 'Doc-Type' ,
itab-ekgrp UNDER 'Purchase-Grp' ,
itab-lifnr UNDER 'Vendor' ,
itab-waers UNDER 'Currency',
itab-wkurs UNDER 'Rate' ,
itab-brtwr under 'Gross Value',
itab-ernam UNDER 'Created By'.
ENDLOOP.
but it is not working with me, am not able to show the result of sum( ekpo~brtwr ) am getting 0 in all lines
thanks a lot for your help" My Full Code.
TABLES: ekko,ekpo,ekbe,rbkp.
data: BEGIN OF itab OCCURS 0, "EKKO TABLE"
inco1 like ekko-inco1,
inco2 like ekko-inco2,
bukrs like ekko-bukrs,
ebeln like ekko-ebeln,
aedat like ekko-aedat,
bsart like ekko-bsart,
ekgrp like ekko-ekgrp,
lifnr like ekko-lifnr,
waers like ekko-waers,
wkurs like ekko-wkurs,
ernam like ekko-ernam,
BRTWR LIKE ekpo-brtwr,
end of itab.
SELECT-OPTIONS : s_bukrs FOR itab-bukrs OBLIGATORY,
s_ebeln for itab-ebeln ,
s_aedat FOR itab-aedat ,
s_bsart for itab-bsart ,
s_ekgrp FOR itab-ekgrp ,
s_lifnr FOR itab-lifnr ,
s_budat FOR jtab-budat ,
s_bewtp for jtab-bewtp .
DATA ProceesITAB LIKE SORTED TABLE OF ITAB WITH UNIQUE KEY TABLE LINE.
AT SELECTION-SCREEN on s_bukrs.
START-OF-SELECTION.
select ekkobukrs ekkoebeln ekkoaedat ekkobsart ekkoekgrp ekkolifnr ekkowaers ekkowkurs ekkoernam ekpobrtwr
into CORRESPONDING FIELDS OF TABLE itab from ekko
inner join EKPO on ekPOEBELN = ekkoebeln.
end-OF-SELECTION.
LOOP at itab.
write:/ itab-bukrs under 'Company Code',
itab-ebeln UNDER 'PO-Number',
itab-aedat UNDER 'Date' ,
itab-bsart UNDER 'Doc-Type' ,
itab-ekgrp UNDER 'Purchase-Grp' ,
itab-lifnr UNDER 'Vendor' ,
itab-waers UNDER 'Currency',
itab-wkurs UNDER 'Rate' ,
itab-brtwr under 'Gross Value',
itab-ernam UNDER 'Created By'.
ENDLOOP.
TOP-OF-PAGE.
write:/70 'Company'.
uline.
skip.
write:/5 'Company Code',25 'PO-Number',40 'Date',55 'Doc-Type',70 'Purchase-Grp',85 'Vendor',100 'Currency',115 'Rate',125 'Created By',
140 'Gross Value'.
ULINE.
SKIP.
Edited by: YasinN on Mar 24, 2010 9:45 AM -
What are the common fields in table KONV = J_1IEXCHDR,EKKO,EKPO,MSEG
Helo everyone,
I need wht are the common fields between table of KONV and J_1IEXCHDR,EKKO,EKPO,MSEG. Pls give me details
thanks in advance
sureshcheck out LIFNR,KUNNR ETC
Maybe you are looking for
-
I have been trying to download apps from the app store and every time it tells me there is a problem with my previous billing and direct me to put in new billing information and every time i do that it still will not let me download any apps.
-
Error message : No order corresponds to selection criteria
Hi, I am using T code CN24N for scheduling networks for a project and entering Project as the input. But I am getting the error: No order corresponds to selection criteria networks are there for the selected Project. Can anyone tell me the possibl
-
HT4623 I can't acces my wifi i don't know what's going on because I can't even turn it on
I need someone to help me fix my phone my wifi doesn't work
-
From cassette tape to Ipod?
I just bought a new Ipod video 30 gb. I checked every online music store that I know and couldn't find one song. It is an old tape and by Various. The name of the song is Spirit in the Forest. Is there a way to transfer a song from a cassette player
-
FileLoadException with Oracle.DataAccess
Hello, I get the following error when I try to run my application on the app server. It works fine on my development box. Details on the server's configuration are below the error message. **** BEGIN ERROR MESSAGE **** System.IO.FileLoadException: Th