URGENT: REALTION b/w MKPF ,BKPF AND BSAK
Hi,
what would be the common fields among the MKPF,BKPF and BSAK so that data can be reterived.. plzz tell me as it really urgent to me.
Hi,
MKPF table stores material document related data.BKPF stores accounting related data.In order to get the accounting document related to the material document in BKPF table we have 2 fields.
AWTYP : give the value as MKPF
AWKEY: concatenate material document number with year and paas it to this field.
Regards,
Shafi
Similar Messages
-
JOIN for BSEG, BSIS, BSAS, MSEG, BKPF and MKPF
I am developing a report related to G/L . i am using the Tables BSEG BSIS BSAS MSEG BKPF MKPF ............please give me the Joinings of these tables.......how exactly we can join and get the prefect Data....
Thank U waiting for ur replies....
Title edited by: Alvaro Tejada Galindo on Jun 3, 2008 3:41 PMI have given the tables, internal tables and the select queries which can give you the join conditions of your requirement.
tables: bsis,
bsas,
bkpf,
bseg,
ekbe,
mkpf,
mseg.
select-options: s_hkont for bseg-hkont,
s_bldat for bkpf-budat,
s_budat for bkpf-bldat obligatory,
s_lifnr for bseg-lifnr,
s_lfbnr for ekbe-lfbnr no intervals no-extension.
data: begin of i_bsis_bsas occurs 0,
bukrs like bsis-bukrs,
hkont like bsis-hkont,
gjahr like bsis-gjahr,
belnr like bsis-belnr,
budat like bsis-budat,
bldat like bsis-bldat,
xblnr like bsis-xblnr,
wrbtr like bsis-wrbtr,
buzei like bsis-buzei,
end of i_bsis_bsas,
begin of i_bkpf occurs 0,
bukrs like bsis-bukrs,
belnr like bsis-belnr,
gjahr like bsis-gjahr,
xblnr like bkpf-xblnr,
stblg like bkpf-stblg,
awtyp like bkpf-awtyp,
tcode like bkpf-tcode,
end of i_bkpf,
begin of i_bseg occurs 0,
bukrs like bsis-bukrs,
belnr like bsis-belnr,
gjahr like bsis-gjahr,
buzei like bseg-buzei,
buzid like bseg-buzid,
koart like bseg-koart,
zuonr like bseg-zuonr,
hkont like bseg-hkont,
lifnr like bseg-lifnr,
sgtxt like bseg-sgtxt,
ebeln like bseg-ebeln,
ebelp like bseg-ebelp,
wrbtr like bseg-wrbtr,
end of i_bseg,
begin of i_ekbe occurs 0,
ebeln like ekbe-ebeln,
ebelp like ekbe-ebelp,
gjahr like ekbe-gjahr,
belnr like ekbe-belnr,
buzei like ekbe-buzei,
lfgja like ekbe-lfgja,
lfbnr like ekbe-lfbnr,
lfpos like ekbe-lfpos,
matnr like ekbe-matnr,
end of i_ekbe,
begin of i_mkpf_mseg occurs 0,
mblnr like mkpf-mblnr,
mjahr like mkpf-mjahr,
bktxt like mkpf-bktxt,
xblnr like mkpf-xblnr,
frbnr like mkpf-frbnr,
zeile like mseg-zeile,
matnr like mseg-matnr,
erfmg like mseg-erfmg,
end of i_mkpf_mseg.
*data: wa_ekbe like i_ekbe.
select bukrs
hkont
gjahr
belnr
budat
bldat
xblnr
wrbtr
buzei appending corresponding fields of table i_bsis_bsas
from bsis
where bukrs eq p_bukrs
and hkont in s_hkont
and gjahr eq p_gjahr
and budat in s_budat
and shkzg eq 'S'.
select bukrs
hkont
gjahr
belnr
budat
bldat
xblnr
wrbtr appending corresponding fields of table i_bsis_bsas
from bsas
where bukrs eq p_bukrs
and hkont in s_hkont
and gjahr eq p_gjahr
and budat in s_budat
and shkzg eq 'S'.
endform. " f_get_bsis_bsas_data
*& Form f_get_bkpf_bseg_data
Subroutine to get BKPF and BSEG data
form f_get_bkpf_bseg_data.
check not i_bsis_bsas[] is initial.
select bukrs
belnr
gjahr
xblnr
stblg
awtyp
tcode into table i_bkpf
from bkpf
for all entries in i_bsis_bsas
where bukrs eq i_bsis_bsas-bukrs
and belnr eq i_bsis_bsas-belnr
and gjahr eq i_bsis_bsas-gjahr.
and awtyp = 'BKPFF'
and tcode = 'J1IE'.
check not i_bkpf[] is initial.
select bukrs
belnr
gjahr
buzei
buzid
koart
zuonr
hkont
lifnr
sgtxt
ebeln
ebelp
wrbtr into corresponding fields of table i_bseg
from bseg
for all entries in i_bsis_bsas
where bukrs eq i_bsis_bsas-bukrs
and belnr eq i_bsis_bsas-belnr
and gjahr eq i_bsis_bsas-gjahr.
and buzei eq i_bsis_bsas-buzei
and hkont eq i_bsis_bsas-hkont.
delete i_bseg where not hkont in s_hkont.
endform. " f_get_bkpf_bseg_data
*& Form f_get_ekbe_data
Subroutine to get EKBE data
form f_get_ekbe_data.
data: $i_bseg like i_bseg occurs 0 with header line.
$i_bseg[] = i_bseg[].
delete $i_bseg where ebeln is initial.
check not $i_bseg[] is initial.
select ebeln
ebelp
gjahr
belnr
buzei
lfgja
lfbnr
lfpos
matnr into table i_ekbe
from ekbe
for all entries in $i_bseg
where ebeln eq $i_bseg-ebeln
and ebelp eq $i_bseg-ebelp
and gjahr eq $i_bseg-gjahr
and bwart = '101'.
and belnr eq $i_bseg-belnr.
check not i_ekbe[] is initial.
select a~mblnr
a~mjahr
a~bktxt
a~xblnr
a~frbnr
b~zeile
b~matnr
b~werks
b~erfmg into table i_mkpf_mseg
from mkpf as a inner join
mseg as b on amblnr eq bmblnr
and amjahr eq bmjahr
for all entries in i_ekbe
where a~mblnr eq i_ekbe-lfbnr
and a~mjahr eq i_ekbe-gjahr
and b~zeile eq i_ekbe-lfpos
and b~werks eq p_werks.
<REMOVED BY MODERATOR>
Edited by: Srikanth Kadiyala on Jun 3, 2008 7:24 AM
Edited by: Alvaro Tejada Galindo on Jun 3, 2008 3:40 PM -
Relation between BKPF and MKPF
I want relation between BKPF and MKPF,
because i want account document number on storage location basis.
if anyone know the solution or any standard report pl. tell me.Hi Omar,
For all tables if you wan to find the table relation shipss...
use the T-Code -->SQVI--> select table join--> enter first the table name--> enetr another tbale name..
it will show the possible relation ship between the tables
Regards,
Prabhduas -
Reg table relation BSIK and BSAK to EKKO and EKPO tables
hi all,
can u plz let me know how to relate BSIK and BSAK with the corresponding POs??Try this:
SELECT belnr gjahr
FROM ekbe
INTO TABLE ekbe_int
UP TO 100 ROWS
WHERE ebeln = ebeln
AND vgabe IN ('1', '2'). "1 - GR, 2 - IR
CHECK sy-subrc = 0.
SORT ekbe_int.
DELETE ADJACENT DUPLICATES FROM ekbe_int.
LOOP AT ekbe_int INTO ekbe_wa.
v_objectkey+00(10) = ekbe_wa-belnr.
v_objectkey+10(10) = ekbe_wa-gjahr. "BELNR+YEAR
IF ekbe_wa-vgabe = '1'.
v_reference = 'MKPF'.
ELSE.
v_reference = 'RMRP'.
ENDIF.
* Uses index BKPF~4 (4.7)
SELECT SINGLE bukrs belnr gjahr "Accounting Doc Header
FROM bkpf
INTO doc_int
WHERE awtyp = v_reference
AND awkey = v_objectkey.
IF sy-subrc = 0.
APPEND doc_int.
ENDIF.
ENDLOOP.
This will give you the document header. You can easily get anything else you need from BSEG.
Rob -
hi gurujis,
with your kind help i am learning something, but there is problem in each step. Now i am working with FI , i have came to know about two tables,
they are BKPF and BSID i have to join them and also produce output on the basis of 4 inputs like company no, coustomer no, currency and posting date. I need your help on this, can somebody send me the code to do this.
Also i would like to know is there any FM's to join two or more tables, if yes, please send me the name of that module with an complete example.
I need this , it is very urgent.
Thanks,
KHAN.hi Khan,
SELECT bkpf~...
bsid~...
INTO TABLE ...
FROM bkpf AS bkpf
INNER JOIN bsid AS bsid
ON bkpf~bukrs EQ bsid~bukrs
AND bkpf~gjahr EQ bsid~gjahr
AND bkpf~belnr EQ bsid~belnr
WHERE bkpf~bukrs EQ p_bukrs
AND bsid~kunnr IN s_kunnr
AND bkpf~waers EQ p_waers
AND bkpf~budat EQ p_budat.
hope this helps
ec -
How to concatenate mkpf-belnr and mkpf-mjahr
hi,
i need to concatenate mkpf-belnr and mkpf-mjahr in select statement and i am going to check the output of concatenation in to my select statement.
is there any way i can do this....
thanks,
jigarRefer this
DATA: v_awkey LIEK bkpf-awkey.
CONCATENATE mkpf-belnr mkpf-mjahr INTO v_awkey.
SELECT * FROM BKPF
INTO TABLE i_bkpf
WHERE awkwy = v_awkey.
In case if u want to concatenate inside a loop.
LOOP AT i_mkpf.
CONCATENATE i_mkpf-belnr i_mkpf-mjahr INTO i_mkpf-awkey.
MODIFY i_mkpf.
CLEAR i_mkpf.
ENDLOOP.
SELECT * FROM BKPF
FOR ALL ENTRIES IN i_mkpf
INTO TABLE i_bkpf
WHERE awkey = i_mkpf-awkey. -
How to create view on bkpf and bseg?
friends,
can we create views on bkpf and bseg if yes wht are the steps...please note it down n send me..regards essam ([email protected])Hi,
Use standard views...
View name Short text
BKPF_AEDAT BW FI: BKPF Extraction Using AEDAT
BKPF_BSAD BW FI: BSAD Extraction Using CPUDT
BKPF_BSAD_AEDAT BW FI: BSAD Extraction using AEDAT
BKPF_BSAK BW FI: BSAK Extraction Using CPUDT
BKPF_BSAK_AEDAT BW FI: BSAK Extraction using AEDAT
BKPF_BSID BW FI: BSID Extraction Using CPUDT
BKPF_BSID_AEDAT BW FI: BSID Extraction using AEDAT
BKPF_BSIK BW FI: BSIK Extraction Using CPUDT
BKPF_BSIK_AEDAT BW FI: BSIK Extraction using AEDAT
CRMV_BKPF_BEBD FI Documents Relevant for Feedback to CRM
V_EWU_BKPF Update View for Parallel Processing on BKPF
V_VBSEGK
V_VBSEGS
Regards,
Omkar. -
Need to create an ABAP query on 2 tables BSIK and BSAK
Hi,
I need to create an ABAP query which has the fields document no, doc date, amount in doc currency and some other fields from 2 tables BSIK and BSAK. Is it possible to write a single abap query to fetch the data from both the tables.
The selection screen fields are doc number, date and doc type.
I need to display invoices for open items and cleared items together.
Please let me know if this is possible.
Thanks and Regards,
AjithSee if this is anything like what you need:
REPORT ztest MESSAGE-ID 00.
TABLES: bkpf, bseg.
SELECT-OPTIONS: s_bukrs FOR bkpf-bukrs,
s_belnr FOR bkpf-belnr,
s_gjahr FOR bkpf-gjahr,
s_blart FOR bkpf-blart,
s_budat FOR bkpf-budat.
DATA: BEGIN OF bkpf_int OCCURS 0.
INCLUDE STRUCTURE bkpf.
DATA: END OF bkpf_int.
DATA: BEGIN OF bseg_int OCCURS 0.
INCLUDE STRUCTURE bseg.
DATA: END OF bseg_int.
DATA: BEGIN OF bsik_int OCCURS 0.
INCLUDE STRUCTURE bsik.
DATA: END OF bsik_int.
SELECT *
FROM bkpf
INTO TABLE bkpf_int
WHERE bukrs IN s_bukrs
AND belnr IN s_belnr
AND gjahr IN s_gjahr
AND blart IN s_blart
AND bldat IN s_budat.
SORT bkpf_int BY bukrs belnr gjahr.
SELECT *
FROM bseg
INTO TABLE bseg_int
FOR ALL ENTRIES IN bkpf_int
WHERE bukrs = bkpf_int-bukrs
AND belnr = bkpf_int-belnr
AND gjahr = bkpf_int-gjahr
AND koart = 'K'.
SORT bseg_int BY bukrs belnr gjahr buzei.
LOOP AT bseg_int.
MOVE-CORRESPONDING bseg_int TO bsik_int.
READ TABLE bkpf_int WITH KEY
bukrs = bseg_int-bukrs
belnr = bseg_int-belnr
gjahr = bseg_int-gjahr
BINARY SEARCH.
IF sy-subrc = 0.
MOVE-CORRESPONDING bkpf_int TO bsik_int.
APPEND bsik_int.
ELSE.
MESSAGE e001 WITH 'Error during read'.
ENDIF.
ENDLOOP.
Rob -
Relationship between Table BKPF and RBKP
Hello Developers,
I need to fetch value of field BKTXT from table BKPF and this value need to insert in internal table i_tab.
in the below situation:
select bebeln bebelp bwerks ausnam alifnr abelnr
abldat abudat
caedat cekgrp cbukrs cekorg
dbanfn dbnfpo dnetpr dafnam
into corresponding fields of table i_tab
from rbkp as a join rseg as b on abelnr = bbelnr
join ekko as c on bebeln = cebeln
join ekpo as d on cebeln = debeln
and bebelp = debelp
where a~budat in s_date
and b~werks in s_werks
and c~bstyp = c_f
and c~ekorg in s_ekorg
and a~bukrs in s_bukrs.
Can any one suggest how to relate table BKPF with other table like RBKP.
Thanks in advance.
Regards
SundeepHi,
perform the following steps:-
1. Go to transaction SQVI
2. Create a View
3. Enter title
4. Choose the Data source as Table Join
5. Go to insert table and add table as per your requirement.
and hereafter you can find relation between any two tables...
Rgds/Abhi -
Pls its very urgent - i dropped by iphone 3G and the display became very dim soon after and it still remains the same - pls advise what should be done to bring the display back to normal
sounds like you broke the display when you dropped it. There's nothing we users here can do for you.
Since the iPhone warranty does not cover accidental damage, you will have to pay to have your phone repaired or replaced. You can bring it into Apple for an out of warranty exchange in the country of purchase, or you can find a 3rd party iPhone repair store in your area. -
Update the Grp. Curr Exg. Rate in BKPF and Amt in 2nd local curr in BSEG
Environment is
R3 4.7
Group Currency: TWD
Company Currency: USD
My customer has a scenario :
PO uses USD, Invoice Verification uses USD. When doing the MIRO, system will automatically write group currency/exchange rate in BKPF and Amount in 2nd Currency in BSEG according to the m-rate.
However, my customer wants to use an exchange-rate recorded in MIRO header, not m-reate.
All the user exits and BADI I reviewed cannot do anything to change the BKPF and BSEG. Is there any suggestion?
All UE and BADI I checked are:
User exits
MRMH0001
MRMH0002
MRMH0003
MRMN0001
LMR1M001
LMR1M002
LMR1M003
LMR1M004
LMR1M005
LMR1M006
BADI
INVOICE_UPDATE
Edited by: Paul C. Lee on Nov 15, 2011 4:10 PMHi Paul,
As a first step, see these notes
SAP Note 191927 - Posting logic: GR for foreign currency PO
SAP Note 308008 - FAQ: Posting logic: GR/IR clearing account (question 12 for instance)
To know the proper BADI, enhancement and so on, check this note
SAP Note 1156325 - BAdIs in the Logistics Invoice Verification environment
If you can't do a modification, try with a check for the right exchange rate.
I hope this helps you
Regards
Eduardo
Edited by: E_Hinojosa on Nov 15, 2011 11:59 AM -
How to use BKPF and BSEG without using inner join
Hi,
can anybody plz tell me the logic about how to complete the report without inner joining bkpf and bseg.Is this report can be really be made by using only bseg,bkpf ?
*selection-criteria .
BKPF-USNAM
BKPF-CPUDT
BKPF-BUDAT
BKPF-GJAHR
BKPF-BUKRS
BKPF-BELNR
BSEG-SAKNR
BSEG-LIFNR
BSEG-KUNNR
BSEG-ZUONR
BSEG-SGTXT
Output fields required.
BKPF-BUKRS
BKPF-BELNR
BKPF-GJAHR
BKPF-MONAT
BKPF-BLART
BKPF-CPUDT
BKPF-BLDAT
BKPF-BUDAT
BKPF-USNAM
BKPF-XBLNR
BKPF-STBLG
BKPF-BKTXT
BKPF-WAERS
BKPF-KURSF
BSEG-BUZEI
BSEG-BSCHL
BSEG-KOART
BSEG-UMSKZ
BSEG-SHKZG
BSEG-MWSKZ
BSEG-PSWBT
BSEG-PSWSL
BSEG-DMBTR
BSEG-SAKNR
BSEG-HKONT
BSEG-KOSTL
BSEG-KUNNR
BSEG-VBELN
BSEG-LIFNR
BSEG-ANLN1
BSEG-ANLN2
BSEG-AUFNR
BSEG-MATNR
BSEG-MENGE
BSEG-MEINS
BSEG-ZUONR
BSEG-SGTXT
Thanks,
Rahman
Moderator Message: Please search before posting your question. Thread locked.
Edited by: Suhas Saha on Jan 31, 2012 3:07 PMQuick question - what's preventing your from using built-in functions?
I suggest mapping your Time Dim to a standard Time Dim and work with it - you'll save a lot more time. You'd even need this table if you wanted to work around Todate/AGO.
It is possible to model this functionality w/o functions, but it'll be time consuming task, similar to using Time Series Wizard in Siebel Analytics. You'll need to build aliases and views along with some complex joins (such as TIME.KEY=TIME.KEY-365), introduce a bunch of variables to control. Also, you might not get much flexibility in terms of years. For each year, you'd need an alias table. (TIME_DIM_PY). -
Hi Experts ,
I want to do an inner join on bsid and bkpf tables in the select query . I want to order the result on the basis of cputm field in bkpf , that is why inner join on bkpf is req , rest all the fields are from bsid . But the requirement is that we should not select the cputm field in the select , it is only to be used for sorting the result of the select query . we are also using select * from bsid where ...... endselect . and not specific fields from bsid currently . Kindly let me know how to use the inner join on bkpf and bsid in this case .
Would reward all helpful answers .
ThanksHi Ankit,
First make a structure of the required fields.
TABLES : bkpf,bsid.
TYPES : BEGIN OF x_tab,
belnr like bkpf-belnr,
kunnr like bsid-kunnr,
bldat like bsid-bldat,
budat like bsid-budat,
waers like bsid-waers,
END OF x_tab.
DATA : itab type STANDARD TABLE OF x_tab,
wa_itab TYPE x_tab.
start-of-SELECTION.
SELECT bkpfbelnr bsidkunnr bsidbldat bsidbudat bsid~waers into table itab
FROM bkpf INNER JOIN bsid on bkpfbelnr = bsidbelnr and
bkpfbukrs = bsidbukrs and
bkpfgjahr = bsidgjahr.
Rewards Points, if useful.
Regards
Manoj Kumar
Edited by: Manoj Kumar on Dec 26, 2007 2:36 PM -
I need a report that will join two tables BKPF and VBRK in QuickViewer. The only field with the right character length is XBLNR but when creating the join no records are dispalyed beacuse the values of this field in both tables are not the same.
There are also other fields available in BKPF but the char length is not the appropriate.
Does anyone have any idea how I can link these two tables?
Thank youNeither of these combinations is possible with QuickViewer because the fields need to have the same length of characters in order to create the join.
VBRK - VBLEN char(10) and BKPF - AWKEY char(20)
VBRK -ZUONR char(18) BKPF- BELNR char (10)
Any other idea?
Thank you, JP -
Update the stastics of tables BKPF and GLFUNCA
Hello All,
update the stastics of tables BKPF and GLFUNCA not updataing
I have execute via Brtools
7 - Database statistics >> 1 = Update database statistics >> 9 ~ Tables for update (table) ......... [BKPF]
same for table GLFUNCA
7 - Database statistics >> 1 = Update database statistics >> 9 ~ Tables for update (table) ......... [GLFUNCA]
But in .sta file it is not collected
<DB20>
Table GLFUNCA
Statistics are current (|Changes| < 50 %)
New Method E
New Sample Size P1
Old Method E Date 17.08.2008
Old Sample Size P1 Time 19:52:15
It is one year old , so please help me how to update this table
Is this table causing performance problem for job RSUVM007
Regards
Mohsin MBefore all,
Why do you wnat to calculate statistics on those tables?
Do you have performance problems and you have identified that they are caused by "bad" statistics?
or simply you "must" collect them because they are "OLD"?
If it is the latter, remember that statistics MUST be representative not current. Please read the SAP Note 825653 "Oracle: Common misconceptions" point 7
Regarding the options of BRtools, it works as designed.
BRCONNECT will check if the table needs statistics:
- if it has changed more than 50% since last time (in your case 17.08.2008) and, if so it will do, otherwise it will not do it. See the output of DB20 that you pasted:
> Statistics are current (|Changes| < 50 %)
IF you need new statistics (and I mean, need, not like) then you have to force them. On BRTOOLS you go to the next screen and choose the option:
> 7 ~ Force options (force) ............... []
In your version/patch could be located in a different place
and here input collect
I strongly recommend you to read the BR*tools documentation as ALL this information is there.
In case you do not know where to find it, it is quite easy:
SAP on Oracle => Oracle DBA Overview => SAP Database Guide: Oracle
Maybe you are looking for
-
Installing a new hard drive. How to make installer dvd from current OS
I have a iMac G5 (PPC). 2004 when I got it. And have the original HD. 150 GB. Following Murphy's Law this HD is due for failure. I have bought a 1 TB. new hard drive to install on this machine. I forgot which OS came with it (10.3) I think. My
-
Photo's are offline but in the same folder as before
Hello ppl, My English is not verry good but I'll try to descripe my problem: I use Lightroom for about 1 year, yesterdag I have re-installed my iMac and backupt the " Lightroom 2 Catalog.lrcat " and the " Lightroom 2 Catalog Previews.lrdata " Also al
-
Spry:if functions with parameters
Hi thanks for reading, I am trying to validate a date range, so im using a javascript function checkDate(start,end). I thought this is where I use a spry:if but maybe I am wrong? ----------------BeginCode------------ <script> function checkRange(star
-
Transfering data between phones
Just upgraded from a 3gs to a 4 and would like some help in transfering the data between the 2.In turn, I'll need to deactivate the 3gs from my system I would appreciate any advice you have to offer. Thanks
-
My normal workflow is adjust image in ACR and then batch sharpen, resize and convert to desired profile in Photoshop. I have the old batch operations working in Lightroom by converting the Photoshop actions to droplets and putting them in the Lightro